@bendyline/squisq-react 0.1.3 → 1.0.2

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 (139) hide show
  1. package/dist/BlockRenderer.d.ts +37 -0
  2. package/dist/BlockRenderer.d.ts.map +1 -0
  3. package/dist/BlockRenderer.js +51 -0
  4. package/dist/BlockRenderer.js.map +1 -0
  5. package/dist/CaptionOverlay.d.ts +24 -0
  6. package/dist/CaptionOverlay.d.ts.map +1 -0
  7. package/dist/CaptionOverlay.js +40 -0
  8. package/dist/CaptionOverlay.js.map +1 -0
  9. package/dist/DocControlsBottom.d.ts +28 -0
  10. package/dist/DocControlsBottom.d.ts.map +1 -0
  11. package/dist/DocControlsBottom.js +23 -0
  12. package/dist/DocControlsBottom.js.map +1 -0
  13. package/dist/DocControlsOverlay.d.ts +28 -0
  14. package/dist/DocControlsOverlay.d.ts.map +1 -0
  15. package/dist/DocControlsOverlay.js +75 -0
  16. package/dist/DocControlsOverlay.js.map +1 -0
  17. package/dist/DocControlsSidebar.d.ts +27 -0
  18. package/dist/DocControlsSidebar.d.ts.map +1 -0
  19. package/dist/DocControlsSidebar.js +6 -0
  20. package/dist/DocControlsSidebar.js.map +1 -0
  21. package/dist/DocControlsSlideshow.d.ts +20 -0
  22. package/dist/DocControlsSlideshow.d.ts.map +1 -0
  23. package/dist/DocControlsSlideshow.js +69 -0
  24. package/dist/DocControlsSlideshow.js.map +1 -0
  25. package/dist/DocPlayer.d.ts +87 -0
  26. package/dist/DocPlayer.d.ts.map +1 -0
  27. package/dist/DocPlayer.js +604 -0
  28. package/dist/DocPlayer.js.map +1 -0
  29. package/dist/DocPlayerWithSidebar.d.ts +41 -0
  30. package/dist/DocPlayerWithSidebar.d.ts.map +1 -0
  31. package/dist/DocPlayerWithSidebar.js +68 -0
  32. package/dist/DocPlayerWithSidebar.js.map +1 -0
  33. package/dist/DocProgressBar.d.ts +31 -0
  34. package/dist/DocProgressBar.d.ts.map +1 -0
  35. package/dist/DocProgressBar.js +122 -0
  36. package/dist/DocProgressBar.js.map +1 -0
  37. package/dist/LinearDocView.d.ts +47 -0
  38. package/dist/LinearDocView.d.ts.map +1 -0
  39. package/dist/LinearDocView.js +184 -0
  40. package/dist/LinearDocView.js.map +1 -0
  41. package/dist/MarkdownRenderer.d.ts +32 -0
  42. package/dist/MarkdownRenderer.d.ts.map +1 -0
  43. package/dist/MarkdownRenderer.js +133 -0
  44. package/dist/MarkdownRenderer.js.map +1 -0
  45. package/dist/__tests__/BlockRenderer.test.d.ts +2 -0
  46. package/dist/__tests__/BlockRenderer.test.d.ts.map +1 -0
  47. package/dist/__tests__/BlockRenderer.test.js +82 -0
  48. package/dist/__tests__/BlockRenderer.test.js.map +1 -0
  49. package/dist/__tests__/DocControlsSlideshow.test.d.ts +2 -0
  50. package/dist/__tests__/DocControlsSlideshow.test.d.ts.map +1 -0
  51. package/dist/__tests__/DocControlsSlideshow.test.js +88 -0
  52. package/dist/__tests__/DocControlsSlideshow.test.js.map +1 -0
  53. package/dist/__tests__/LinearDocView.test.d.ts +2 -0
  54. package/dist/__tests__/LinearDocView.test.d.ts.map +1 -0
  55. package/dist/__tests__/LinearDocView.test.js +160 -0
  56. package/dist/__tests__/LinearDocView.test.js.map +1 -0
  57. package/dist/__tests__/MarkdownRenderer.test.d.ts +2 -0
  58. package/dist/__tests__/MarkdownRenderer.test.d.ts.map +1 -0
  59. package/dist/__tests__/MarkdownRenderer.test.js +208 -0
  60. package/dist/__tests__/MarkdownRenderer.test.js.map +1 -0
  61. package/dist/__tests__/exports.test.d.ts +2 -0
  62. package/dist/__tests__/exports.test.d.ts.map +1 -0
  63. package/dist/__tests__/exports.test.js +48 -0
  64. package/dist/__tests__/exports.test.js.map +1 -0
  65. package/dist/hooks/AudioProvider.d.ts +71 -0
  66. package/dist/hooks/AudioProvider.d.ts.map +1 -0
  67. package/dist/hooks/AudioProvider.js +52 -0
  68. package/dist/hooks/AudioProvider.js.map +1 -0
  69. package/dist/hooks/MediaContext.d.ts +35 -0
  70. package/dist/hooks/MediaContext.d.ts.map +1 -0
  71. package/dist/hooks/MediaContext.js +66 -0
  72. package/dist/hooks/MediaContext.js.map +1 -0
  73. package/dist/hooks/index.d.ts +6 -0
  74. package/dist/hooks/index.d.ts.map +1 -0
  75. package/dist/hooks/index.js +5 -0
  76. package/dist/hooks/index.js.map +1 -0
  77. package/dist/hooks/useAudioSync.d.ts +18 -0
  78. package/dist/hooks/useAudioSync.d.ts.map +1 -0
  79. package/dist/hooks/useAudioSync.js +338 -0
  80. package/dist/hooks/useAudioSync.js.map +1 -0
  81. package/dist/hooks/useDocPlayback.d.ts +47 -0
  82. package/dist/hooks/useDocPlayback.d.ts.map +1 -0
  83. package/dist/hooks/useDocPlayback.js +176 -0
  84. package/dist/hooks/useDocPlayback.js.map +1 -0
  85. package/dist/hooks/useViewportOrientation.d.ts +31 -0
  86. package/dist/hooks/useViewportOrientation.d.ts.map +1 -0
  87. package/dist/hooks/useViewportOrientation.js +92 -0
  88. package/dist/hooks/useViewportOrientation.js.map +1 -0
  89. package/dist/index.d.ts +25 -563
  90. package/dist/index.d.ts.map +1 -0
  91. package/dist/index.js +26 -3179
  92. package/dist/index.js.map +1 -1
  93. package/dist/layers/ImageLayer.d.ts +23 -0
  94. package/dist/layers/ImageLayer.d.ts.map +1 -0
  95. package/dist/layers/ImageLayer.js +104 -0
  96. package/dist/layers/ImageLayer.js.map +1 -0
  97. package/dist/layers/MapLayer.d.ts +29 -0
  98. package/dist/layers/MapLayer.d.ts.map +1 -0
  99. package/dist/layers/MapLayer.js +97 -0
  100. package/dist/layers/MapLayer.js.map +1 -0
  101. package/dist/layers/ShapeLayer.d.ts +20 -0
  102. package/dist/layers/ShapeLayer.d.ts.map +1 -0
  103. package/dist/layers/ShapeLayer.js +35 -0
  104. package/dist/layers/ShapeLayer.js.map +1 -0
  105. package/dist/layers/TextLayer.d.ts +23 -0
  106. package/dist/layers/TextLayer.d.ts.map +1 -0
  107. package/dist/layers/TextLayer.js +126 -0
  108. package/dist/layers/TextLayer.js.map +1 -0
  109. package/dist/layers/VideoLayer.d.ts +40 -0
  110. package/dist/layers/VideoLayer.d.ts.map +1 -0
  111. package/dist/layers/VideoLayer.js +105 -0
  112. package/dist/layers/VideoLayer.js.map +1 -0
  113. package/dist/layers/index.d.ts +6 -0
  114. package/dist/layers/index.d.ts.map +1 -0
  115. package/dist/layers/index.js +6 -0
  116. package/dist/layers/index.js.map +1 -0
  117. package/dist/squisq-player.global.js +1 -1
  118. package/dist/standalone-entry.d.ts +61 -0
  119. package/dist/standalone-entry.d.ts.map +1 -0
  120. package/dist/standalone-entry.js +169 -0
  121. package/dist/standalone-entry.js.map +1 -0
  122. package/dist/standalone-source.js +1 -1
  123. package/dist/types.d.ts +131 -0
  124. package/dist/types.d.ts.map +1 -0
  125. package/dist/types.js +21 -0
  126. package/dist/types.js.map +1 -0
  127. package/dist/utils/animationUtils.d.ts +8 -0
  128. package/dist/utils/animationUtils.d.ts.map +1 -0
  129. package/dist/utils/animationUtils.js +8 -0
  130. package/dist/utils/animationUtils.js.map +1 -0
  131. package/dist/utils/layerUtils.d.ts +17 -0
  132. package/dist/utils/layerUtils.d.ts.map +1 -0
  133. package/dist/utils/layerUtils.js +37 -0
  134. package/dist/utils/layerUtils.js.map +1 -0
  135. package/dist/utils/mapTileUtils.d.ts +105 -0
  136. package/dist/utils/mapTileUtils.d.ts.map +1 -0
  137. package/dist/utils/mapTileUtils.js +268 -0
  138. package/dist/utils/mapTileUtils.js.map +1 -0
  139. package/package.json +3 -4
@@ -1,2 +1,2 @@
1
1
  /** Auto-generated — do not edit. Contains the squisq-player IIFE bundle as a string. */
2
- export const PLAYER_BUNDLE = "var SquisqPlayer=(function(exports){'use strict';var rt,B,hn,ge,pn,gn,yn,bn,St,xt,vt,_n,et={},tt=[],Jr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,De=Array.isArray;function ue(e,t){for(var n in t)e[n]=t[n];return e}function Tt(e){e&&e.parentNode&&e.parentNode.removeChild(e);}function de(e,t,n){var r,o,i,a={};for(i in t)i==\"key\"?r=t[i]:i==\"ref\"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?rt.call(arguments,2):n),typeof e==\"function\"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return Je(e,a,r,o,null)}function Je(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++hn,__i:-1,__u:0};return o==null&&B.vnode!=null&&B.vnode(i),i}function te(e){return e.children}function ie(e,t){this.props=e,this.context=t;}function Me(e,t){if(t==null)return e.__?Me(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==\"function\"?Me(e):null}function eo(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],o=[],i=ue({},t);i.__v=t.__v+1,B.vnode&&B.vnode(i),Ct(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??Me(t),!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,wn(r,i,o),t.__e=t.__=null,i.__e!=n&&xn(i);}}function xn(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),xn(e)}function kt(e){(!e.__d&&(e.__d=true)&&ge.push(e)&&!nt.__r++||pn!=B.debounceRendering)&&((pn=B.debounceRendering)||gn)(nt);}function nt(){try{for(var e,t=1;ge.length;)ge.length>t&&ge.sort(yn),e=ge.shift(),t=ge.length,eo(e);}finally{ge.length=nt.__r=0;}}function vn(e,t,n,r,o,i,a,s,u,c,f){var d,m,p,y,h,b,v,_=r&&r.__k||tt,S=t.length;for(u=to(n,t,_,u,S),d=0;d<S;d++)(p=n.__k[d])!=null&&(m=p.__i!=-1&&_[p.__i]||et,p.__i=d,b=Ct(e,p,m,o,i,a,s,u,c,f),y=p.__e,p.ref&&m.ref!=p.ref&&(m.ref&&At(m.ref,null,p),f.push(p.ref,p.__c||y,p)),h==null&&y!=null&&(h=y),(v=!!(4&p.__u))||m.__k===p.__k?u=kn(p,u,e,v):typeof p.type==\"function\"&&b!==void 0?u=b:y&&(u=y.nextSibling),p.__u&=-7);return n.__e=h,u}function to(e,t,n,r,o){var i,a,s,u,c,f=n.length,d=f,m=0;for(e.__k=new Array(o),i=0;i<o;i++)(a=t[i])!=null&&typeof a!=\"boolean\"&&typeof a!=\"function\"?(typeof a==\"string\"||typeof a==\"number\"||typeof a==\"bigint\"||a.constructor==String?a=e.__k[i]=Je(null,a,null,null,null):De(a)?a=e.__k[i]=Je(te,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[i]=Je(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,u=i+m,a.__=e,a.__b=e.__b+1,s=null,(c=a.__i=no(a,n,u,d))!=-1&&(d--,(s=n[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(o>f?m--:o<f&&m++),typeof a.type!=\"function\"&&(a.__u|=4)):c!=u&&(c==u-1?m--:c==u+1?m++:(c>u?m--:m++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<f;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=Me(s)),Tn(s,s));return r}function kn(e,t,n,r){var o,i;if(typeof e.type==\"function\"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=kn(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Me(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Fe(e,t){return t=t||[],e==null||typeof e==\"boolean\"||(De(e)?e.some(function(n){Fe(n,t);}):t.push(e)),t}function no(e,t,n,r){var o,i,a,s=e.key,u=e.type,c=t[n],f=c!=null&&(2&c.__u)==0;if(c===null&&s==null||f&&s==c.key&&u==c.type)return n;if(r>(f?1:0)){for(o=n-1,i=n+1;o>=0||i<t.length;)if((c=t[a=o>=0?o--:i++])!=null&&(2&c.__u)==0&&s==c.key&&u==c.type)return a}return -1}function fn(e,t,n){t[0]==\"-\"?e.setProperty(t,n??\"\"):e[t]=n==null?\"\":typeof n!=\"number\"||Jr.test(t)?n:n+\"px\";}function Ke(e,t,n,r,o){var i,a;e:if(t==\"style\")if(typeof n==\"string\")e.style.cssText=n;else {if(typeof r==\"string\"&&(e.style.cssText=r=\"\"),r)for(t in r)n&&t in n||fn(e.style,t,\"\");if(n)for(t in n)r&&n[t]==r[t]||fn(e.style,t,n[t]);}else if(t[0]==\"o\"&&t[1]==\"n\")i=t!=(t=t.replace(bn,\"$1\")),a=t.toLowerCase(),t=a in e||t==\"onFocusOut\"||t==\"onFocusIn\"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=St,e.addEventListener(t,i?vt:xt,i)):e.removeEventListener(t,i?vt:xt,i);else {if(o==\"http://www.w3.org/2000/svg\")t=t.replace(/xlink(H|:h)/,\"h\").replace(/sName$/,\"s\");else if(t!=\"width\"&&t!=\"height\"&&t!=\"href\"&&t!=\"list\"&&t!=\"form\"&&t!=\"tabIndex\"&&t!=\"download\"&&t!=\"rowSpan\"&&t!=\"colSpan\"&&t!=\"role\"&&t!=\"popover\"&&t in e)try{e[t]=n??\"\";break e}catch{}typeof n==\"function\"||(n==null||n===false&&t[4]!=\"-\"?e.removeAttribute(t):e.setAttribute(t,t==\"popover\"&&n==1?\"\":n));}}function mn(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=St++;else if(t.t<n.u)return;return n(B.event?B.event(t):t)}}}function Ct(e,t,n,r,o,i,a,s,u,c){var f,d,m,p,y,h,b,v,_,S,w,A,I,$,N,W=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=t.__e=n.__e]),(f=B.__b)&&f(t);e:if(typeof W==\"function\")try{if(v=t.props,_=W.prototype&&W.prototype.render,S=(f=W.contextType)&&r[f.__c],w=f?S?S.props.value:f.__:r,n.__c?b=(d=t.__c=n.__c).__=d.__E:(_?t.__c=d=new W(v,w):(t.__c=d=new ie(v,w),d.constructor=W,d.render=oo),S&&S.sub(d),d.state||(d.state={}),d.__n=r,m=d.__d=!0,d.__h=[],d._sb=[]),_&&d.__s==null&&(d.__s=d.state),_&&W.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=ue({},d.__s)),ue(d.__s,W.getDerivedStateFromProps(v,d.__s))),p=d.props,y=d.state,d.__v=t,m)_&&W.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),_&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else {if(_&&W.getDerivedStateFromProps==null&&v!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,w),t.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,w)===!1){t.__v!=n.__v&&(d.props=v,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(U){U&&(U.__=t);}),tt.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,w),_&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,y,h);});}if(d.context=w,d.props=v,d.__P=e,d.__e=!1,A=B.__r,I=0,_)d.state=d.__s,d.__d=!1,A&&A(t),f=d.render(d.props,d.state,d.context),tt.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,A&&A(t),f=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++I<25);d.state=d.__s,d.getChildContext!=null&&(r=ue(ue({},r),d.getChildContext())),_&&!m&&d.getSnapshotBeforeUpdate!=null&&(h=d.getSnapshotBeforeUpdate(p,y)),$=f!=null&&f.type===te&&f.key==null?Sn(f.props.children):f,s=vn(e,De($)?$:[$],t,n,r,o,i,a,s,u,c),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),b&&(d.__E=d.__=null);}catch(U){if(t.__v=null,u||i!=null)if(U.then){for(t.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s;}else {for(N=i.length;N--;)Tt(i[N]);wt(t);}else t.__e=n.__e,t.__k=n.__k,U.then||wt(t);B.__e(U,t,n);}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=ro(n.__e,t,n,r,o,i,a,u,c);return (f=B.diffed)&&f(t),128&t.__u?void 0:s}function wt(e){e&&(e.__c&&(e.__c.__e=true),e.__k&&e.__k.some(wt));}function wn(e,t,n){for(var r=0;r<n.length;r++)At(n[r],n[++r],n[++r]);B.__c&&B.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o);});}catch(i){B.__e(i,o.__v);}});}function Sn(e){return typeof e!=\"object\"||e==null||e.__b>0?e:De(e)?e.map(Sn):ue({},e)}function ro(e,t,n,r,o,i,a,s,u){var c,f,d,m,p,y,h,b=n.props||et,v=t.props,_=t.type;if(_==\"svg\"?o=\"http://www.w3.org/2000/svg\":_==\"math\"?o=\"http://www.w3.org/1998/Math/MathML\":o||(o=\"http://www.w3.org/1999/xhtml\"),i!=null){for(c=0;c<i.length;c++)if((p=i[c])&&\"setAttribute\"in p==!!_&&(_?p.localName==_:p.nodeType==3)){e=p,i[c]=null;break}}if(e==null){if(_==null)return document.createTextNode(v);e=document.createElementNS(o,_,v.is&&v),s&&(B.__m&&B.__m(t,i),s=false),i=null;}if(_==null)b===v||s&&e.data==v||(e.data=v);else {if(i=i&&rt.call(e.childNodes),!s&&i!=null)for(b={},c=0;c<e.attributes.length;c++)b[(p=e.attributes[c]).name]=p.value;for(c in b)p=b[c],c==\"dangerouslySetInnerHTML\"?d=p:c==\"children\"||c in v||c==\"value\"&&\"defaultValue\"in v||c==\"checked\"&&\"defaultChecked\"in v||Ke(e,c,null,p,o);for(c in v)p=v[c],c==\"children\"?m=p:c==\"dangerouslySetInnerHTML\"?f=p:c==\"value\"?y=p:c==\"checked\"?h=p:s&&typeof p!=\"function\"||b[c]===p||Ke(e,c,p,b[c],o);if(f)s||d&&(f.__html==d.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(d&&(e.innerHTML=\"\"),vn(t.type==\"template\"?e.content:e,De(m)?m:[m],t,n,r,_==\"foreignObject\"?\"http://www.w3.org/1999/xhtml\":o,i,a,i?i[0]:n.__k&&Me(n,0),s,u),i!=null)for(c=i.length;c--;)Tt(i[c]);s||(c=\"value\",_==\"progress\"&&y==null?e.removeAttribute(\"value\"):y!=null&&(y!==e[c]||_==\"progress\"&&!y||_==\"option\"&&y!=b[c])&&Ke(e,c,y,b[c],o),c=\"checked\",h!=null&&h!=e[c]&&Ke(e,c,h,b[c],o));}return e}function At(e,t,n){try{if(typeof e==\"function\"){var r=typeof e.__u==\"function\";r&&e.__u(),r&&t==null||(e.__u=e(t));}else e.current=t;}catch(o){B.__e(o,n);}}function Tn(e,t,n){var r,o;if(B.unmount&&B.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||At(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount();}catch(i){B.__e(i,t);}r.base=r.__P=null;}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Tn(r[o],t,n||typeof e.type!=\"function\");n||Tt(e.__e),e.__c=e.__=e.__e=void 0;}function oo(e,t,n){return this.constructor(e,n)}function Mt(e,t,n){var r,o,i,a;t==document&&(t=document.documentElement),B.__&&B.__(e,t),o=(r=\"undefined\"==\"function\")?null:t.__k,i=[],a=[],Ct(t,e=(t).__k=de(te,null,[e]),o||et,et,t.namespaceURI,o?null:t.firstChild?rt.call(t.childNodes):null,i,o?o.__e:t.firstChild,r,a),wn(i,e,a);}function ot(e){function t(n){var r,o;return this.getChildContext||(r=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){r=null;},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&r.forEach(function(a){a.__e=true,kt(a);});},this.sub=function(i){r.add(i);var a=i.componentWillUnmount;i.componentWillUnmount=function(){r&&r.delete(i),a&&a.call(i);};}),n.children}return t.__c=\"__cC\"+_n++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,r){return n.children(r)}).contextType=t,t}rt=tt.slice,B={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(s){e=s;}throw e}},hn=0,ie.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ue({},this.state),typeof e==\"function\"&&(e=e(ue({},n),this.props)),e&&ue(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),kt(this));},ie.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),kt(this));},ie.prototype.render=te,ge=[],gn=typeof Promise==\"function\"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,yn=function(e,t){return e.__v.__b-t.__v.__b},nt.__r=0,bn=/(PointerCapture)$|Capture$/i,St=0,xt=mn(false),vt=mn(true),_n=0;var Le,V,Lt,Cn,ze=0,Rn=[],Z=B,An=Z.__b,Mn=Z.__r,Ln=Z.diffed,Pn=Z.__c,Bn=Z.unmount,En=Z.__;function at(e,t){Z.__h&&Z.__h(V,e,ze||t),ze=0;var n=V.__H||(V.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function O(e){return ze=1,$n(Dn,e)}function $n(e,t,n){var r=at(Le++,2);if(r.t=e,!r.__c&&(r.__=[Dn(void 0,t),function(s){var u=r.__N?r.__N[0]:r.__[0],c=r.t(u,s);u!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}));}],r.__c=V,!V.__f)){var o=function(s,u,c){if(!r.__c.__H)return true;var f=r.__c.__H.__.filter(function(m){return m.__c});if(f.every(function(m){return !m.__N}))return !i||i.call(this,s,u,c);var d=r.__c.props!==s;return f.some(function(m){if(m.__N){var p=m.__[0];m.__=m.__N,m.__N=void 0,p!==m.__[0]&&(d=true);}}),i&&i.call(this,s,u,c)||d};V.__f=true;var i=V.shouldComponentUpdate,a=V.componentWillUpdate;V.componentWillUpdate=function(s,u,c){if(this.__e){var f=i;i=void 0,o(s,u,c),i=f;}a&&a.call(this,s,u,c);},V.shouldComponentUpdate=o;}return r.__N||r.__}function D(e,t){var n=at(Le++,3);!Z.__s&&Nn(n.__H,t)&&(n.__=e,n.u=t,V.__H.__h.push(n));}function q(e){return ze=5,F(function(){return {current:e}},[])}function F(e,t){var n=at(Le++,7);return Nn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function j(e,t){return ze=8,F(function(){return e},t)}function Bt(e){var t=V.context[e.__c],n=at(Le++,9);return n.c=e,t?(n.__==null&&(n.__=true,t.sub(V)),t.props.value):e.__}function io(){for(var e;e=Rn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(it),t.__h.some(Pt),t.__h=[];}catch(n){t.__h=[],Z.__e(n,e.__v);}}}Z.__b=function(e){V=null,An&&An(e);},Z.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),En&&En(e,t);},Z.__r=function(e){Mn&&Mn(e),Le=0;var t=(V=e.__c).__H;t&&(Lt===V?(t.__h=[],V.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(t.__h.some(it),t.__h.some(Pt),t.__h=[],Le=0)),Lt=V;},Z.diffed=function(e){Ln&&Ln(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Rn.push(t)!==1&&Cn===Z.requestAnimationFrame||((Cn=Z.requestAnimationFrame)||ao)(io)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0;})),Lt=V=null;},Z.__c=function(e,t){t.some(function(n){try{n.__h.some(it),n.__h=n.__h.filter(function(r){return !r.__||Pt(r)});}catch(r){t.some(function(o){o.__h&&(o.__h=[]);}),t=[],Z.__e(r,n.__v);}}),Pn&&Pn(e,t);},Z.unmount=function(e){Bn&&Bn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{it(r);}catch(o){t=o;}}),n.__H=void 0,t&&Z.__e(t,n.__v));};var In=typeof requestAnimationFrame==\"function\";function ao(e){var t,n=function(){clearTimeout(r),In&&cancelAnimationFrame(t),setTimeout(e);},r=setTimeout(n,35);In&&(t=requestAnimationFrame(n));}function it(e){var t=V,n=e.__c;typeof n==\"function\"&&(e.__c=void 0,n()),V=t;}function Pt(e){var t=V;e.__c=e.__(),V=t;}function Nn(e,t){return !e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Dn(e,t){return typeof t==\"function\"?t(e):t}function lo(e,t){for(var n in t)e[n]=t[n];return e}function Fn(e,t){for(var n in e)if(n!==\"__source\"&&!(n in t))return true;for(var r in t)if(r!==\"__source\"&&e[r]!==t[r])return true;return false}function zn(e,t){this.props=e,this.context=t;}(zn.prototype=new ie).isPureReactComponent=true,zn.prototype.shouldComponentUpdate=function(e,t){return Fn(this.props,e)||Fn(this.state,t)};var qn=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),qn&&qn(e);};var co=B.__e;B.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}co(e,t,n,r);};var On=B.unmount;function jn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c==\"function\"&&r.__c();}),e.__c.__H=null),(e=lo({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=true,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return jn(r,t,n)})),e}function Xn(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Xn(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=true,e.__c.__P=n)),e}function Et(){this.__u=0,this.o=null,this.__b=null;}function Zn(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function st(){this.i=null,this.l=null;}B.unmount=function(e){var t=e.__c;t&&(t.__z=true),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),On&&On(e);},(Et.prototype=new ie).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=Zn(r.__v),i=false,a=function(){i||r.__z||(i=true,n.__R=null,o?o(u):u());};n.__R=a;var s=n.__P;n.__P=null;var u=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=Xn(c,c.__c.__P,c.__c.__O);}var f;for(r.setState({__a:r.__b=null});f=r.o.pop();)f.__P=s,f.forceUpdate();}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a);},Et.prototype.componentWillUnmount=function(){this.o=[];},Et.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement(\"div\"),r=this.__v.__k[0].__c;this.__v.__k[0]=jn(this.__b,n,r.__O=r.__P);}this.__b=null;}var o=t.__a&&de(te,null,e.fallback);return o&&(o.__u&=-33),[de(te,null,t.__a?null:e.children),o]};var Hn=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!==\"t\"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2];}};(st.prototype=new ie).__a=function(e){var t=this,n=Zn(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Hn(t,e,r)):o();};n?n(i):i();}},st.prototype.render=function(e){this.i=null,this.l=new Map;var t=Fe(e.children);e.revealOrder&&e.revealOrder[0]===\"b\"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},st.prototype.componentDidUpdate=st.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Hn(e,n,t);});};var uo=typeof Symbol<\"u\"&&Symbol.for&&Symbol.for(\"react.element\")||60103,po=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,fo=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,mo=/[A-Z0-9]/g,ho=typeof document<\"u\",go=function(e){return (typeof Symbol<\"u\"&&typeof Symbol()==\"symbol\"?/fil|che|rad/:/fil|che|ra/).test(e)};function Gn(e,t,n){return t.__k==null&&(t.textContent=\"\"),Mt(e,t),e?e.__c:null}ie.prototype.isReactComponent=true,[\"componentWillMount\",\"componentWillReceiveProps\",\"componentWillUpdate\"].forEach(function(e){Object.defineProperty(ie.prototype,e,{configurable:true,get:function(){return this[\"UNSAFE_\"+e]},set:function(t){Object.defineProperty(this,e,{configurable:true,writable:true,value:t});}});});var Wn=B.event;B.event=function(e){return Wn&&(e=Wn(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var yo={configurable:true,get:function(){return this.class}},Vn=B.vnode;B.vnode=function(e){typeof e.type==\"string\"&&(function(t){var n=t.props,r=t.type,o={},i=r.indexOf(\"-\")==-1;for(var a in n){var s=n[a];if(!(a===\"value\"&&\"defaultValue\"in n&&s==null||ho&&a===\"children\"&&r===\"noscript\"||a===\"class\"||a===\"className\")){var u=a.toLowerCase();a===\"defaultValue\"&&\"value\"in n&&n.value==null?a=\"value\":a===\"download\"&&s===true?s=\"\":u===\"translate\"&&s===\"no\"?s=false:u[0]===\"o\"&&u[1]===\"n\"?u===\"ondoubleclick\"?a=\"ondblclick\":u!==\"onchange\"||r!==\"input\"&&r!==\"textarea\"||go(n.type)?u===\"onfocus\"?a=\"onfocusin\":u===\"onblur\"?a=\"onfocusout\":fo.test(a)&&(a=u):u=a=\"oninput\":i&&po.test(a)?a=a.replace(mo,\"-$&\").toLowerCase():s===null&&(s=void 0),u===\"oninput\"&&o[a=u]&&(a=\"oninputCapture\"),o[a]=s;}}r==\"select\"&&(o.multiple&&Array.isArray(o.value)&&(o.value=Fe(n.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1;})),o.defaultValue!=null&&(o.value=Fe(n.children).forEach(function(c){c.props.selected=o.multiple?o.defaultValue.indexOf(c.props.value)!=-1:o.defaultValue==c.props.value;}))),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,\"className\",yo)):n.className&&(o.class=o.className=n.className),t.props=o;})(e),e.$$typeof=uo,Vn&&Vn(e);};var Un=B.__r;B.__r=function(e){Un&&Un(e),e.__c;};var Yn=B.diffed;B.diffed=function(e){Yn&&Yn(e);var t=e.props,n=e.__e;n!=null&&e.type===\"textarea\"&&\"value\"in t&&t.value!==n.value&&(n.value=t.value==null?\"\":t.value);};function Kn(e){return !!e.__k&&(Mt(null,e),true)}function Jn(e){return {render:function(t){Gn(t,e);},unmount:function(){Kn(e);}}}function It(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(t>=r.startTime&&t<r.startTime+r.duration)return r}return e[0]||null}function qe(e,t){if(!e||!e.phrases.length)return null;for(let n of e.phrases)if(t>=n.startTime&&t<n.endTime)return n;return null}var J={landscape:{width:1920,height:1080,name:\"16:9 Landscape\"},portrait:{width:1080,height:1920,name:\"9:16 Portrait\"},square:{width:1080,height:1080,name:\"1:1 Square\"}};var bo=Math.sqrt(1920*1920+1080*1080);function Rt(e){return Math.sqrt(e.width*e.width+e.height*e.height)/bo}function $t(e){let t=e.width/e.height;return Math.abs(t-1)<.05?\"square\":t>1?\"landscape\":\"portrait\"}var _o={landscape:{primaryY:\"35%\",secondaryY:\"55%\",tertiaryY:\"75%\",titleScale:1,bodyScale:1,columnLeftX:\"25%\",columnRightX:\"75%\",columnTopY:\"35%\",columnBottomY:\"65%\",stackColumns:false,maxTextWidth:\"80%\",horizontalPadding:\"10%\",captionY:\"85%\",captionScale:1},portrait:{primaryY:\"25%\",secondaryY:\"42%\",tertiaryY:\"58%\",titleScale:.7,bodyScale:1.5,columnLeftX:\"50%\",columnRightX:\"50%\",columnTopY:\"30%\",columnBottomY:\"55%\",stackColumns:true,maxTextWidth:\"90%\",horizontalPadding:\"5%\",captionY:\"75%\",captionScale:.85},square:{primaryY:\"30%\",secondaryY:\"50%\",tertiaryY:\"70%\",titleScale:.85,bodyScale:.9,columnLeftX:\"25%\",columnRightX:\"75%\",columnTopY:\"35%\",columnBottomY:\"65%\",stackColumns:false,maxTextWidth:\"85%\",horizontalPadding:\"7.5%\",captionY:\"82%\",captionScale:.9}};function Oe(e){return _o[e]}function tr(e,t,n,r=false){let o=Rt(t),i=Oe(n),a=r?i.titleScale:i.bodyScale;return Math.round(e*o*a)}function lt(e){let t=Oe(e);return t.stackColumns?{left:{x:\"50%\",y:t.columnTopY},right:{x:\"50%\",y:t.columnBottomY}}:{left:{x:t.columnLeftX,y:\"50%\"},right:{x:t.columnRightX,y:\"50%\"}}}var Nt='\"PT Serif\", Georgia, \"Times New Roman\", serif';function ne(e){return \"template\"in e&&typeof e.template==\"string\"}function pe(e,t,n,r=J.landscape){let o=$t(r);return {theme:e,blockIndex:t,totalBlocks:n,viewport:r,fontScale:Rt(r),orientation:o,layout:Oe(o)}}function P(e,t,n=false){return tr(e,t.viewport,t.orientation,n)}function Dt(e){return \"template\"in e&&typeof e.template==\"string\"}var er='\"PT Serif\", Georgia, \"Times New Roman\", serif';var xo={blue:{bg:\"#1a365d\",text:\"#63b3ed\",accent:\"#90cdf4\"},green:{bg:\"#22543d\",text:\"#9ae6b4\",accent:\"#68d391\"},purple:{bg:\"#44337a\",text:\"#d6bcfa\",accent:\"#b794f4\"},red:{bg:\"#742a2a\",text:\"#fc8181\",accent:\"#feb2b2\"},orange:{bg:\"#744210\",text:\"#fbd38d\",accent:\"#f6ad55\"},teal:{bg:\"#234e52\",text:\"#81e6d9\",accent:\"#4fd1c5\"}},vo={id:\"documentary\",name:\"Documentary\",description:\"Classic dark cinematic look with serif typography. The original Squisq style.\",colors:{primary:\"#3d5a80\",secondary:\"#63b3ed\",background:\"#1a202c\",backgroundLight:\"#2d3748\",text:\"#ffffff\",textMuted:\"#a0aec0\",highlight:\"#63b3ed\",warning:\"#fc8181\"},typography:{bodyFontFamily:er,titleFontFamily:er,titleWeight:\"bold\"},style:{textShadow:true,overlayOpacity:.5,animationSpeed:1},renderStyle:{name:\"documentary\",defaultTextAnimation:\"fadeIn\",defaultImageAnimation:\"slowZoom\",ambientMotion:true,defaultTransition:{type:\"fade\",duration:.8}},colorSchemes:xo,persistentLayers:{bottomLayers:[{template:\"gradientBackground\",config:{type:\"gradientBackground\",preset:\"dark-vignette\"}}]}};var fe=vo;function nr(e){return \"children\"in e&&Array.isArray(e.children)?e.children:[]}function xe(e){return \"value\"in e&&typeof e.value==\"string\"?e.value:nr(e).map(xe).join(\"\")}var Co={\"dark-vignette\":\"radial-gradient(ellipse at center, rgba(26,32,44,0.8) 0%, rgba(0,0,0,0.95) 100%)\",\"radial-dark\":\"radial-gradient(ellipse at center, #1a202c 0%, #000000 100%)\",\"warm-sunset\":\"linear-gradient(135deg, rgba(124,58,48,0.9) 0%, rgba(26,32,44,0.95) 100%)\",\"cool-blue\":\"linear-gradient(135deg, rgba(26,54,93,0.9) 0%, rgba(26,32,44,0.95) 100%)\",\"earth-tones\":\"linear-gradient(135deg, rgba(68,51,34,0.9) 0%, rgba(26,32,44,0.95) 100%)\"};function Ao(e){return {type:\"shape\",id:\"persistent-bg-solid\",content:{shape:\"rect\",fill:e.color},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}}function Mo(e){return {type:\"shape\",id:\"persistent-bg-gradient\",content:{shape:\"rect\",fill:e.gradient??Co[e.preset??\"dark-vignette\"]},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}}function Lo(e){let t=[],n=e.opacity??.4,r={type:\"image\",id:\"persistent-bg-image\",content:{src:e.src,alt:\"Background\",fit:\"cover\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"},animation:e.ambientMotion?{type:e.ambientMotion,duration:30}:void 0};return t.push(r),t.push({type:\"shape\",id:\"persistent-bg-overlay\",content:{shape:\"rect\",fill:`rgba(0,0,0,${.5+(1-n)*.3})`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}),t}function Po(e){let t=e.opacity??.1;return {type:\"shape\",id:\"persistent-bg-pattern\",content:{shape:\"rect\",fill:e.color??`rgba(255,255,255,${t})`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}}function Bo(e){let t=[],n=e.fontSize??18,r=!!e.subtitle,o=e.position.includes(\"bottom\"),i=e.position.includes(\"left\"),a=3,s=r?\"15%\":\"7%\",u=o?r?\"78%\":\"84%\":\"2%\",c=i?`${a}%`:\"68%\",f=r?\"6%\":\"5%\",d=r?\"10%\":\"5%\",m=1.5,p=e.showThumbnail&&i?`${a+m+6+m}%`:`${a+m}%`,y=e.showThumbnail?\"19%\":\"24%\",h=o?r?\"80%\":\"86%\":\"4%\";if(t.push({type:\"shape\",id:\"persistent-caption-bg\",content:{shape:\"rect\",fill:\"rgba(0,0,0,0.6)\",borderRadius:8},position:{x:c,y:u,width:e.showThumbnail?\"30%\":\"28%\",height:s}}),e.showThumbnail&&e.thumbnailSrc){let b=i?`${a+m}%`:\"93%\",v=o?r?`${78+m}%`:\"85%\":\"3%\";t.push({type:\"image\",id:\"persistent-caption-thumb\",content:{src:e.thumbnailSrc,alt:\"Article thumbnail\",fit:\"cover\"},position:{x:b,y:v,width:f,height:d}});}if(t.push({type:\"text\",id:\"persistent-caption-title\",content:{text:e.title,style:{fontSize:n,fontWeight:\"bold\",color:\"rgba(255,255,255,0.9)\",textAlign:i?\"left\":\"right\",maxLines:1}},position:{x:p,y:h,width:y}}),r){let b=o?\"85.5%\":\"8%\";t.push({type:\"text\",id:\"persistent-caption-subtitle\",content:{text:e.subtitle,style:{fontSize:18,fontWeight:\"normal\",color:\"rgba(255,255,255,0.55)\",textAlign:i?\"left\":\"right\"}},position:{x:p,y:b,width:y}});}return t}function Eo(e){let t=e.position.includes(\"bottom\"),r=e.position.includes(\"left\")?\"3%\":\"90%\",o=t?\"94%\":\"3%\";return e.isImage?{type:\"image\",id:\"persistent-branding\",content:{src:e.content,alt:\"Branding\",fit:\"contain\"},position:{x:r,y:o,width:\"8%\",height:\"4%\"}}:{type:\"text\",id:\"persistent-branding\",content:{text:e.content,style:{fontSize:14,fontWeight:\"normal\",color:\"rgba(255,255,255,0.6)\"}},position:{x:r,y:o}}}function Io(e){let t=e.color??\"rgba(255,255,255,0.3)\",n=e.position===\"top\"?\"1%\":\"98%\";return {type:\"shape\",id:\"persistent-progress\",content:{shape:\"rect\",fill:t,borderRadius:2},position:{x:\"5%\",y:n,width:\"90%\",height:\"0.5%\"}}}function Ro(e){if(!Dt(e))return [e];let n=e.config;switch(n.type){case \"solidBackground\":return [Ao(n)];case \"gradientBackground\":return [Mo(n)];case \"imageBackground\":return Lo(n);case \"patternBackground\":return [Po(n)];case \"titleCaption\":return Bo(n);case \"cornerBranding\":return [Eo(n)];case \"progressIndicator\":return [Io(n)];default:return console.warn(\"Unknown persistent layer template:\",n.type),[]}}function He(e){return !e||e.length===0?[]:e.reduce((t,n)=>t.concat(Ro(n)),[])}function ir(e,t){let{title:n,subtitle:r,backgroundColor:o}=e,{theme:i,layout:a}=t,s=P(96,t,true),u=P(36,t,false),f=[{type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:`radial-gradient(ellipse at 50% 40%, ${o||i.colors.primary} 0%, ${i.colors.background} 100%)`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}},{type:\"shape\",id:\"accent-line\",content:{shape:\"rect\",fill:\"rgba(255, 255, 255, 0.2)\"},position:{x:\"40%\",y:r?\"28%\":\"38%\",width:\"20%\",height:\"2px\"}},{type:\"text\",id:\"title\",content:{text:n,style:{fontSize:s,fontWeight:\"bold\",color:i.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:r?a.primaryY:\"50%\",anchor:\"center\",width:a.maxTextWidth},animation:{type:\"fadeIn\",duration:2}}];return r&&f.push({type:\"text\",id:\"subtitle\",content:{text:r,style:{fontSize:u,color:i.colors.textMuted,textAlign:\"center\",lineHeight:1.5}},position:{x:\"50%\",y:a.secondaryY,anchor:\"center\",width:a.maxTextWidth},animation:{type:\"fadeIn\",duration:1.5,delay:1}}),f}var $o={bg:\"#1a365d\",text:\"#63b3ed\",accent:\"#90cdf4\"};function ye(e,t){let n=e.theme.colorSchemes;if(t&&t in n)return n[t];let r=Object.keys(n);return r.length>0?n[r[0]]:$o}function ar(e,t){let{title:n,colorScheme:r=\"blue\",imageSrc:o,imageAlt:i,ambientMotion:a}=e,{layout:s}=t,u=ye(t,r),c=P(72,t,true),f=[];return o?(f.push({type:\"image\",id:\"bg-image\",content:{src:o,alt:i||n,fit:\"cover\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"},animation:a?{type:a,duration:8}:{type:\"slowZoom\",duration:8,direction:\"in\"}}),f.push({type:\"shape\",id:\"overlay\",content:{shape:\"rect\",fill:\"rgba(0, 0, 0, 0.5)\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"}})):(f.push({type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:u.bg},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}),f.push({type:\"shape\",id:\"line-top\",content:{shape:\"rect\",fill:`${u.text}33`},position:{x:\"50%\",y:\"40%\",width:\"20%\",height:\"2px\",anchor:\"center\"}}),f.push({type:\"shape\",id:\"line-bottom\",content:{shape:\"rect\",fill:`${u.text}33`},position:{x:\"50%\",y:\"60%\",width:\"20%\",height:\"2px\",anchor:\"center\"}})),f.push({type:\"text\",id:\"title\",content:{text:n,style:{fontSize:c,fontWeight:\"bold\",color:o?\"#ffffff\":u.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:\"50%\",anchor:\"center\",width:s.maxTextWidth},animation:{type:\"fadeIn\",duration:1.5}}),f}var No=/^(\\d+(?:\\.\\d+)?)\\s*%?$/,be={textCenterX:\"50%\",textWidth:\"85%\",textYAdjust:0,adjustY:false};function Pe(e,t){if(!e)return;let n=t!==void 0?{duration:t}:{};switch(e){case \"zoomIn\":case \"in\":return {type:\"slowZoom\",direction:\"in\",...n};case \"zoomOut\":case \"out\":return {type:\"slowZoom\",direction:\"out\",...n};case \"panLeft\":case \"left\":return {type:\"slowZoom\",panDirection:\"left\",...n};case \"panRight\":case \"right\":return {type:\"slowZoom\",panDirection:\"right\",...n};default:return}}var le=35,sr=`${le}%`;function ve(e){switch(e){case \"left-strip\":return {textCenterX:`${50+le/2}%`,textWidth:`${100-le-8}%`,textYAdjust:0,adjustY:false};case \"right-strip\":return {textCenterX:`${50-le/2}%`,textWidth:`${100-le-8}%`,textYAdjust:0,adjustY:false};case \"bottom-strip\":return {textCenterX:\"50%\",textWidth:\"85%\",textYAdjust:-10,adjustY:true};case \"corner-inset\":return {textCenterX:\"45%\",textWidth:\"70%\",textYAdjust:0,adjustY:false};default:return be}}function ke(e,t){let n=[],{src:r,alt:o,position:i,ambientMotion:a,credit:s,license:u}=e;switch(i){case \"left-strip\":n.push(rr(r,o,\"left\",t,a,s,u)),n.push(or(\"left\",t));break;case \"right-strip\":n.push(rr(r,o,\"right\",t,a,s,u)),n.push(or(\"right\",t));break;case \"bottom-strip\":n.push(Do(r,o,t,a,s,u)),n.push(Fo(t));break;case \"corner-inset\":n.push(zo(r,o,t,a,s,u)),n.push(qo(t));break}return n}function rr(e,t,n,r,o,i,a){return {type:\"image\",id:`${r}-accent-img`,content:{src:e,alt:t,fit:\"cover\",credit:i,license:a},position:{x:n===\"left\"?0:`${100-le}%`,y:0,width:sr,height:\"100%\"},animation:Pe(o,15)}}function or(e,t){let n=e===\"left\"?\"accent-gradient-left\":\"accent-gradient-right\";return {type:\"shape\",id:`${t}-accent-fade`,content:{shape:\"rect\",fill:`url(#${n})`},position:{x:e===\"left\"?`${le-8}%`:`${100-le}%`,y:0,width:\"10%\",height:\"100%\"}}}function Do(e,t,n,r,o,i){return {type:\"image\",id:`${n}-accent-img`,content:{src:e,alt:t,fit:\"cover\",credit:o,license:i},position:{x:0,y:`${100-le}%`,width:\"100%\",height:sr},animation:Pe(r,15)}}function Fo(e){return {type:\"shape\",id:`${e}-accent-fade`,content:{shape:\"rect\",fill:\"url(#accent-gradient-bottom)\"},position:{x:0,y:`${100-le-8}%`,width:\"100%\",height:\"12%\"}}}function zo(e,t,n,r,o,i){return {type:\"image\",id:`${n}-accent-img`,content:{src:e,alt:t,fit:\"cover\",credit:o,license:i},position:{x:\"70%\",y:\"60%\",width:\"28%\",height:\"38%\",anchor:\"top-left\"},animation:Pe(r,15)??{type:\"fadeIn\",duration:2,delay:.5}}}function qo(e){return {type:\"shape\",id:`${e}-accent-vignette`,content:{shape:\"rect\",fill:\"url(#accent-vignette-corner)\",borderRadius:8},position:{x:\"69%\",y:\"59%\",width:\"30%\",height:\"40%\"}}}function G(e,t){if(!t.adjustY||t.textYAdjust===0)return typeof e==\"number\"?`${e}%`:e;let n=typeof e==\"number\"?`${e}`:e,r=n.match(No);if(r){let o=parseFloat(r[1]);return `${Math.max(5,o+t.textYAdjust)}%`}return n}var Oo=/[.;:!?]+$/;function zt(e){return e.replace(Oo,\"\").trim()}function ut(e,t){return {type:\"shape\",id:e,content:{shape:\"rect\",fill:t},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}}function lr(e,t){let{stat:n,description:r,detail:o,colorScheme:i=\"blue\",accentImage:a}=e,{theme:s}=t,u=ye(t,i),c=a?ve(a.position):be,f=P(148,t,true),d=P(32,t,false),m=P(26,t,false),p=[ut(\"bg\",`linear-gradient(180deg, ${s.colors.background} 0%, #0f1520 100%)`)];return a&&p.push(...ke(a,e.id)),p.push({type:\"text\",id:\"stat\",content:{text:n,style:{fontSize:f,fontWeight:\"bold\",color:u.text,shadow:!!a}},position:{x:c.textCenterX,y:G(\"32%\",c),anchor:\"center\"},animation:{type:\"zoomIn\",duration:.6}}),p.push({type:\"text\",id:\"description\",content:{text:r,style:{fontSize:d,color:s.colors.textMuted,textAlign:\"center\",lineHeight:1.6,shadow:!!a}},position:{x:c.textCenterX,y:G(\"58%\",c),width:c.textWidth,anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:.3}}),o&&p.push({type:\"text\",id:\"detail\",content:{text:o,style:{fontSize:m,color:u.accent,textAlign:\"center\",shadow:!!a}},position:{x:c.textCenterX,y:G(\"75%\",c),anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:1}}),p}function cr(e,t){let{quote:n,attribution:r,accentImage:o}=e,{theme:i,layout:a}=t,s=o?ve(o.position):be,u=P(48,t,true),c=P(24,t,false),f=P(280,t,true),d=[ut(\"bg\",`linear-gradient(160deg, ${i.colors.backgroundLight} 0%, #1e2636 100%)`)];o&&d.push(...ke(o,e.id)),d.push({type:\"text\",id:\"deco-quote\",content:{text:\"\\u201C\",style:{fontSize:f,color:\"rgba(255, 255, 255, 0.06)\",textAlign:\"center\"}},position:{x:s.textCenterX,y:G(\"18%\",s),anchor:\"center\"}});let m=r?a.primaryY:\"50%\";return d.push({type:\"text\",id:\"quote\",content:{text:n,style:{fontSize:u,color:i.colors.text,textAlign:\"center\",lineHeight:1.6,shadow:true}},position:{x:s.textCenterX,y:G(m,s),anchor:\"center\",width:s.textWidth},animation:{type:\"fadeIn\",duration:2}}),r&&d.push({type:\"text\",id:\"attribution\",content:{text:`\\u2014 ${r}`,style:{fontSize:c,color:i.colors.textMuted,textAlign:\"center\",shadow:!!o}},position:{x:s.textCenterX,y:G(a.captionY,s),anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:1.5}}),d}function ur(e,t){let{fact:n,explanation:r,source:o,accentImage:i}=e,{theme:a}=t,s=i?ve(i.position):be,u=P(56,t,true),c=P(32,t,false),f=P(20,t,false),d=[ut(\"bg\",`linear-gradient(170deg, #1e2030 0%, ${a.colors.background} 100%)`)];return i&&d.push(...ke(i,e.id)),d.push({type:\"text\",id:\"fact\",content:{text:n,style:{fontSize:u,fontWeight:\"bold\",color:a.colors.text,textAlign:\"center\",lineHeight:1.4,shadow:true}},position:{x:s.textCenterX,y:G(\"35%\",s),width:s.textWidth,anchor:\"center\"},animation:{type:\"fadeIn\",duration:1.5}}),d.push({type:\"text\",id:\"explanation\",content:{text:r,style:{fontSize:c,color:a.colors.textMuted,textAlign:\"center\",lineHeight:1.5,shadow:!!i}},position:{x:s.textCenterX,y:G(\"60%\",s),width:s.textWidth,anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:.8}}),o&&d.push({type:\"text\",id:\"source\",content:{text:o,style:{fontSize:f,color:a.colors.textMuted,textAlign:\"center\",shadow:!!i}},position:{x:s.textCenterX,y:G(\"85%\",s),anchor:\"center\"},animation:{type:\"fadeIn\",duration:.8,delay:1.5}}),d}function dr(e,t){let{left:n,right:r,header:o,leftColor:i=\"green\",rightColor:a=\"blue\"}=e;if(!n?.label||!r?.label)return [];let{theme:s,layout:u,orientation:c}=t,f=ye(t,i),d=ye(t,a),m=lt(c),p=u.stackColumns,y=p?\"85%\":\"42%\",h=P(32,t,false),b=P(44,t,true),v=P(22,t,false),_=[{type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:`linear-gradient(135deg, ${s.colors.background} 0%, #16202e 100%)`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}];p||(_.push({type:\"shape\",id:\"left-panel\",content:{shape:\"rect\",fill:\"rgba(255, 255, 255, 0.04)\"},position:{x:\"3%\",y:\"15%\",width:\"44%\",height:\"70%\"}}),_.push({type:\"shape\",id:\"right-panel\",content:{shape:\"rect\",fill:\"rgba(255, 255, 255, 0.04)\"},position:{x:\"53%\",y:\"15%\",width:\"44%\",height:\"70%\"}}));let S=p?\"12%\":\"22%\";o&&_.push({type:\"text\",id:\"header\",content:{text:o,style:{fontSize:h,color:s.colors.textMuted,textAlign:\"center\"}},position:{x:\"50%\",y:S,anchor:\"center\"},animation:{type:\"fadeIn\",duration:.8}});let w,A,I,$;if(p)w=o?\"30%\":\"25%\",A=o?\"40%\":\"35%\",I=o?\"60%\":\"55%\",$=o?\"70%\":\"65%\";else {let se=o?\"47%\":\"45%\",k=o?\"58%\":\"56%\";w=se,A=k,I=se,$=k;}_.push({type:\"text\",id:\"left-label\",content:{text:n.label,style:{fontSize:b,fontWeight:\"bold\",color:f.text,textAlign:\"center\",lineHeight:1.3}},position:{x:m.left.x,y:w,anchor:\"center\",width:y},animation:{type:\"fadeIn\",duration:1}}),n.sublabel&&_.push({type:\"text\",id:\"left-sublabel\",content:{text:n.sublabel,style:{fontSize:v,color:s.colors.textMuted,textAlign:\"center\",lineHeight:1.4}},position:{x:m.left.x,y:A,anchor:\"center\",width:y},animation:{type:\"fadeIn\",duration:.8,delay:.3}});let N=P(120,t,true),W=p?\"48%\":\"50%\",U=p?\"\\u2193\":\"\\u2192\";return _.push({type:\"text\",id:\"connector\",content:{text:U,style:{fontSize:N,fontWeight:\"bold\",color:\"rgba(255, 255, 255, 0.6)\",textAlign:\"center\"}},position:{x:\"50%\",y:W,anchor:\"center\"},animation:{type:\"fadeIn\",duration:.6,delay:.4}}),_.push({type:\"text\",id:\"right-label\",content:{text:r.label,style:{fontSize:b,fontWeight:\"bold\",color:d.text,textAlign:\"center\",lineHeight:1.3}},position:{x:m.right.x,y:I,anchor:\"center\",width:y},animation:{type:\"fadeIn\",duration:1,delay:.5}}),r.sublabel&&_.push({type:\"text\",id:\"right-sublabel\",content:{text:r.sublabel,style:{fontSize:v,color:s.colors.textMuted,textAlign:\"center\",lineHeight:1.4}},position:{x:m.right.x,y:$,anchor:\"center\",width:y},animation:{type:\"fadeIn\",duration:.8,delay:.8}}),_}var Ho={neutral:{bg:\"#1a202c\",date:\"#63b3ed\",text:\"#ffffff\"},somber:{bg:\"#1a1a2e\",date:\"#e53e3e\",text:\"#a0aec0\"},celebratory:{bg:\"#1a365d\",date:\"#68d391\",text:\"#ffffff\"}};function pr(e,t){let{date:n,description:r,footer:o,mood:i=\"neutral\",accentImage:a}=e,{theme:s}=t,u=Ho[i],c=a?ve(a.position):be,f=P(96,t,true),d=P(30,t,false),m=P(26,t,false),p=[{type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:`linear-gradient(135deg, ${u.bg} 0%, #0d1117 100%)`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}];return a&&p.push(...ke(a,e.id)),p.push({type:\"text\",id:\"date\",content:{text:n,style:{fontSize:f,fontWeight:\"bold\",color:u.date,shadow:!!a}},position:{x:c.textCenterX,y:G(\"35%\",c),anchor:\"center\"},animation:{type:\"fadeIn\",duration:1.5}}),p.push({type:\"text\",id:\"description\",content:{text:r,style:{fontSize:d,color:u.text,textAlign:\"center\",lineHeight:1.8,shadow:!!a}},position:{x:c.textCenterX,y:G(\"58%\",c),width:c.textWidth,anchor:\"center\"},animation:{type:\"fadeIn\",duration:2,delay:1}}),o&&p.push({type:\"text\",id:\"footer\",content:{text:o,style:{fontSize:m,color:s.colors.textMuted,shadow:!!a}},position:{x:c.textCenterX,y:G(\"82%\",c),anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:3}}),p}function fr(e,t){let{imageSrc:n,imageAlt:r,caption:o,captionPosition:i=\"bottom\",ambientMotion:a,isTitle:s,subtitle:u,imageCredit:c,imageLicense:f}=e,d=o&&zt(o),{theme:m,layout:p}=t,y=P(36,t,false),h=P(96,t,true),b=P(36,t,false),v=e.kenBurns,S=Pe(a||v),w=[{type:\"image\",id:\"bg-image\",content:{src:n,alt:r,fit:\"cover\",credit:c,license:f},position:{x:0,y:0,width:\"100%\",height:\"100%\"},animation:S}];return s&&d?(w.push({type:\"shape\",id:\"title-gradient\",content:{shape:\"rect\",fill:\"linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.1) 70%, transparent 100%)\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}),w.push({type:\"text\",id:\"title\",content:{text:d,style:{fontSize:h,fontWeight:\"bold\",color:m.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:u?\"70%\":\"75%\",anchor:\"center\",width:p.maxTextWidth},animation:{type:\"fadeIn\",duration:.8}}),u&&w.push({type:\"text\",id:\"subtitle\",content:{text:u,style:{fontSize:b,color:m.colors.textMuted,textAlign:\"center\",lineHeight:1.5}},position:{x:\"50%\",y:\"82%\",anchor:\"center\",width:p.maxTextWidth},animation:{type:\"fadeIn\",duration:.8,delay:.2}}),w):(d&&(w.push({type:\"shape\",id:\"caption-gradient\",content:{shape:\"rect\",fill:\"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%)\"},position:{x:0,y:\"65%\",width:\"100%\",height:\"35%\"}}),w.push({type:\"text\",id:\"caption\",content:{text:d,style:{fontSize:y,color:m.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:\"82%\",anchor:\"center\",width:p.maxTextWidth},animation:{type:\"fadeIn\",duration:1.5,delay:.5}})),w)}function mr(e,t){let{center:n,zoom:r,mapStyle:o=\"terrain\",title:i,caption:a,markers:s,ambientMotion:u,staticSrc:c}=e,{theme:f,layout:d}=t,m=P(64,t,true),p=P(32,t,false),y=Pe(u),h=[{type:\"map\",id:\"map-bg\",content:{center:n,zoom:r,style:o,markers:s,showAttribution:true,staticSrc:c},position:{x:0,y:0,width:\"100%\",height:\"100%\"},animation:y}];return i&&(h.push({type:\"shape\",id:\"title-overlay\",content:{shape:\"rect\",fill:\"rgba(0,0,0,0.6)\"},position:{x:0,y:0,width:\"100%\",height:\"18%\"}}),h.push({type:\"text\",id:\"title\",content:{text:i,style:{fontSize:m,fontWeight:\"bold\",color:f.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:\"9%\",anchor:\"center\",width:d.maxTextWidth},animation:{type:\"fadeIn\",duration:1,delay:.3}})),a&&(h.push({type:\"shape\",id:\"caption-overlay\",content:{shape:\"rect\",fill:\"rgba(0,0,0,0.6)\"},position:{x:0,y:\"82%\",width:\"100%\",height:\"18%\"}}),h.push({type:\"text\",id:\"caption\",content:{text:a,style:{fontSize:p,color:f.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:d.captionY,anchor:\"center\",width:d.maxTextWidth},animation:{type:\"fadeIn\",duration:1,delay:.5}})),h}function hr(e,t){let{text:n,colorScheme:r=\"blue\"}=e,{theme:o}=t,i=ye(t,r),a=P(120,t,true);return [{type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:`radial-gradient(ellipse at 50% 50%, ${o.colors.backgroundLight} 0%, #000000 100%)`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}},{type:\"text\",id:\"impact-text\",content:{text:n,style:{fontSize:a,fontWeight:\"bold\",color:i.text,textAlign:\"center\",lineHeight:1.2,shadow:true}},position:{x:\"50%\",y:\"50%\",anchor:\"center\",width:\"85%\"},animation:{type:\"fadeIn\",duration:1.5}}]}function gr(e,t){let{items:n,title:r,accentImage:o}=e,{theme:i}=t,a=o?ve(o.position):be,s=P(44,t,true),u=P(34,t,false),c=[{type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:`linear-gradient(155deg, ${i.colors.backgroundLight} 0%, ${i.colors.background} 100%)`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}];o&&c.push(...ke(o,e.id));let f=r?30:22;r&&c.push({type:\"text\",id:\"list-title\",content:{text:r,style:{fontSize:s,fontWeight:\"bold\",color:i.colors.text,textAlign:\"center\",shadow:!!o}},position:{x:a.textCenterX,y:G(\"16%\",a),anchor:\"center\"},animation:{type:\"fadeIn\",duration:1}});let m=n.length>1?(80-f)/(n.length-1):0;for(let p=0;p<n.length;p++){let y=f+m*p,h=`${p+1}. ${n[p]}`;c.push({type:\"text\",id:`item-${p}`,content:{text:h,style:{fontSize:u,color:i.colors.text,lineHeight:1.4,shadow:!!o}},position:{x:a.textCenterX,y:G(`${y}%`,a),anchor:\"center\",width:a.textWidth},animation:{type:\"fadeIn\",duration:.8,delay:.3+.3*p}});}return c}var ee=.5;function yr(e,t){let{images:n,caption:r,ambientMotion:o}=e;if(!n||n.length===0)return [];let i=r&&zt(r),{theme:a,layout:s}=t,u=[{type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:\"#000000\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}],c=i?s.stackColumns?18:22:0,f=100-c,d=Wo(n.length,f,s.stackColumns),m=P(24,t,false);for(let p=0;p<Math.min(n.length,4);p++){let y=n[p],h=d[p];u.push({type:\"shape\",id:`grid-placeholder-${p}`,content:{shape:\"rect\",fill:a.colors.background},position:{x:`${h.x}%`,y:`${h.y}%`,width:`${h.w}%`,height:`${h.h}%`}}),y.alt&&u.push({type:\"text\",id:`grid-alt-${p}`,content:{text:y.alt,style:{fontSize:m,color:a.colors.textMuted,textAlign:\"center\"}},position:{x:`${h.x+h.w/2}%`,y:`${h.y+h.h/2}%`,anchor:\"center\"}}),u.push({type:\"image\",id:`grid-img-${p}`,content:{src:y.src,alt:y.alt,fit:\"cover\",credit:y.credit,license:y.license},position:{x:`${h.x}%`,y:`${h.y}%`,width:`${h.w}%`,height:`${h.h}%`},animation:p===0&&o?{type:o,duration:15}:{type:\"fadeIn\",duration:1,delay:.2*p}});}if(i){let p=P(s.stackColumns?28:40,t,false);u.push({type:\"shape\",id:\"caption-bg\",content:{shape:\"rect\",fill:\"linear-gradient(transparent, rgba(0,0,0,0.8))\"},position:{x:0,y:`${f-4}%`,width:\"100%\",height:`${c+4}%`}}),u.push({type:\"text\",id:\"caption\",content:{text:i,style:{fontSize:p,color:a.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:`${f+(s.stackColumns?c/2:c*.3)}%`,anchor:\"center\",width:\"90%\"},animation:{type:\"fadeIn\",duration:1,delay:.5}});}return u}function Wo(e,t,n){let r=50-ee/2,o=t/2-ee/2;switch(e){case 2:return n?[{x:0,y:0,w:100,h:o},{x:0,y:t/2+ee/2,w:100,h:o}]:[{x:0,y:0,w:r,h:t},{x:50+ee/2,y:0,w:r,h:t}];case 3:{if(n){let s=t/3-ee*2/3;return [{x:0,y:0,w:100,h:s},{x:0,y:t/3+ee/3,w:100,h:s},{x:0,y:t*2/3+ee*2/3,w:100,h:s}]}let i=60-ee/2,a=40-ee/2;return [{x:0,y:0,w:i,h:t},{x:60+ee/2,y:0,w:a,h:o},{x:60+ee/2,y:t/2+ee/2,w:a,h:o}]}default:return [{x:0,y:0,w:r,h:o},{x:50+ee/2,y:0,w:r,h:o},{x:0,y:t/2+ee/2,w:r,h:o},{x:50+ee/2,y:t/2+ee/2,w:r,h:o}]}}function br(e,t){let{term:n,definition:r,origin:o,colorScheme:i=\"blue\",accentImage:a}=e,{theme:s}=t,u=ye(t,i),c=a?ve(a.position):be,f=P(72,t,true),d=P(32,t,false),m=P(22,t,false),p=[ut(\"bg\",`linear-gradient(145deg, #1e2030 0%, ${s.colors.background} 100%)`)];return a&&p.push(...ke(a,e.id)),p.push({type:\"text\",id:\"term\",content:{text:n,style:{fontSize:f,fontWeight:\"bold\",color:u.text,textAlign:\"center\",shadow:!!a}},position:{x:c.textCenterX,y:G(\"30%\",c),anchor:\"center\"},animation:{type:\"fadeIn\",duration:1.5}}),p.push({type:\"shape\",id:\"separator\",content:{shape:\"rect\",fill:`${u.text}33`},position:{x:c.textCenterX,y:G(\"42%\",c),width:\"30%\",height:\"2px\",anchor:\"center\"}}),p.push({type:\"text\",id:\"definition\",content:{text:r,style:{fontSize:d,color:s.colors.text,textAlign:\"center\",lineHeight:1.6,maxLines:4,shadow:!!a}},position:{x:c.textCenterX,y:G(\"55%\",c),width:c.textWidth,anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:.8}}),o&&p.push({type:\"text\",id:\"origin\",content:{text:o,style:{fontSize:m,color:s.colors.textMuted,textAlign:\"center\",shadow:!!a}},position:{x:c.textCenterX,y:G(\"78%\",c),anchor:\"center\"},animation:{type:\"fadeIn\",duration:.8,delay:1.5}}),p}function _r(e,t){let{leftLabel:n,leftValue:r,rightLabel:o,rightValue:i,unit:a,colorScheme:s=\"blue\"}=e,{theme:u}=t,c=ye(t,s),f=P(28,t,false),d=P(48,t,true),m=Math.max(r,i,1),p=65,y=r/m*p,h=i/m*p,b=15,v=6,_=36,S=58,w=$=>$>=1e6?`${($/1e6).toFixed(1)}M`:$>=1e3?`${($/1e3).toFixed($>=1e4?0:1)}K`:$.toLocaleString(),A=a?`${w(r)} ${a}`:w(r),I=a?`${w(i)} ${a}`:w(i);return [{type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:`linear-gradient(180deg, ${u.colors.background} 0%, #0f1520 100%)`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}},{type:\"text\",id:\"left-label\",content:{text:n,style:{fontSize:f,color:u.colors.textMuted}},position:{x:`${b}%`,y:`${_-8}%`}},{type:\"text\",id:\"left-value\",content:{text:A,style:{fontSize:d,fontWeight:\"bold\",color:c.text}},position:{x:`${b+y+2}%`,y:`${_-1}%`},animation:{type:\"fadeIn\",duration:.8,delay:.3}},{type:\"shape\",id:\"left-bar\",content:{shape:\"rect\",fill:c.text,borderRadius:4},position:{x:`${b}%`,y:`${_}%`,width:`${y}%`,height:`${v}%`},animation:{type:\"fadeIn\",duration:1}},{type:\"text\",id:\"right-label\",content:{text:o,style:{fontSize:f,color:u.colors.textMuted}},position:{x:`${b}%`,y:`${S-8}%`}},{type:\"text\",id:\"right-value\",content:{text:I,style:{fontSize:d,fontWeight:\"bold\",color:c.accent}},position:{x:`${b+h+2}%`,y:`${S-1}%`},animation:{type:\"fadeIn\",duration:.8,delay:.6}},{type:\"shape\",id:\"right-bar\",content:{shape:\"rect\",fill:c.accent,borderRadius:4},position:{x:`${b}%`,y:`${S}%`,width:`${h}%`,height:`${v}%`},animation:{type:\"fadeIn\",duration:1,delay:.3}}]}function xr(e,t){let{text:n,attribution:r,backgroundImage:o,ambientMotion:i}=e;if(!o?.src)return [];let a=P(52,t,true),s=P(24,t,false),u=P(200,t,true),c=[{type:\"image\",id:\"bg-image\",content:{src:o.src,alt:o.alt,fit:\"cover\",credit:o.credit,license:o.license},position:{x:0,y:0,width:\"100%\",height:\"100%\"},animation:i?{type:i,duration:15}:void 0},{type:\"shape\",id:\"overlay\",content:{shape:\"rect\",fill:\"rgba(0, 0, 0, 0.55)\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"}},{type:\"text\",id:\"deco-quote\",content:{text:\"\\u201C\",style:{fontSize:u,color:\"rgba(255, 255, 255, 0.08)\",textAlign:\"center\"}},position:{x:\"50%\",y:\"20%\",anchor:\"center\"}},{type:\"text\",id:\"quote-text\",content:{text:n,style:{fontSize:a,color:\"#ffffff\",textAlign:\"center\",lineHeight:1.5,shadow:true}},position:{x:\"50%\",y:r?\"45%\":\"50%\",anchor:\"center\",width:\"80%\"},animation:{type:\"fadeIn\",duration:2}}];return r&&c.push({type:\"text\",id:\"attribution\",content:{text:`\\u2014 ${r}`,style:{fontSize:s,color:\"rgba(255, 255, 255, 0.7)\",textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:\"72%\",anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:1.5}}),c}function vr(e,t){let{videoSrc:n,posterSrc:r,videoAlt:o,clipStart:i,clipEnd:a,sourceDuration:s,caption:u,captionPosition:c=\"bottom\",videoCredit:f,videoLicense:d}=e,m=u&&zt(u),{theme:p,layout:y}=t,h=P(36,t,false),b=P(16,t,false),v=[{type:\"video\",id:\"bg-video\",content:{src:n,posterSrc:r,alt:o,fit:\"cover\",clipStart:i,clipEnd:a,sourceDuration:s,credit:f,license:d},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}];if(m){v.push({type:\"shape\",id:\"caption-gradient\",content:{shape:\"rect\",fill:\"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%)\"},position:{x:0,y:c===\"top\"?0:\"65%\",width:\"100%\",height:\"35%\"}});let _=c===\"top\"?\"15%\":c===\"center\"?\"50%\":\"82%\";v.push({type:\"text\",id:\"caption\",content:{text:m,style:{fontSize:h,color:p.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:_,anchor:\"center\",width:y.maxTextWidth},animation:{type:\"fadeIn\",duration:1.5,delay:.5}});}return f&&v.push({type:\"text\",id:\"credit\",content:{text:f,style:{fontSize:b,color:\"rgba(255, 255, 255, 0.5)\",textAlign:\"right\"}},position:{x:\"96%\",y:\"96%\",anchor:\"bottom-right\"}}),v}function kr(e,t){let{text:n,attribution:r,backgroundVideo:o}=e;if(!o?.src)return [];let i=P(52,t,true),a=P(24,t,false),s=P(200,t,true),u=[{type:\"video\",id:\"bg-video\",content:{src:o.src,posterSrc:o.posterSrc,alt:o.alt,fit:\"cover\",clipStart:o.clipStart,clipEnd:o.clipEnd,credit:o.credit,license:o.license},position:{x:0,y:0,width:\"100%\",height:\"100%\"}},{type:\"shape\",id:\"overlay\",content:{shape:\"rect\",fill:\"rgba(0, 0, 0, 0.55)\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"}},{type:\"text\",id:\"deco-quote\",content:{text:\"\\u201C\",style:{fontSize:s,color:\"rgba(255, 255, 255, 0.08)\",textAlign:\"center\"}},position:{x:\"50%\",y:\"20%\",anchor:\"center\"}},{type:\"text\",id:\"quote-text\",content:{text:n,style:{fontSize:i,color:\"#ffffff\",textAlign:\"center\",lineHeight:1.5,shadow:true}},position:{x:\"50%\",y:r?\"45%\":\"50%\",anchor:\"center\",width:\"80%\"},animation:{type:\"fadeIn\",duration:2}}];return r&&u.push({type:\"text\",id:\"attribution\",content:{text:`\\u2014 ${r}`,style:{fontSize:a,color:\"rgba(255, 255, 255, 0.7)\",textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:\"72%\",anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:1.5}}),u}function wr(e,t){let{heroSrc:n,heroAlt:r,title:o,subtitle:i,ambientMotion:a,heroCredit:s,heroLicense:u}=e,{theme:c,layout:f}=t,d=P(96,t,true),m=P(36,t,false),p=Pe(a),y=[{type:\"image\",id:\"cover-hero\",content:{src:n,alt:r||o,fit:\"cover\",credit:s,license:u},position:{x:0,y:0,width:\"100%\",height:\"100%\"},animation:p},{type:\"shape\",id:\"cover-gradient\",content:{shape:\"rect\",fill:\"linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.1) 70%, transparent 100%)\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"}},{type:\"text\",id:\"cover-title\",content:{text:o,style:{fontSize:d,fontWeight:\"bold\",color:c.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:i?\"70%\":\"75%\",anchor:\"center\",width:f.maxTextWidth},animation:{type:\"fadeIn\",duration:.8}}];return i&&y.push({type:\"text\",id:\"cover-subtitle\",content:{text:i,style:{fontSize:m,color:c.colors.textMuted,textAlign:\"center\",lineHeight:1.5}},position:{x:\"50%\",y:\"82%\",anchor:\"center\",width:f.maxTextWidth},animation:{type:\"fadeIn\",duration:.8,delay:.2}}),y}function Vo(e){return {heroSrc:e.heroSrc,heroAlt:e.heroAlt,title:e.title,subtitle:e.subtitle,ambientMotion:e.ambientMotion,heroCredit:e.heroCredit,heroLicense:e.heroLicense}}function qt(e,t){let n=Vo(e);return wr(n,t)}var We={titleBlock:ir,sectionHeader:ar,statHighlight:lr,quoteBlock:cr,factCard:ur,twoColumn:dr,dateEvent:pr,imageWithCaption:fr,mapBlock:mr,fullBleedQuote:hr,listBlock:gr,photoGrid:yr,definitionCard:br,comparisonBar:_r,pullQuote:xr,videoWithCaption:vr,videoPullQuote:kr};function ct(e,t){let n=We[e.template];if(!n)return console.warn(`Unknown template: ${e.template}`),{id:e.id,startTime:0,duration:e.duration,audioSegment:e.audioSegment,transition:e.transition,template:e.template};let r;try{r=n(e,t),Array.isArray(r)||(console.error(`Template ${e.template} did not return an array, got:`,typeof r),r=[]);}catch(o){console.error(`Error expanding template ${e.template}:`,o),r=[];}return {id:e.id,startTime:0,duration:e.duration,audioSegment:e.audioSegment,...r.length>0?{layers:r}:{},transition:e.transition,template:e.template}}function Ot(e,t={}){let n=t,r=n.theme??fe,o=n.viewport??J.landscape,{persistentLayers:i,audioSegments:a}=n,s=e.length,u=He(i?.bottomLayers),c=He(i?.topLayers);if(!a||a.length===0){let m=0;return e.map((p,y)=>{let h=pe(r,y,s,o),b=ne(p)?ct(p,h):p,v=p,_=v.useBottomLayer!==false,S=v.useTopLayer!==false;return (u.length>0||c.length>0)&&(b.layers=[..._?u:[],...b.layers??[],...S?c:[]]),b.startTime=m,m+=b.duration,b})}let f=new Map;e.forEach((m,p)=>{let y=m.audioSegment??0;f.has(y)||f.set(y,[]),f.get(y).push({block:m,originalIndex:p});});let d=new Array(e.length);for(let[m,p]of f){let y=a[m];if(!y){let g=0;for(let{block:x,originalIndex:C}of p){let R=pe(r,C,s,o),M=ne(x)?ct(x,R):x,E=x,Y=E.useBottomLayer!==false,K=E.useTopLayer!==false;(u.length>0||c.length>0)&&(M.layers=[...Y?u:[],...M.layers??[],...K?c:[]]),M.startTime=g,g+=M.duration,d[C]=M;}continue}let h=[],b=[];for(let g of p)g.block.template===\"sectionHeader\"?h.push(g):b.push(g);let v=h.reduce((g,{block:x})=>g+(x.duration??0),0),_=b.reduce((g,{block:x})=>g+(x.duration??0),0),S=y.duration-v,w=_>0&&S>0?S/_:1,A=[];for(let{block:g,originalIndex:x}of p){let C=pe(r,x,s,o),R=ne(g)?ct(g,C):g,M=g,E=M.useBottomLayer!==false,Y=M.useTopLayer!==false;(u.length>0||c.length>0)&&(R.layers=[...E?u:[],...R.layers??[],...Y?c:[]]),A.push({block:R,originalIndex:x,templateBlock:M,hasSourceTiming:typeof M.sourceStartTime==\"number\"});}let I=A.some(g=>g.hasSourceTiming);A.sort((g,x)=>{if(I){let C=g.templateBlock.template===\"sectionHeader\",R=x.templateBlock.template===\"sectionHeader\";if(C&&!R)return -1;if(!C&&R)return 1;if(g.hasSourceTiming&&x.hasSourceTiming)return g.templateBlock.sourceStartTime-x.templateBlock.sourceStartTime;if(g.hasSourceTiming&&!x.hasSourceTiming)return -1;if(!g.hasSourceTiming&&x.hasSourceTiming)return 1}return g.originalIndex-x.originalIndex});let $=0;for(let g=0;g<A.length;g++){let x=A[g],{block:C,templateBlock:R}=x;if(x.hasSourceTiming){let M=R.sourceStartTime;C.startTime=y.startTime+M,typeof R.sourceDuration==\"number\"&&(C.duration=Math.max(5,R.sourceDuration)),$=M+C.duration;}else if(R.template===\"sectionHeader\")C.startTime=y.startTime+$,$+=C.duration;else {C.startTime=y.startTime+$;let M=C.duration*w;C.duration=M,$+=M;}d[x.originalIndex]=C;}let N=A.map(g=>d[g.originalIndex]).sort((g,x)=>g.startTime-x.startTime);for(let g=0;g<N.length-1;g++){let x=N[g],C=N[g+1],R=x.startTime+x.duration;R>C.startTime?x.duration=C.startTime-x.startTime:R<C.startTime-.5&&(x.duration=Math.max(.1,C.startTime-x.startTime));}let W=5,U=y.startTime+y.duration;for(;N.length>1;){let g=N[N.length-1];if(U-g.startTime<W&&g.template!==\"sectionHeader\"){let C=N[N.length-2];C.duration=U-C.startTime,g.duration=0,g.startTime=U,N.pop();}else {g.startTime+g.duration<U&&(g.duration=U-g.startTime);break}}if(N.length===1){let g=N[0];g.startTime+g.duration<U&&(g.duration=U-g.startTime);}let se=true;for(;se;){se=false;for(let g=N.length-1;g>=1;g--){let x=N[g];if(x.duration>0&&x.duration<W){let C=N[g-1],R=x.startTime+x.duration;C.duration=R-C.startTime,x.duration=0,x.startTime=U,N.splice(g,1),se=true;break}}}let k=20;for(let g=0;g<N.length;g++){let x=N[g];if(x.duration>k){let C=Math.ceil(x.duration/k),R=x.duration/C;if(R>=W){x.duration=R;for(let M=1;M<C;M++){let E={id:`${x.id}-split-${M}`,startTime:x.startTime+M*R,duration:R,audioSegment:x.audioSegment,layers:(x.layers??[]).map(Y=>({...Y,id:`${Y.id}-split-${M}`})),transition:{type:\"dissolve\",duration:1},template:x.template};d.push(E);}}}}}return d.filter(m=>m&&m.duration>0)}function Ht(e){return e in We}function ae(e,t=0){if(!e||e.type===\"none\")return {className:\"\",style:{}};let n=Uo(e),r=Yo(e);return {className:n,style:r}}function Uo(e){let{type:t,direction:n,panDirection:r}=e;switch(t){case \"fadeIn\":return \"anim-fadeIn\";case \"fadeOut\":return \"anim-fadeOut\";case \"slowZoom\":return r===\"left\"?\"anim-slowZoom-panLeft\":r===\"right\"?\"anim-slowZoom-panRight\":n===\"out\"?\"anim-slowZoom-out\":\"anim-slowZoom-in\";case \"zoomIn\":return \"anim-zoomIn\";case \"zoomOut\":return \"anim-zoomOut\";case \"panLeft\":return \"anim-panLeft\";case \"panRight\":return \"anim-panRight\";case \"typewriter\":return \"anim-typewriter\";default:return \"\"}}function Yo(e){let t={};return e.duration!==void 0&&(t[\"--anim-duration\"]=`${e.duration}s`),e.delay!==void 0&&(t[\"--anim-delay\"]=`${e.delay}s`),e.easing&&(t[\"--anim-easing\"]=e.easing),t}function Ve(e,t){return `transition-${e}-${t?\"enter\":\"exit\"}`}function Wt(e,t={}){let n=t.theme??fe,r=t.viewport??J.landscape,o=t.blockIndex??0,i=t.totalBlocks??1,a=e.layers;if(a&&a.length>0&&!ne(e))return Ft(a,e,t);if(ne(e)&&e.template in We){let s=e.template,u=pe(n,o,i,r),c;try{let f=We[s];c=f(e,u),Array.isArray(c)||(console.error(`Template ${s} did not return an array, got:`,typeof c),c=[]);}catch(f){console.error(`Error expanding template ${s}:`,f),c=[];}return Ft(c,e,t)}return Ft([],e,t)}function Ft(e,t,n){let{persistentLayers:r}=n;if(!r)return e;let o=He(r.bottomLayers),i=He(r.topLayers);if(o.length===0&&i.length===0)return e;let a=t,s=a.useBottomLayer!==false,u=a.useTopLayer!==false;return [...s?o:[],...e,...u?i:[]]}function H(e,t){return typeof e==\"number\"?e:e.endsWith(\"%\")?parseFloat(e)/100*t:parseFloat(e)}function Be(e,t,n){switch(e){case \"center\":return {x:-t/2,y:-n/2};case \"top-right\":return {x:-t,y:0};case \"bottom-left\":return {x:0,y:-n};case \"bottom-right\":return {x:-t,y:-n};default:return {x:0,y:0}}}var Vt=ot(null);function Zo(){return Bt(Vt)}function Ue(e,t){let n=Zo(),r=e.startsWith(\"http\")||e.startsWith(\"/\")||e.startsWith(\"data:\")||e.startsWith(\"blob:\"),o=F(()=>r?e:`${t}/${e}`,[r,e,t]),i=!r&&!!n,[a,s]=O(o);return D(()=>{if(!i){s(o);return}let u=false;return n.resolveUrl(e).then(c=>{u||s(c);}),()=>{u=true;}},[i,n,e,o]),i?a:o}var Go=0;function l(e,t,n,r,o,i){t||(t={});var a,s,u=t;if(\"ref\"in u)for(s in u={},t)s==\"ref\"?a=t[s]:u[s]=t[s];var c={type:e,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Go,__i:-1,__u:0,__source:o,__self:i};if(typeof e==\"function\"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return B.vnode&&B.vnode(c),c}function Sr({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,s=H(i.x,n.width),u=H(i.y,n.height),c=i.width?H(i.width,n.width):n.width,f=i.height?H(i.height,n.height):n.height,d=Be(i.anchor,c,f),m=s+d.x,p=u+d.y,y=Ue(o.src,t),h=ae(a,r),b=Qo(o.fit),v=o.fit===\"cover\",_=a&&Ko.has(a.type);if(v&&_&&a){let S=Jo(a),w=ae(S,r);return l(\"g\",{className:\"block-layer block-layer--image\",\"data-layer-id\":e.id,children:l(\"foreignObject\",{x:m,y:p,width:c,height:f,children:l(\"div\",{style:{width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:l(\"img\",{src:y,alt:o.alt||\"\",className:w.className,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:\"center\",display:\"block\",pointerEvents:\"none\",transformOrigin:\"center center\",...w.style}})})})})}return v?l(\"g\",{className:`block-layer block-layer--image ${h.className}`,style:h.style,\"data-layer-id\":e.id,children:l(\"foreignObject\",{x:m,y:p,width:c,height:f,children:l(\"img\",{src:y,alt:o.alt||\"\",style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:\"center\",display:\"block\",pointerEvents:\"none\"}})})}):l(\"g\",{className:`block-layer block-layer--image ${h.className}`,style:h.style,\"data-layer-id\":e.id,children:l(\"image\",{href:y,x:m,y:p,width:c,height:f,preserveAspectRatio:b,style:{pointerEvents:\"none\"}})})}function Qo(e){switch(e){case \"cover\":return \"xMidYMid slice\";case \"fill\":return \"none\";default:return \"xMidYMid meet\"}}var Ko=new Set([\"panLeft\",\"panRight\",\"slowZoom\",\"zoomIn\",\"zoomOut\"]);function Jo(e){switch(e.type){case \"panLeft\":return {...e,type:\"slowZoom\",panDirection:\"left\"};case \"panRight\":return {...e,type:\"slowZoom\",panDirection:\"right\"};case \"zoomIn\":return {...e,type:\"slowZoom\",direction:\"in\"};case \"zoomOut\":return {...e,type:\"slowZoom\",direction:\"out\"};default:return e}}function Tr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,{text:a,style:s}=r,u=H(o.x,t.width),c=H(o.y,t.height),f=o.width?H(o.width,t.width):void 0,d=ei(s.textAlign,o.anchor),m=ti(o.anchor),p=ae(i,n),y=a.split(`\n`),h=f?y.reduce((w,A)=>w.concat(ri(A,s.fontSize,f)),[]):y;if(s.maxLines&&h.length>s.maxLines){h=h.slice(0,s.maxLines);let w=h[h.length-1];h[h.length-1]=w.replace(/\\s*$/,\"\")+\"...\";}let b=s.lineHeight||1.4,v=s.fontSize*b,_={fontSize:`${s.fontSize}px`,fontFamily:s.fontFamily||Nt,fontWeight:s.fontWeight||\"normal\",fill:s.color,...p.style},S=s.shadow?`shadow-${e.id}`:void 0;return l(\"g\",{className:`block-layer block-layer--text ${p.className}`,\"data-layer-id\":e.id,children:[s.shadow&&l(\"defs\",{children:l(\"filter\",{id:S,x:\"-20%\",y:\"-20%\",width:\"140%\",height:\"140%\",children:l(\"feDropShadow\",{dx:\"0\",dy:\"2\",stdDeviation:\"3\",floodColor:\"rgba(0,0,0,0.7)\"})})}),s.background&&l(\"rect\",{x:u-(s.padding||16),y:c-s.fontSize-(s.padding||16),width:ni(h,s)+(s.padding||16)*2,height:h.length*v+(s.padding||16)*2,fill:s.background,rx:4,ry:4}),l(\"text\",{x:u,y:c,textAnchor:d,dominantBaseline:m,style:_,filter:S?`url(#${S})`:void 0,children:h.map((w,A)=>l(\"tspan\",{x:u,dy:A===0?0:v,children:[w||\"\\xA0\",\" \"]},A))})]})}function ei(e,t){return e===\"center\"?\"middle\":e===\"right\"?\"end\":e===\"left\"?\"start\":t?.includes(\"right\")?\"end\":t===\"center\"?\"middle\":\"start\"}function ti(e){return e?.includes(\"bottom\")?\"text-after-edge\":e===\"center\"?\"middle\":\"text-before-edge\"}function ni(e,t){return Math.max(...e.map(r=>r.length))*t.fontSize*.55}function ri(e,t,n){if(!e.trim())return [\"\"];let r=t*.5,o=Math.floor(n/r);if(o<=0)return [e];let i=e.split(/\\s+/),a=[],s=\"\";for(let u of i){let c=s?`${s} ${u}`:u;if(c.length<=o)s=c;else if(s&&a.push(s),u.length>o){let f=u;for(;f.length>o;)a.push(f.slice(0,o)),f=f.slice(o);s=f;}else s=u;}return s&&a.push(s),a.length>0?a:[\"\"]}function Cr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,a=H(o.x,t.width),s=H(o.y,t.height),u=o.width?H(o.width,t.width):100,c=o.height?H(o.height,t.height):100,f=ae(i,n),d=r.fill||\"none\",m=typeof d==\"string\"&&d.includes(\"gradient(\");if(r.shape===\"rect\"&&m)return l(\"g\",{className:`block-layer block-layer--shape ${f.className}`,style:f.style,\"data-layer-id\":e.id,children:l(\"foreignObject\",{x:a,y:s,width:u,height:c,children:l(\"div\",{style:{width:\"100%\",height:\"100%\",background:d,borderRadius:r.borderRadius?`${r.borderRadius}px`:void 0,pointerEvents:\"none\"}})})});let p={fill:d,stroke:r.stroke,strokeWidth:r.strokeWidth};return l(\"g\",{className:`block-layer block-layer--shape ${f.className}`,style:f.style,\"data-layer-id\":e.id,children:[r.shape===\"rect\"&&l(\"rect\",{x:a,y:s,width:u,height:c,rx:r.borderRadius,ry:r.borderRadius,...p}),r.shape===\"circle\"&&l(\"circle\",{cx:a+u/2,cy:s+c/2,r:Math.min(u,c)/2,...p}),r.shape===\"line\"&&l(\"line\",{x1:a,y1:s,x2:a+u,y2:s+c,stroke:r.stroke||\"#ffffff\",strokeWidth:r.strokeWidth||2})]})}var oi={terrain:{url:\"https://tile.opentopomap.org/{z}/{x}/{y}.png\",attribution:\"Map: OpenTopoMap (CC-BY-SA)\",maxZoom:17},road:{url:\"https://tile.openstreetmap.org/{z}/{x}/{y}.png\",attribution:\"\\xA9 OpenStreetMap contributors\",maxZoom:19},satellite:{url:\"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}\",attribution:\"Imagery: Esri, Maxar, Earthstar\",maxZoom:18},toner:{url:\"https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png\",attribution:\"Map: Stadia Maps, Stamen Design\",maxZoom:20},watercolor:{url:\"https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg\",attribution:\"Map: Stadia Maps, Stamen Design\",maxZoom:16}};function Ut(e,t,n){let r=Math.pow(2,n),o=Math.floor((t+180)/360*r),i=e*Math.PI/180,a=Math.floor((1-Math.log(Math.tan(i)+1/Math.cos(i))/Math.PI)/2*r);return {x:o,y:a}}function Yt(e,t,n,r=256){let o=Math.pow(2,n),i=(t+180)/360*o,a=e*Math.PI/180,s=(1-Math.log(Math.tan(a)+1/Math.cos(a))/Math.PI)/2*o;return {x:(i-Math.floor(i))*r,y:(s-Math.floor(s))*r}}function ii(e,t,n,r,o,i=256){let a=Ut(e,t,n),s=Yt(e,t,n,i),u=Math.ceil(r/i)+1,c=Math.ceil(o/i)+1,f=a.x-Math.floor(u/2),d=a.y-Math.floor(c/2),m=r/2-s.x,p=o/2-s.y,y=[];for(let h=0;h<c;h++)for(let b=0;b<u;b++){let v=f+b,_=d+h,S=m+(v-a.x)*i,w=p+(_-a.y)*i;y.push({x:v,y:_,screenX:S,screenY:w});}return y}function ai(e,t,n,r){return e.url.replace(\"{z}\",String(r)).replace(\"{x}\",String(t)).replace(\"{y}\",String(n))}async function si(e){return new Promise((t,n)=>{let r=new Image;r.crossOrigin=\"anonymous\",r.onload=()=>t(r),r.onerror=()=>n(new Error(`Failed to load tile: ${e}`)),r.src=e;})}async function Ar(e){let{center:t,zoom:n,style:r,width:o,height:i,markers:a=[],showAttribution:s=true}=e,u=oi[r],c=u.tileSize||256,f=Math.min(n,u.maxZoom),d=document.createElement(\"canvas\");d.width=o,d.height=i;let m=d.getContext(\"2d\");if(!m)throw new Error(\"Failed to get canvas context\");m.fillStyle=r===\"toner\"?\"#ffffff\":\"#e5e7eb\",m.fillRect(0,0,o,i);let y=ii(t.lat,t.lng,f,o,i,c).map(async h=>{let b=ai(u,h.x,h.y,f);try{let v=await si(b);m.drawImage(v,h.screenX,h.screenY,c,c);}catch(v){console.warn(`Tile load failed: ${b}`,v);}});await Promise.all(y);for(let h of a)li(m,h,t,f,o,i,c);return s&&ui(m,u.attribution,o,i),d.toDataURL(\"image/png\")}function li(e,t,n,r,o,i,a){let s=Ut(n.lat,n.lng,r),u=Ut(t.lat,t.lng,r),c=Yt(n.lat,n.lng,r,a),f=Yt(t.lat,t.lng,r,a),d=(u.x-s.x)*a+(f.x-c.x),m=(u.y-s.y)*a+(f.y-c.y),p=o/2+d,y=i/2+m,h=t.color||\"#ef4444\",b=t.icon||\"pin\";e.save(),b===\"pin\"?(e.fillStyle=h,e.beginPath(),e.arc(p,y-12,8,Math.PI,0,false),e.lineTo(p,y),e.closePath(),e.fill(),e.fillStyle=\"#ffffff\",e.beginPath(),e.arc(p,y-12,3,0,Math.PI*2),e.fill()):b===\"circle\"?(e.fillStyle=h,e.beginPath(),e.arc(p,y,8,0,Math.PI*2),e.fill(),e.strokeStyle=\"#ffffff\",e.lineWidth=2,e.stroke()):b===\"star\"&&(e.fillStyle=h,ci(e,p,y,5,10,5),e.fill()),t.label&&(e.fillStyle=\"#1f2937\",e.font=\"bold 12px system-ui, sans-serif\",e.textAlign=\"center\",e.fillText(t.label,p,y+20)),e.restore();}function ci(e,t,n,r,o,i){let a=Math.PI/2*3,s=Math.PI/r;e.beginPath(),e.moveTo(t,n-o);for(let u=0;u<r;u++)e.lineTo(t+Math.cos(a)*o,n+Math.sin(a)*o),a+=s,e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i),a+=s;e.lineTo(t,n-o),e.closePath();}function ui(e,t,n,r){e.save(),e.fillStyle=\"rgba(255, 255, 255, 0.8)\";let o=4;e.font=\"10px system-ui, sans-serif\";let i=e.measureText(t).width;e.fillRect(n-i-o*2-4,r-16,i+o*2,14),e.fillStyle=\"#374151\",e.textAlign=\"right\",e.fillText(t,n-o-4,r-5),e.restore();}function Mr({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,[s,u]=O(null),[c,f]=O(true),[d,m]=O(null),p=H(i.x,n.width),y=H(i.y,n.height),h=i.width?H(i.width,n.width):n.width,b=i.height?H(i.height,n.height):n.height,v=Be(i.anchor,h,b),_=p+v.x,S=y+v.y;D(()=>{let A=false;if(o.staticSrc){let I=o.staticSrc.startsWith(\"http\")?o.staticSrc:`${t}/${o.staticSrc}`;u(I),f(false);return}return f(true),m(null),Ar({center:o.center,zoom:o.zoom,style:o.style,width:h,height:b,markers:o.markers,showAttribution:o.showAttribution!==false}).then(I=>{A||(u(I),f(false));}).catch(I=>{A||(console.error(\"Failed to compose map:\",I),m(I instanceof Error?I.message:String(I)),f(false));}),()=>{A=true;}},[o.center.lat,o.center.lng,o.zoom,o.style,o.staticSrc,h,b,t]);let w=ae(a,r);return c?l(\"g\",{className:`block-layer block-layer--map ${w.className}`,style:w.style,\"data-layer-id\":e.id,children:[l(\"rect\",{x:_,y:S,width:h,height:b,fill:\"#e5e7eb\"}),l(\"text\",{x:_+h/2,y:S+b/2,textAnchor:\"middle\",dominantBaseline:\"middle\",fill:\"#9ca3af\",fontSize:\"24\",fontFamily:\"system-ui, sans-serif\",children:\"Loading map...\"})]}):d||!s?l(\"g\",{className:`block-layer block-layer--map ${w.className}`,style:w.style,\"data-layer-id\":e.id,children:[l(\"rect\",{x:_,y:S,width:h,height:b,fill:\"#fef2f2\"}),l(\"text\",{x:_+h/2,y:S+b/2,textAnchor:\"middle\",dominantBaseline:\"middle\",fill:\"#dc2626\",fontSize:\"18\",fontFamily:\"system-ui, sans-serif\",children:\"Map failed to load\"})]}):l(\"g\",{className:`block-layer block-layer--map ${w.className}`,style:w.style,\"data-layer-id\":e.id,children:[l(\"defs\",{children:l(\"clipPath\",{id:`clip-${e.id}`,children:l(\"rect\",{x:_,y:S,width:h,height:b})})}),l(\"g\",{clipPath:`url(#clip-${e.id})`,children:l(\"image\",{href:s,x:_,y:S,width:h,height:b,preserveAspectRatio:\"xMidYMid slice\",style:{pointerEvents:\"none\"}})})]})}function Lr({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){let{content:i,position:a}=e,s=q(null),u=q(false),c=H(a.x,n.width),f=H(a.y,n.height),d=a.width?H(a.width,n.width):n.width,m=a.height?H(a.height,n.height):n.height,p=Be(a.anchor,d,m),y=c+p.x,h=f+p.y,b=Ue(i.src,t),v=Ue(i.posterSrc||\"\",t),_=i.posterSrc?v:void 0;return D(()=>{let S=s.current;if(!S)return;if(S.currentTime=i.clipStart,u.current=true,o){let A=S.play();A&&A.catch(()=>{});}let w=()=>{S.currentTime>=i.clipEnd&&(S.pause(),S.currentTime=i.clipEnd);};return S.addEventListener(\"timeupdate\",w),()=>{S.removeEventListener(\"timeupdate\",w),S.pause();}},[i.src,i.clipStart,i.clipEnd]),D(()=>{let S=s.current;if(!(!S||!u.current)&&!(S.currentTime>=i.clipEnd))if(o){let w=S.play();w&&w.catch(()=>{});}else S.pause();},[o,i.clipEnd]),l(\"g\",{className:\"block-layer block-layer--video\",\"data-layer-id\":e.id,children:l(\"foreignObject\",{x:y,y:h,width:d,height:m,children:l(\"video\",{ref:s,src:b,poster:_,muted:true,playsInline:true,preload:\"auto\",\"data-clip-start\":i.clipStart,\"data-clip-end\":i.clipEnd,style:{width:\"100%\",height:\"100%\",objectFit:i.fit||\"cover\",objectPosition:\"center\",display:\"block\",pointerEvents:\"none\"}})})})}var di={width:1920,height:1080};function Ee({block:e,blockTime:t,basePath:n,isEntering:r=false,isExiting:o=false,viewport:i=di,isPlaying:a}){let s=\"\",u={};e.transition&&r?(s=Ve(e.transition.type,true),u[\"--transition-duration\"]=`${e.transition.duration}s`):e.transition&&o&&(s=Ve(e.transition.type,false),u[\"--transition-duration\"]=`${e.transition.duration}s`);let c=`vb-clip-${e.id}`;return l(\"svg\",{className:`block-svg ${s}`,style:u,viewBox:`0 0 ${i.width} ${i.height}`,preserveAspectRatio:\"xMidYMid meet\",overflow:\"hidden\",\"data-block-id\":e.id,children:[l(\"defs\",{children:l(\"clipPath\",{id:c,children:l(\"rect\",{x:\"0\",y:\"0\",width:i.width,height:i.height})})}),l(\"g\",{clipPath:`url(#${c})`,children:(e.layers??[]).map(f=>l(pi,{layer:f,basePath:n,viewport:i,blockTime:t,isPlaying:a},f.id))})]})}function pi({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){switch(e.type){case \"image\":return l(Sr,{layer:e,basePath:t,viewport:n,blockTime:r});case \"text\":return l(Tr,{layer:e,viewport:n,blockTime:r});case \"shape\":return l(Cr,{layer:e,viewport:n,blockTime:r});case \"map\":return l(Mr,{layer:e,basePath:t,viewport:n,blockTime:r});case \"video\":return l(Lr,{layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o});default:return console.warn(`Unknown layer type: ${e.type}`),null}}function Pr({captions:e,currentTime:t,enabled:n=true,fontSize:r=16}){let i=(n&&e?qe(e,t):null)?.text??null;return l(\"div\",{className:\"caption-overlay\",style:{position:\"absolute\",top:\"6px\",left:\"50%\",transform:\"translateX(-50%)\",zIndex:50,pointerEvents:\"none\",maxWidth:\"100%\",width:\"100%\",textAlign:\"center\",opacity:i?1:0,transition:\"opacity 0.15s ease-in-out\",padding:\"0 4px\",boxSizing:\"border-box\"},children:i&&l(\"div\",{style:{display:\"inline-block\",padding:\"3px 10px\",background:\"rgba(0, 0, 0, 0.65)\",borderRadius:\"4px\",backdropFilter:\"blur(4px)\"},children:l(\"span\",{style:{color:\"#ffffff\",fontSize:`${r}px`,fontFamily:\"'Hanken Grotesk', system-ui, sans-serif\",fontWeight:500,lineHeight:1.25,textShadow:\"0 1px 3px rgba(0,0,0,0.5)\",whiteSpace:\"pre-wrap\",wordWrap:\"break-word\"},children:i})})})}function Br(e,t,n=\"\"){let[r,o]=O(0),[i,a]=O(false),[s,u]=O(0),[c,f]=O(false),[d,m]=O(false),[p,y]=O(0),h=q([]),b=q(null),v=q(false),_=q(new Map),S=q(new Map),w=q(false);D(()=>{if(!t?.segments)return;let k=0;h.current=t.segments.map(g=>{let x=k;return k+=g.duration,x}),y(k);},[t]);let A=j(async k=>{let g=n?`${n}/${k}`:k;if(_.current.has(k))return _.current.get(k);if(S.current.has(k))return S.current.get(k);let x=(async()=>{try{let C=await fetch(g);if(!C.ok)throw new Error(`HTTP ${C.status}`);let R=await C.blob(),M=URL.createObjectURL(R);return _.current.set(k,M),M}catch{return g}finally{S.current.delete(k);}})();return S.current.set(k,x),x},[n]);D(()=>{if(!t?.segments)return;t.segments.forEach(g=>{A(g.src);});let k=_.current;return ()=>{k.forEach(g=>{URL.revokeObjectURL(g);}),k.clear();}},[t,A]),D(()=>{let k=e.current;if(!k)return;let g=()=>{let Y=(h.current[s]||0)+k.currentTime;o(Y);},x=()=>{w.current=false,a(true);},C=()=>a(false),R=()=>{m(true);},M=()=>{t&&s<t.segments.length-1?(v.current=true,u(E=>E+1)):(f(true),a(false));};return k.addEventListener(\"timeupdate\",g),k.addEventListener(\"play\",x),k.addEventListener(\"pause\",C),k.addEventListener(\"ended\",M),k.addEventListener(\"error\",R),()=>{k.removeEventListener(\"timeupdate\",g),k.removeEventListener(\"play\",x),k.removeEventListener(\"pause\",C),k.removeEventListener(\"ended\",M),k.removeEventListener(\"error\",R);}},[e,s,t]),D(()=>{let k=e.current;if(!k||!t?.segments)return;let g=t.segments[s];if(!g)return;let x=()=>{if(b.current!==null){let E=h.current[s]||0,Y=b.current-E;k.currentTime=Math.max(0,Y),o(b.current),b.current=null;}v.current&&(k.play().catch(()=>{}),v.current=false);},C=k.src,R=_.current.get(g.src);C&&(C===R||C.endsWith(g.src))?x():(async()=>{let Y=await A(g.src),K=()=>{m(true),x(),k.removeEventListener(\"canplay\",K);};k.addEventListener(\"canplay\",K),k.src=Y,k.load(),await Promise.resolve(),k.readyState>=3&&(k.removeEventListener(\"canplay\",K),m(true),x());})();},[e,s,t,A]);let I=j(()=>{let k=e.current;k&&(c&&(u(0),f(false)),k.play().then(()=>{w.current=false;}).catch(()=>{w.current=true,a(true);}));},[e,c]),$=j(()=>{let k=e.current;k&&k.pause(),a(false);},[e]),N=j(()=>{e.current&&(i?$():I());},[e,i,I,$]),W=j(k=>{let g=e.current;if(!g||!t?.segments)return;let x=Math.max(0,Math.min(k,p)),C=0,R=0;for(let E=0;E<t.segments.length;E++){let Y=R+t.segments[E].duration;if(x<Y){C=E;break}R=Y,E===t.segments.length-1&&(C=E);}let M=!g.paused;if(f(false),C!==s)b.current=x,v.current=M,u(C);else {let E=x-R;g.currentTime=Math.max(0,E),o(x);}},[e,t,s,p]),U=j(k=>{!t?.segments||k<0||k>=t.segments.length||(u(k),f(false));},[t]),se=j(async()=>{W(0),await new Promise(k=>setTimeout(k,50)),I();},[W,I]);return D(()=>{if(!i||!w.current||!p)return;let k=performance.now(),g,x=C=>{if(!w.current)return;let R=(C-k)/1e3;k=C,o(M=>{let E=M+R;return E>=p?(w.current=false,f(true),a(false),p):E}),g=requestAnimationFrame(x);};return g=requestAnimationFrame(x),()=>cancelAnimationFrame(g)},[i,p]),{currentTime:r,isPlaying:i,currentSegment:s,totalDuration:p,isEnded:c,isReady:d,isAvailable:true,play:async()=>I(),pause:async()=>$(),toggle:async()=>N(),seekTo:async k=>W(k),skipToSegment:async k=>U(k),restart:se}}function Er(e,t,n=J.landscape,r=false,o){let [i,a]=O({entering:false,exiting:false,previousBlock:null}),s=F(()=>{if(!e?.blocks)return [];if(e.blocks.some(ne)){let I=e.audio?.segments?.map(N=>({startTime:N.startTime,duration:N.duration}));return Ot(e.blocks,{audioSegments:I,viewport:n,persistentLayers:e.persistentLayers,theme:o})}return e.blocks},[e?.blocks,e?.audio?.segments,e?.persistentLayers,n,o]),u=F(()=>It(s,t),[s,t]),c=F(()=>u?s.indexOf(u):-1,[s,u]),f=F(()=>u?Math.max(0,t-u.startTime):0,[u,t]),d=F(()=>!u||u.duration===0?0:Math.min(1,f/u.duration),[u,f]),m=F(()=>!e||e.duration===0?0:Math.min(1,t/e.duration),[e,t]);F(()=>u,[c]);D(()=>{if(!(!u||r)&&i.previousBlock?.id!==u.id){let I=u.transition?.duration||0;if(I>0){a({entering:true,exiting:true,previousBlock:i.previousBlock});let $=setTimeout(()=>{a({entering:false,exiting:false,previousBlock:u});},I*1e3);return ()=>clearTimeout($)}else a({entering:false,exiting:false,previousBlock:u});}},[u?.id,r]);let y=q(null);D(()=>{if(!(!r||!u)&&i.previousBlock?.id!==u.id){let A=i.previousBlock;y.current=A,a(I=>({...I,previousBlock:u}));}},[u?.id,r]);let h=u?.transition?.duration||0,b=r&&h>0&&f<h,v=b&&y.current!==null,_=j(A=>{if(!e||A<0||A>=s.length)return;let I=s[A];if(I)return I.startTime},[e,s]),S=j(()=>{if(c<s.length-1)return _(c+1)},[c,s.length,_]),w=j(()=>{if(c>0)return _(c-1)},[c,_]);return {currentBlock:u,currentBlockIndex:c,previousBlock:r?v?y.current:null:i.exiting?i.previousBlock:null,isEntering:r?b:i.entering,isExiting:r?v:i.exiting,blockTime:f,blockProgress:d,docProgress:m,nextBlock:S,prevBlock:w,goToBlock:_,blocks:s}}function fi(e,t){let n=e/t;return n>1.2?\"landscape\":n<.83?\"portrait\":\"landscape\"}function mi(e){switch(e){case \"portrait\":return J.portrait;case \"square\":return J.square;default:return J.landscape}}function Ir(){let[e,t]=O(()=>({width:typeof window<\"u\"?window.innerWidth:1920,height:typeof window<\"u\"?window.innerHeight:1080}));D(()=>{if(typeof window>\"u\")return;let o=()=>{t({width:window.innerWidth,height:window.innerHeight});},i,a=()=>{clearTimeout(i),i=setTimeout(o,100);};return window.addEventListener(\"resize\",a),()=>{window.removeEventListener(\"resize\",a),clearTimeout(i);}},[]);let n=F(()=>fi(e.width,e.height),[e.width,e.height]);return {viewport:F(()=>mi(n),[n]),orientation:n,windowSize:e}}function Ye(e){let t=Math.floor(e/60),n=Math.floor(e%60);return `${t}:${n.toString().padStart(2,\"0\")}`}function dt({state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}){let i=q(null),[a,s]=O(null),u=j(d=>{let m=i.current;if(!m)return;let p=m.getBoundingClientRect(),y=d.clientX-p.left,h=Math.max(0,Math.min(1,y/p.width));s(h);},[]),c=j(()=>{s(null);},[]),f=j(d=>{for(let m=r.length-1;m>=0;m--){let p=r[m];if(d>=p.startTime)return {block:p,index:m}}return r.length>0?{block:r[0],index:0}:null},[r]);return l(\"div\",{ref:i,style:{flex:1,height:\"24px\",cursor:\"pointer\",position:\"relative\",display:\"flex\",alignItems:\"center\"},onClick:d=>{let m=d.currentTarget.getBoundingClientRect(),y=(d.clientX-m.left)/m.width;t.seekTo(y*e.totalDuration);},onMouseMove:u,onMouseLeave:c,children:[l(\"div\",{style:{position:\"absolute\",left:0,right:0,height:\"6px\",background:\"rgba(255,255,255,0.2)\",borderRadius:\"3px\"}}),l(\"div\",{style:{position:\"absolute\",left:0,width:`${e.docProgress*100}%`,height:\"6px\",background:\"#3d5a80\",borderRadius:\"3px\",transition:\"width 0.1s\"}}),n.map((d,m)=>l(\"div\",{style:{position:\"absolute\",left:`${d.position}%`,transform:\"translateX(-50%)\",width:\"10px\",height:\"10px\",borderRadius:\"50%\",background:d.index===e.currentBlockIndex?\"#ffffff\":\"rgba(255,255,255,0.5)\",border:\"2px solid #3d5a80\",cursor:\"pointer\",zIndex:2,transition:\"transform 0.15s, background 0.15s\"},title:d.title,onClick:p=>{p.stopPropagation(),t.seekTo(d.block.startTime);},onMouseEnter:p=>{p.currentTarget.style.transform=\"translateX(-50%) scale(1.3)\";},onMouseLeave:p=>{p.currentTarget.style.transform=\"translateX(-50%)\";}},`${d.block.id}-${m}`)),a!==null&&l(\"div\",{style:{position:\"absolute\",left:`${a*100}%`,bottom:\"100%\",transform:\"translateX(-50%)\",marginBottom:\"8px\",padding:\"6px 10px\",background:\"rgba(0,0,0,0.9)\",borderRadius:\"4px\",whiteSpace:\"nowrap\",pointerEvents:\"none\",zIndex:10},children:[l(\"div\",{style:{color:\"white\",fontSize:\"12px\",fontFamily:\"monospace\"},children:Ye(a*e.totalDuration)}),(()=>{let d=a*e.totalDuration,m=f(d);return m&&o?l(\"div\",{style:{color:\"rgba(255,255,255,0.7)\",fontSize:\"11px\",marginTop:\"2px\"},children:o(m.block)}):null})()]}),a!==null&&l(\"div\",{style:{position:\"absolute\",left:`${a*100}%`,top:\"50%\",transform:\"translate(-50%, -50%)\",width:\"2px\",height:\"16px\",background:\"rgba(255,255,255,0.6)\",pointerEvents:\"none\",zIndex:1}})]})}function Rr({state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}){return l(\"div\",{className:\"doc-player__controls\",style:{position:\"absolute\",bottom:0,left:0,right:0,padding:\"12px 16px\",background:\"linear-gradient(transparent, rgba(0,0,0,0.8))\",display:\"flex\",alignItems:\"center\",gap:\"8px\",zIndex:100},children:[l(\"button\",{onClick:t.restart,style:{background:\"none\",border:\"none\",color:\"rgba(255,255,255,0.7)\",cursor:\"pointer\",padding:\"8px\",fontSize:\"14px\",display:\"flex\",alignItems:\"center\"},title:\"Restart\",\"aria-label\":\"Restart from beginning\",children:l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"18\",height:\"18\",children:l(\"path\",{d:\"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z\"})})}),l(\"button\",{onClick:t.toggle,style:{background:\"rgba(255,255,255,0.2)\",border:\"none\",borderRadius:\"50%\",color:\"white\",cursor:\"pointer\",padding:\"10px\",fontSize:\"16px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"40px\",height:\"40px\"},\"aria-label\":e.isPlaying?\"Pause\":\"Play\",children:e.isPlaying?l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"20\",height:\"20\",children:l(\"path\",{d:\"M6 19h4V5H6v14zm8-14v14h4V5h-4z\"})}):l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"20\",height:\"20\",children:l(\"path\",{d:\"M8 5v14l11-7z\"})})}),l(\"span\",{style:{color:\"white\",fontSize:\"12px\",minWidth:\"80px\",fontFamily:\"monospace\"},children:[Ye(e.currentTime),\" / \",Ye(e.totalDuration)]}),l(dt,{state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}),l(\"span\",{style:{color:\"rgba(255,255,255,0.5)\",fontSize:\"11px\",whiteSpace:\"nowrap\"},children:[e.currentBlockIndex+1,\"/\",e.totalBlocks]}),e.hasCaptions&&l(\"button\",{onClick:()=>t.setCaptionsEnabled(!e.captionsEnabled),style:{background:e.captionsEnabled?\"rgba(255,255,255,0.2)\":\"none\",border:\"none\",color:e.captionsEnabled?\"white\":\"rgba(255,255,255,0.5)\",cursor:\"pointer\",padding:\"8px\",fontSize:\"12px\",display:\"flex\",alignItems:\"center\",borderRadius:\"4px\"},title:e.captionsEnabled?\"Hide captions\":\"Show captions\",\"aria-label\":e.captionsEnabled?\"Hide captions\":\"Show captions\",children:l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"18\",height:\"18\",children:l(\"path\",{d:\"M19 4H5a2 2 0 00-2 2v12a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1a1 1 0 01-1 1h-3a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1z\"})})}),t.toggleFullscreen&&l(\"button\",{onClick:t.toggleFullscreen,style:{background:e.isFullscreen?\"rgba(255,255,255,0.2)\":\"none\",border:\"none\",color:e.isFullscreen?\"white\":\"rgba(255,255,255,0.5)\",cursor:\"pointer\",padding:\"8px\",display:\"flex\",alignItems:\"center\",borderRadius:\"4px\"},title:e.isFullscreen?\"Exit fullscreen (F)\":\"Fullscreen (F)\",\"aria-label\":e.isFullscreen?\"Exit fullscreen\":\"Enter fullscreen\",children:e.isFullscreen?l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"18\",height:\"18\",children:l(\"path\",{d:\"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z\"})}):l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"18\",height:\"18\",children:l(\"path\",{d:\"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z\"})})})]})}function $r({state:e,slideNav:t}){let{currentBlockIndex:n,totalBlocks:r}=e,o=n<=0,i=n>=r-1;return l(\"div\",{className:\"doc-controls-slideshow\",\"data-testid\":\"slideshow-controls\",style:{position:\"absolute\",bottom:\"16px\",right:\"16px\",display:\"flex\",alignItems:\"center\",gap:\"2px\",background:\"rgba(0, 0, 0, 0.65)\",borderRadius:\"8px\",padding:\"4px 6px\",zIndex:100,userSelect:\"none\",backdropFilter:\"blur(8px)\",WebkitBackdropFilter:\"blur(8px)\"},children:[l(\"button\",{onClick:a=>{a.stopPropagation(),t.prevSlide();},disabled:o,\"data-testid\":\"slide-prev\",\"aria-label\":\"Previous slide\",title:\"Previous slide\",style:{background:\"none\",border:\"none\",color:o?\"rgba(255,255,255,0.3)\":\"rgba(255,255,255,0.9)\",cursor:o?\"default\":\"pointer\",padding:\"6px 8px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",borderRadius:\"4px\",transition:\"background 0.15s\"},onMouseEnter:a=>{o||(a.currentTarget.style.background=\"rgba(255,255,255,0.1)\");},onMouseLeave:a=>{a.currentTarget.style.background=\"none\";},children:l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"18\",height:\"18\",children:l(\"path\",{d:\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"})})}),l(\"span\",{\"data-testid\":\"slide-counter\",style:{color:\"rgba(255,255,255,0.9)\",fontSize:\"13px\",fontFamily:'-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',fontVariantNumeric:\"tabular-nums\",minWidth:\"48px\",textAlign:\"center\",padding:\"0 4px\",letterSpacing:\"0.02em\"},children:r>0?`${n+1} / ${r}`:\"\\u2014\"}),l(\"button\",{onClick:a=>{a.stopPropagation(),t.nextSlide();},disabled:i,\"data-testid\":\"slide-next\",\"aria-label\":\"Next slide\",title:\"Next slide\",style:{background:\"none\",border:\"none\",color:i?\"rgba(255,255,255,0.3)\":\"rgba(255,255,255,0.9)\",cursor:i?\"default\":\"pointer\",padding:\"6px 8px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",borderRadius:\"4px\",transition:\"background 0.15s\"},onMouseEnter:a=>{i||(a.currentTarget.style.background=\"rgba(255,255,255,0.1)\");},onMouseLeave:a=>{a.currentTarget.style.background=\"none\";},children:l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"18\",height:\"18\",children:l(\"path\",{d:\"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z\"})})})]})}function re(e,t=\"\"){return e.map((n,r)=>{let o=`${t}i${r}`;switch(n.type){case \"text\":return l(te,{children:n.value},o);case \"emphasis\":return l(\"em\",{className:\"squisq-md-em\",children:re(n.children,o)},o);case \"strong\":return l(\"strong\",{className:\"squisq-md-strong\",children:re(n.children,o)},o);case \"delete\":return l(\"del\",{className:\"squisq-md-del\",children:re(n.children,o)},o);case \"inlineCode\":return l(\"code\",{className:\"squisq-md-inline-code\",children:n.value},o);case \"link\":return l(\"a\",{className:\"squisq-md-link\",href:n.url,title:n.title??void 0,target:\"_blank\",rel:\"noopener noreferrer\",children:re(n.children,o)},o);case \"image\":return l(\"img\",{className:\"squisq-md-image\",src:n.url,alt:n.alt??\"\",title:n.title??void 0},o);case \"break\":return l(\"br\",{},o);case \"inlineMath\":return l(\"code\",{className:\"squisq-md-inline-math\",children:n.value},o);case \"htmlInline\":return l(\"span\",{className:\"squisq-md-html-inline\",dangerouslySetInnerHTML:{__html:n.rawHtml}},o);case \"footnoteReference\":return l(\"sup\",{className:\"squisq-md-footnote-ref\",children:l(\"a\",{href:`#fn-${n.identifier}`,children:[\"[\",n.label??n.identifier,\"]\"]})},o);case \"linkReference\":return l(\"span\",{className:\"squisq-md-link-ref\",children:re(n.children,o)},o);case \"imageReference\":return l(\"span\",{className:\"squisq-md-image-ref\",children:[\"[\",n.alt??n.identifier,\"]\"]},o);case \"textDirective\":return l(\"span\",{className:\"squisq-md-text-directive\",\"data-directive\":n.name,children:re(n.children,o)},o);default:return null}})}function gi(e,t){switch(e.type){case \"paragraph\":return l(\"p\",{className:\"squisq-md-p\",children:re(e.children,t)},t);case \"heading\":{let n=`h${e.depth}`;return l(n,{className:`squisq-md-heading squisq-md-h${e.depth}`,children:re(e.children,t)},t)}case \"blockquote\":return l(\"blockquote\",{className:\"squisq-md-blockquote\",children:Ie(e.children,t)},t);case \"list\":return e.ordered?l(\"ol\",{className:\"squisq-md-list squisq-md-ol\",start:e.start??void 0,children:e.children.map((n,r)=>Nr(n,`${t}li${r}`))},t):l(\"ul\",{className:\"squisq-md-list squisq-md-ul\",children:e.children.map((n,r)=>Nr(n,`${t}li${r}`))},t);case \"code\":return l(\"pre\",{className:\"squisq-md-code-block\",children:l(\"code\",{className:e.lang?`language-${e.lang}`:void 0,children:e.value})},t);case \"thematicBreak\":return l(\"hr\",{className:\"squisq-md-hr\"},t);case \"table\":return yi(e.children,e.align,t);case \"htmlBlock\":return l(\"div\",{className:\"squisq-md-html-block\",dangerouslySetInnerHTML:{__html:e.rawHtml}},t);case \"math\":return l(\"pre\",{className:\"squisq-md-math-block\",children:l(\"code\",{children:e.value})},t);case \"definition\":return null;case \"footnoteDefinition\":return l(\"div\",{className:\"squisq-md-footnote-def\",id:`fn-${e.identifier}`,children:[l(\"sup\",{children:e.label??e.identifier}),Ie(e.children,t)]},t);case \"containerDirective\":return l(\"div\",{className:`squisq-md-directive squisq-md-directive-${e.name}`,\"data-directive\":e.name,children:[e.label&&l(\"div\",{className:\"squisq-md-directive-label\",children:e.label}),Ie(e.children,t)]},t);case \"leafDirective\":return l(\"div\",{className:`squisq-md-directive squisq-md-directive-${e.name}`,\"data-directive\":e.name,children:re(e.children,t)},t);case \"definitionList\":return l(\"dl\",{className:\"squisq-md-dl\",children:e.children.map((n,r)=>n.type===\"definitionTerm\"?l(\"dt\",{className:\"squisq-md-dt\",children:re(n.children,`${t}dt${r}`)},`${t}dt${r}`):l(\"dd\",{className:\"squisq-md-dd\",children:Ie(n.children,`${t}dd${r}`)},`${t}dd${r}`))},t);default:return null}}function Nr(e,t){let n=e.checked!==null&&e.checked!==void 0;return l(\"li\",{className:`squisq-md-li${n?\" squisq-md-task\":\"\"}`,children:[n&&l(\"input\",{type:\"checkbox\",checked:!!e.checked,readOnly:true,className:\"squisq-md-checkbox\"}),Ie(e.children,t)]},t)}function yi(e,t,n){let[r,...o]=e;return l(\"table\",{className:\"squisq-md-table\",children:[r&&l(\"thead\",{children:l(\"tr\",{children:r.children.map((i,a)=>l(\"th\",{className:\"squisq-md-th\",style:t?.[a]?{textAlign:t[a]}:void 0,children:re(i.children,`${n}th${a}`)},`${n}th${a}`))})}),o.length>0&&l(\"tbody\",{children:o.map((i,a)=>l(\"tr\",{children:i.children.map((s,u)=>l(\"td\",{className:\"squisq-md-td\",style:t?.[u]?{textAlign:t[u]}:void 0,children:re(s.children,`${n}td${a}-${u}`)},`${n}td${a}-${u}`))},`${n}tr${a}`))})]},n)}function Ie(e,t=\"\"){return e.map((n,r)=>gi(n,`${t}b${r}`))}function pt({nodes:e,className:t}){return !e||e.length===0?null:l(\"div\",{className:`squisq-md ${t||\"\"}`,children:Ie(e)})}function bi(e){let t=e.sourceHeading?.templateAnnotation;return t?Ht(t.template):false}function Dr(e){let t=0;for(let n of e)t++,n.children&&(t+=Dr(n.children));return t}function Fr({block:e,basePath:t,viewport:n,renderContext:r,blockIndex:o}){let i=bi(e),a=F(()=>{if(!i)return null;let s=e.sourceHeading.templateAnnotation,u=xe(e.sourceHeading),c=_i(e.contents),f={id:e.id,template:s.template,startTime:0,duration:1,audioSegment:0,title:u,...vi(s.template,u,c,e.contents),...s.params,...e.templateOverrides},d={...r,blockIndex:o},m=Wt(f,d);return {...e,layers:m,template:s.template}},[e,i,r,o]);return l(\"div\",{className:\"squisq-linear-section\",\"data-block-id\":e.id,\"data-template\":i?e.sourceHeading?.templateAnnotation?.template:void 0,children:[e.sourceHeading&&!i&&l(pt,{nodes:[e.sourceHeading]}),i&&a&&l(\"div\",{className:\"squisq-linear-card\",children:[e.sourceHeading&&l(\"div\",{className:\"squisq-linear-card-label squisq-md\",children:l(pt,{nodes:[e.sourceHeading]})}),l(\"div\",{className:\"squisq-linear-card-svg\",style:{width:\"100%\",aspectRatio:`${n.width} / ${n.height}`,overflow:\"hidden\",borderRadius:\"8px\",boxShadow:\"0 2px 8px rgba(0, 0, 0, 0.12)\",marginBottom:\"1em\"},children:l(Ee,{block:a,blockTime:0,basePath:t,viewport:n})})]}),!i&&e.contents&&e.contents.length>0&&l(pt,{nodes:e.contents}),e.children&&e.children.length>0&&l(\"div\",{className:\"squisq-linear-children\",children:e.children.map((s,u)=>l(Fr,{block:s,basePath:t,viewport:n,renderContext:r,blockIndex:o+u+1},s.id))})]})}function _i(e){return !e||e.length===0?\"\":e.map(t=>xe(t)).join(`\n`).trim()}function xi(e){if(!e)return [];let t=[];for(let n of e)if(n.type===\"list\")for(let r of n.children){let o=xe(r).trim();o&&t.push(o);}return t}function vi(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:xi(r)||[\"Item 1\",\"Item 2\",\"Item 3\"]};case \"definitionCard\":return {term:t,definition:n||t};case \"dateEvent\":return {date:t,description:n||t};default:return {}}}function ft({doc:e,basePath:t=\"/\",viewport:n,className:r,theme:o}){let i=n??J.landscape,a=F(()=>Dr(e.blocks),[e.blocks]),s=F(()=>({theme:o??fe,viewport:i,totalBlocks:a}),[i,a,o]);return l(\"div\",{className:`squisq-linear ${r||\"\"}`,style:{width:\"100%\",height:\"100%\",overflowY:\"auto\",overflowX:\"hidden\"},children:l(\"div\",{className:\"squisq-linear-content\",style:{maxWidth:\"720px\",margin:\"0 auto\",padding:\"24px 16px\",lineHeight:1.7,fontSize:\"16px\",color:\"var(--squisq-text, #1f2937)\"},children:e.blocks.map((u,c)=>l(Fr,{block:u,basePath:t,viewport:i,renderContext:s,blockIndex:c},u.id))})})}var ki=new Set([\"a\",\"an\",\"the\",\"and\",\"but\",\"or\",\"for\",\"nor\",\"on\",\"at\",\"to\",\"in\",\"of\",\"by\",\"is\"]);function zr(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||!ki.has(a)?a.charAt(0).toUpperCase()+a.slice(1):a).join(\" \");t.set(n,i);}}return t}function qr({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:f,onCaptionsToggle:d,onPlaybackStateChange:m,onControlsReady:p,isFullscreen:y=false,onFullscreenToggle:h,onBlockMarkers:b,forceViewport:v,displayMode:_=\"video\",theme:S}){let w=_===\"slideshow\",A=_===\"linear\",I=q(null),$=q(null),[N,W]=O(null),U=q(),{viewport:se,orientation:k}=Ir(),g=v||(n?J.landscape:se),x=F(()=>typeof window>\"u\"?false:new URLSearchParams(window.location.search).get(\"debug\")===\"true\",[]),C=Br(I,e.audio,t),R=a||C,{currentTime:M,isPlaying:E,currentSegment:Y,totalDuration:K,isEnded:jt,isReady:Xt,isAvailable:Wr,unavailableMessage:Zt,play:je,pause:we,toggle:Se,seekTo:oe,skipToSegment:Li,restart:Gt}=R,ht=q(M);ht.current=M;let Qt=q(K);Qt.current=K;let Kt=q(0),Vr=j(T=>{if(n||w||A||T.target.closest(\"button, a, input, .doc-player__controls, .doc-player__scrubber, .doc-controls-sidebar, .doc-controls-slideshow\"))return;Se(),W(E?\"play\":\"pause\"),clearTimeout(U.current),U.current=setTimeout(()=>W(null),600);},[n,Se,E,w,A]),{currentBlock:_e,currentBlockIndex:me,previousBlock:Jt,isEntering:Ur,isExiting:Yr,blockTime:gt,docProgress:en,blocks:X}=Er(e,M,g,n,S),he=F(()=>{let T=e.startBlock;if(!T)return null;let L=pe(S??fe,0,1,g);return {id:\"cover-block\",startTime:-1,duration:0,audioSegment:-1,layers:qt(T,L)}},[e.startBlock,g,S]),[jr,tn]=O(false),[Xr,nn]=O(false),rn=q(),yt=q(false);he&&!E&&M===0&&!n&&!r&&(yt.current=true),D(()=>{if(E&&yt.current&&he&&!n)return yt.current=false,nn(true),rn.current=setTimeout(()=>nn(false),3e3),()=>clearTimeout(rn.current)},[E,he,n]);let Xe=!w&&!A&&he&&(jr||Xr||!E&&M===0&&!n&&!r),on=q(false);D(()=>{Xt&&r&&!on.current&&(on.current=true,je());},[Xt,r,je]),D(()=>{i?.(M);},[M,i]),D(()=>{jt&&o?.();},[jt,o]),D(()=>{if((n||x)&&typeof window<\"u\"){let T=window;T.seekTo=L=>(oe(L),new Promise(z=>{requestAnimationFrame(()=>{let Q=0;for(let ce=X.length-1;ce>=0;ce--)if(L>=X[ce].startTime){Q=X[ce].startTime;break}let ln=(L-Q)*1e3;document.getAnimations().forEach(ce=>{let Ne=ce.effect?.target;Ne&&(Ne.closest(\".doc-player__block--active\")||Ne.closest(\".doc-player__block--previous\"))&&(ce.currentTime=Math.max(0,ln));});let Zr=L-Q,cn=[],un=document.querySelector(\".doc-player__block--active\");un&&un.querySelectorAll(\"video[data-clip-start]\").forEach(Ne=>{let Ae=Ne,Gr=parseFloat(Ae.dataset.clipStart||\"0\"),Qr=parseFloat(Ae.dataset.clipEnd||\"0\"),dn=Math.min(Gr+Math.max(0,Zr),Qr);Ae.pause(),Ae.currentTime=dn,cn.push(new Promise(_t=>{Math.abs(Ae.currentTime-dn)<.1?_t():(Ae.addEventListener(\"seeked\",()=>_t(),{once:true}),setTimeout(_t,200));}));}),Promise.all(cn).then(()=>{requestAnimationFrame(()=>z());});});})),T.getDuration=()=>K,T.getBlocks=()=>X.map(L=>({id:L.id,template:L.template??\"raw\",startTime:L.startTime,duration:L.duration})),T.getAudioSegments=()=>e.audio.segments.map(L=>({src:L.src,name:L.name,duration:L.duration,startTime:L.startTime})),T.getCaptions=()=>e.captions?.phrases?.map(L=>({text:L.text,startTime:L.startTime,endTime:L.endTime}))||[],T.getChapters=()=>{let L=zr(e);return e.audio.segments.map((z,Q)=>({title:L.get(Q)||z.name,startTime:z.startTime,duration:z.duration}))},T.showCover=()=>(tn(true),new Promise(L=>requestAnimationFrame(()=>L()))),T.hideCover=()=>(tn(false),new Promise(L=>requestAnimationFrame(()=>L()))),T.hasCoverBlock=()=>!!he;}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,x,oe,K,X,he]);let Te=f!==void 0?f:true,an=j(T=>{d?.(T);},[d]),Ze=e.captions&&e.captions.phrases.length>0,sn=F(()=>zr(e),[e]),Re=F(()=>({isPlaying:E,currentTime:M,totalDuration:K,currentBlockIndex:me,totalBlocks:X.length,docProgress:en,hasCaptions:!!Ze,captionsEnabled:Te,isFullscreen:y,currentSegmentIndex:Y,currentSegmentName:sn.get(Y)??e.audio.segments[Y]?.name??null,currentBlock:_e??null}),[E,M,K,me,X.length,en,Ze,Te,y,Y,sn,_e]),Ge=F(()=>({toggle:Se,restart:Gt,seekTo:oe,setCaptionsEnabled:an,toggleFullscreen:h}),[Se,Gt,oe,an,h]),Ce=F(()=>({nextSlide:()=>{if(me<X.length-1){let T=X[me+1];T&&(oe(T.startTime),we());}},prevSlide:()=>{if(me>0){let T=X[me-1];T&&(oe(T.startTime),we());}},goToSlide:T=>{if(T>=0&&T<X.length){let L=X[T];L&&(oe(L.startTime),we());}}}),[me,X,oe,we]);D(()=>{m?.(Re);},[Re,m]),D(()=>{p?.({play:je,pause:we,...Ge});},[je,we,Ge,p]);let Qe=j(T=>{let L=T;if(ne(L)){let z=L;if(typeof z.title==\"string\")return z.title;if(typeof z.stat==\"string\")return z.stat;if(typeof z.quote==\"string\"){let Q=z.quote.split(`\n`)[0];return Q.length<=30?Q:Q.slice(0,27)+\"...\"}if(typeof z.date==\"string\")return z.date;if(typeof z.fact==\"string\")return z.fact}if(T.layers&&Array.isArray(T.layers)){let z=T.layers.find(Q=>Q.type===\"text\");if(z?.content?.text){let Q=z.content.text.split(`\n`)[0];return Q.length<=30?Q:Q.slice(0,27)+\"...\"}}return T.id.replace(/-/g,\" \").replace(/\\b\\w/g,z=>z.toUpperCase())},[]),$e=F(()=>{if(!K||!X.length)return [];let T=-1;return X.map((L,z)=>{let Q=L.audioSegment!==T;return T=L.audioSegment,{block:L,index:z,position:L.startTime/K*100,title:Qe(L),isSectionStart:Q}})},[X,K,Qe]);D(()=>{$e.length>0&&b?.($e);},[$e,b]),Kt.current=X.length;let bt=j(T=>{let L=document.activeElement;if(!(L&&(L.tagName===\"INPUT\"||L.tagName===\"TEXTAREA\"||L.tagName===\"SELECT\"))&&!A)if(w)switch(T.key){case \"ArrowRight\":case \"ArrowDown\":case \" \":T.preventDefault(),Ce.nextSlide();break;case \"ArrowLeft\":case \"ArrowUp\":T.preventDefault(),Ce.prevSlide();break;case \"Home\":T.preventDefault(),Ce.goToSlide(0);break;case \"End\":T.preventDefault(),Ce.goToSlide(Kt.current-1);break}else switch(T.key){case \" \":T.preventDefault(),Se();break;case \"ArrowRight\":oe(Math.min(ht.current+10,Qt.current));break;case \"ArrowLeft\":oe(Math.max(ht.current-10,0));break}},[w,A,Se,oe,Ce]);return D(()=>{if(!n)return window.addEventListener(\"keydown\",bt),()=>window.removeEventListener(\"keydown\",bt)},[bt,n]),A?l(\"div\",{ref:$,className:\"doc-player doc-player--linear\",style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:l(ft,{doc:e,basePath:t,viewport:g})}):l(\"div\",{ref:$,className:\"doc-player\",onClick:Vr,style:{position:\"relative\",width:\"100%\",aspectRatio:`${g.width} / ${g.height}`,margin:\"0 auto\",overflow:\"hidden\",cursor:n?void 0:\"pointer\"},children:[l(\"audio\",{ref:I,preload:\"auto\",muted:c}),l(\"div\",{className:\"doc-player__viewport\",children:[Xe&&he&&l(\"div\",{className:\"doc-player__block doc-player__block--cover\",children:l(Ee,{block:he,blockTime:0,basePath:t,isEntering:false,viewport:g})}),!Xe&&Jt&&Yr&&l(\"div\",{className:\"doc-player__block doc-player__block--previous\",children:l(Ee,{block:Jt,blockTime:gt,basePath:t,isExiting:true,viewport:g})}),!Xe&&_e&&l(\"div\",{className:\"doc-player__block doc-player__block--active\",children:l(Ee,{block:_e,blockTime:gt,basePath:t,isEntering:Ur,viewport:g,isPlaying:E})}),Ze&&!n&&l(Pr,{captions:e.captions,currentTime:M,enabled:Te&&(E||M>0),fontSize:16}),x&&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:_e?.template??\"raw\"})]}),l(\"div\",{children:[l(\"span\",{style:{color:\"#888\"},children:\"block:\"}),\" \",me+1,\"/\",X.length,\" \",l(\"span\",{style:{color:\"#666\"},children:[\"(\",_e?.id||\"none\",\")\"]})]}),l(\"div\",{children:[l(\"span\",{style:{color:\"#888\"},children:\"time:\"}),\" \",M.toFixed(2),\"s /\",\" \",K.toFixed(1),\"s\"]}),l(\"div\",{children:[l(\"span\",{style:{color:\"#888\"},children:\"blockTime:\"}),\" \",gt.toFixed(2),\"s /\",\" \",(_e?.duration||0).toFixed(1),\"s\"]}),l(\"div\",{children:[l(\"span\",{style:{color:\"#888\"},children:\"segment:\"}),\" \",Y,\"/\",e.audio.segments.length-1,\" \",l(\"span\",{style:{color:\"#666\"},children:[\"(\",e.audio.segments[Y]?.name||\"none\",\")\"]})]}),l(\"div\",{children:[l(\"span\",{style:{color:\"#888\"},children:\"viewport:\"}),\" \",g.name||`${g.width}x${g.height}`,\" \",l(\"span\",{style:{color:\"#666\"},children:[\"(\",k,\")\"]})]}),l(\"div\",{children:[l(\"span\",{style:{color:\"#888\"},children:\"playing:\"}),\" \",l(\"span\",{style:{color:E?\"#4ade80\":\"#f87171\"},children:E?\"yes\":\"no\"}),Xe&&l(\"span\",{style:{color:\"#60a5fa\"},children:\" (cover)\"})]}),Ze&&(()=>{let T=qe(e.captions,M),L=Te&&(E||M>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:Te?\"#4ade80\":\"#666\"},children:[\"(\",Te?\"on\":\"off\",\")\"]})]}),l(\"div\",{children:[l(\"span\",{style:{color:\"#888\"},children:\"cc.enabled:\"}),\" \",l(\"span\",{style:{color:L?\"#4ade80\":\"#f87171\"},children:String(L)}),\" \",l(\"span\",{style:{color:\"#666\"},children:[\"(playing=\",String(E),\" t>0=\",String(M>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)]})]})]})})()]})]}),!Wr&&Zt&&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:Zt})]}),!n&&!w&&s&&l(Rr,{state:Re,actions:Ge,blockMarkers:$e,expandedBlocks:X,getBlockTitle:Qe}),!n&&!w&&!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(dt,{state:Re,actions:Ge,blockMarkers:$e,expandedBlocks:X,getBlockTitle:Qe})}),!n&&w&&l($r,{state:Re,slideNav:Ce}),!w&&N&&l(\"div\",{className:\"doc-player__tap-feedback\",children:l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"white\",width:\"48\",height:\"48\",children:N===\"pause\"?l(\"path\",{d:\"M6 19h4V5H6v14zm8-14v14h4V5h-4z\"}):l(\"path\",{d:\"M8 5v14l11-7z\"})})},Date.now())]})}var Or={};var Hr=false;function Si(){if(Hr||typeof document>\"u\")return;let e=document.createElement(\"style\");e.setAttribute(\"data-squisq-player\",\"animations\"),e.textContent=Or,document.head.appendChild(e),Hr=true;}function Ti(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:Ci(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 Ci(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 Ai(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 mt=new WeakMap;function Mi(e,t,n={}){Si();let{mode:r=\"slideshow\",basePath:o=\".\",images:i,audio:a,autoPlay:s=false,theme:u}=n,c=a?Ai(t,a):t,f=i?Ti(i,o):null,d;r===\"static\"?d=de(ft,{doc:c,basePath:o,theme:u}):d=de(qr,{script:c,basePath:o,displayMode:\"slideshow\",autoPlay:s,showControls:true,theme:u}),f&&(d=de(Vt.Provider,{value:f},d));let m=mt.get(e);m||(m=Jn(e),mt.set(e,m)),m.render(d);}function Dl(e,t,n={}){Mi(e,t,{...n,mode:\"static\"});}function Fl(e){let t=mt.get(e);t&&(t.unmount(),mt.delete(e));}var zl=\"0.1.3\";exports.mount=Mi;exports.mountStatic=Dl;exports.unmount=Fl;exports.version=zl;return exports;})({});//# sourceMappingURL=squisq-player.global.js.map\n//# sourceMappingURL=squisq-player.global.js.map";
2
+ export const PLAYER_BUNDLE = "var SquisqPlayer=(function(exports){'use strict';var rt,B,hn,ge,pn,gn,yn,bn,St,xt,vt,_n,et={},tt=[],Jr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,De=Array.isArray;function ue(e,t){for(var n in t)e[n]=t[n];return e}function Tt(e){e&&e.parentNode&&e.parentNode.removeChild(e);}function de(e,t,n){var r,o,i,a={};for(i in t)i==\"key\"?r=t[i]:i==\"ref\"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?rt.call(arguments,2):n),typeof e==\"function\"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return Je(e,a,r,o,null)}function Je(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++hn,__i:-1,__u:0};return o==null&&B.vnode!=null&&B.vnode(i),i}function te(e){return e.children}function ie(e,t){this.props=e,this.context=t;}function Me(e,t){if(t==null)return e.__?Me(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==\"function\"?Me(e):null}function eo(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],o=[],i=ue({},t);i.__v=t.__v+1,B.vnode&&B.vnode(i),Ct(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??Me(t),!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,wn(r,i,o),t.__e=t.__=null,i.__e!=n&&xn(i);}}function xn(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),xn(e)}function kt(e){(!e.__d&&(e.__d=true)&&ge.push(e)&&!nt.__r++||pn!=B.debounceRendering)&&((pn=B.debounceRendering)||gn)(nt);}function nt(){try{for(var e,t=1;ge.length;)ge.length>t&&ge.sort(yn),e=ge.shift(),t=ge.length,eo(e);}finally{ge.length=nt.__r=0;}}function vn(e,t,n,r,o,i,a,s,u,c,f){var d,m,p,y,h,b,v,_=r&&r.__k||tt,S=t.length;for(u=to(n,t,_,u,S),d=0;d<S;d++)(p=n.__k[d])!=null&&(m=p.__i!=-1&&_[p.__i]||et,p.__i=d,b=Ct(e,p,m,o,i,a,s,u,c,f),y=p.__e,p.ref&&m.ref!=p.ref&&(m.ref&&At(m.ref,null,p),f.push(p.ref,p.__c||y,p)),h==null&&y!=null&&(h=y),(v=!!(4&p.__u))||m.__k===p.__k?u=kn(p,u,e,v):typeof p.type==\"function\"&&b!==void 0?u=b:y&&(u=y.nextSibling),p.__u&=-7);return n.__e=h,u}function to(e,t,n,r,o){var i,a,s,u,c,f=n.length,d=f,m=0;for(e.__k=new Array(o),i=0;i<o;i++)(a=t[i])!=null&&typeof a!=\"boolean\"&&typeof a!=\"function\"?(typeof a==\"string\"||typeof a==\"number\"||typeof a==\"bigint\"||a.constructor==String?a=e.__k[i]=Je(null,a,null,null,null):De(a)?a=e.__k[i]=Je(te,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=e.__k[i]=Je(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,u=i+m,a.__=e,a.__b=e.__b+1,s=null,(c=a.__i=no(a,n,u,d))!=-1&&(d--,(s=n[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(o>f?m--:o<f&&m++),typeof a.type!=\"function\"&&(a.__u|=4)):c!=u&&(c==u-1?m--:c==u+1?m++:(c>u?m--:m++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<f;i++)(s=n[i])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=Me(s)),Tn(s,s));return r}function kn(e,t,n,r){var o,i;if(typeof e.type==\"function\"){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=kn(o[i],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Me(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Fe(e,t){return t=t||[],e==null||typeof e==\"boolean\"||(De(e)?e.some(function(n){Fe(n,t);}):t.push(e)),t}function no(e,t,n,r){var o,i,a,s=e.key,u=e.type,c=t[n],f=c!=null&&(2&c.__u)==0;if(c===null&&s==null||f&&s==c.key&&u==c.type)return n;if(r>(f?1:0)){for(o=n-1,i=n+1;o>=0||i<t.length;)if((c=t[a=o>=0?o--:i++])!=null&&(2&c.__u)==0&&s==c.key&&u==c.type)return a}return -1}function fn(e,t,n){t[0]==\"-\"?e.setProperty(t,n??\"\"):e[t]=n==null?\"\":typeof n!=\"number\"||Jr.test(t)?n:n+\"px\";}function Ke(e,t,n,r,o){var i,a;e:if(t==\"style\")if(typeof n==\"string\")e.style.cssText=n;else {if(typeof r==\"string\"&&(e.style.cssText=r=\"\"),r)for(t in r)n&&t in n||fn(e.style,t,\"\");if(n)for(t in n)r&&n[t]==r[t]||fn(e.style,t,n[t]);}else if(t[0]==\"o\"&&t[1]==\"n\")i=t!=(t=t.replace(bn,\"$1\")),a=t.toLowerCase(),t=a in e||t==\"onFocusOut\"||t==\"onFocusIn\"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=St,e.addEventListener(t,i?vt:xt,i)):e.removeEventListener(t,i?vt:xt,i);else {if(o==\"http://www.w3.org/2000/svg\")t=t.replace(/xlink(H|:h)/,\"h\").replace(/sName$/,\"s\");else if(t!=\"width\"&&t!=\"height\"&&t!=\"href\"&&t!=\"list\"&&t!=\"form\"&&t!=\"tabIndex\"&&t!=\"download\"&&t!=\"rowSpan\"&&t!=\"colSpan\"&&t!=\"role\"&&t!=\"popover\"&&t in e)try{e[t]=n??\"\";break e}catch{}typeof n==\"function\"||(n==null||n===false&&t[4]!=\"-\"?e.removeAttribute(t):e.setAttribute(t,t==\"popover\"&&n==1?\"\":n));}}function mn(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=St++;else if(t.t<n.u)return;return n(B.event?B.event(t):t)}}}function Ct(e,t,n,r,o,i,a,s,u,c){var f,d,m,p,y,h,b,v,_,S,w,A,I,$,N,W=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=t.__e=n.__e]),(f=B.__b)&&f(t);e:if(typeof W==\"function\")try{if(v=t.props,_=W.prototype&&W.prototype.render,S=(f=W.contextType)&&r[f.__c],w=f?S?S.props.value:f.__:r,n.__c?b=(d=t.__c=n.__c).__=d.__E:(_?t.__c=d=new W(v,w):(t.__c=d=new ie(v,w),d.constructor=W,d.render=oo),S&&S.sub(d),d.state||(d.state={}),d.__n=r,m=d.__d=!0,d.__h=[],d._sb=[]),_&&d.__s==null&&(d.__s=d.state),_&&W.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=ue({},d.__s)),ue(d.__s,W.getDerivedStateFromProps(v,d.__s))),p=d.props,y=d.state,d.__v=t,m)_&&W.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),_&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else {if(_&&W.getDerivedStateFromProps==null&&v!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,w),t.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,w)===!1){t.__v!=n.__v&&(d.props=v,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(U){U&&(U.__=t);}),tt.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,w),_&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,y,h);});}if(d.context=w,d.props=v,d.__P=e,d.__e=!1,A=B.__r,I=0,_)d.state=d.__s,d.__d=!1,A&&A(t),f=d.render(d.props,d.state,d.context),tt.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,A&&A(t),f=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++I<25);d.state=d.__s,d.getChildContext!=null&&(r=ue(ue({},r),d.getChildContext())),_&&!m&&d.getSnapshotBeforeUpdate!=null&&(h=d.getSnapshotBeforeUpdate(p,y)),$=f!=null&&f.type===te&&f.key==null?Sn(f.props.children):f,s=vn(e,De($)?$:[$],t,n,r,o,i,a,s,u,c),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),b&&(d.__E=d.__=null);}catch(U){if(t.__v=null,u||i!=null)if(U.then){for(t.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s;}else {for(N=i.length;N--;)Tt(i[N]);wt(t);}else t.__e=n.__e,t.__k=n.__k,U.then||wt(t);B.__e(U,t,n);}else i==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=ro(n.__e,t,n,r,o,i,a,u,c);return (f=B.diffed)&&f(t),128&t.__u?void 0:s}function wt(e){e&&(e.__c&&(e.__c.__e=true),e.__k&&e.__k.some(wt));}function wn(e,t,n){for(var r=0;r<n.length;r++)At(n[r],n[++r],n[++r]);B.__c&&B.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o);});}catch(i){B.__e(i,o.__v);}});}function Sn(e){return typeof e!=\"object\"||e==null||e.__b>0?e:De(e)?e.map(Sn):ue({},e)}function ro(e,t,n,r,o,i,a,s,u){var c,f,d,m,p,y,h,b=n.props||et,v=t.props,_=t.type;if(_==\"svg\"?o=\"http://www.w3.org/2000/svg\":_==\"math\"?o=\"http://www.w3.org/1998/Math/MathML\":o||(o=\"http://www.w3.org/1999/xhtml\"),i!=null){for(c=0;c<i.length;c++)if((p=i[c])&&\"setAttribute\"in p==!!_&&(_?p.localName==_:p.nodeType==3)){e=p,i[c]=null;break}}if(e==null){if(_==null)return document.createTextNode(v);e=document.createElementNS(o,_,v.is&&v),s&&(B.__m&&B.__m(t,i),s=false),i=null;}if(_==null)b===v||s&&e.data==v||(e.data=v);else {if(i=i&&rt.call(e.childNodes),!s&&i!=null)for(b={},c=0;c<e.attributes.length;c++)b[(p=e.attributes[c]).name]=p.value;for(c in b)p=b[c],c==\"dangerouslySetInnerHTML\"?d=p:c==\"children\"||c in v||c==\"value\"&&\"defaultValue\"in v||c==\"checked\"&&\"defaultChecked\"in v||Ke(e,c,null,p,o);for(c in v)p=v[c],c==\"children\"?m=p:c==\"dangerouslySetInnerHTML\"?f=p:c==\"value\"?y=p:c==\"checked\"?h=p:s&&typeof p!=\"function\"||b[c]===p||Ke(e,c,p,b[c],o);if(f)s||d&&(f.__html==d.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(d&&(e.innerHTML=\"\"),vn(t.type==\"template\"?e.content:e,De(m)?m:[m],t,n,r,_==\"foreignObject\"?\"http://www.w3.org/1999/xhtml\":o,i,a,i?i[0]:n.__k&&Me(n,0),s,u),i!=null)for(c=i.length;c--;)Tt(i[c]);s||(c=\"value\",_==\"progress\"&&y==null?e.removeAttribute(\"value\"):y!=null&&(y!==e[c]||_==\"progress\"&&!y||_==\"option\"&&y!=b[c])&&Ke(e,c,y,b[c],o),c=\"checked\",h!=null&&h!=e[c]&&Ke(e,c,h,b[c],o));}return e}function At(e,t,n){try{if(typeof e==\"function\"){var r=typeof e.__u==\"function\";r&&e.__u(),r&&t==null||(e.__u=e(t));}else e.current=t;}catch(o){B.__e(o,n);}}function Tn(e,t,n){var r,o;if(B.unmount&&B.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||At(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount();}catch(i){B.__e(i,t);}r.base=r.__P=null;}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Tn(r[o],t,n||typeof e.type!=\"function\");n||Tt(e.__e),e.__c=e.__=e.__e=void 0;}function oo(e,t,n){return this.constructor(e,n)}function Mt(e,t,n){var r,o,i,a;t==document&&(t=document.documentElement),B.__&&B.__(e,t),o=(r=\"undefined\"==\"function\")?null:t.__k,i=[],a=[],Ct(t,e=(t).__k=de(te,null,[e]),o||et,et,t.namespaceURI,o?null:t.firstChild?rt.call(t.childNodes):null,i,o?o.__e:t.firstChild,r,a),wn(i,e,a);}function ot(e){function t(n){var r,o;return this.getChildContext||(r=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){r=null;},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&r.forEach(function(a){a.__e=true,kt(a);});},this.sub=function(i){r.add(i);var a=i.componentWillUnmount;i.componentWillUnmount=function(){r&&r.delete(i),a&&a.call(i);};}),n.children}return t.__c=\"__cC\"+_n++,t.__=e,t.Provider=t.__l=(t.Consumer=function(n,r){return n.children(r)}).contextType=t,t}rt=tt.slice,B={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(s){e=s;}throw e}},hn=0,ie.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ue({},this.state),typeof e==\"function\"&&(e=e(ue({},n),this.props)),e&&ue(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),kt(this));},ie.prototype.forceUpdate=function(e){this.__v&&(this.__e=true,e&&this.__h.push(e),kt(this));},ie.prototype.render=te,ge=[],gn=typeof Promise==\"function\"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,yn=function(e,t){return e.__v.__b-t.__v.__b},nt.__r=0,bn=/(PointerCapture)$|Capture$/i,St=0,xt=mn(false),vt=mn(true),_n=0;var Le,V,Lt,Cn,ze=0,Rn=[],Z=B,An=Z.__b,Mn=Z.__r,Ln=Z.diffed,Pn=Z.__c,Bn=Z.unmount,En=Z.__;function at(e,t){Z.__h&&Z.__h(V,e,ze||t),ze=0;var n=V.__H||(V.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function O(e){return ze=1,$n(Dn,e)}function $n(e,t,n){var r=at(Le++,2);if(r.t=e,!r.__c&&(r.__=[Dn(void 0,t),function(s){var u=r.__N?r.__N[0]:r.__[0],c=r.t(u,s);u!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}));}],r.__c=V,!V.__f)){var o=function(s,u,c){if(!r.__c.__H)return true;var f=r.__c.__H.__.filter(function(m){return m.__c});if(f.every(function(m){return !m.__N}))return !i||i.call(this,s,u,c);var d=r.__c.props!==s;return f.some(function(m){if(m.__N){var p=m.__[0];m.__=m.__N,m.__N=void 0,p!==m.__[0]&&(d=true);}}),i&&i.call(this,s,u,c)||d};V.__f=true;var i=V.shouldComponentUpdate,a=V.componentWillUpdate;V.componentWillUpdate=function(s,u,c){if(this.__e){var f=i;i=void 0,o(s,u,c),i=f;}a&&a.call(this,s,u,c);},V.shouldComponentUpdate=o;}return r.__N||r.__}function D(e,t){var n=at(Le++,3);!Z.__s&&Nn(n.__H,t)&&(n.__=e,n.u=t,V.__H.__h.push(n));}function q(e){return ze=5,F(function(){return {current:e}},[])}function F(e,t){var n=at(Le++,7);return Nn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function j(e,t){return ze=8,F(function(){return e},t)}function Bt(e){var t=V.context[e.__c],n=at(Le++,9);return n.c=e,t?(n.__==null&&(n.__=true,t.sub(V)),t.props.value):e.__}function io(){for(var e;e=Rn.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(it),t.__h.some(Pt),t.__h=[];}catch(n){t.__h=[],Z.__e(n,e.__v);}}}Z.__b=function(e){V=null,An&&An(e);},Z.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),En&&En(e,t);},Z.__r=function(e){Mn&&Mn(e),Le=0;var t=(V=e.__c).__H;t&&(Lt===V?(t.__h=[],V.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0;})):(t.__h.some(it),t.__h.some(Pt),t.__h=[],Le=0)),Lt=V;},Z.diffed=function(e){Ln&&Ln(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Rn.push(t)!==1&&Cn===Z.requestAnimationFrame||((Cn=Z.requestAnimationFrame)||ao)(io)),t.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0;})),Lt=V=null;},Z.__c=function(e,t){t.some(function(n){try{n.__h.some(it),n.__h=n.__h.filter(function(r){return !r.__||Pt(r)});}catch(r){t.some(function(o){o.__h&&(o.__h=[]);}),t=[],Z.__e(r,n.__v);}}),Pn&&Pn(e,t);},Z.unmount=function(e){Bn&&Bn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(r){try{it(r);}catch(o){t=o;}}),n.__H=void 0,t&&Z.__e(t,n.__v));};var In=typeof requestAnimationFrame==\"function\";function ao(e){var t,n=function(){clearTimeout(r),In&&cancelAnimationFrame(t),setTimeout(e);},r=setTimeout(n,35);In&&(t=requestAnimationFrame(n));}function it(e){var t=V,n=e.__c;typeof n==\"function\"&&(e.__c=void 0,n()),V=t;}function Pt(e){var t=V;e.__c=e.__(),V=t;}function Nn(e,t){return !e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Dn(e,t){return typeof t==\"function\"?t(e):t}function lo(e,t){for(var n in t)e[n]=t[n];return e}function Fn(e,t){for(var n in e)if(n!==\"__source\"&&!(n in t))return true;for(var r in t)if(r!==\"__source\"&&e[r]!==t[r])return true;return false}function zn(e,t){this.props=e,this.context=t;}(zn.prototype=new ie).isPureReactComponent=true,zn.prototype.shouldComponentUpdate=function(e,t){return Fn(this.props,e)||Fn(this.state,t)};var qn=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),qn&&qn(e);};var co=B.__e;B.__e=function(e,t,n,r){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}co(e,t,n,r);};var On=B.unmount;function jn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c==\"function\"&&r.__c();}),e.__c.__H=null),(e=lo({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=true,e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return jn(r,t,n)})),e}function Xn(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Xn(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=true,e.__c.__P=n)),e}function Et(){this.__u=0,this.o=null,this.__b=null;}function Zn(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function st(){this.i=null,this.l=null;}B.unmount=function(e){var t=e.__c;t&&(t.__z=true),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),On&&On(e);},(Et.prototype=new ie).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=Zn(r.__v),i=false,a=function(){i||r.__z||(i=true,n.__R=null,o?o(u):u());};n.__R=a;var s=n.__P;n.__P=null;var u=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=Xn(c,c.__c.__P,c.__c.__O);}var f;for(r.setState({__a:r.__b=null});f=r.o.pop();)f.__P=s,f.forceUpdate();}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a);},Et.prototype.componentWillUnmount=function(){this.o=[];},Et.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement(\"div\"),r=this.__v.__k[0].__c;this.__v.__k[0]=jn(this.__b,n,r.__O=r.__P);}this.__b=null;}var o=t.__a&&de(te,null,e.fallback);return o&&(o.__u&=-33),[de(te,null,t.__a?null:e.children),o]};var Hn=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!==\"t\"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2];}};(st.prototype=new ie).__a=function(e){var t=this,n=Zn(t.__v),r=t.l.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Hn(t,e,r)):o();};n?n(i):i();}},st.prototype.render=function(e){this.i=null,this.l=new Map;var t=Fe(e.children);e.revealOrder&&e.revealOrder[0]===\"b\"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},st.prototype.componentDidUpdate=st.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Hn(e,n,t);});};var uo=typeof Symbol<\"u\"&&Symbol.for&&Symbol.for(\"react.element\")||60103,po=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,fo=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,mo=/[A-Z0-9]/g,ho=typeof document<\"u\",go=function(e){return (typeof Symbol<\"u\"&&typeof Symbol()==\"symbol\"?/fil|che|rad/:/fil|che|ra/).test(e)};function Gn(e,t,n){return t.__k==null&&(t.textContent=\"\"),Mt(e,t),e?e.__c:null}ie.prototype.isReactComponent=true,[\"componentWillMount\",\"componentWillReceiveProps\",\"componentWillUpdate\"].forEach(function(e){Object.defineProperty(ie.prototype,e,{configurable:true,get:function(){return this[\"UNSAFE_\"+e]},set:function(t){Object.defineProperty(this,e,{configurable:true,writable:true,value:t});}});});var Wn=B.event;B.event=function(e){return Wn&&(e=Wn(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var yo={configurable:true,get:function(){return this.class}},Vn=B.vnode;B.vnode=function(e){typeof e.type==\"string\"&&(function(t){var n=t.props,r=t.type,o={},i=r.indexOf(\"-\")==-1;for(var a in n){var s=n[a];if(!(a===\"value\"&&\"defaultValue\"in n&&s==null||ho&&a===\"children\"&&r===\"noscript\"||a===\"class\"||a===\"className\")){var u=a.toLowerCase();a===\"defaultValue\"&&\"value\"in n&&n.value==null?a=\"value\":a===\"download\"&&s===true?s=\"\":u===\"translate\"&&s===\"no\"?s=false:u[0]===\"o\"&&u[1]===\"n\"?u===\"ondoubleclick\"?a=\"ondblclick\":u!==\"onchange\"||r!==\"input\"&&r!==\"textarea\"||go(n.type)?u===\"onfocus\"?a=\"onfocusin\":u===\"onblur\"?a=\"onfocusout\":fo.test(a)&&(a=u):u=a=\"oninput\":i&&po.test(a)?a=a.replace(mo,\"-$&\").toLowerCase():s===null&&(s=void 0),u===\"oninput\"&&o[a=u]&&(a=\"oninputCapture\"),o[a]=s;}}r==\"select\"&&(o.multiple&&Array.isArray(o.value)&&(o.value=Fe(n.children).forEach(function(c){c.props.selected=o.value.indexOf(c.props.value)!=-1;})),o.defaultValue!=null&&(o.value=Fe(n.children).forEach(function(c){c.props.selected=o.multiple?o.defaultValue.indexOf(c.props.value)!=-1:o.defaultValue==c.props.value;}))),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,\"className\",yo)):n.className&&(o.class=o.className=n.className),t.props=o;})(e),e.$$typeof=uo,Vn&&Vn(e);};var Un=B.__r;B.__r=function(e){Un&&Un(e),e.__c;};var Yn=B.diffed;B.diffed=function(e){Yn&&Yn(e);var t=e.props,n=e.__e;n!=null&&e.type===\"textarea\"&&\"value\"in t&&t.value!==n.value&&(n.value=t.value==null?\"\":t.value);};function Kn(e){return !!e.__k&&(Mt(null,e),true)}function Jn(e){return {render:function(t){Gn(t,e);},unmount:function(){Kn(e);}}}function It(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(t>=r.startTime&&t<r.startTime+r.duration)return r}return e[0]||null}function qe(e,t){if(!e||!e.phrases.length)return null;for(let n of e.phrases)if(t>=n.startTime&&t<n.endTime)return n;return null}var J={landscape:{width:1920,height:1080,name:\"16:9 Landscape\"},portrait:{width:1080,height:1920,name:\"9:16 Portrait\"},square:{width:1080,height:1080,name:\"1:1 Square\"}};var bo=Math.sqrt(1920*1920+1080*1080);function Rt(e){return Math.sqrt(e.width*e.width+e.height*e.height)/bo}function $t(e){let t=e.width/e.height;return Math.abs(t-1)<.05?\"square\":t>1?\"landscape\":\"portrait\"}var _o={landscape:{primaryY:\"35%\",secondaryY:\"55%\",tertiaryY:\"75%\",titleScale:1,bodyScale:1,columnLeftX:\"25%\",columnRightX:\"75%\",columnTopY:\"35%\",columnBottomY:\"65%\",stackColumns:false,maxTextWidth:\"80%\",horizontalPadding:\"10%\",captionY:\"85%\",captionScale:1},portrait:{primaryY:\"25%\",secondaryY:\"42%\",tertiaryY:\"58%\",titleScale:.7,bodyScale:1.5,columnLeftX:\"50%\",columnRightX:\"50%\",columnTopY:\"30%\",columnBottomY:\"55%\",stackColumns:true,maxTextWidth:\"90%\",horizontalPadding:\"5%\",captionY:\"75%\",captionScale:.85},square:{primaryY:\"30%\",secondaryY:\"50%\",tertiaryY:\"70%\",titleScale:.85,bodyScale:.9,columnLeftX:\"25%\",columnRightX:\"75%\",columnTopY:\"35%\",columnBottomY:\"65%\",stackColumns:false,maxTextWidth:\"85%\",horizontalPadding:\"7.5%\",captionY:\"82%\",captionScale:.9}};function Oe(e){return _o[e]}function tr(e,t,n,r=false){let o=Rt(t),i=Oe(n),a=r?i.titleScale:i.bodyScale;return Math.round(e*o*a)}function lt(e){let t=Oe(e);return t.stackColumns?{left:{x:\"50%\",y:t.columnTopY},right:{x:\"50%\",y:t.columnBottomY}}:{left:{x:t.columnLeftX,y:\"50%\"},right:{x:t.columnRightX,y:\"50%\"}}}var Nt='\"PT Serif\", Georgia, \"Times New Roman\", serif';function ne(e){return \"template\"in e&&typeof e.template==\"string\"}function pe(e,t,n,r=J.landscape){let o=$t(r);return {theme:e,blockIndex:t,totalBlocks:n,viewport:r,fontScale:Rt(r),orientation:o,layout:Oe(o)}}function P(e,t,n=false){return tr(e,t.viewport,t.orientation,n)}function Dt(e){return \"template\"in e&&typeof e.template==\"string\"}var er='\"PT Serif\", Georgia, \"Times New Roman\", serif';var xo={blue:{bg:\"#1a365d\",text:\"#63b3ed\",accent:\"#90cdf4\"},green:{bg:\"#22543d\",text:\"#9ae6b4\",accent:\"#68d391\"},purple:{bg:\"#44337a\",text:\"#d6bcfa\",accent:\"#b794f4\"},red:{bg:\"#742a2a\",text:\"#fc8181\",accent:\"#feb2b2\"},orange:{bg:\"#744210\",text:\"#fbd38d\",accent:\"#f6ad55\"},teal:{bg:\"#234e52\",text:\"#81e6d9\",accent:\"#4fd1c5\"}},vo={id:\"documentary\",name:\"Documentary\",description:\"Classic dark cinematic look with serif typography. The original Squisq style.\",colors:{primary:\"#3d5a80\",secondary:\"#63b3ed\",background:\"#1a202c\",backgroundLight:\"#2d3748\",text:\"#ffffff\",textMuted:\"#a0aec0\",highlight:\"#63b3ed\",warning:\"#fc8181\"},typography:{bodyFontFamily:er,titleFontFamily:er,titleWeight:\"bold\"},style:{textShadow:true,overlayOpacity:.5,animationSpeed:1},renderStyle:{name:\"documentary\",defaultTextAnimation:\"fadeIn\",defaultImageAnimation:\"slowZoom\",ambientMotion:true,defaultTransition:{type:\"fade\",duration:.8}},colorSchemes:xo,persistentLayers:{bottomLayers:[{template:\"gradientBackground\",config:{type:\"gradientBackground\",preset:\"dark-vignette\"}}]}};var fe=vo;function nr(e){return \"children\"in e&&Array.isArray(e.children)?e.children:[]}function xe(e){return \"value\"in e&&typeof e.value==\"string\"?e.value:nr(e).map(xe).join(\"\")}var Co={\"dark-vignette\":\"radial-gradient(ellipse at center, rgba(26,32,44,0.8) 0%, rgba(0,0,0,0.95) 100%)\",\"radial-dark\":\"radial-gradient(ellipse at center, #1a202c 0%, #000000 100%)\",\"warm-sunset\":\"linear-gradient(135deg, rgba(124,58,48,0.9) 0%, rgba(26,32,44,0.95) 100%)\",\"cool-blue\":\"linear-gradient(135deg, rgba(26,54,93,0.9) 0%, rgba(26,32,44,0.95) 100%)\",\"earth-tones\":\"linear-gradient(135deg, rgba(68,51,34,0.9) 0%, rgba(26,32,44,0.95) 100%)\"};function Ao(e){return {type:\"shape\",id:\"persistent-bg-solid\",content:{shape:\"rect\",fill:e.color},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}}function Mo(e){return {type:\"shape\",id:\"persistent-bg-gradient\",content:{shape:\"rect\",fill:e.gradient??Co[e.preset??\"dark-vignette\"]},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}}function Lo(e){let t=[],n=e.opacity??.4,r={type:\"image\",id:\"persistent-bg-image\",content:{src:e.src,alt:\"Background\",fit:\"cover\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"},animation:e.ambientMotion?{type:e.ambientMotion,duration:30}:void 0};return t.push(r),t.push({type:\"shape\",id:\"persistent-bg-overlay\",content:{shape:\"rect\",fill:`rgba(0,0,0,${.5+(1-n)*.3})`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}),t}function Po(e){let t=e.opacity??.1;return {type:\"shape\",id:\"persistent-bg-pattern\",content:{shape:\"rect\",fill:e.color??`rgba(255,255,255,${t})`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}}function Bo(e){let t=[],n=e.fontSize??18,r=!!e.subtitle,o=e.position.includes(\"bottom\"),i=e.position.includes(\"left\"),a=3,s=r?\"15%\":\"7%\",u=o?r?\"78%\":\"84%\":\"2%\",c=i?`${a}%`:\"68%\",f=r?\"6%\":\"5%\",d=r?\"10%\":\"5%\",m=1.5,p=e.showThumbnail&&i?`${a+m+6+m}%`:`${a+m}%`,y=e.showThumbnail?\"19%\":\"24%\",h=o?r?\"80%\":\"86%\":\"4%\";if(t.push({type:\"shape\",id:\"persistent-caption-bg\",content:{shape:\"rect\",fill:\"rgba(0,0,0,0.6)\",borderRadius:8},position:{x:c,y:u,width:e.showThumbnail?\"30%\":\"28%\",height:s}}),e.showThumbnail&&e.thumbnailSrc){let b=i?`${a+m}%`:\"93%\",v=o?r?`${78+m}%`:\"85%\":\"3%\";t.push({type:\"image\",id:\"persistent-caption-thumb\",content:{src:e.thumbnailSrc,alt:\"Article thumbnail\",fit:\"cover\"},position:{x:b,y:v,width:f,height:d}});}if(t.push({type:\"text\",id:\"persistent-caption-title\",content:{text:e.title,style:{fontSize:n,fontWeight:\"bold\",color:\"rgba(255,255,255,0.9)\",textAlign:i?\"left\":\"right\",maxLines:1}},position:{x:p,y:h,width:y}}),r){let b=o?\"85.5%\":\"8%\";t.push({type:\"text\",id:\"persistent-caption-subtitle\",content:{text:e.subtitle,style:{fontSize:18,fontWeight:\"normal\",color:\"rgba(255,255,255,0.55)\",textAlign:i?\"left\":\"right\"}},position:{x:p,y:b,width:y}});}return t}function Eo(e){let t=e.position.includes(\"bottom\"),r=e.position.includes(\"left\")?\"3%\":\"90%\",o=t?\"94%\":\"3%\";return e.isImage?{type:\"image\",id:\"persistent-branding\",content:{src:e.content,alt:\"Branding\",fit:\"contain\"},position:{x:r,y:o,width:\"8%\",height:\"4%\"}}:{type:\"text\",id:\"persistent-branding\",content:{text:e.content,style:{fontSize:14,fontWeight:\"normal\",color:\"rgba(255,255,255,0.6)\"}},position:{x:r,y:o}}}function Io(e){let t=e.color??\"rgba(255,255,255,0.3)\",n=e.position===\"top\"?\"1%\":\"98%\";return {type:\"shape\",id:\"persistent-progress\",content:{shape:\"rect\",fill:t,borderRadius:2},position:{x:\"5%\",y:n,width:\"90%\",height:\"0.5%\"}}}function Ro(e){if(!Dt(e))return [e];let n=e.config;switch(n.type){case \"solidBackground\":return [Ao(n)];case \"gradientBackground\":return [Mo(n)];case \"imageBackground\":return Lo(n);case \"patternBackground\":return [Po(n)];case \"titleCaption\":return Bo(n);case \"cornerBranding\":return [Eo(n)];case \"progressIndicator\":return [Io(n)];default:return console.warn(\"Unknown persistent layer template:\",n.type),[]}}function He(e){return !e||e.length===0?[]:e.reduce((t,n)=>t.concat(Ro(n)),[])}function ir(e,t){let{title:n,subtitle:r,backgroundColor:o}=e,{theme:i,layout:a}=t,s=P(96,t,true),u=P(36,t,false),f=[{type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:`radial-gradient(ellipse at 50% 40%, ${o||i.colors.primary} 0%, ${i.colors.background} 100%)`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}},{type:\"shape\",id:\"accent-line\",content:{shape:\"rect\",fill:\"rgba(255, 255, 255, 0.2)\"},position:{x:\"40%\",y:r?\"28%\":\"38%\",width:\"20%\",height:\"2px\"}},{type:\"text\",id:\"title\",content:{text:n,style:{fontSize:s,fontWeight:\"bold\",color:i.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:r?a.primaryY:\"50%\",anchor:\"center\",width:a.maxTextWidth},animation:{type:\"fadeIn\",duration:2}}];return r&&f.push({type:\"text\",id:\"subtitle\",content:{text:r,style:{fontSize:u,color:i.colors.textMuted,textAlign:\"center\",lineHeight:1.5}},position:{x:\"50%\",y:a.secondaryY,anchor:\"center\",width:a.maxTextWidth},animation:{type:\"fadeIn\",duration:1.5,delay:1}}),f}var $o={bg:\"#1a365d\",text:\"#63b3ed\",accent:\"#90cdf4\"};function ye(e,t){let n=e.theme.colorSchemes;if(t&&t in n)return n[t];let r=Object.keys(n);return r.length>0?n[r[0]]:$o}function ar(e,t){let{title:n,colorScheme:r=\"blue\",imageSrc:o,imageAlt:i,ambientMotion:a}=e,{layout:s}=t,u=ye(t,r),c=P(72,t,true),f=[];return o?(f.push({type:\"image\",id:\"bg-image\",content:{src:o,alt:i||n,fit:\"cover\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"},animation:a?{type:a,duration:8}:{type:\"slowZoom\",duration:8,direction:\"in\"}}),f.push({type:\"shape\",id:\"overlay\",content:{shape:\"rect\",fill:\"rgba(0, 0, 0, 0.5)\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"}})):(f.push({type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:u.bg},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}),f.push({type:\"shape\",id:\"line-top\",content:{shape:\"rect\",fill:`${u.text}33`},position:{x:\"50%\",y:\"40%\",width:\"20%\",height:\"2px\",anchor:\"center\"}}),f.push({type:\"shape\",id:\"line-bottom\",content:{shape:\"rect\",fill:`${u.text}33`},position:{x:\"50%\",y:\"60%\",width:\"20%\",height:\"2px\",anchor:\"center\"}})),f.push({type:\"text\",id:\"title\",content:{text:n,style:{fontSize:c,fontWeight:\"bold\",color:o?\"#ffffff\":u.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:\"50%\",anchor:\"center\",width:s.maxTextWidth},animation:{type:\"fadeIn\",duration:1.5}}),f}var No=/^(\\d+(?:\\.\\d+)?)\\s*%?$/,be={textCenterX:\"50%\",textWidth:\"85%\",textYAdjust:0,adjustY:false};function Pe(e,t){if(!e)return;let n=t!==void 0?{duration:t}:{};switch(e){case \"zoomIn\":case \"in\":return {type:\"slowZoom\",direction:\"in\",...n};case \"zoomOut\":case \"out\":return {type:\"slowZoom\",direction:\"out\",...n};case \"panLeft\":case \"left\":return {type:\"slowZoom\",panDirection:\"left\",...n};case \"panRight\":case \"right\":return {type:\"slowZoom\",panDirection:\"right\",...n};default:return}}var le=35,sr=`${le}%`;function ve(e){switch(e){case \"left-strip\":return {textCenterX:`${50+le/2}%`,textWidth:`${100-le-8}%`,textYAdjust:0,adjustY:false};case \"right-strip\":return {textCenterX:`${50-le/2}%`,textWidth:`${100-le-8}%`,textYAdjust:0,adjustY:false};case \"bottom-strip\":return {textCenterX:\"50%\",textWidth:\"85%\",textYAdjust:-10,adjustY:true};case \"corner-inset\":return {textCenterX:\"45%\",textWidth:\"70%\",textYAdjust:0,adjustY:false};default:return be}}function ke(e,t){let n=[],{src:r,alt:o,position:i,ambientMotion:a,credit:s,license:u}=e;switch(i){case \"left-strip\":n.push(rr(r,o,\"left\",t,a,s,u)),n.push(or(\"left\",t));break;case \"right-strip\":n.push(rr(r,o,\"right\",t,a,s,u)),n.push(or(\"right\",t));break;case \"bottom-strip\":n.push(Do(r,o,t,a,s,u)),n.push(Fo(t));break;case \"corner-inset\":n.push(zo(r,o,t,a,s,u)),n.push(qo(t));break}return n}function rr(e,t,n,r,o,i,a){return {type:\"image\",id:`${r}-accent-img`,content:{src:e,alt:t,fit:\"cover\",credit:i,license:a},position:{x:n===\"left\"?0:`${100-le}%`,y:0,width:sr,height:\"100%\"},animation:Pe(o,15)}}function or(e,t){let n=e===\"left\"?\"accent-gradient-left\":\"accent-gradient-right\";return {type:\"shape\",id:`${t}-accent-fade`,content:{shape:\"rect\",fill:`url(#${n})`},position:{x:e===\"left\"?`${le-8}%`:`${100-le}%`,y:0,width:\"10%\",height:\"100%\"}}}function Do(e,t,n,r,o,i){return {type:\"image\",id:`${n}-accent-img`,content:{src:e,alt:t,fit:\"cover\",credit:o,license:i},position:{x:0,y:`${100-le}%`,width:\"100%\",height:sr},animation:Pe(r,15)}}function Fo(e){return {type:\"shape\",id:`${e}-accent-fade`,content:{shape:\"rect\",fill:\"url(#accent-gradient-bottom)\"},position:{x:0,y:`${100-le-8}%`,width:\"100%\",height:\"12%\"}}}function zo(e,t,n,r,o,i){return {type:\"image\",id:`${n}-accent-img`,content:{src:e,alt:t,fit:\"cover\",credit:o,license:i},position:{x:\"70%\",y:\"60%\",width:\"28%\",height:\"38%\",anchor:\"top-left\"},animation:Pe(r,15)??{type:\"fadeIn\",duration:2,delay:.5}}}function qo(e){return {type:\"shape\",id:`${e}-accent-vignette`,content:{shape:\"rect\",fill:\"url(#accent-vignette-corner)\",borderRadius:8},position:{x:\"69%\",y:\"59%\",width:\"30%\",height:\"40%\"}}}function G(e,t){if(!t.adjustY||t.textYAdjust===0)return typeof e==\"number\"?`${e}%`:e;let n=typeof e==\"number\"?`${e}`:e,r=n.match(No);if(r){let o=parseFloat(r[1]);return `${Math.max(5,o+t.textYAdjust)}%`}return n}var Oo=/[.;:!?]+$/;function zt(e){return e.replace(Oo,\"\").trim()}function ut(e,t){return {type:\"shape\",id:e,content:{shape:\"rect\",fill:t},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}}function lr(e,t){let{stat:n,description:r,detail:o,colorScheme:i=\"blue\",accentImage:a}=e,{theme:s}=t,u=ye(t,i),c=a?ve(a.position):be,f=P(148,t,true),d=P(32,t,false),m=P(26,t,false),p=[ut(\"bg\",`linear-gradient(180deg, ${s.colors.background} 0%, #0f1520 100%)`)];return a&&p.push(...ke(a,e.id)),p.push({type:\"text\",id:\"stat\",content:{text:n,style:{fontSize:f,fontWeight:\"bold\",color:u.text,shadow:!!a}},position:{x:c.textCenterX,y:G(\"32%\",c),anchor:\"center\"},animation:{type:\"zoomIn\",duration:.6}}),p.push({type:\"text\",id:\"description\",content:{text:r,style:{fontSize:d,color:s.colors.textMuted,textAlign:\"center\",lineHeight:1.6,shadow:!!a}},position:{x:c.textCenterX,y:G(\"58%\",c),width:c.textWidth,anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:.3}}),o&&p.push({type:\"text\",id:\"detail\",content:{text:o,style:{fontSize:m,color:u.accent,textAlign:\"center\",shadow:!!a}},position:{x:c.textCenterX,y:G(\"75%\",c),anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:1}}),p}function cr(e,t){let{quote:n,attribution:r,accentImage:o}=e,{theme:i,layout:a}=t,s=o?ve(o.position):be,u=P(48,t,true),c=P(24,t,false),f=P(280,t,true),d=[ut(\"bg\",`linear-gradient(160deg, ${i.colors.backgroundLight} 0%, #1e2636 100%)`)];o&&d.push(...ke(o,e.id)),d.push({type:\"text\",id:\"deco-quote\",content:{text:\"\\u201C\",style:{fontSize:f,color:\"rgba(255, 255, 255, 0.06)\",textAlign:\"center\"}},position:{x:s.textCenterX,y:G(\"18%\",s),anchor:\"center\"}});let m=r?a.primaryY:\"50%\";return d.push({type:\"text\",id:\"quote\",content:{text:n,style:{fontSize:u,color:i.colors.text,textAlign:\"center\",lineHeight:1.6,shadow:true}},position:{x:s.textCenterX,y:G(m,s),anchor:\"center\",width:s.textWidth},animation:{type:\"fadeIn\",duration:2}}),r&&d.push({type:\"text\",id:\"attribution\",content:{text:`\\u2014 ${r}`,style:{fontSize:c,color:i.colors.textMuted,textAlign:\"center\",shadow:!!o}},position:{x:s.textCenterX,y:G(a.captionY,s),anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:1.5}}),d}function ur(e,t){let{fact:n,explanation:r,source:o,accentImage:i}=e,{theme:a}=t,s=i?ve(i.position):be,u=P(56,t,true),c=P(32,t,false),f=P(20,t,false),d=[ut(\"bg\",`linear-gradient(170deg, #1e2030 0%, ${a.colors.background} 100%)`)];return i&&d.push(...ke(i,e.id)),d.push({type:\"text\",id:\"fact\",content:{text:n,style:{fontSize:u,fontWeight:\"bold\",color:a.colors.text,textAlign:\"center\",lineHeight:1.4,shadow:true}},position:{x:s.textCenterX,y:G(\"35%\",s),width:s.textWidth,anchor:\"center\"},animation:{type:\"fadeIn\",duration:1.5}}),d.push({type:\"text\",id:\"explanation\",content:{text:r,style:{fontSize:c,color:a.colors.textMuted,textAlign:\"center\",lineHeight:1.5,shadow:!!i}},position:{x:s.textCenterX,y:G(\"60%\",s),width:s.textWidth,anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:.8}}),o&&d.push({type:\"text\",id:\"source\",content:{text:o,style:{fontSize:f,color:a.colors.textMuted,textAlign:\"center\",shadow:!!i}},position:{x:s.textCenterX,y:G(\"85%\",s),anchor:\"center\"},animation:{type:\"fadeIn\",duration:.8,delay:1.5}}),d}function dr(e,t){let{left:n,right:r,header:o,leftColor:i=\"green\",rightColor:a=\"blue\"}=e;if(!n?.label||!r?.label)return [];let{theme:s,layout:u,orientation:c}=t,f=ye(t,i),d=ye(t,a),m=lt(c),p=u.stackColumns,y=p?\"85%\":\"42%\",h=P(32,t,false),b=P(44,t,true),v=P(22,t,false),_=[{type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:`linear-gradient(135deg, ${s.colors.background} 0%, #16202e 100%)`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}];p||(_.push({type:\"shape\",id:\"left-panel\",content:{shape:\"rect\",fill:\"rgba(255, 255, 255, 0.04)\"},position:{x:\"3%\",y:\"15%\",width:\"44%\",height:\"70%\"}}),_.push({type:\"shape\",id:\"right-panel\",content:{shape:\"rect\",fill:\"rgba(255, 255, 255, 0.04)\"},position:{x:\"53%\",y:\"15%\",width:\"44%\",height:\"70%\"}}));let S=p?\"12%\":\"22%\";o&&_.push({type:\"text\",id:\"header\",content:{text:o,style:{fontSize:h,color:s.colors.textMuted,textAlign:\"center\"}},position:{x:\"50%\",y:S,anchor:\"center\"},animation:{type:\"fadeIn\",duration:.8}});let w,A,I,$;if(p)w=o?\"30%\":\"25%\",A=o?\"40%\":\"35%\",I=o?\"60%\":\"55%\",$=o?\"70%\":\"65%\";else {let se=o?\"47%\":\"45%\",k=o?\"58%\":\"56%\";w=se,A=k,I=se,$=k;}_.push({type:\"text\",id:\"left-label\",content:{text:n.label,style:{fontSize:b,fontWeight:\"bold\",color:f.text,textAlign:\"center\",lineHeight:1.3}},position:{x:m.left.x,y:w,anchor:\"center\",width:y},animation:{type:\"fadeIn\",duration:1}}),n.sublabel&&_.push({type:\"text\",id:\"left-sublabel\",content:{text:n.sublabel,style:{fontSize:v,color:s.colors.textMuted,textAlign:\"center\",lineHeight:1.4}},position:{x:m.left.x,y:A,anchor:\"center\",width:y},animation:{type:\"fadeIn\",duration:.8,delay:.3}});let N=P(120,t,true),W=p?\"48%\":\"50%\",U=p?\"\\u2193\":\"\\u2192\";return _.push({type:\"text\",id:\"connector\",content:{text:U,style:{fontSize:N,fontWeight:\"bold\",color:\"rgba(255, 255, 255, 0.6)\",textAlign:\"center\"}},position:{x:\"50%\",y:W,anchor:\"center\"},animation:{type:\"fadeIn\",duration:.6,delay:.4}}),_.push({type:\"text\",id:\"right-label\",content:{text:r.label,style:{fontSize:b,fontWeight:\"bold\",color:d.text,textAlign:\"center\",lineHeight:1.3}},position:{x:m.right.x,y:I,anchor:\"center\",width:y},animation:{type:\"fadeIn\",duration:1,delay:.5}}),r.sublabel&&_.push({type:\"text\",id:\"right-sublabel\",content:{text:r.sublabel,style:{fontSize:v,color:s.colors.textMuted,textAlign:\"center\",lineHeight:1.4}},position:{x:m.right.x,y:$,anchor:\"center\",width:y},animation:{type:\"fadeIn\",duration:.8,delay:.8}}),_}var Ho={neutral:{bg:\"#1a202c\",date:\"#63b3ed\",text:\"#ffffff\"},somber:{bg:\"#1a1a2e\",date:\"#e53e3e\",text:\"#a0aec0\"},celebratory:{bg:\"#1a365d\",date:\"#68d391\",text:\"#ffffff\"}};function pr(e,t){let{date:n,description:r,footer:o,mood:i=\"neutral\",accentImage:a}=e,{theme:s}=t,u=Ho[i],c=a?ve(a.position):be,f=P(96,t,true),d=P(30,t,false),m=P(26,t,false),p=[{type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:`linear-gradient(135deg, ${u.bg} 0%, #0d1117 100%)`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}];return a&&p.push(...ke(a,e.id)),p.push({type:\"text\",id:\"date\",content:{text:n,style:{fontSize:f,fontWeight:\"bold\",color:u.date,shadow:!!a}},position:{x:c.textCenterX,y:G(\"35%\",c),anchor:\"center\"},animation:{type:\"fadeIn\",duration:1.5}}),p.push({type:\"text\",id:\"description\",content:{text:r,style:{fontSize:d,color:u.text,textAlign:\"center\",lineHeight:1.8,shadow:!!a}},position:{x:c.textCenterX,y:G(\"58%\",c),width:c.textWidth,anchor:\"center\"},animation:{type:\"fadeIn\",duration:2,delay:1}}),o&&p.push({type:\"text\",id:\"footer\",content:{text:o,style:{fontSize:m,color:s.colors.textMuted,shadow:!!a}},position:{x:c.textCenterX,y:G(\"82%\",c),anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:3}}),p}function fr(e,t){let{imageSrc:n,imageAlt:r,caption:o,captionPosition:i=\"bottom\",ambientMotion:a,isTitle:s,subtitle:u,imageCredit:c,imageLicense:f}=e,d=o&&zt(o),{theme:m,layout:p}=t,y=P(36,t,false),h=P(96,t,true),b=P(36,t,false),v=e.kenBurns,S=Pe(a||v),w=[{type:\"image\",id:\"bg-image\",content:{src:n,alt:r,fit:\"cover\",credit:c,license:f},position:{x:0,y:0,width:\"100%\",height:\"100%\"},animation:S}];return s&&d?(w.push({type:\"shape\",id:\"title-gradient\",content:{shape:\"rect\",fill:\"linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.1) 70%, transparent 100%)\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}),w.push({type:\"text\",id:\"title\",content:{text:d,style:{fontSize:h,fontWeight:\"bold\",color:m.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:u?\"70%\":\"75%\",anchor:\"center\",width:p.maxTextWidth},animation:{type:\"fadeIn\",duration:.8}}),u&&w.push({type:\"text\",id:\"subtitle\",content:{text:u,style:{fontSize:b,color:m.colors.textMuted,textAlign:\"center\",lineHeight:1.5}},position:{x:\"50%\",y:\"82%\",anchor:\"center\",width:p.maxTextWidth},animation:{type:\"fadeIn\",duration:.8,delay:.2}}),w):(d&&(w.push({type:\"shape\",id:\"caption-gradient\",content:{shape:\"rect\",fill:\"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%)\"},position:{x:0,y:\"65%\",width:\"100%\",height:\"35%\"}}),w.push({type:\"text\",id:\"caption\",content:{text:d,style:{fontSize:y,color:m.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:\"82%\",anchor:\"center\",width:p.maxTextWidth},animation:{type:\"fadeIn\",duration:1.5,delay:.5}})),w)}function mr(e,t){let{center:n,zoom:r,mapStyle:o=\"terrain\",title:i,caption:a,markers:s,ambientMotion:u,staticSrc:c}=e,{theme:f,layout:d}=t,m=P(64,t,true),p=P(32,t,false),y=Pe(u),h=[{type:\"map\",id:\"map-bg\",content:{center:n,zoom:r,style:o,markers:s,showAttribution:true,staticSrc:c},position:{x:0,y:0,width:\"100%\",height:\"100%\"},animation:y}];return i&&(h.push({type:\"shape\",id:\"title-overlay\",content:{shape:\"rect\",fill:\"rgba(0,0,0,0.6)\"},position:{x:0,y:0,width:\"100%\",height:\"18%\"}}),h.push({type:\"text\",id:\"title\",content:{text:i,style:{fontSize:m,fontWeight:\"bold\",color:f.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:\"9%\",anchor:\"center\",width:d.maxTextWidth},animation:{type:\"fadeIn\",duration:1,delay:.3}})),a&&(h.push({type:\"shape\",id:\"caption-overlay\",content:{shape:\"rect\",fill:\"rgba(0,0,0,0.6)\"},position:{x:0,y:\"82%\",width:\"100%\",height:\"18%\"}}),h.push({type:\"text\",id:\"caption\",content:{text:a,style:{fontSize:p,color:f.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:d.captionY,anchor:\"center\",width:d.maxTextWidth},animation:{type:\"fadeIn\",duration:1,delay:.5}})),h}function hr(e,t){let{text:n,colorScheme:r=\"blue\"}=e,{theme:o}=t,i=ye(t,r),a=P(120,t,true);return [{type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:`radial-gradient(ellipse at 50% 50%, ${o.colors.backgroundLight} 0%, #000000 100%)`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}},{type:\"text\",id:\"impact-text\",content:{text:n,style:{fontSize:a,fontWeight:\"bold\",color:i.text,textAlign:\"center\",lineHeight:1.2,shadow:true}},position:{x:\"50%\",y:\"50%\",anchor:\"center\",width:\"85%\"},animation:{type:\"fadeIn\",duration:1.5}}]}function gr(e,t){let{items:n,title:r,accentImage:o}=e,{theme:i}=t,a=o?ve(o.position):be,s=P(44,t,true),u=P(34,t,false),c=[{type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:`linear-gradient(155deg, ${i.colors.backgroundLight} 0%, ${i.colors.background} 100%)`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}];o&&c.push(...ke(o,e.id));let f=r?30:22;r&&c.push({type:\"text\",id:\"list-title\",content:{text:r,style:{fontSize:s,fontWeight:\"bold\",color:i.colors.text,textAlign:\"center\",shadow:!!o}},position:{x:a.textCenterX,y:G(\"16%\",a),anchor:\"center\"},animation:{type:\"fadeIn\",duration:1}});let m=n.length>1?(80-f)/(n.length-1):0;for(let p=0;p<n.length;p++){let y=f+m*p,h=`${p+1}. ${n[p]}`;c.push({type:\"text\",id:`item-${p}`,content:{text:h,style:{fontSize:u,color:i.colors.text,lineHeight:1.4,shadow:!!o}},position:{x:a.textCenterX,y:G(`${y}%`,a),anchor:\"center\",width:a.textWidth},animation:{type:\"fadeIn\",duration:.8,delay:.3+.3*p}});}return c}var ee=.5;function yr(e,t){let{images:n,caption:r,ambientMotion:o}=e;if(!n||n.length===0)return [];let i=r&&zt(r),{theme:a,layout:s}=t,u=[{type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:\"#000000\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}],c=i?s.stackColumns?18:22:0,f=100-c,d=Wo(n.length,f,s.stackColumns),m=P(24,t,false);for(let p=0;p<Math.min(n.length,4);p++){let y=n[p],h=d[p];u.push({type:\"shape\",id:`grid-placeholder-${p}`,content:{shape:\"rect\",fill:a.colors.background},position:{x:`${h.x}%`,y:`${h.y}%`,width:`${h.w}%`,height:`${h.h}%`}}),y.alt&&u.push({type:\"text\",id:`grid-alt-${p}`,content:{text:y.alt,style:{fontSize:m,color:a.colors.textMuted,textAlign:\"center\"}},position:{x:`${h.x+h.w/2}%`,y:`${h.y+h.h/2}%`,anchor:\"center\"}}),u.push({type:\"image\",id:`grid-img-${p}`,content:{src:y.src,alt:y.alt,fit:\"cover\",credit:y.credit,license:y.license},position:{x:`${h.x}%`,y:`${h.y}%`,width:`${h.w}%`,height:`${h.h}%`},animation:p===0&&o?{type:o,duration:15}:{type:\"fadeIn\",duration:1,delay:.2*p}});}if(i){let p=P(s.stackColumns?28:40,t,false);u.push({type:\"shape\",id:\"caption-bg\",content:{shape:\"rect\",fill:\"linear-gradient(transparent, rgba(0,0,0,0.8))\"},position:{x:0,y:`${f-4}%`,width:\"100%\",height:`${c+4}%`}}),u.push({type:\"text\",id:\"caption\",content:{text:i,style:{fontSize:p,color:a.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:`${f+(s.stackColumns?c/2:c*.3)}%`,anchor:\"center\",width:\"90%\"},animation:{type:\"fadeIn\",duration:1,delay:.5}});}return u}function Wo(e,t,n){let r=50-ee/2,o=t/2-ee/2;switch(e){case 2:return n?[{x:0,y:0,w:100,h:o},{x:0,y:t/2+ee/2,w:100,h:o}]:[{x:0,y:0,w:r,h:t},{x:50+ee/2,y:0,w:r,h:t}];case 3:{if(n){let s=t/3-ee*2/3;return [{x:0,y:0,w:100,h:s},{x:0,y:t/3+ee/3,w:100,h:s},{x:0,y:t*2/3+ee*2/3,w:100,h:s}]}let i=60-ee/2,a=40-ee/2;return [{x:0,y:0,w:i,h:t},{x:60+ee/2,y:0,w:a,h:o},{x:60+ee/2,y:t/2+ee/2,w:a,h:o}]}default:return [{x:0,y:0,w:r,h:o},{x:50+ee/2,y:0,w:r,h:o},{x:0,y:t/2+ee/2,w:r,h:o},{x:50+ee/2,y:t/2+ee/2,w:r,h:o}]}}function br(e,t){let{term:n,definition:r,origin:o,colorScheme:i=\"blue\",accentImage:a}=e,{theme:s}=t,u=ye(t,i),c=a?ve(a.position):be,f=P(72,t,true),d=P(32,t,false),m=P(22,t,false),p=[ut(\"bg\",`linear-gradient(145deg, #1e2030 0%, ${s.colors.background} 100%)`)];return a&&p.push(...ke(a,e.id)),p.push({type:\"text\",id:\"term\",content:{text:n,style:{fontSize:f,fontWeight:\"bold\",color:u.text,textAlign:\"center\",shadow:!!a}},position:{x:c.textCenterX,y:G(\"30%\",c),anchor:\"center\"},animation:{type:\"fadeIn\",duration:1.5}}),p.push({type:\"shape\",id:\"separator\",content:{shape:\"rect\",fill:`${u.text}33`},position:{x:c.textCenterX,y:G(\"42%\",c),width:\"30%\",height:\"2px\",anchor:\"center\"}}),p.push({type:\"text\",id:\"definition\",content:{text:r,style:{fontSize:d,color:s.colors.text,textAlign:\"center\",lineHeight:1.6,maxLines:4,shadow:!!a}},position:{x:c.textCenterX,y:G(\"55%\",c),width:c.textWidth,anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:.8}}),o&&p.push({type:\"text\",id:\"origin\",content:{text:o,style:{fontSize:m,color:s.colors.textMuted,textAlign:\"center\",shadow:!!a}},position:{x:c.textCenterX,y:G(\"78%\",c),anchor:\"center\"},animation:{type:\"fadeIn\",duration:.8,delay:1.5}}),p}function _r(e,t){let{leftLabel:n,leftValue:r,rightLabel:o,rightValue:i,unit:a,colorScheme:s=\"blue\"}=e,{theme:u}=t,c=ye(t,s),f=P(28,t,false),d=P(48,t,true),m=Math.max(r,i,1),p=65,y=r/m*p,h=i/m*p,b=15,v=6,_=36,S=58,w=$=>$>=1e6?`${($/1e6).toFixed(1)}M`:$>=1e3?`${($/1e3).toFixed($>=1e4?0:1)}K`:$.toLocaleString(),A=a?`${w(r)} ${a}`:w(r),I=a?`${w(i)} ${a}`:w(i);return [{type:\"shape\",id:\"bg\",content:{shape:\"rect\",fill:`linear-gradient(180deg, ${u.colors.background} 0%, #0f1520 100%)`},position:{x:0,y:0,width:\"100%\",height:\"100%\"}},{type:\"text\",id:\"left-label\",content:{text:n,style:{fontSize:f,color:u.colors.textMuted}},position:{x:`${b}%`,y:`${_-8}%`}},{type:\"text\",id:\"left-value\",content:{text:A,style:{fontSize:d,fontWeight:\"bold\",color:c.text}},position:{x:`${b+y+2}%`,y:`${_-1}%`},animation:{type:\"fadeIn\",duration:.8,delay:.3}},{type:\"shape\",id:\"left-bar\",content:{shape:\"rect\",fill:c.text,borderRadius:4},position:{x:`${b}%`,y:`${_}%`,width:`${y}%`,height:`${v}%`},animation:{type:\"fadeIn\",duration:1}},{type:\"text\",id:\"right-label\",content:{text:o,style:{fontSize:f,color:u.colors.textMuted}},position:{x:`${b}%`,y:`${S-8}%`}},{type:\"text\",id:\"right-value\",content:{text:I,style:{fontSize:d,fontWeight:\"bold\",color:c.accent}},position:{x:`${b+h+2}%`,y:`${S-1}%`},animation:{type:\"fadeIn\",duration:.8,delay:.6}},{type:\"shape\",id:\"right-bar\",content:{shape:\"rect\",fill:c.accent,borderRadius:4},position:{x:`${b}%`,y:`${S}%`,width:`${h}%`,height:`${v}%`},animation:{type:\"fadeIn\",duration:1,delay:.3}}]}function xr(e,t){let{text:n,attribution:r,backgroundImage:o,ambientMotion:i}=e;if(!o?.src)return [];let a=P(52,t,true),s=P(24,t,false),u=P(200,t,true),c=[{type:\"image\",id:\"bg-image\",content:{src:o.src,alt:o.alt,fit:\"cover\",credit:o.credit,license:o.license},position:{x:0,y:0,width:\"100%\",height:\"100%\"},animation:i?{type:i,duration:15}:void 0},{type:\"shape\",id:\"overlay\",content:{shape:\"rect\",fill:\"rgba(0, 0, 0, 0.55)\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"}},{type:\"text\",id:\"deco-quote\",content:{text:\"\\u201C\",style:{fontSize:u,color:\"rgba(255, 255, 255, 0.08)\",textAlign:\"center\"}},position:{x:\"50%\",y:\"20%\",anchor:\"center\"}},{type:\"text\",id:\"quote-text\",content:{text:n,style:{fontSize:a,color:\"#ffffff\",textAlign:\"center\",lineHeight:1.5,shadow:true}},position:{x:\"50%\",y:r?\"45%\":\"50%\",anchor:\"center\",width:\"80%\"},animation:{type:\"fadeIn\",duration:2}}];return r&&c.push({type:\"text\",id:\"attribution\",content:{text:`\\u2014 ${r}`,style:{fontSize:s,color:\"rgba(255, 255, 255, 0.7)\",textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:\"72%\",anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:1.5}}),c}function vr(e,t){let{videoSrc:n,posterSrc:r,videoAlt:o,clipStart:i,clipEnd:a,sourceDuration:s,caption:u,captionPosition:c=\"bottom\",videoCredit:f,videoLicense:d}=e,m=u&&zt(u),{theme:p,layout:y}=t,h=P(36,t,false),b=P(16,t,false),v=[{type:\"video\",id:\"bg-video\",content:{src:n,posterSrc:r,alt:o,fit:\"cover\",clipStart:i,clipEnd:a,sourceDuration:s,credit:f,license:d},position:{x:0,y:0,width:\"100%\",height:\"100%\"}}];if(m){v.push({type:\"shape\",id:\"caption-gradient\",content:{shape:\"rect\",fill:\"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%)\"},position:{x:0,y:c===\"top\"?0:\"65%\",width:\"100%\",height:\"35%\"}});let _=c===\"top\"?\"15%\":c===\"center\"?\"50%\":\"82%\";v.push({type:\"text\",id:\"caption\",content:{text:m,style:{fontSize:h,color:p.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:_,anchor:\"center\",width:y.maxTextWidth},animation:{type:\"fadeIn\",duration:1.5,delay:.5}});}return f&&v.push({type:\"text\",id:\"credit\",content:{text:f,style:{fontSize:b,color:\"rgba(255, 255, 255, 0.5)\",textAlign:\"right\"}},position:{x:\"96%\",y:\"96%\",anchor:\"bottom-right\"}}),v}function kr(e,t){let{text:n,attribution:r,backgroundVideo:o}=e;if(!o?.src)return [];let i=P(52,t,true),a=P(24,t,false),s=P(200,t,true),u=[{type:\"video\",id:\"bg-video\",content:{src:o.src,posterSrc:o.posterSrc,alt:o.alt,fit:\"cover\",clipStart:o.clipStart,clipEnd:o.clipEnd,credit:o.credit,license:o.license},position:{x:0,y:0,width:\"100%\",height:\"100%\"}},{type:\"shape\",id:\"overlay\",content:{shape:\"rect\",fill:\"rgba(0, 0, 0, 0.55)\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"}},{type:\"text\",id:\"deco-quote\",content:{text:\"\\u201C\",style:{fontSize:s,color:\"rgba(255, 255, 255, 0.08)\",textAlign:\"center\"}},position:{x:\"50%\",y:\"20%\",anchor:\"center\"}},{type:\"text\",id:\"quote-text\",content:{text:n,style:{fontSize:i,color:\"#ffffff\",textAlign:\"center\",lineHeight:1.5,shadow:true}},position:{x:\"50%\",y:r?\"45%\":\"50%\",anchor:\"center\",width:\"80%\"},animation:{type:\"fadeIn\",duration:2}}];return r&&u.push({type:\"text\",id:\"attribution\",content:{text:`\\u2014 ${r}`,style:{fontSize:a,color:\"rgba(255, 255, 255, 0.7)\",textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:\"72%\",anchor:\"center\"},animation:{type:\"fadeIn\",duration:1,delay:1.5}}),u}function wr(e,t){let{heroSrc:n,heroAlt:r,title:o,subtitle:i,ambientMotion:a,heroCredit:s,heroLicense:u}=e,{theme:c,layout:f}=t,d=P(96,t,true),m=P(36,t,false),p=Pe(a),y=[{type:\"image\",id:\"cover-hero\",content:{src:n,alt:r||o,fit:\"cover\",credit:s,license:u},position:{x:0,y:0,width:\"100%\",height:\"100%\"},animation:p},{type:\"shape\",id:\"cover-gradient\",content:{shape:\"rect\",fill:\"linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 40%, rgba(0,0,0,0.1) 70%, transparent 100%)\"},position:{x:0,y:0,width:\"100%\",height:\"100%\"}},{type:\"text\",id:\"cover-title\",content:{text:o,style:{fontSize:d,fontWeight:\"bold\",color:c.colors.text,textAlign:\"center\",shadow:true}},position:{x:\"50%\",y:i?\"70%\":\"75%\",anchor:\"center\",width:f.maxTextWidth},animation:{type:\"fadeIn\",duration:.8}}];return i&&y.push({type:\"text\",id:\"cover-subtitle\",content:{text:i,style:{fontSize:m,color:c.colors.textMuted,textAlign:\"center\",lineHeight:1.5}},position:{x:\"50%\",y:\"82%\",anchor:\"center\",width:f.maxTextWidth},animation:{type:\"fadeIn\",duration:.8,delay:.2}}),y}function Vo(e){return {heroSrc:e.heroSrc,heroAlt:e.heroAlt,title:e.title,subtitle:e.subtitle,ambientMotion:e.ambientMotion,heroCredit:e.heroCredit,heroLicense:e.heroLicense}}function qt(e,t){let n=Vo(e);return wr(n,t)}var We={titleBlock:ir,sectionHeader:ar,statHighlight:lr,quoteBlock:cr,factCard:ur,twoColumn:dr,dateEvent:pr,imageWithCaption:fr,mapBlock:mr,fullBleedQuote:hr,listBlock:gr,photoGrid:yr,definitionCard:br,comparisonBar:_r,pullQuote:xr,videoWithCaption:vr,videoPullQuote:kr};function ct(e,t){let n=We[e.template];if(!n)return console.warn(`Unknown template: ${e.template}`),{id:e.id,startTime:0,duration:e.duration,audioSegment:e.audioSegment,transition:e.transition,template:e.template};let r;try{r=n(e,t),Array.isArray(r)||(console.error(`Template ${e.template} did not return an array, got:`,typeof r),r=[]);}catch(o){console.error(`Error expanding template ${e.template}:`,o),r=[];}return {id:e.id,startTime:0,duration:e.duration,audioSegment:e.audioSegment,...r.length>0?{layers:r}:{},transition:e.transition,template:e.template}}function Ot(e,t={}){let n=t,r=n.theme??fe,o=n.viewport??J.landscape,{persistentLayers:i,audioSegments:a}=n,s=e.length,u=He(i?.bottomLayers),c=He(i?.topLayers);if(!a||a.length===0){let m=0;return e.map((p,y)=>{let h=pe(r,y,s,o),b=ne(p)?ct(p,h):p,v=p,_=v.useBottomLayer!==false,S=v.useTopLayer!==false;return (u.length>0||c.length>0)&&(b.layers=[..._?u:[],...b.layers??[],...S?c:[]]),b.startTime=m,m+=b.duration,b})}let f=new Map;e.forEach((m,p)=>{let y=m.audioSegment??0;f.has(y)||f.set(y,[]),f.get(y).push({block:m,originalIndex:p});});let d=new Array(e.length);for(let[m,p]of f){let y=a[m];if(!y){let g=0;for(let{block:x,originalIndex:C}of p){let R=pe(r,C,s,o),M=ne(x)?ct(x,R):x,E=x,Y=E.useBottomLayer!==false,K=E.useTopLayer!==false;(u.length>0||c.length>0)&&(M.layers=[...Y?u:[],...M.layers??[],...K?c:[]]),M.startTime=g,g+=M.duration,d[C]=M;}continue}let h=[],b=[];for(let g of p)g.block.template===\"sectionHeader\"?h.push(g):b.push(g);let v=h.reduce((g,{block:x})=>g+(x.duration??0),0),_=b.reduce((g,{block:x})=>g+(x.duration??0),0),S=y.duration-v,w=_>0&&S>0?S/_:1,A=[];for(let{block:g,originalIndex:x}of p){let C=pe(r,x,s,o),R=ne(g)?ct(g,C):g,M=g,E=M.useBottomLayer!==false,Y=M.useTopLayer!==false;(u.length>0||c.length>0)&&(R.layers=[...E?u:[],...R.layers??[],...Y?c:[]]),A.push({block:R,originalIndex:x,templateBlock:M,hasSourceTiming:typeof M.sourceStartTime==\"number\"});}let I=A.some(g=>g.hasSourceTiming);A.sort((g,x)=>{if(I){let C=g.templateBlock.template===\"sectionHeader\",R=x.templateBlock.template===\"sectionHeader\";if(C&&!R)return -1;if(!C&&R)return 1;if(g.hasSourceTiming&&x.hasSourceTiming)return g.templateBlock.sourceStartTime-x.templateBlock.sourceStartTime;if(g.hasSourceTiming&&!x.hasSourceTiming)return -1;if(!g.hasSourceTiming&&x.hasSourceTiming)return 1}return g.originalIndex-x.originalIndex});let $=0;for(let g=0;g<A.length;g++){let x=A[g],{block:C,templateBlock:R}=x;if(x.hasSourceTiming){let M=R.sourceStartTime;C.startTime=y.startTime+M,typeof R.sourceDuration==\"number\"&&(C.duration=Math.max(5,R.sourceDuration)),$=M+C.duration;}else if(R.template===\"sectionHeader\")C.startTime=y.startTime+$,$+=C.duration;else {C.startTime=y.startTime+$;let M=C.duration*w;C.duration=M,$+=M;}d[x.originalIndex]=C;}let N=A.map(g=>d[g.originalIndex]).sort((g,x)=>g.startTime-x.startTime);for(let g=0;g<N.length-1;g++){let x=N[g],C=N[g+1],R=x.startTime+x.duration;R>C.startTime?x.duration=C.startTime-x.startTime:R<C.startTime-.5&&(x.duration=Math.max(.1,C.startTime-x.startTime));}let W=5,U=y.startTime+y.duration;for(;N.length>1;){let g=N[N.length-1];if(U-g.startTime<W&&g.template!==\"sectionHeader\"){let C=N[N.length-2];C.duration=U-C.startTime,g.duration=0,g.startTime=U,N.pop();}else {g.startTime+g.duration<U&&(g.duration=U-g.startTime);break}}if(N.length===1){let g=N[0];g.startTime+g.duration<U&&(g.duration=U-g.startTime);}let se=true;for(;se;){se=false;for(let g=N.length-1;g>=1;g--){let x=N[g];if(x.duration>0&&x.duration<W){let C=N[g-1],R=x.startTime+x.duration;C.duration=R-C.startTime,x.duration=0,x.startTime=U,N.splice(g,1),se=true;break}}}let k=20;for(let g=0;g<N.length;g++){let x=N[g];if(x.duration>k){let C=Math.ceil(x.duration/k),R=x.duration/C;if(R>=W){x.duration=R;for(let M=1;M<C;M++){let E={id:`${x.id}-split-${M}`,startTime:x.startTime+M*R,duration:R,audioSegment:x.audioSegment,layers:(x.layers??[]).map(Y=>({...Y,id:`${Y.id}-split-${M}`})),transition:{type:\"dissolve\",duration:1},template:x.template};d.push(E);}}}}}return d.filter(m=>m&&m.duration>0)}function Ht(e){return e in We}function ae(e,t=0){if(!e||e.type===\"none\")return {className:\"\",style:{}};let n=Uo(e),r=Yo(e);return {className:n,style:r}}function Uo(e){let{type:t,direction:n,panDirection:r}=e;switch(t){case \"fadeIn\":return \"anim-fadeIn\";case \"fadeOut\":return \"anim-fadeOut\";case \"slowZoom\":return r===\"left\"?\"anim-slowZoom-panLeft\":r===\"right\"?\"anim-slowZoom-panRight\":n===\"out\"?\"anim-slowZoom-out\":\"anim-slowZoom-in\";case \"zoomIn\":return \"anim-zoomIn\";case \"zoomOut\":return \"anim-zoomOut\";case \"panLeft\":return \"anim-panLeft\";case \"panRight\":return \"anim-panRight\";case \"typewriter\":return \"anim-typewriter\";default:return \"\"}}function Yo(e){let t={};return e.duration!==void 0&&(t[\"--anim-duration\"]=`${e.duration}s`),e.delay!==void 0&&(t[\"--anim-delay\"]=`${e.delay}s`),e.easing&&(t[\"--anim-easing\"]=e.easing),t}function Ve(e,t){return `transition-${e}-${t?\"enter\":\"exit\"}`}function Wt(e,t={}){let n=t.theme??fe,r=t.viewport??J.landscape,o=t.blockIndex??0,i=t.totalBlocks??1,a=e.layers;if(a&&a.length>0&&!ne(e))return Ft(a,e,t);if(ne(e)&&e.template in We){let s=e.template,u=pe(n,o,i,r),c;try{let f=We[s];c=f(e,u),Array.isArray(c)||(console.error(`Template ${s} did not return an array, got:`,typeof c),c=[]);}catch(f){console.error(`Error expanding template ${s}:`,f),c=[];}return Ft(c,e,t)}return Ft([],e,t)}function Ft(e,t,n){let{persistentLayers:r}=n;if(!r)return e;let o=He(r.bottomLayers),i=He(r.topLayers);if(o.length===0&&i.length===0)return e;let a=t,s=a.useBottomLayer!==false,u=a.useTopLayer!==false;return [...s?o:[],...e,...u?i:[]]}function H(e,t){return typeof e==\"number\"?e:e.endsWith(\"%\")?parseFloat(e)/100*t:parseFloat(e)}function Be(e,t,n){switch(e){case \"center\":return {x:-t/2,y:-n/2};case \"top-right\":return {x:-t,y:0};case \"bottom-left\":return {x:0,y:-n};case \"bottom-right\":return {x:-t,y:-n};default:return {x:0,y:0}}}var Vt=ot(null);function Zo(){return Bt(Vt)}function Ue(e,t){let n=Zo(),r=e.startsWith(\"http\")||e.startsWith(\"/\")||e.startsWith(\"data:\")||e.startsWith(\"blob:\"),o=F(()=>r?e:`${t}/${e}`,[r,e,t]),i=!r&&!!n,[a,s]=O(o);return D(()=>{if(!i){s(o);return}let u=false;return n.resolveUrl(e).then(c=>{u||s(c);}),()=>{u=true;}},[i,n,e,o]),i?a:o}var Go=0;function l(e,t,n,r,o,i){t||(t={});var a,s,u=t;if(\"ref\"in u)for(s in u={},t)s==\"ref\"?a=t[s]:u[s]=t[s];var c={type:e,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Go,__i:-1,__u:0,__source:o,__self:i};if(typeof e==\"function\"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return B.vnode&&B.vnode(c),c}function Sr({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,s=H(i.x,n.width),u=H(i.y,n.height),c=i.width?H(i.width,n.width):n.width,f=i.height?H(i.height,n.height):n.height,d=Be(i.anchor,c,f),m=s+d.x,p=u+d.y,y=Ue(o.src,t),h=ae(a,r),b=Qo(o.fit),v=o.fit===\"cover\",_=a&&Ko.has(a.type);if(v&&_&&a){let S=Jo(a),w=ae(S,r);return l(\"g\",{className:\"block-layer block-layer--image\",\"data-layer-id\":e.id,children:l(\"foreignObject\",{x:m,y:p,width:c,height:f,children:l(\"div\",{style:{width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:l(\"img\",{src:y,alt:o.alt||\"\",className:w.className,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:\"center\",display:\"block\",pointerEvents:\"none\",transformOrigin:\"center center\",...w.style}})})})})}return v?l(\"g\",{className:`block-layer block-layer--image ${h.className}`,style:h.style,\"data-layer-id\":e.id,children:l(\"foreignObject\",{x:m,y:p,width:c,height:f,children:l(\"img\",{src:y,alt:o.alt||\"\",style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:\"center\",display:\"block\",pointerEvents:\"none\"}})})}):l(\"g\",{className:`block-layer block-layer--image ${h.className}`,style:h.style,\"data-layer-id\":e.id,children:l(\"image\",{href:y,x:m,y:p,width:c,height:f,preserveAspectRatio:b,style:{pointerEvents:\"none\"}})})}function Qo(e){switch(e){case \"cover\":return \"xMidYMid slice\";case \"fill\":return \"none\";default:return \"xMidYMid meet\"}}var Ko=new Set([\"panLeft\",\"panRight\",\"slowZoom\",\"zoomIn\",\"zoomOut\"]);function Jo(e){switch(e.type){case \"panLeft\":return {...e,type:\"slowZoom\",panDirection:\"left\"};case \"panRight\":return {...e,type:\"slowZoom\",panDirection:\"right\"};case \"zoomIn\":return {...e,type:\"slowZoom\",direction:\"in\"};case \"zoomOut\":return {...e,type:\"slowZoom\",direction:\"out\"};default:return e}}function Tr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,{text:a,style:s}=r,u=H(o.x,t.width),c=H(o.y,t.height),f=o.width?H(o.width,t.width):void 0,d=ei(s.textAlign,o.anchor),m=ti(o.anchor),p=ae(i,n),y=a.split(`\n`),h=f?y.reduce((w,A)=>w.concat(ri(A,s.fontSize,f)),[]):y;if(s.maxLines&&h.length>s.maxLines){h=h.slice(0,s.maxLines);let w=h[h.length-1];h[h.length-1]=w.replace(/\\s*$/,\"\")+\"...\";}let b=s.lineHeight||1.4,v=s.fontSize*b,_={fontSize:`${s.fontSize}px`,fontFamily:s.fontFamily||Nt,fontWeight:s.fontWeight||\"normal\",fill:s.color,...p.style},S=s.shadow?`shadow-${e.id}`:void 0;return l(\"g\",{className:`block-layer block-layer--text ${p.className}`,\"data-layer-id\":e.id,children:[s.shadow&&l(\"defs\",{children:l(\"filter\",{id:S,x:\"-20%\",y:\"-20%\",width:\"140%\",height:\"140%\",children:l(\"feDropShadow\",{dx:\"0\",dy:\"2\",stdDeviation:\"3\",floodColor:\"rgba(0,0,0,0.7)\"})})}),s.background&&l(\"rect\",{x:u-(s.padding||16),y:c-s.fontSize-(s.padding||16),width:ni(h,s)+(s.padding||16)*2,height:h.length*v+(s.padding||16)*2,fill:s.background,rx:4,ry:4}),l(\"text\",{x:u,y:c,textAnchor:d,dominantBaseline:m,style:_,filter:S?`url(#${S})`:void 0,children:h.map((w,A)=>l(\"tspan\",{x:u,dy:A===0?0:v,children:[w||\"\\xA0\",\" \"]},A))})]})}function ei(e,t){return e===\"center\"?\"middle\":e===\"right\"?\"end\":e===\"left\"?\"start\":t?.includes(\"right\")?\"end\":t===\"center\"?\"middle\":\"start\"}function ti(e){return e?.includes(\"bottom\")?\"text-after-edge\":e===\"center\"?\"middle\":\"text-before-edge\"}function ni(e,t){return Math.max(...e.map(r=>r.length))*t.fontSize*.55}function ri(e,t,n){if(!e.trim())return [\"\"];let r=t*.5,o=Math.floor(n/r);if(o<=0)return [e];let i=e.split(/\\s+/),a=[],s=\"\";for(let u of i){let c=s?`${s} ${u}`:u;if(c.length<=o)s=c;else if(s&&a.push(s),u.length>o){let f=u;for(;f.length>o;)a.push(f.slice(0,o)),f=f.slice(o);s=f;}else s=u;}return s&&a.push(s),a.length>0?a:[\"\"]}function Cr({layer:e,viewport:t,blockTime:n}){let{content:r,position:o,animation:i}=e,a=H(o.x,t.width),s=H(o.y,t.height),u=o.width?H(o.width,t.width):100,c=o.height?H(o.height,t.height):100,f=ae(i,n),d=r.fill||\"none\",m=typeof d==\"string\"&&d.includes(\"gradient(\");if(r.shape===\"rect\"&&m)return l(\"g\",{className:`block-layer block-layer--shape ${f.className}`,style:f.style,\"data-layer-id\":e.id,children:l(\"foreignObject\",{x:a,y:s,width:u,height:c,children:l(\"div\",{style:{width:\"100%\",height:\"100%\",background:d,borderRadius:r.borderRadius?`${r.borderRadius}px`:void 0,pointerEvents:\"none\"}})})});let p={fill:d,stroke:r.stroke,strokeWidth:r.strokeWidth};return l(\"g\",{className:`block-layer block-layer--shape ${f.className}`,style:f.style,\"data-layer-id\":e.id,children:[r.shape===\"rect\"&&l(\"rect\",{x:a,y:s,width:u,height:c,rx:r.borderRadius,ry:r.borderRadius,...p}),r.shape===\"circle\"&&l(\"circle\",{cx:a+u/2,cy:s+c/2,r:Math.min(u,c)/2,...p}),r.shape===\"line\"&&l(\"line\",{x1:a,y1:s,x2:a+u,y2:s+c,stroke:r.stroke||\"#ffffff\",strokeWidth:r.strokeWidth||2})]})}var oi={terrain:{url:\"https://tile.opentopomap.org/{z}/{x}/{y}.png\",attribution:\"Map: OpenTopoMap (CC-BY-SA)\",maxZoom:17},road:{url:\"https://tile.openstreetmap.org/{z}/{x}/{y}.png\",attribution:\"\\xA9 OpenStreetMap contributors\",maxZoom:19},satellite:{url:\"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}\",attribution:\"Imagery: Esri, Maxar, Earthstar\",maxZoom:18},toner:{url:\"https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png\",attribution:\"Map: Stadia Maps, Stamen Design\",maxZoom:20},watercolor:{url:\"https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg\",attribution:\"Map: Stadia Maps, Stamen Design\",maxZoom:16}};function Ut(e,t,n){let r=Math.pow(2,n),o=Math.floor((t+180)/360*r),i=e*Math.PI/180,a=Math.floor((1-Math.log(Math.tan(i)+1/Math.cos(i))/Math.PI)/2*r);return {x:o,y:a}}function Yt(e,t,n,r=256){let o=Math.pow(2,n),i=(t+180)/360*o,a=e*Math.PI/180,s=(1-Math.log(Math.tan(a)+1/Math.cos(a))/Math.PI)/2*o;return {x:(i-Math.floor(i))*r,y:(s-Math.floor(s))*r}}function ii(e,t,n,r,o,i=256){let a=Ut(e,t,n),s=Yt(e,t,n,i),u=Math.ceil(r/i)+1,c=Math.ceil(o/i)+1,f=a.x-Math.floor(u/2),d=a.y-Math.floor(c/2),m=r/2-s.x,p=o/2-s.y,y=[];for(let h=0;h<c;h++)for(let b=0;b<u;b++){let v=f+b,_=d+h,S=m+(v-a.x)*i,w=p+(_-a.y)*i;y.push({x:v,y:_,screenX:S,screenY:w});}return y}function ai(e,t,n,r){return e.url.replace(\"{z}\",String(r)).replace(\"{x}\",String(t)).replace(\"{y}\",String(n))}async function si(e){return new Promise((t,n)=>{let r=new Image;r.crossOrigin=\"anonymous\",r.onload=()=>t(r),r.onerror=()=>n(new Error(`Failed to load tile: ${e}`)),r.src=e;})}async function Ar(e){let{center:t,zoom:n,style:r,width:o,height:i,markers:a=[],showAttribution:s=true}=e,u=oi[r],c=u.tileSize||256,f=Math.min(n,u.maxZoom),d=document.createElement(\"canvas\");d.width=o,d.height=i;let m=d.getContext(\"2d\");if(!m)throw new Error(\"Failed to get canvas context\");m.fillStyle=r===\"toner\"?\"#ffffff\":\"#e5e7eb\",m.fillRect(0,0,o,i);let y=ii(t.lat,t.lng,f,o,i,c).map(async h=>{let b=ai(u,h.x,h.y,f);try{let v=await si(b);m.drawImage(v,h.screenX,h.screenY,c,c);}catch(v){console.warn(`Tile load failed: ${b}`,v);}});await Promise.all(y);for(let h of a)li(m,h,t,f,o,i,c);return s&&ui(m,u.attribution,o,i),d.toDataURL(\"image/png\")}function li(e,t,n,r,o,i,a){let s=Ut(n.lat,n.lng,r),u=Ut(t.lat,t.lng,r),c=Yt(n.lat,n.lng,r,a),f=Yt(t.lat,t.lng,r,a),d=(u.x-s.x)*a+(f.x-c.x),m=(u.y-s.y)*a+(f.y-c.y),p=o/2+d,y=i/2+m,h=t.color||\"#ef4444\",b=t.icon||\"pin\";e.save(),b===\"pin\"?(e.fillStyle=h,e.beginPath(),e.arc(p,y-12,8,Math.PI,0,false),e.lineTo(p,y),e.closePath(),e.fill(),e.fillStyle=\"#ffffff\",e.beginPath(),e.arc(p,y-12,3,0,Math.PI*2),e.fill()):b===\"circle\"?(e.fillStyle=h,e.beginPath(),e.arc(p,y,8,0,Math.PI*2),e.fill(),e.strokeStyle=\"#ffffff\",e.lineWidth=2,e.stroke()):b===\"star\"&&(e.fillStyle=h,ci(e,p,y,5,10,5),e.fill()),t.label&&(e.fillStyle=\"#1f2937\",e.font=\"bold 12px system-ui, sans-serif\",e.textAlign=\"center\",e.fillText(t.label,p,y+20)),e.restore();}function ci(e,t,n,r,o,i){let a=Math.PI/2*3,s=Math.PI/r;e.beginPath(),e.moveTo(t,n-o);for(let u=0;u<r;u++)e.lineTo(t+Math.cos(a)*o,n+Math.sin(a)*o),a+=s,e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i),a+=s;e.lineTo(t,n-o),e.closePath();}function ui(e,t,n,r){e.save(),e.fillStyle=\"rgba(255, 255, 255, 0.8)\";let o=4;e.font=\"10px system-ui, sans-serif\";let i=e.measureText(t).width;e.fillRect(n-i-o*2-4,r-16,i+o*2,14),e.fillStyle=\"#374151\",e.textAlign=\"right\",e.fillText(t,n-o-4,r-5),e.restore();}function Mr({layer:e,basePath:t,viewport:n,blockTime:r}){let{content:o,position:i,animation:a}=e,[s,u]=O(null),[c,f]=O(true),[d,m]=O(null),p=H(i.x,n.width),y=H(i.y,n.height),h=i.width?H(i.width,n.width):n.width,b=i.height?H(i.height,n.height):n.height,v=Be(i.anchor,h,b),_=p+v.x,S=y+v.y;D(()=>{let A=false;if(o.staticSrc){let I=o.staticSrc.startsWith(\"http\")?o.staticSrc:`${t}/${o.staticSrc}`;u(I),f(false);return}return f(true),m(null),Ar({center:o.center,zoom:o.zoom,style:o.style,width:h,height:b,markers:o.markers,showAttribution:o.showAttribution!==false}).then(I=>{A||(u(I),f(false));}).catch(I=>{A||(console.error(\"Failed to compose map:\",I),m(I instanceof Error?I.message:String(I)),f(false));}),()=>{A=true;}},[o.center.lat,o.center.lng,o.zoom,o.style,o.staticSrc,h,b,t]);let w=ae(a,r);return c?l(\"g\",{className:`block-layer block-layer--map ${w.className}`,style:w.style,\"data-layer-id\":e.id,children:[l(\"rect\",{x:_,y:S,width:h,height:b,fill:\"#e5e7eb\"}),l(\"text\",{x:_+h/2,y:S+b/2,textAnchor:\"middle\",dominantBaseline:\"middle\",fill:\"#9ca3af\",fontSize:\"24\",fontFamily:\"system-ui, sans-serif\",children:\"Loading map...\"})]}):d||!s?l(\"g\",{className:`block-layer block-layer--map ${w.className}`,style:w.style,\"data-layer-id\":e.id,children:[l(\"rect\",{x:_,y:S,width:h,height:b,fill:\"#fef2f2\"}),l(\"text\",{x:_+h/2,y:S+b/2,textAnchor:\"middle\",dominantBaseline:\"middle\",fill:\"#dc2626\",fontSize:\"18\",fontFamily:\"system-ui, sans-serif\",children:\"Map failed to load\"})]}):l(\"g\",{className:`block-layer block-layer--map ${w.className}`,style:w.style,\"data-layer-id\":e.id,children:[l(\"defs\",{children:l(\"clipPath\",{id:`clip-${e.id}`,children:l(\"rect\",{x:_,y:S,width:h,height:b})})}),l(\"g\",{clipPath:`url(#clip-${e.id})`,children:l(\"image\",{href:s,x:_,y:S,width:h,height:b,preserveAspectRatio:\"xMidYMid slice\",style:{pointerEvents:\"none\"}})})]})}function Lr({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){let{content:i,position:a}=e,s=q(null),u=q(false),c=H(a.x,n.width),f=H(a.y,n.height),d=a.width?H(a.width,n.width):n.width,m=a.height?H(a.height,n.height):n.height,p=Be(a.anchor,d,m),y=c+p.x,h=f+p.y,b=Ue(i.src,t),v=Ue(i.posterSrc||\"\",t),_=i.posterSrc?v:void 0;return D(()=>{let S=s.current;if(!S)return;if(S.currentTime=i.clipStart,u.current=true,o){let A=S.play();A&&A.catch(()=>{});}let w=()=>{S.currentTime>=i.clipEnd&&(S.pause(),S.currentTime=i.clipEnd);};return S.addEventListener(\"timeupdate\",w),()=>{S.removeEventListener(\"timeupdate\",w),S.pause();}},[i.src,i.clipStart,i.clipEnd]),D(()=>{let S=s.current;if(!(!S||!u.current)&&!(S.currentTime>=i.clipEnd))if(o){let w=S.play();w&&w.catch(()=>{});}else S.pause();},[o,i.clipEnd]),l(\"g\",{className:\"block-layer block-layer--video\",\"data-layer-id\":e.id,children:l(\"foreignObject\",{x:y,y:h,width:d,height:m,children:l(\"video\",{ref:s,src:b,poster:_,muted:true,playsInline:true,preload:\"auto\",\"data-clip-start\":i.clipStart,\"data-clip-end\":i.clipEnd,style:{width:\"100%\",height:\"100%\",objectFit:i.fit||\"cover\",objectPosition:\"center\",display:\"block\",pointerEvents:\"none\"}})})})}var di={width:1920,height:1080};function Ee({block:e,blockTime:t,basePath:n,isEntering:r=false,isExiting:o=false,viewport:i=di,isPlaying:a}){let s=\"\",u={};e.transition&&r?(s=Ve(e.transition.type,true),u[\"--transition-duration\"]=`${e.transition.duration}s`):e.transition&&o&&(s=Ve(e.transition.type,false),u[\"--transition-duration\"]=`${e.transition.duration}s`);let c=`vb-clip-${e.id}`;return l(\"svg\",{className:`block-svg ${s}`,style:u,viewBox:`0 0 ${i.width} ${i.height}`,preserveAspectRatio:\"xMidYMid meet\",overflow:\"hidden\",\"data-block-id\":e.id,children:[l(\"defs\",{children:l(\"clipPath\",{id:c,children:l(\"rect\",{x:\"0\",y:\"0\",width:i.width,height:i.height})})}),l(\"g\",{clipPath:`url(#${c})`,children:(e.layers??[]).map(f=>l(pi,{layer:f,basePath:n,viewport:i,blockTime:t,isPlaying:a},f.id))})]})}function pi({layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o}){switch(e.type){case \"image\":return l(Sr,{layer:e,basePath:t,viewport:n,blockTime:r});case \"text\":return l(Tr,{layer:e,viewport:n,blockTime:r});case \"shape\":return l(Cr,{layer:e,viewport:n,blockTime:r});case \"map\":return l(Mr,{layer:e,basePath:t,viewport:n,blockTime:r});case \"video\":return l(Lr,{layer:e,basePath:t,viewport:n,blockTime:r,isPlaying:o});default:return console.warn(`Unknown layer type: ${e.type}`),null}}function Pr({captions:e,currentTime:t,enabled:n=true,fontSize:r=16}){let i=(n&&e?qe(e,t):null)?.text??null;return l(\"div\",{className:\"caption-overlay\",style:{position:\"absolute\",top:\"6px\",left:\"50%\",transform:\"translateX(-50%)\",zIndex:50,pointerEvents:\"none\",maxWidth:\"100%\",width:\"100%\",textAlign:\"center\",opacity:i?1:0,transition:\"opacity 0.15s ease-in-out\",padding:\"0 4px\",boxSizing:\"border-box\"},children:i&&l(\"div\",{style:{display:\"inline-block\",padding:\"3px 10px\",background:\"rgba(0, 0, 0, 0.65)\",borderRadius:\"4px\",backdropFilter:\"blur(4px)\"},children:l(\"span\",{style:{color:\"#ffffff\",fontSize:`${r}px`,fontFamily:\"'Hanken Grotesk', system-ui, sans-serif\",fontWeight:500,lineHeight:1.25,textShadow:\"0 1px 3px rgba(0,0,0,0.5)\",whiteSpace:\"pre-wrap\",wordWrap:\"break-word\"},children:i})})})}function Br(e,t,n=\"\"){let[r,o]=O(0),[i,a]=O(false),[s,u]=O(0),[c,f]=O(false),[d,m]=O(false),[p,y]=O(0),h=q([]),b=q(null),v=q(false),_=q(new Map),S=q(new Map),w=q(false);D(()=>{if(!t?.segments)return;let k=0;h.current=t.segments.map(g=>{let x=k;return k+=g.duration,x}),y(k);},[t]);let A=j(async k=>{let g=n?`${n}/${k}`:k;if(_.current.has(k))return _.current.get(k);if(S.current.has(k))return S.current.get(k);let x=(async()=>{try{let C=await fetch(g);if(!C.ok)throw new Error(`HTTP ${C.status}`);let R=await C.blob(),M=URL.createObjectURL(R);return _.current.set(k,M),M}catch{return g}finally{S.current.delete(k);}})();return S.current.set(k,x),x},[n]);D(()=>{if(!t?.segments)return;t.segments.forEach(g=>{A(g.src);});let k=_.current;return ()=>{k.forEach(g=>{URL.revokeObjectURL(g);}),k.clear();}},[t,A]),D(()=>{let k=e.current;if(!k)return;let g=()=>{let Y=(h.current[s]||0)+k.currentTime;o(Y);},x=()=>{w.current=false,a(true);},C=()=>a(false),R=()=>{m(true);},M=()=>{t&&s<t.segments.length-1?(v.current=true,u(E=>E+1)):(f(true),a(false));};return k.addEventListener(\"timeupdate\",g),k.addEventListener(\"play\",x),k.addEventListener(\"pause\",C),k.addEventListener(\"ended\",M),k.addEventListener(\"error\",R),()=>{k.removeEventListener(\"timeupdate\",g),k.removeEventListener(\"play\",x),k.removeEventListener(\"pause\",C),k.removeEventListener(\"ended\",M),k.removeEventListener(\"error\",R);}},[e,s,t]),D(()=>{let k=e.current;if(!k||!t?.segments)return;let g=t.segments[s];if(!g)return;let x=()=>{if(b.current!==null){let E=h.current[s]||0,Y=b.current-E;k.currentTime=Math.max(0,Y),o(b.current),b.current=null;}v.current&&(k.play().catch(()=>{}),v.current=false);},C=k.src,R=_.current.get(g.src);C&&(C===R||C.endsWith(g.src))?x():(async()=>{let Y=await A(g.src),K=()=>{m(true),x(),k.removeEventListener(\"canplay\",K);};k.addEventListener(\"canplay\",K),k.src=Y,k.load(),await Promise.resolve(),k.readyState>=3&&(k.removeEventListener(\"canplay\",K),m(true),x());})();},[e,s,t,A]);let I=j(()=>{let k=e.current;k&&(c&&(u(0),f(false)),k.play().then(()=>{w.current=false;}).catch(()=>{w.current=true,a(true);}));},[e,c]),$=j(()=>{let k=e.current;k&&k.pause(),a(false);},[e]),N=j(()=>{e.current&&(i?$():I());},[e,i,I,$]),W=j(k=>{let g=e.current;if(!g||!t?.segments)return;let x=Math.max(0,Math.min(k,p)),C=0,R=0;for(let E=0;E<t.segments.length;E++){let Y=R+t.segments[E].duration;if(x<Y){C=E;break}R=Y,E===t.segments.length-1&&(C=E);}let M=!g.paused;if(f(false),C!==s)b.current=x,v.current=M,u(C);else {let E=x-R;g.currentTime=Math.max(0,E),o(x);}},[e,t,s,p]),U=j(k=>{!t?.segments||k<0||k>=t.segments.length||(u(k),f(false));},[t]),se=j(async()=>{W(0),await new Promise(k=>setTimeout(k,50)),I();},[W,I]);return D(()=>{if(!i||!w.current||!p)return;let k=performance.now(),g,x=C=>{if(!w.current)return;let R=(C-k)/1e3;k=C,o(M=>{let E=M+R;return E>=p?(w.current=false,f(true),a(false),p):E}),g=requestAnimationFrame(x);};return g=requestAnimationFrame(x),()=>cancelAnimationFrame(g)},[i,p]),{currentTime:r,isPlaying:i,currentSegment:s,totalDuration:p,isEnded:c,isReady:d,isAvailable:true,play:async()=>I(),pause:async()=>$(),toggle:async()=>N(),seekTo:async k=>W(k),skipToSegment:async k=>U(k),restart:se}}function Er(e,t,n=J.landscape,r=false,o){let [i,a]=O({entering:false,exiting:false,previousBlock:null}),s=F(()=>{if(!e?.blocks)return [];if(e.blocks.some(ne)){let I=e.audio?.segments?.map(N=>({startTime:N.startTime,duration:N.duration}));return Ot(e.blocks,{audioSegments:I,viewport:n,persistentLayers:e.persistentLayers,theme:o})}return e.blocks},[e?.blocks,e?.audio?.segments,e?.persistentLayers,n,o]),u=F(()=>It(s,t),[s,t]),c=F(()=>u?s.indexOf(u):-1,[s,u]),f=F(()=>u?Math.max(0,t-u.startTime):0,[u,t]),d=F(()=>!u||u.duration===0?0:Math.min(1,f/u.duration),[u,f]),m=F(()=>!e||e.duration===0?0:Math.min(1,t/e.duration),[e,t]);F(()=>u,[c]);D(()=>{if(!(!u||r)&&i.previousBlock?.id!==u.id){let I=u.transition?.duration||0;if(I>0){a({entering:true,exiting:true,previousBlock:i.previousBlock});let $=setTimeout(()=>{a({entering:false,exiting:false,previousBlock:u});},I*1e3);return ()=>clearTimeout($)}else a({entering:false,exiting:false,previousBlock:u});}},[u?.id,r]);let y=q(null);D(()=>{if(!(!r||!u)&&i.previousBlock?.id!==u.id){let A=i.previousBlock;y.current=A,a(I=>({...I,previousBlock:u}));}},[u?.id,r]);let h=u?.transition?.duration||0,b=r&&h>0&&f<h,v=b&&y.current!==null,_=j(A=>{if(!e||A<0||A>=s.length)return;let I=s[A];if(I)return I.startTime},[e,s]),S=j(()=>{if(c<s.length-1)return _(c+1)},[c,s.length,_]),w=j(()=>{if(c>0)return _(c-1)},[c,_]);return {currentBlock:u,currentBlockIndex:c,previousBlock:r?v?y.current:null:i.exiting?i.previousBlock:null,isEntering:r?b:i.entering,isExiting:r?v:i.exiting,blockTime:f,blockProgress:d,docProgress:m,nextBlock:S,prevBlock:w,goToBlock:_,blocks:s}}function fi(e,t){let n=e/t;return n>1.2?\"landscape\":n<.83?\"portrait\":\"landscape\"}function mi(e){switch(e){case \"portrait\":return J.portrait;case \"square\":return J.square;default:return J.landscape}}function Ir(){let[e,t]=O(()=>({width:typeof window<\"u\"?window.innerWidth:1920,height:typeof window<\"u\"?window.innerHeight:1080}));D(()=>{if(typeof window>\"u\")return;let o=()=>{t({width:window.innerWidth,height:window.innerHeight});},i,a=()=>{clearTimeout(i),i=setTimeout(o,100);};return window.addEventListener(\"resize\",a),()=>{window.removeEventListener(\"resize\",a),clearTimeout(i);}},[]);let n=F(()=>fi(e.width,e.height),[e.width,e.height]);return {viewport:F(()=>mi(n),[n]),orientation:n,windowSize:e}}function Ye(e){let t=Math.floor(e/60),n=Math.floor(e%60);return `${t}:${n.toString().padStart(2,\"0\")}`}function dt({state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}){let i=q(null),[a,s]=O(null),u=j(d=>{let m=i.current;if(!m)return;let p=m.getBoundingClientRect(),y=d.clientX-p.left,h=Math.max(0,Math.min(1,y/p.width));s(h);},[]),c=j(()=>{s(null);},[]),f=j(d=>{for(let m=r.length-1;m>=0;m--){let p=r[m];if(d>=p.startTime)return {block:p,index:m}}return r.length>0?{block:r[0],index:0}:null},[r]);return l(\"div\",{ref:i,style:{flex:1,height:\"24px\",cursor:\"pointer\",position:\"relative\",display:\"flex\",alignItems:\"center\"},onClick:d=>{let m=d.currentTarget.getBoundingClientRect(),y=(d.clientX-m.left)/m.width;t.seekTo(y*e.totalDuration);},onMouseMove:u,onMouseLeave:c,children:[l(\"div\",{style:{position:\"absolute\",left:0,right:0,height:\"6px\",background:\"rgba(255,255,255,0.2)\",borderRadius:\"3px\"}}),l(\"div\",{style:{position:\"absolute\",left:0,width:`${e.docProgress*100}%`,height:\"6px\",background:\"#3d5a80\",borderRadius:\"3px\",transition:\"width 0.1s\"}}),n.map((d,m)=>l(\"div\",{style:{position:\"absolute\",left:`${d.position}%`,transform:\"translateX(-50%)\",width:\"10px\",height:\"10px\",borderRadius:\"50%\",background:d.index===e.currentBlockIndex?\"#ffffff\":\"rgba(255,255,255,0.5)\",border:\"2px solid #3d5a80\",cursor:\"pointer\",zIndex:2,transition:\"transform 0.15s, background 0.15s\"},title:d.title,onClick:p=>{p.stopPropagation(),t.seekTo(d.block.startTime);},onMouseEnter:p=>{p.currentTarget.style.transform=\"translateX(-50%) scale(1.3)\";},onMouseLeave:p=>{p.currentTarget.style.transform=\"translateX(-50%)\";}},`${d.block.id}-${m}`)),a!==null&&l(\"div\",{style:{position:\"absolute\",left:`${a*100}%`,bottom:\"100%\",transform:\"translateX(-50%)\",marginBottom:\"8px\",padding:\"6px 10px\",background:\"rgba(0,0,0,0.9)\",borderRadius:\"4px\",whiteSpace:\"nowrap\",pointerEvents:\"none\",zIndex:10},children:[l(\"div\",{style:{color:\"white\",fontSize:\"12px\",fontFamily:\"monospace\"},children:Ye(a*e.totalDuration)}),(()=>{let d=a*e.totalDuration,m=f(d);return m&&o?l(\"div\",{style:{color:\"rgba(255,255,255,0.7)\",fontSize:\"11px\",marginTop:\"2px\"},children:o(m.block)}):null})()]}),a!==null&&l(\"div\",{style:{position:\"absolute\",left:`${a*100}%`,top:\"50%\",transform:\"translate(-50%, -50%)\",width:\"2px\",height:\"16px\",background:\"rgba(255,255,255,0.6)\",pointerEvents:\"none\",zIndex:1}})]})}function Rr({state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}){return l(\"div\",{className:\"doc-player__controls\",style:{position:\"absolute\",bottom:0,left:0,right:0,padding:\"12px 16px\",background:\"linear-gradient(transparent, rgba(0,0,0,0.8))\",display:\"flex\",alignItems:\"center\",gap:\"8px\",zIndex:100},children:[l(\"button\",{onClick:t.restart,style:{background:\"none\",border:\"none\",color:\"rgba(255,255,255,0.7)\",cursor:\"pointer\",padding:\"8px\",fontSize:\"14px\",display:\"flex\",alignItems:\"center\"},title:\"Restart\",\"aria-label\":\"Restart from beginning\",children:l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"18\",height:\"18\",children:l(\"path\",{d:\"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z\"})})}),l(\"button\",{onClick:t.toggle,style:{background:\"rgba(255,255,255,0.2)\",border:\"none\",borderRadius:\"50%\",color:\"white\",cursor:\"pointer\",padding:\"10px\",fontSize:\"16px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"40px\",height:\"40px\"},\"aria-label\":e.isPlaying?\"Pause\":\"Play\",children:e.isPlaying?l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"20\",height:\"20\",children:l(\"path\",{d:\"M6 19h4V5H6v14zm8-14v14h4V5h-4z\"})}):l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"20\",height:\"20\",children:l(\"path\",{d:\"M8 5v14l11-7z\"})})}),l(\"span\",{style:{color:\"white\",fontSize:\"12px\",minWidth:\"80px\",fontFamily:\"monospace\"},children:[Ye(e.currentTime),\" / \",Ye(e.totalDuration)]}),l(dt,{state:e,actions:t,blockMarkers:n,expandedBlocks:r,getBlockTitle:o}),l(\"span\",{style:{color:\"rgba(255,255,255,0.5)\",fontSize:\"11px\",whiteSpace:\"nowrap\"},children:[e.currentBlockIndex+1,\"/\",e.totalBlocks]}),e.hasCaptions&&l(\"button\",{onClick:()=>t.setCaptionsEnabled(!e.captionsEnabled),style:{background:e.captionsEnabled?\"rgba(255,255,255,0.2)\":\"none\",border:\"none\",color:e.captionsEnabled?\"white\":\"rgba(255,255,255,0.5)\",cursor:\"pointer\",padding:\"8px\",fontSize:\"12px\",display:\"flex\",alignItems:\"center\",borderRadius:\"4px\"},title:e.captionsEnabled?\"Hide captions\":\"Show captions\",\"aria-label\":e.captionsEnabled?\"Hide captions\":\"Show captions\",children:l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"18\",height:\"18\",children:l(\"path\",{d:\"M19 4H5a2 2 0 00-2 2v12a2 2 0 002 2h14a2 2 0 002-2V6a2 2 0 00-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1a1 1 0 01-1 1H7a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1a1 1 0 01-1 1h-3a1 1 0 01-1-1v-4a1 1 0 011-1h3a1 1 0 011 1v1z\"})})}),t.toggleFullscreen&&l(\"button\",{onClick:t.toggleFullscreen,style:{background:e.isFullscreen?\"rgba(255,255,255,0.2)\":\"none\",border:\"none\",color:e.isFullscreen?\"white\":\"rgba(255,255,255,0.5)\",cursor:\"pointer\",padding:\"8px\",display:\"flex\",alignItems:\"center\",borderRadius:\"4px\"},title:e.isFullscreen?\"Exit fullscreen (F)\":\"Fullscreen (F)\",\"aria-label\":e.isFullscreen?\"Exit fullscreen\":\"Enter fullscreen\",children:e.isFullscreen?l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"18\",height:\"18\",children:l(\"path\",{d:\"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z\"})}):l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"18\",height:\"18\",children:l(\"path\",{d:\"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z\"})})})]})}function $r({state:e,slideNav:t}){let{currentBlockIndex:n,totalBlocks:r}=e,o=n<=0,i=n>=r-1;return l(\"div\",{className:\"doc-controls-slideshow\",\"data-testid\":\"slideshow-controls\",style:{position:\"absolute\",bottom:\"16px\",right:\"16px\",display:\"flex\",alignItems:\"center\",gap:\"2px\",background:\"rgba(0, 0, 0, 0.65)\",borderRadius:\"8px\",padding:\"4px 6px\",zIndex:100,userSelect:\"none\",backdropFilter:\"blur(8px)\",WebkitBackdropFilter:\"blur(8px)\"},children:[l(\"button\",{onClick:a=>{a.stopPropagation(),t.prevSlide();},disabled:o,\"data-testid\":\"slide-prev\",\"aria-label\":\"Previous slide\",title:\"Previous slide\",style:{background:\"none\",border:\"none\",color:o?\"rgba(255,255,255,0.3)\":\"rgba(255,255,255,0.9)\",cursor:o?\"default\":\"pointer\",padding:\"6px 8px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",borderRadius:\"4px\",transition:\"background 0.15s\"},onMouseEnter:a=>{o||(a.currentTarget.style.background=\"rgba(255,255,255,0.1)\");},onMouseLeave:a=>{a.currentTarget.style.background=\"none\";},children:l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"18\",height:\"18\",children:l(\"path\",{d:\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"})})}),l(\"span\",{\"data-testid\":\"slide-counter\",style:{color:\"rgba(255,255,255,0.9)\",fontSize:\"13px\",fontFamily:'-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',fontVariantNumeric:\"tabular-nums\",minWidth:\"48px\",textAlign:\"center\",padding:\"0 4px\",letterSpacing:\"0.02em\"},children:r>0?`${n+1} / ${r}`:\"\\u2014\"}),l(\"button\",{onClick:a=>{a.stopPropagation(),t.nextSlide();},disabled:i,\"data-testid\":\"slide-next\",\"aria-label\":\"Next slide\",title:\"Next slide\",style:{background:\"none\",border:\"none\",color:i?\"rgba(255,255,255,0.3)\":\"rgba(255,255,255,0.9)\",cursor:i?\"default\":\"pointer\",padding:\"6px 8px\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",borderRadius:\"4px\",transition:\"background 0.15s\"},onMouseEnter:a=>{i||(a.currentTarget.style.background=\"rgba(255,255,255,0.1)\");},onMouseLeave:a=>{a.currentTarget.style.background=\"none\";},children:l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"currentColor\",width:\"18\",height:\"18\",children:l(\"path\",{d:\"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z\"})})})]})}function re(e,t=\"\"){return e.map((n,r)=>{let o=`${t}i${r}`;switch(n.type){case \"text\":return l(te,{children:n.value},o);case \"emphasis\":return l(\"em\",{className:\"squisq-md-em\",children:re(n.children,o)},o);case \"strong\":return l(\"strong\",{className:\"squisq-md-strong\",children:re(n.children,o)},o);case \"delete\":return l(\"del\",{className:\"squisq-md-del\",children:re(n.children,o)},o);case \"inlineCode\":return l(\"code\",{className:\"squisq-md-inline-code\",children:n.value},o);case \"link\":return l(\"a\",{className:\"squisq-md-link\",href:n.url,title:n.title??void 0,target:\"_blank\",rel:\"noopener noreferrer\",children:re(n.children,o)},o);case \"image\":return l(\"img\",{className:\"squisq-md-image\",src:n.url,alt:n.alt??\"\",title:n.title??void 0},o);case \"break\":return l(\"br\",{},o);case \"inlineMath\":return l(\"code\",{className:\"squisq-md-inline-math\",children:n.value},o);case \"htmlInline\":return l(\"span\",{className:\"squisq-md-html-inline\",dangerouslySetInnerHTML:{__html:n.rawHtml}},o);case \"footnoteReference\":return l(\"sup\",{className:\"squisq-md-footnote-ref\",children:l(\"a\",{href:`#fn-${n.identifier}`,children:[\"[\",n.label??n.identifier,\"]\"]})},o);case \"linkReference\":return l(\"span\",{className:\"squisq-md-link-ref\",children:re(n.children,o)},o);case \"imageReference\":return l(\"span\",{className:\"squisq-md-image-ref\",children:[\"[\",n.alt??n.identifier,\"]\"]},o);case \"textDirective\":return l(\"span\",{className:\"squisq-md-text-directive\",\"data-directive\":n.name,children:re(n.children,o)},o);default:return null}})}function gi(e,t){switch(e.type){case \"paragraph\":return l(\"p\",{className:\"squisq-md-p\",children:re(e.children,t)},t);case \"heading\":{let n=`h${e.depth}`;return l(n,{className:`squisq-md-heading squisq-md-h${e.depth}`,children:re(e.children,t)},t)}case \"blockquote\":return l(\"blockquote\",{className:\"squisq-md-blockquote\",children:Ie(e.children,t)},t);case \"list\":return e.ordered?l(\"ol\",{className:\"squisq-md-list squisq-md-ol\",start:e.start??void 0,children:e.children.map((n,r)=>Nr(n,`${t}li${r}`))},t):l(\"ul\",{className:\"squisq-md-list squisq-md-ul\",children:e.children.map((n,r)=>Nr(n,`${t}li${r}`))},t);case \"code\":return l(\"pre\",{className:\"squisq-md-code-block\",children:l(\"code\",{className:e.lang?`language-${e.lang}`:void 0,children:e.value})},t);case \"thematicBreak\":return l(\"hr\",{className:\"squisq-md-hr\"},t);case \"table\":return yi(e.children,e.align,t);case \"htmlBlock\":return l(\"div\",{className:\"squisq-md-html-block\",dangerouslySetInnerHTML:{__html:e.rawHtml}},t);case \"math\":return l(\"pre\",{className:\"squisq-md-math-block\",children:l(\"code\",{children:e.value})},t);case \"definition\":return null;case \"footnoteDefinition\":return l(\"div\",{className:\"squisq-md-footnote-def\",id:`fn-${e.identifier}`,children:[l(\"sup\",{children:e.label??e.identifier}),Ie(e.children,t)]},t);case \"containerDirective\":return l(\"div\",{className:`squisq-md-directive squisq-md-directive-${e.name}`,\"data-directive\":e.name,children:[e.label&&l(\"div\",{className:\"squisq-md-directive-label\",children:e.label}),Ie(e.children,t)]},t);case \"leafDirective\":return l(\"div\",{className:`squisq-md-directive squisq-md-directive-${e.name}`,\"data-directive\":e.name,children:re(e.children,t)},t);case \"definitionList\":return l(\"dl\",{className:\"squisq-md-dl\",children:e.children.map((n,r)=>n.type===\"definitionTerm\"?l(\"dt\",{className:\"squisq-md-dt\",children:re(n.children,`${t}dt${r}`)},`${t}dt${r}`):l(\"dd\",{className:\"squisq-md-dd\",children:Ie(n.children,`${t}dd${r}`)},`${t}dd${r}`))},t);default:return null}}function Nr(e,t){let n=e.checked!==null&&e.checked!==void 0;return l(\"li\",{className:`squisq-md-li${n?\" squisq-md-task\":\"\"}`,children:[n&&l(\"input\",{type:\"checkbox\",checked:!!e.checked,readOnly:true,className:\"squisq-md-checkbox\"}),Ie(e.children,t)]},t)}function yi(e,t,n){let[r,...o]=e;return l(\"table\",{className:\"squisq-md-table\",children:[r&&l(\"thead\",{children:l(\"tr\",{children:r.children.map((i,a)=>l(\"th\",{className:\"squisq-md-th\",style:t?.[a]?{textAlign:t[a]}:void 0,children:re(i.children,`${n}th${a}`)},`${n}th${a}`))})}),o.length>0&&l(\"tbody\",{children:o.map((i,a)=>l(\"tr\",{children:i.children.map((s,u)=>l(\"td\",{className:\"squisq-md-td\",style:t?.[u]?{textAlign:t[u]}:void 0,children:re(s.children,`${n}td${a}-${u}`)},`${n}td${a}-${u}`))},`${n}tr${a}`))})]},n)}function Ie(e,t=\"\"){return e.map((n,r)=>gi(n,`${t}b${r}`))}function pt({nodes:e,className:t}){return !e||e.length===0?null:l(\"div\",{className:`squisq-md ${t||\"\"}`,children:Ie(e)})}function bi(e){let t=e.sourceHeading?.templateAnnotation;return t?Ht(t.template):false}function Dr(e){let t=0;for(let n of e)t++,n.children&&(t+=Dr(n.children));return t}function Fr({block:e,basePath:t,viewport:n,renderContext:r,blockIndex:o}){let i=bi(e),a=F(()=>{if(!i)return null;let s=e.sourceHeading.templateAnnotation,u=xe(e.sourceHeading),c=_i(e.contents),f={id:e.id,template:s.template,startTime:0,duration:1,audioSegment:0,title:u,...vi(s.template,u,c,e.contents),...s.params,...e.templateOverrides},d={...r,blockIndex:o},m=Wt(f,d);return {...e,layers:m,template:s.template}},[e,i,r,o]);return l(\"div\",{className:\"squisq-linear-section\",\"data-block-id\":e.id,\"data-template\":i?e.sourceHeading?.templateAnnotation?.template:void 0,children:[e.sourceHeading&&!i&&l(pt,{nodes:[e.sourceHeading]}),i&&a&&l(\"div\",{className:\"squisq-linear-card\",children:[e.sourceHeading&&l(\"div\",{className:\"squisq-linear-card-label squisq-md\",children:l(pt,{nodes:[e.sourceHeading]})}),l(\"div\",{className:\"squisq-linear-card-svg\",style:{width:\"100%\",aspectRatio:`${n.width} / ${n.height}`,overflow:\"hidden\",borderRadius:\"8px\",boxShadow:\"0 2px 8px rgba(0, 0, 0, 0.12)\",marginBottom:\"1em\"},children:l(Ee,{block:a,blockTime:0,basePath:t,viewport:n})})]}),!i&&e.contents&&e.contents.length>0&&l(pt,{nodes:e.contents}),e.children&&e.children.length>0&&l(\"div\",{className:\"squisq-linear-children\",children:e.children.map((s,u)=>l(Fr,{block:s,basePath:t,viewport:n,renderContext:r,blockIndex:o+u+1},s.id))})]})}function _i(e){return !e||e.length===0?\"\":e.map(t=>xe(t)).join(`\n`).trim()}function xi(e){if(!e)return [];let t=[];for(let n of e)if(n.type===\"list\")for(let r of n.children){let o=xe(r).trim();o&&t.push(o);}return t}function vi(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:xi(r)||[\"Item 1\",\"Item 2\",\"Item 3\"]};case \"definitionCard\":return {term:t,definition:n||t};case \"dateEvent\":return {date:t,description:n||t};default:return {}}}function ft({doc:e,basePath:t=\"/\",viewport:n,className:r,theme:o}){let i=n??J.landscape,a=F(()=>Dr(e.blocks),[e.blocks]),s=F(()=>({theme:o??fe,viewport:i,totalBlocks:a}),[i,a,o]);return l(\"div\",{className:`squisq-linear ${r||\"\"}`,style:{width:\"100%\",height:\"100%\",overflowY:\"auto\",overflowX:\"hidden\"},children:l(\"div\",{className:\"squisq-linear-content\",style:{maxWidth:\"720px\",margin:\"0 auto\",padding:\"24px 16px\",lineHeight:1.7,fontSize:\"16px\",color:\"var(--squisq-text, #1f2937)\"},children:e.blocks.map((u,c)=>l(Fr,{block:u,basePath:t,viewport:i,renderContext:s,blockIndex:c},u.id))})})}var ki=new Set([\"a\",\"an\",\"the\",\"and\",\"but\",\"or\",\"for\",\"nor\",\"on\",\"at\",\"to\",\"in\",\"of\",\"by\",\"is\"]);function zr(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||!ki.has(a)?a.charAt(0).toUpperCase()+a.slice(1):a).join(\" \");t.set(n,i);}}return t}function qr({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:f,onCaptionsToggle:d,onPlaybackStateChange:m,onControlsReady:p,isFullscreen:y=false,onFullscreenToggle:h,onBlockMarkers:b,forceViewport:v,displayMode:_=\"video\",theme:S}){let w=_===\"slideshow\",A=_===\"linear\",I=q(null),$=q(null),[N,W]=O(null),U=q(),{viewport:se,orientation:k}=Ir(),g=v||(n?J.landscape:se),x=F(()=>typeof window>\"u\"?false:new URLSearchParams(window.location.search).get(\"debug\")===\"true\",[]),C=Br(I,e.audio,t),R=a||C,{currentTime:M,isPlaying:E,currentSegment:Y,totalDuration:K,isEnded:jt,isReady:Xt,isAvailable:Wr,unavailableMessage:Zt,play:je,pause:we,toggle:Se,seekTo:oe,skipToSegment:Li,restart:Gt}=R,ht=q(M);ht.current=M;let Qt=q(K);Qt.current=K;let Kt=q(0),Vr=j(T=>{if(n||w||A||T.target.closest(\"button, a, input, .doc-player__controls, .doc-player__scrubber, .doc-controls-sidebar, .doc-controls-slideshow\"))return;Se(),W(E?\"play\":\"pause\"),clearTimeout(U.current),U.current=setTimeout(()=>W(null),600);},[n,Se,E,w,A]),{currentBlock:_e,currentBlockIndex:me,previousBlock:Jt,isEntering:Ur,isExiting:Yr,blockTime:gt,docProgress:en,blocks:X}=Er(e,M,g,n,S),he=F(()=>{let T=e.startBlock;if(!T)return null;let L=pe(S??fe,0,1,g);return {id:\"cover-block\",startTime:-1,duration:0,audioSegment:-1,layers:qt(T,L)}},[e.startBlock,g,S]),[jr,tn]=O(false),[Xr,nn]=O(false),rn=q(),yt=q(false);he&&!E&&M===0&&!n&&!r&&(yt.current=true),D(()=>{if(E&&yt.current&&he&&!n)return yt.current=false,nn(true),rn.current=setTimeout(()=>nn(false),3e3),()=>clearTimeout(rn.current)},[E,he,n]);let Xe=!w&&!A&&he&&(jr||Xr||!E&&M===0&&!n&&!r),on=q(false);D(()=>{Xt&&r&&!on.current&&(on.current=true,je());},[Xt,r,je]),D(()=>{i?.(M);},[M,i]),D(()=>{jt&&o?.();},[jt,o]),D(()=>{if((n||x)&&typeof window<\"u\"){let T=window;T.seekTo=L=>(oe(L),new Promise(z=>{requestAnimationFrame(()=>{let Q=0;for(let ce=X.length-1;ce>=0;ce--)if(L>=X[ce].startTime){Q=X[ce].startTime;break}let ln=(L-Q)*1e3;document.getAnimations().forEach(ce=>{let Ne=ce.effect?.target;Ne&&(Ne.closest(\".doc-player__block--active\")||Ne.closest(\".doc-player__block--previous\"))&&(ce.currentTime=Math.max(0,ln));});let Zr=L-Q,cn=[],un=document.querySelector(\".doc-player__block--active\");un&&un.querySelectorAll(\"video[data-clip-start]\").forEach(Ne=>{let Ae=Ne,Gr=parseFloat(Ae.dataset.clipStart||\"0\"),Qr=parseFloat(Ae.dataset.clipEnd||\"0\"),dn=Math.min(Gr+Math.max(0,Zr),Qr);Ae.pause(),Ae.currentTime=dn,cn.push(new Promise(_t=>{Math.abs(Ae.currentTime-dn)<.1?_t():(Ae.addEventListener(\"seeked\",()=>_t(),{once:true}),setTimeout(_t,200));}));}),Promise.all(cn).then(()=>{requestAnimationFrame(()=>z());});});})),T.getDuration=()=>K,T.getBlocks=()=>X.map(L=>({id:L.id,template:L.template??\"raw\",startTime:L.startTime,duration:L.duration})),T.getAudioSegments=()=>e.audio.segments.map(L=>({src:L.src,name:L.name,duration:L.duration,startTime:L.startTime})),T.getCaptions=()=>e.captions?.phrases?.map(L=>({text:L.text,startTime:L.startTime,endTime:L.endTime}))||[],T.getChapters=()=>{let L=zr(e);return e.audio.segments.map((z,Q)=>({title:L.get(Q)||z.name,startTime:z.startTime,duration:z.duration}))},T.showCover=()=>(tn(true),new Promise(L=>requestAnimationFrame(()=>L()))),T.hideCover=()=>(tn(false),new Promise(L=>requestAnimationFrame(()=>L()))),T.hasCoverBlock=()=>!!he;}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,x,oe,K,X,he]);let Te=f!==void 0?f:true,an=j(T=>{d?.(T);},[d]),Ze=e.captions&&e.captions.phrases.length>0,sn=F(()=>zr(e),[e]),Re=F(()=>({isPlaying:E,currentTime:M,totalDuration:K,currentBlockIndex:me,totalBlocks:X.length,docProgress:en,hasCaptions:!!Ze,captionsEnabled:Te,isFullscreen:y,currentSegmentIndex:Y,currentSegmentName:sn.get(Y)??e.audio.segments[Y]?.name??null,currentBlock:_e??null}),[E,M,K,me,X.length,en,Ze,Te,y,Y,sn,_e]),Ge=F(()=>({toggle:Se,restart:Gt,seekTo:oe,setCaptionsEnabled:an,toggleFullscreen:h}),[Se,Gt,oe,an,h]),Ce=F(()=>({nextSlide:()=>{if(me<X.length-1){let T=X[me+1];T&&(oe(T.startTime),we());}},prevSlide:()=>{if(me>0){let T=X[me-1];T&&(oe(T.startTime),we());}},goToSlide:T=>{if(T>=0&&T<X.length){let L=X[T];L&&(oe(L.startTime),we());}}}),[me,X,oe,we]);D(()=>{m?.(Re);},[Re,m]),D(()=>{p?.({play:je,pause:we,...Ge});},[je,we,Ge,p]);let Qe=j(T=>{let L=T;if(ne(L)){let z=L;if(typeof z.title==\"string\")return z.title;if(typeof z.stat==\"string\")return z.stat;if(typeof z.quote==\"string\"){let Q=z.quote.split(`\n`)[0];return Q.length<=30?Q:Q.slice(0,27)+\"...\"}if(typeof z.date==\"string\")return z.date;if(typeof z.fact==\"string\")return z.fact}if(T.layers&&Array.isArray(T.layers)){let z=T.layers.find(Q=>Q.type===\"text\");if(z?.content?.text){let Q=z.content.text.split(`\n`)[0];return Q.length<=30?Q:Q.slice(0,27)+\"...\"}}return T.id.replace(/-/g,\" \").replace(/\\b\\w/g,z=>z.toUpperCase())},[]),$e=F(()=>{if(!K||!X.length)return [];let T=-1;return X.map((L,z)=>{let Q=L.audioSegment!==T;return T=L.audioSegment,{block:L,index:z,position:L.startTime/K*100,title:Qe(L),isSectionStart:Q}})},[X,K,Qe]);D(()=>{$e.length>0&&b?.($e);},[$e,b]),Kt.current=X.length;let bt=j(T=>{let L=document.activeElement;if(!(L&&(L.tagName===\"INPUT\"||L.tagName===\"TEXTAREA\"||L.tagName===\"SELECT\"))&&!A)if(w)switch(T.key){case \"ArrowRight\":case \"ArrowDown\":case \" \":T.preventDefault(),Ce.nextSlide();break;case \"ArrowLeft\":case \"ArrowUp\":T.preventDefault(),Ce.prevSlide();break;case \"Home\":T.preventDefault(),Ce.goToSlide(0);break;case \"End\":T.preventDefault(),Ce.goToSlide(Kt.current-1);break}else switch(T.key){case \" \":T.preventDefault(),Se();break;case \"ArrowRight\":oe(Math.min(ht.current+10,Qt.current));break;case \"ArrowLeft\":oe(Math.max(ht.current-10,0));break}},[w,A,Se,oe,Ce]);return D(()=>{if(!n)return window.addEventListener(\"keydown\",bt),()=>window.removeEventListener(\"keydown\",bt)},[bt,n]),A?l(\"div\",{ref:$,className:\"doc-player doc-player--linear\",style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:l(ft,{doc:e,basePath:t,viewport:g})}):l(\"div\",{ref:$,className:\"doc-player\",onClick:Vr,style:{position:\"relative\",width:\"100%\",aspectRatio:`${g.width} / ${g.height}`,margin:\"0 auto\",overflow:\"hidden\",cursor:n?void 0:\"pointer\"},children:[l(\"audio\",{ref:I,preload:\"auto\",muted:c}),l(\"div\",{className:\"doc-player__viewport\",children:[Xe&&he&&l(\"div\",{className:\"doc-player__block doc-player__block--cover\",children:l(Ee,{block:he,blockTime:0,basePath:t,isEntering:false,viewport:g})}),!Xe&&Jt&&Yr&&l(\"div\",{className:\"doc-player__block doc-player__block--previous\",children:l(Ee,{block:Jt,blockTime:gt,basePath:t,isExiting:true,viewport:g})}),!Xe&&_e&&l(\"div\",{className:\"doc-player__block doc-player__block--active\",children:l(Ee,{block:_e,blockTime:gt,basePath:t,isEntering:Ur,viewport:g,isPlaying:E})}),Ze&&!n&&l(Pr,{captions:e.captions,currentTime:M,enabled:Te&&(E||M>0),fontSize:16}),x&&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:_e?.template??\"raw\"})]}),l(\"div\",{children:[l(\"span\",{style:{color:\"#888\"},children:\"block:\"}),\" \",me+1,\"/\",X.length,\" \",l(\"span\",{style:{color:\"#666\"},children:[\"(\",_e?.id||\"none\",\")\"]})]}),l(\"div\",{children:[l(\"span\",{style:{color:\"#888\"},children:\"time:\"}),\" \",M.toFixed(2),\"s /\",\" \",K.toFixed(1),\"s\"]}),l(\"div\",{children:[l(\"span\",{style:{color:\"#888\"},children:\"blockTime:\"}),\" \",gt.toFixed(2),\"s /\",\" \",(_e?.duration||0).toFixed(1),\"s\"]}),l(\"div\",{children:[l(\"span\",{style:{color:\"#888\"},children:\"segment:\"}),\" \",Y,\"/\",e.audio.segments.length-1,\" \",l(\"span\",{style:{color:\"#666\"},children:[\"(\",e.audio.segments[Y]?.name||\"none\",\")\"]})]}),l(\"div\",{children:[l(\"span\",{style:{color:\"#888\"},children:\"viewport:\"}),\" \",g.name||`${g.width}x${g.height}`,\" \",l(\"span\",{style:{color:\"#666\"},children:[\"(\",k,\")\"]})]}),l(\"div\",{children:[l(\"span\",{style:{color:\"#888\"},children:\"playing:\"}),\" \",l(\"span\",{style:{color:E?\"#4ade80\":\"#f87171\"},children:E?\"yes\":\"no\"}),Xe&&l(\"span\",{style:{color:\"#60a5fa\"},children:\" (cover)\"})]}),Ze&&(()=>{let T=qe(e.captions,M),L=Te&&(E||M>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:Te?\"#4ade80\":\"#666\"},children:[\"(\",Te?\"on\":\"off\",\")\"]})]}),l(\"div\",{children:[l(\"span\",{style:{color:\"#888\"},children:\"cc.enabled:\"}),\" \",l(\"span\",{style:{color:L?\"#4ade80\":\"#f87171\"},children:String(L)}),\" \",l(\"span\",{style:{color:\"#666\"},children:[\"(playing=\",String(E),\" t>0=\",String(M>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)]})]})]})})()]})]}),!Wr&&Zt&&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:Zt})]}),!n&&!w&&s&&l(Rr,{state:Re,actions:Ge,blockMarkers:$e,expandedBlocks:X,getBlockTitle:Qe}),!n&&!w&&!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(dt,{state:Re,actions:Ge,blockMarkers:$e,expandedBlocks:X,getBlockTitle:Qe})}),!n&&w&&l($r,{state:Re,slideNav:Ce}),!w&&N&&l(\"div\",{className:\"doc-player__tap-feedback\",children:l(\"svg\",{viewBox:\"0 0 24 24\",fill:\"white\",width:\"48\",height:\"48\",children:N===\"pause\"?l(\"path\",{d:\"M6 19h4V5H6v14zm8-14v14h4V5h-4z\"}):l(\"path\",{d:\"M8 5v14l11-7z\"})})},Date.now())]})}var Or={};var Hr=false;function Si(){if(Hr||typeof document>\"u\")return;let e=document.createElement(\"style\");e.setAttribute(\"data-squisq-player\",\"animations\"),e.textContent=Or,document.head.appendChild(e),Hr=true;}function Ti(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:Ci(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 Ci(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 Ai(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 mt=new WeakMap;function Mi(e,t,n={}){Si();let{mode:r=\"slideshow\",basePath:o=\".\",images:i,audio:a,autoPlay:s=false,theme:u}=n,c=a?Ai(t,a):t,f=i?Ti(i,o):null,d;r===\"static\"?d=de(ft,{doc:c,basePath:o,theme:u}):d=de(qr,{script:c,basePath:o,displayMode:\"slideshow\",autoPlay:s,showControls:true,theme:u}),f&&(d=de(Vt.Provider,{value:f},d));let m=mt.get(e);m||(m=Jn(e),mt.set(e,m)),m.render(d);}function Dl(e,t,n={}){Mi(e,t,{...n,mode:\"static\"});}function Fl(e){let t=mt.get(e);t&&(t.unmount(),mt.delete(e));}var zl=\"1.0.1\";exports.mount=Mi;exports.mountStatic=Dl;exports.unmount=Fl;exports.version=zl;return exports;})({});//# sourceMappingURL=squisq-player.global.js.map\n//# sourceMappingURL=squisq-player.global.js.map";