@hyperframes/shader-transitions 0.8.75 → 0.8.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var Tn="attribute vec2 a_pos; varying vec2 v_uv; void main(){v_uv=a_pos*0.5+0.5;
|
|
|
3
3
|
content: "" !important;
|
|
4
4
|
display: none !important;
|
|
5
5
|
}`,ru=function(A){nu(A,"."+en+eu+Ts+`
|
|
6
|
-
.`+tn+tu+Ts)},nu=function(A,e){var r=A.ownerDocument;if(r){var t=r.createElement("style");t.textContent=e,A.appendChild(t)}},Ti=(function(){function A(){}return A.getOrigin=function(e){var r=A._link;return r?(r.href=e,r.href=r.href,r.protocol+r.hostname+r.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A})(),su=(function(){function A(e,r){this.context=e,this._options=r,this._cache={}}return A.prototype.addImage=function(e){var r=Promise.resolve();return this.has(e)||(Sr(e)||Bu(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),r},A.prototype.match=function(e){return this._cache[e]},A.prototype.loadImage=function(e){return wA(this,void 0,void 0,function(){var r,t,n,s,i=this;return cA(this,function(o){switch(o.label){case 0:return r=Ti.isSameOrigin(e),t=!Lr(e)&&this._options.useCORS===!0&&aA.SUPPORT_CORS_IMAGES&&!r,n=!Lr(e)&&!r&&!Sr(e)&&typeof this._options.proxy=="string"&&aA.SUPPORT_CORS_XHR&&!t,!r&&this._options.allowTaint===!1&&!Lr(e)&&!Sr(e)&&!n&&!t?[2]:(s=e,n?[4,this.proxy(s)]:[3,2]);case 1:s=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(a,B){var l=new Image;l.onload=function(){return a(l)},l.onerror=B,(cu(s)||t)&&(l.crossOrigin="anonymous"),l.src=s,l.complete===!0&&setTimeout(function(){return a(l)},500),i._options.imageTimeout>0&&setTimeout(function(){return B("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},A.prototype.has=function(e){return typeof this._cache[e]<"u"},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(e){var r=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var n=e.substring(0,256);return new Promise(function(s,i){var o=aA.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(o==="text")s(a.response);else{var u=new FileReader;u.addEventListener("load",function(){return s(u.result)},!1),u.addEventListener("error",function(f){return i(f)},!1),u.readAsDataURL(a.response)}else i("Failed to proxy resource "+n+" with status code "+a.status)},a.onerror=i;var B=t.indexOf("?")>-1?"&":"?";if(a.open("GET",""+t+B+"url="+encodeURIComponent(e)+"&responseType="+o),o!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=o),r._options.imageTimeout){var l=r._options.imageTimeout;a.timeout=l,a.ontimeout=function(){return i("Timed out ("+l+"ms) proxying "+n)}}a.send()})},A})(),iu=/^data:image\/svg\+xml/i,ou=/^data:image\/.*;base64,/i,au=/^data:image\/.*/i,Bu=function(A){return aA.SUPPORT_SVG_DRAWING||!lu(A)},Lr=function(A){return au.test(A)},cu=function(A){return ou.test(A)},Sr=function(A){return A.substr(0,4)==="blob"},lu=function(A){return A.substr(-3).toLowerCase()==="svg"||iu.test(A)},v=(function(){function A(e,r){this.type=0,this.x=e,this.y=r}return A.prototype.add=function(e,r){return new A(this.x+e,this.y+r)},A})(),Ue=function(A,e,r){return new v(A.x+(e.x-A.x)*r,A.y+(e.y-A.y)*r)},Et=(function(){function A(e,r,t,n){this.type=1,this.start=e,this.startControl=r,this.endControl=t,this.end=n}return A.prototype.subdivide=function(e,r){var t=Ue(this.start,this.startControl,e),n=Ue(this.startControl,this.endControl,e),s=Ue(this.endControl,this.end,e),i=Ue(t,n,e),o=Ue(n,s,e),a=Ue(i,o,e);return r?new A(this.start,t,i,a):new A(a,o,s,this.end)},A.prototype.add=function(e,r){return new A(this.start.add(e,r),this.startControl.add(e,r),this.endControl.add(e,r),this.end.add(e,r))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A})(),vA=function(A){return A.type===1},uu=(function(){function A(e){var r=e.styles,t=e.bounds,n=Pe(r.borderTopLeftRadius,t.width,t.height),s=n[0],i=n[1],o=Pe(r.borderTopRightRadius,t.width,t.height),a=o[0],B=o[1],l=Pe(r.borderBottomRightRadius,t.width,t.height),u=l[0],f=l[1],C=Pe(r.borderBottomLeftRadius,t.width,t.height),g=C[0],w=C[1],x=[];x.push((s+a)/t.width),x.push((g+u)/t.width),x.push((i+w)/t.height),x.push((B+f)/t.height);var F=Math.max.apply(Math,x);F>1&&(s/=F,i/=F,a/=F,B/=F,u/=F,f/=F,g/=F,w/=F);var p=t.width-a,L=t.height-f,m=t.width-u,I=t.height-w,h=r.borderTopWidth,y=r.borderRightWidth,M=r.borderBottomWidth,S=r.borderLeftWidth,Y=z(r.paddingTop,e.bounds.width),K=z(r.paddingRight,e.bounds.width),R=z(r.paddingBottom,e.bounds.width),_=z(r.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=s>0||i>0?AA(t.left+S/3,t.top+h/3,s-S/3,i-h/3,J.TOP_LEFT):new v(t.left+S/3,t.top+h/3),this.topRightBorderDoubleOuterBox=s>0||i>0?AA(t.left+p,t.top+h/3,a-y/3,B-h/3,J.TOP_RIGHT):new v(t.left+t.width-y/3,t.top+h/3),this.bottomRightBorderDoubleOuterBox=u>0||f>0?AA(t.left+m,t.top+L,u-y/3,f-M/3,J.BOTTOM_RIGHT):new v(t.left+t.width-y/3,t.top+t.height-M/3),this.bottomLeftBorderDoubleOuterBox=g>0||w>0?AA(t.left+S/3,t.top+I,g-S/3,w-M/3,J.BOTTOM_LEFT):new v(t.left+S/3,t.top+t.height-M/3),this.topLeftBorderDoubleInnerBox=s>0||i>0?AA(t.left+S*2/3,t.top+h*2/3,s-S*2/3,i-h*2/3,J.TOP_LEFT):new v(t.left+S*2/3,t.top+h*2/3),this.topRightBorderDoubleInnerBox=s>0||i>0?AA(t.left+p,t.top+h*2/3,a-y*2/3,B-h*2/3,J.TOP_RIGHT):new v(t.left+t.width-y*2/3,t.top+h*2/3),this.bottomRightBorderDoubleInnerBox=u>0||f>0?AA(t.left+m,t.top+L,u-y*2/3,f-M*2/3,J.BOTTOM_RIGHT):new v(t.left+t.width-y*2/3,t.top+t.height-M*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||w>0?AA(t.left+S*2/3,t.top+I,g-S*2/3,w-M*2/3,J.BOTTOM_LEFT):new v(t.left+S*2/3,t.top+t.height-M*2/3),this.topLeftBorderStroke=s>0||i>0?AA(t.left+S/2,t.top+h/2,s-S/2,i-h/2,J.TOP_LEFT):new v(t.left+S/2,t.top+h/2),this.topRightBorderStroke=s>0||i>0?AA(t.left+p,t.top+h/2,a-y/2,B-h/2,J.TOP_RIGHT):new v(t.left+t.width-y/2,t.top+h/2),this.bottomRightBorderStroke=u>0||f>0?AA(t.left+m,t.top+L,u-y/2,f-M/2,J.BOTTOM_RIGHT):new v(t.left+t.width-y/2,t.top+t.height-M/2),this.bottomLeftBorderStroke=g>0||w>0?AA(t.left+S/2,t.top+I,g-S/2,w-M/2,J.BOTTOM_LEFT):new v(t.left+S/2,t.top+t.height-M/2),this.topLeftBorderBox=s>0||i>0?AA(t.left,t.top,s,i,J.TOP_LEFT):new v(t.left,t.top),this.topRightBorderBox=a>0||B>0?AA(t.left+p,t.top,a,B,J.TOP_RIGHT):new v(t.left+t.width,t.top),this.bottomRightBorderBox=u>0||f>0?AA(t.left+m,t.top+L,u,f,J.BOTTOM_RIGHT):new v(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=g>0||w>0?AA(t.left,t.top+I,g,w,J.BOTTOM_LEFT):new v(t.left,t.top+t.height),this.topLeftPaddingBox=s>0||i>0?AA(t.left+S,t.top+h,Math.max(0,s-S),Math.max(0,i-h),J.TOP_LEFT):new v(t.left+S,t.top+h),this.topRightPaddingBox=a>0||B>0?AA(t.left+Math.min(p,t.width-y),t.top+h,p>t.width+y?0:Math.max(0,a-y),Math.max(0,B-h),J.TOP_RIGHT):new v(t.left+t.width-y,t.top+h),this.bottomRightPaddingBox=u>0||f>0?AA(t.left+Math.min(m,t.width-S),t.top+Math.min(L,t.height-M),Math.max(0,u-y),Math.max(0,f-M),J.BOTTOM_RIGHT):new v(t.left+t.width-y,t.top+t.height-M),this.bottomLeftPaddingBox=g>0||w>0?AA(t.left+S,t.top+Math.min(I,t.height-M),Math.max(0,g-S),Math.max(0,w-M),J.BOTTOM_LEFT):new v(t.left+S,t.top+t.height-M),this.topLeftContentBox=s>0||i>0?AA(t.left+S+_,t.top+h+Y,Math.max(0,s-(S+_)),Math.max(0,i-(h+Y)),J.TOP_LEFT):new v(t.left+S+_,t.top+h+Y),this.topRightContentBox=a>0||B>0?AA(t.left+Math.min(p,t.width+S+_),t.top+h+Y,p>t.width+S+_?0:a-S+_,B-(h+Y),J.TOP_RIGHT):new v(t.left+t.width-(y+K),t.top+h+Y),this.bottomRightContentBox=u>0||f>0?AA(t.left+Math.min(m,t.width-(S+_)),t.top+Math.min(L,t.height+h+Y),Math.max(0,u-(y+K)),f-(M+R),J.BOTTOM_RIGHT):new v(t.left+t.width-(y+K),t.top+t.height-(M+R)),this.bottomLeftContentBox=g>0||w>0?AA(t.left+S+_,t.top+I,Math.max(0,g-(S+_)),w-(M+R),J.BOTTOM_LEFT):new v(t.left+S+_,t.top+t.height-(M+R))}return A})(),J;(function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(J||(J={}));var AA=function(A,e,r,t,n){var s=4*((Math.sqrt(2)-1)/3),i=r*s,o=t*s,a=A+r,B=e+t;switch(n){case J.TOP_LEFT:return new Et(new v(A,B),new v(A,B-o),new v(a-i,e),new v(a,e));case J.TOP_RIGHT:return new Et(new v(A,e),new v(A+i,e),new v(a,B-o),new v(a,B));case J.BOTTOM_RIGHT:return new Et(new v(a,e),new v(a,e+o),new v(A+i,B),new v(A,B));case J.BOTTOM_LEFT:default:return new Et(new v(a,B),new v(a-i,B),new v(A,e+o),new v(A,e))}},Gt=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},fu=function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]},Nt=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},gu=(function(){function A(e,r,t){this.offsetX=e,this.offsetY=r,this.matrix=t,this.type=0,this.target=6}return A})(),Ht=(function(){function A(e,r){this.path=e,this.target=r,this.type=1}return A})(),wu=(function(){function A(e){this.opacity=e,this.type=2,this.target=6}return A})(),Qu=function(A){return A.type===0},Li=function(A){return A.type===1},Cu=function(A){return A.type===2},Ls=function(A,e){return A.length===e.length?A.some(function(r,t){return r===e[t]}):!1},du=function(A,e,r,t,n){return A.map(function(s,i){switch(i){case 0:return s.add(e,r);case 1:return s.add(e+t,r);case 2:return s.add(e+t,r+n);case 3:return s.add(e,r+n)}return s})},Si=(function(){function A(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return A})(),Ki=(function(){function A(e,r){if(this.container=e,this.parent=r,this.effects=[],this.curves=new uu(this.container),this.container.styles.opacity<1&&this.effects.push(new wu(this.container.styles.opacity)),this.container.styles.transform!==null){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,s=this.container.styles.transform;this.effects.push(new gu(t,n,s))}if(this.container.styles.overflowX!==0){var i=Gt(this.curves),o=Nt(this.curves);Ls(i,o)?this.effects.push(new Ht(i,6)):(this.effects.push(new Ht(i,2)),this.effects.push(new Ht(o,4)))}}return A.prototype.getEffects=function(e){for(var r=[2,3].indexOf(this.container.styles.position)===-1,t=this.parent,n=this.effects.slice(0);t;){var s=t.effects.filter(function(a){return!Li(a)});if(r||t.container.styles.position!==0||!t.parent){if(n.unshift.apply(n,s),r=[2,3].indexOf(t.container.styles.position)===-1,t.container.styles.overflowX!==0){var i=Gt(t.curves),o=Nt(t.curves);Ls(i,o)||n.unshift(new Ht(o,6))}}else n.unshift.apply(n,s);t=t.parent}return n.filter(function(a){return sA(a.target,e)})},A})(),rn=function(A,e,r,t){A.container.elements.forEach(function(n){var s=sA(n.flags,4),i=sA(n.flags,2),o=new Ki(n,A);sA(n.styles.display,2048)&&t.push(o);var a=sA(n.flags,8)?[]:t;if(s||i){var B=s||n.styles.isPositioned()?r:e,l=new Si(o);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var u=n.styles.zIndex.order;if(u<0){var f=0;B.negativeZIndex.some(function(g,w){return u>g.element.container.styles.zIndex.order?(f=w,!1):f>0}),B.negativeZIndex.splice(f,0,l)}else if(u>0){var C=0;B.positiveZIndex.some(function(g,w){return u>=g.element.container.styles.zIndex.order?(C=w+1,!1):C>0}),B.positiveZIndex.splice(C,0,l)}else B.zeroOrAutoZIndexOrTransformedOrOpacity.push(l)}else n.styles.isFloating()?B.nonPositionedFloats.push(l):B.nonPositionedInlineLevel.push(l);rn(o,l,s?l:r,a)}else n.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),rn(o,e,r,a);sA(n.flags,8)&&Di(n,a)})},Di=function(A,e){for(var r=A instanceof zr?A.start:1,t=A instanceof zr?A.reversed:!1,n=0;n<e.length;n++){var s=e[n];s.container instanceof di&&typeof s.container.value=="number"&&s.container.value!==0&&(r=s.container.value),s.listValue=$e(r,s.container.styles.listStyleType,!0),r+=t?-1:1}},hu=function(A){var e=new Ki(A,null),r=new Si(e),t=[];return rn(e,r,r,t),Di(e.container,t),r},Ss=function(A,e){switch(e){case 0:return HA(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return HA(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return HA(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return HA(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},Uu=function(A,e){switch(e){case 0:return HA(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return HA(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return HA(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return HA(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}},Fu=function(A,e){switch(e){case 0:return HA(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return HA(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return HA(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return HA(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}},pu=function(A,e){switch(e){case 0:return yt(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return yt(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return yt(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return yt(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}},yt=function(A,e){var r=[];return vA(A)?r.push(A.subdivide(.5,!1)):r.push(A),vA(e)?r.push(e.subdivide(.5,!0)):r.push(e),r},HA=function(A,e,r,t){var n=[];return vA(A)?n.push(A.subdivide(.5,!1)):n.push(A),vA(r)?n.push(r.subdivide(.5,!0)):n.push(r),vA(t)?n.push(t.subdivide(.5,!0).reverse()):n.push(t),vA(e)?n.push(e.subdivide(.5,!1).reverse()):n.push(e),n},_i=function(A){var e=A.bounds,r=A.styles;return e.add(r.borderLeftWidth,r.borderTopWidth,-(r.borderRightWidth+r.borderLeftWidth),-(r.borderTopWidth+r.borderBottomWidth))},Vt=function(A){var e=A.styles,r=A.bounds,t=z(e.paddingLeft,r.width),n=z(e.paddingRight,r.width),s=z(e.paddingTop,r.width),i=z(e.paddingBottom,r.width);return r.add(t+e.borderLeftWidth,s+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+t+n),-(e.borderTopWidth+e.borderBottomWidth+s+i))},mu=function(A,e){return A===0?e.bounds:A===2?Vt(e):_i(e)},vu=function(A,e){return A===0?e.bounds:A===2?Vt(e):_i(e)},Kr=function(A,e,r){var t=mu(me(A.styles.backgroundOrigin,e),A),n=vu(me(A.styles.backgroundClip,e),A),s=Eu(me(A.styles.backgroundSize,e),r,t),i=s[0],o=s[1],a=Pe(me(A.styles.backgroundPosition,e),t.width-i,t.height-o),B=Hu(me(A.styles.backgroundRepeat,e),a,s,t,n),l=Math.round(t.left+a[0]),u=Math.round(t.top+a[1]);return[B,l,u,i,o]},Fe=function(A){return Z(A)&&A.value===Ee.AUTO},It=function(A){return typeof A=="number"},Eu=function(A,e,r){var t=e[0],n=e[1],s=e[2],i=A[0],o=A[1];if(!i)return[0,0];if(nA(i)&&o&&nA(o))return[z(i,r.width),z(o,r.height)];var a=It(s);if(Z(i)&&(i.value===Ee.CONTAIN||i.value===Ee.COVER)){if(It(s)){var B=r.width/r.height;return B<s!=(i.value===Ee.COVER)?[r.width,r.width/s]:[r.height*s,r.height]}return[r.width,r.height]}var l=It(t),u=It(n),f=l||u;if(Fe(i)&&(!o||Fe(o))){if(l&&u)return[t,n];if(!a&&!f)return[r.width,r.height];if(f&&a){var C=l?t:n*s,g=u?n:t/s;return[C,g]}var w=l?t:r.width,x=u?n:r.height;return[w,x]}if(a){var F=0,p=0;return nA(i)?F=z(i,r.width):nA(o)&&(p=z(o,r.height)),Fe(i)?F=p*s:(!o||Fe(o))&&(p=F/s),[F,p]}var L=null,m=null;if(nA(i)?L=z(i,r.width):o&&nA(o)&&(m=z(o,r.height)),L!==null&&(!o||Fe(o))&&(m=l&&u?L/t*n:r.height),m!==null&&Fe(i)&&(L=l&&u?m/n*t:r.width),L!==null&&m!==null)return[L,m];throw new Error("Unable to calculate background-size for element")},me=function(A,e){var r=A[e];return typeof r>"u"?A[0]:r},Hu=function(A,e,r,t,n){var s=e[0],i=e[1],o=r[0],a=r[1];switch(A){case 2:return[new v(Math.round(t.left),Math.round(t.top+i)),new v(Math.round(t.left+t.width),Math.round(t.top+i)),new v(Math.round(t.left+t.width),Math.round(a+t.top+i)),new v(Math.round(t.left),Math.round(a+t.top+i))];case 3:return[new v(Math.round(t.left+s),Math.round(t.top)),new v(Math.round(t.left+s+o),Math.round(t.top)),new v(Math.round(t.left+s+o),Math.round(t.height+t.top)),new v(Math.round(t.left+s),Math.round(t.height+t.top))];case 1:return[new v(Math.round(t.left+s),Math.round(t.top+i)),new v(Math.round(t.left+s+o),Math.round(t.top+i)),new v(Math.round(t.left+s+o),Math.round(t.top+i+a)),new v(Math.round(t.left+s),Math.round(t.top+i+a))];default:return[new v(Math.round(n.left),Math.round(n.top)),new v(Math.round(n.left+n.width),Math.round(n.top)),new v(Math.round(n.left+n.width),Math.round(n.height+n.top)),new v(Math.round(n.left),Math.round(n.height+n.top))]}},yu="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Ks="Hidden Text",Iu=(function(){function A(e){this._data={},this._document=e}return A.prototype.parseMetrics=function(e,r){var t=this._document.createElement("div"),n=this._document.createElement("img"),s=this._document.createElement("span"),i=this._document.body;t.style.visibility="hidden",t.style.fontFamily=e,t.style.fontSize=r,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",i.appendChild(t),n.src=yu,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",s.style.fontFamily=e,s.style.fontSize=r,s.style.margin="0",s.style.padding="0",s.appendChild(this._document.createTextNode(Ks)),t.appendChild(s),t.appendChild(n);var o=n.offsetTop-s.offsetTop+2;t.removeChild(s),t.appendChild(this._document.createTextNode(Ks)),t.style.lineHeight="normal",n.style.verticalAlign="super";var a=n.offsetTop-t.offsetTop+2;return i.removeChild(t),{baseline:o,middle:a}},A.prototype.getMetrics=function(e,r){var t=e+" "+r;return typeof this._data[t]>"u"&&(this._data[t]=this.parseMetrics(e,r)),this._data[t]},A})(),Mi=(function(){function A(e,r){this.context=e,this.options=r}return A})(),bu=1e4,xu=(function(A){LA(e,A);function e(r,t){var n=A.call(this,r,t)||this;return n._activeEffects=[],n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),t.canvas||(n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px"),n.fontMetrics=new Iu(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+t.width+"x"+t.height+") with scale "+t.scale),n}return e.prototype.applyEffects=function(r){for(var t=this;this._activeEffects.length;)this.popEffect();r.forEach(function(n){return t.applyEffect(n)})},e.prototype.applyEffect=function(r){this.ctx.save(),Cu(r)&&(this.ctx.globalAlpha=r.opacity),Qu(r)&&(this.ctx.translate(r.offsetX,r.offsetY),this.ctx.transform(r.matrix[0],r.matrix[1],r.matrix[2],r.matrix[3],r.matrix[4],r.matrix[5]),this.ctx.translate(-r.offsetX,-r.offsetY)),Li(r)&&(this.path(r.path),this.ctx.clip()),this._activeEffects.push(r)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(r){return wA(this,void 0,void 0,function(){var t;return cA(this,function(n){switch(n.label){case 0:return t=r.element.container.styles,t.isVisible()?[4,this.renderStackContent(r)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(r){return wA(this,void 0,void 0,function(){return cA(this,function(t){switch(t.label){case 0:if(sA(r.container.flags,16))debugger;return r.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(r)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(r)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(r,t,n){var s=this;if(t===0)this.ctx.fillText(r.text,r.bounds.left,r.bounds.top+n);else{var i=Bn(r.text);i.reduce(function(o,a){return s.ctx.fillText(a,o,r.bounds.top+n),o+s.ctx.measureText(a).width},r.bounds.left)}},e.prototype.createFontStyle=function(r){var t=r.fontVariant.filter(function(i){return i==="normal"||i==="small-caps"}).join(""),n=Du(r.fontFamily).join(", "),s=et(r.fontSize)?""+r.fontSize.number+r.fontSize.unit:r.fontSize.number+"px";return[[r.fontStyle,t,r.fontWeight,s,n].join(" "),n,s]},e.prototype.renderTextNode=function(r,t){return wA(this,void 0,void 0,function(){var n,s,i,o,a,B,l,u,f=this;return cA(this,function(C){return n=this.createFontStyle(t),s=n[0],i=n[1],o=n[2],this.ctx.font=s,this.ctx.direction=t.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(i,o),B=a.baseline,l=a.middle,u=t.paintOrder,r.textBounds.forEach(function(g){u.forEach(function(w){switch(w){case 0:f.ctx.fillStyle=iA(t.color),f.renderTextWithLetterSpacing(g,t.letterSpacing,B);var x=t.textShadow;x.length&&g.text.trim().length&&(x.slice(0).reverse().forEach(function(F){f.ctx.shadowColor=iA(F.color),f.ctx.shadowOffsetX=F.offsetX.number*f.options.scale,f.ctx.shadowOffsetY=F.offsetY.number*f.options.scale,f.ctx.shadowBlur=F.blur.number,f.renderTextWithLetterSpacing(g,t.letterSpacing,B)}),f.ctx.shadowColor="",f.ctx.shadowOffsetX=0,f.ctx.shadowOffsetY=0,f.ctx.shadowBlur=0),t.textDecorationLine.length&&(f.ctx.fillStyle=iA(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(F){switch(F){case 1:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top+B),g.bounds.width,1);break;case 2:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top),g.bounds.width,1);break;case 3:f.ctx.fillRect(g.bounds.left,Math.ceil(g.bounds.top+l),g.bounds.width,1);break}}));break;case 1:t.webkitTextStrokeWidth&&g.text.trim().length&&(f.ctx.strokeStyle=iA(t.webkitTextStrokeColor),f.ctx.lineWidth=t.webkitTextStrokeWidth,f.ctx.lineJoin=window.chrome?"miter":"round",f.ctx.strokeText(g.text,g.bounds.left,g.bounds.top+B)),f.ctx.strokeStyle="",f.ctx.lineWidth=0,f.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(r,t,n){if(n&&r.intrinsicWidth>0&&r.intrinsicHeight>0){var s=Vt(r),i=Nt(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,r.intrinsicWidth,r.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(r){return wA(this,void 0,void 0,function(){var t,n,s,i,o,a,p,p,B,l,u,f,m,C,g,I,w,x,F,p,L,m,I;return cA(this,function(h){switch(h.label){case 0:this.applyEffects(r.getEffects(4)),t=r.container,n=r.curves,s=t.styles,i=0,o=t.textNodes,h.label=1;case 1:return i<o.length?(a=o[i],[4,this.renderTextNode(a,s)]):[3,4];case 2:h.sent(),h.label=3;case 3:return i++,[3,1];case 4:if(!(t instanceof wi))return[3,8];h.label=5;case 5:return h.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return p=h.sent(),this.renderReplacedElement(t,n,p),[3,8];case 7:return h.sent(),this.context.logger.error("Error loading image "+t.src),[3,8];case 8:if(t instanceof Qi&&this.renderReplacedElement(t,n,t.canvas),!(t instanceof Ci))return[3,12];h.label=9;case 9:return h.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return p=h.sent(),this.renderReplacedElement(t,n,p),[3,12];case 11:return h.sent(),this.context.logger.error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof Fi&&t.tree?(B=new e(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}),[4,B.render(t.tree)]):[3,14];case 13:l=h.sent(),t.width&&t.height&&this.ctx.drawImage(l,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),h.label=14;case 14:if(t instanceof cn&&(u=Math.min(t.bounds.width,t.bounds.height),t.type===_t?t.checked&&(this.ctx.save(),this.path([new v(t.bounds.left+u*.39363,t.bounds.top+u*.79),new v(t.bounds.left+u*.16,t.bounds.top+u*.5549),new v(t.bounds.left+u*.27347,t.bounds.top+u*.44071),new v(t.bounds.left+u*.39694,t.bounds.top+u*.5649),new v(t.bounds.left+u*.72983,t.bounds.top+u*.23),new v(t.bounds.left+u*.84,t.bounds.top+u*.34085),new v(t.bounds.left+u*.39363,t.bounds.top+u*.79)]),this.ctx.fillStyle=iA(Fs),this.ctx.fill(),this.ctx.restore()):t.type===Mt&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+u/2,t.bounds.top+u/2,u/4,0,Math.PI*2,!0),this.ctx.fillStyle=iA(Fs),this.ctx.fill(),this.ctx.restore())),Tu(t)&&t.value.length){switch(f=this.createFontStyle(s),m=f[0],C=f[1],g=this.fontMetrics.getMetrics(m,C).baseline,this.ctx.font=m,this.ctx.fillStyle=iA(s.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Su(t.styles.textAlign),I=Vt(t),w=0,t.styles.textAlign){case 1:w+=I.width/2;break;case 2:w+=I.width;break}x=I.add(w,0,0,-I.height/2+1),this.ctx.save(),this.path([new v(I.left,I.top),new v(I.left+I.width,I.top),new v(I.left+I.width,I.top+I.height),new v(I.left,I.top+I.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Ze(t.value,x),s.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!sA(t.styles.display,2048))return[3,20];if(t.styles.listStyleImage===null)return[3,19];if(F=t.styles.listStyleImage,F.type!==0)return[3,18];p=void 0,L=F.url,h.label=15;case 15:return h.trys.push([15,17,,18]),[4,this.context.cache.match(L)];case 16:return p=h.sent(),this.ctx.drawImage(p,t.bounds.left-(p.width+10),t.bounds.top),[3,18];case 17:return h.sent(),this.context.logger.error("Error loading list-style-image "+L),[3,18];case 18:return[3,20];case 19:r.listValue&&t.styles.listStyleType!==-1&&(m=this.createFontStyle(s)[0],this.ctx.font=m,this.ctx.fillStyle=iA(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",I=new PA(t.bounds.left,t.bounds.top+z(t.styles.paddingTop,t.bounds.width),t.bounds.width,ns(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Ze(r.listValue,I),s.letterSpacing,ns(s.lineHeight,s.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),h.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(r){return wA(this,void 0,void 0,function(){var t,n,F,s,i,F,o,a,F,B,l,F,u,f,F,C,g,F,w,x,F;return cA(this,function(p){switch(p.label){case 0:if(sA(r.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(r.element)];case 1:p.sent(),t=0,n=r.negativeZIndex,p.label=2;case 2:return t<n.length?(F=n[t],[4,this.renderStack(F)]):[3,5];case 3:p.sent(),p.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(r.element)];case 6:p.sent(),s=0,i=r.nonInlineLevel,p.label=7;case 7:return s<i.length?(F=i[s],[4,this.renderNode(F)]):[3,10];case 8:p.sent(),p.label=9;case 9:return s++,[3,7];case 10:o=0,a=r.nonPositionedFloats,p.label=11;case 11:return o<a.length?(F=a[o],[4,this.renderStack(F)]):[3,14];case 12:p.sent(),p.label=13;case 13:return o++,[3,11];case 14:B=0,l=r.nonPositionedInlineLevel,p.label=15;case 15:return B<l.length?(F=l[B],[4,this.renderStack(F)]):[3,18];case 16:p.sent(),p.label=17;case 17:return B++,[3,15];case 18:u=0,f=r.inlineLevel,p.label=19;case 19:return u<f.length?(F=f[u],[4,this.renderNode(F)]):[3,22];case 20:p.sent(),p.label=21;case 21:return u++,[3,19];case 22:C=0,g=r.zeroOrAutoZIndexOrTransformedOrOpacity,p.label=23;case 23:return C<g.length?(F=g[C],[4,this.renderStack(F)]):[3,26];case 24:p.sent(),p.label=25;case 25:return C++,[3,23];case 26:w=0,x=r.positiveZIndex,p.label=27;case 27:return w<x.length?(F=x[w],[4,this.renderStack(F)]):[3,30];case 28:p.sent(),p.label=29;case 29:return w++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(r){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(r.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(r){this.ctx.beginPath(),this.formatPath(r),this.ctx.closePath()},e.prototype.formatPath=function(r){var t=this;r.forEach(function(n,s){var i=vA(n)?n.start:n;s===0?t.ctx.moveTo(i.x,i.y):t.ctx.lineTo(i.x,i.y),vA(n)&&t.ctx.bezierCurveTo(n.startControl.x,n.startControl.y,n.endControl.x,n.endControl.y,n.end.x,n.end.y)})},e.prototype.renderRepeat=function(r,t,n,s){this.path(r),this.ctx.fillStyle=t,this.ctx.translate(n,s),this.ctx.fill(),this.ctx.translate(-n,-s)},e.prototype.resizeImage=function(r,t,n){var s;if(r.width===t&&r.height===n)return r;var i=(s=this.canvas.ownerDocument)!==null&&s!==void 0?s:document,o=i.createElement("canvas");o.width=Math.max(1,t),o.height=Math.max(1,n);var a=o.getContext("2d");return a.drawImage(r,0,0,r.width,r.height,0,0,t,n),o},e.prototype.renderBackgroundImage=function(r){return wA(this,void 0,void 0,function(){var t,n,s,i,o,a;return cA(this,function(B){switch(B.label){case 0:t=r.styles.backgroundImage.length-1,n=function(l){var u,f,C,Y,k,P,_,O,M,g,Y,k,P,_,O,w,x,F,p,L,m,I,h,y,M,S,Y,K,R,_,O,q,k,P,uA,$,eA,UA,MA,QA,yA,FA;return cA(this,function(RA){switch(RA.label){case 0:if(l.type!==0)return[3,5];u=void 0,f=l.url,RA.label=1;case 1:return RA.trys.push([1,3,,4]),[4,s.context.cache.match(f)];case 2:return u=RA.sent(),[3,4];case 3:return RA.sent(),s.context.logger.error("Error loading background-image "+f),[3,4];case 4:return u&&(C=Kr(r,t,[u.width,u.height,u.width/u.height]),Y=C[0],k=C[1],P=C[2],_=C[3],O=C[4],M=s.ctx.createPattern(s.resizeImage(u,_,O),"repeat"),s.renderRepeat(Y,M,k,P)),[3,6];case 5:QB(l)?(g=Kr(r,t,[null,null,null]),Y=g[0],k=g[1],P=g[2],_=g[3],O=g[4],w=lB(l.angle,_,O),x=w[0],F=w[1],p=w[2],L=w[3],m=w[4],I=document.createElement("canvas"),I.width=_,I.height=O,h=I.getContext("2d"),y=h.createLinearGradient(F,L,p,m),ts(l.stops,x).forEach(function(ee){return y.addColorStop(ee.stop,iA(ee.color))}),h.fillStyle=y,h.fillRect(0,0,_,O),_>0&&O>0&&(M=s.ctx.createPattern(I,"repeat"),s.renderRepeat(Y,M,k,P))):CB(l)&&(S=Kr(r,t,[null,null,null]),Y=S[0],K=S[1],R=S[2],_=S[3],O=S[4],q=l.position.length===0?[sn]:l.position,k=z(q[0],_),P=z(q[q.length-1],O),uA=uB(l,k,P,_,O),$=uA[0],eA=uA[1],$>0&&eA>0&&(UA=s.ctx.createRadialGradient(K+k,R+P,0,K+k,R+P,$),ts(l.stops,$*2).forEach(function(ee){return UA.addColorStop(ee.stop,iA(ee.color))}),s.path(Y),s.ctx.fillStyle=UA,$!==eA?(MA=r.bounds.left+.5*r.bounds.width,QA=r.bounds.top+.5*r.bounds.height,yA=eA/$,FA=1/yA,s.ctx.save(),s.ctx.translate(MA,QA),s.ctx.transform(1,0,0,yA,0,0),s.ctx.translate(-MA,-QA),s.ctx.fillRect(K,FA*(R-QA)+QA,_,O*FA),s.ctx.restore()):s.ctx.fill())),RA.label=6;case 6:return t--,[2]}})},s=this,i=0,o=r.styles.backgroundImage.slice(0).reverse(),B.label=1;case 1:return i<o.length?(a=o[i],[5,n(a)]):[3,4];case 2:B.sent(),B.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(r,t,n){return wA(this,void 0,void 0,function(){return cA(this,function(s){return this.path(Ss(n,t)),this.ctx.fillStyle=iA(r),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(r,t,n,s){return wA(this,void 0,void 0,function(){var i,o;return cA(this,function(a){switch(a.label){case 0:return t<3?[4,this.renderSolidBorder(r,n,s)]:[3,2];case 1:return a.sent(),[2];case 2:return i=Uu(s,n),this.path(i),this.ctx.fillStyle=iA(r),this.ctx.fill(),o=Fu(s,n),this.path(o),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(r){return wA(this,void 0,void 0,function(){var t,n,s,i,o,a,B,l,u=this;return cA(this,function(f){switch(f.label){case 0:return this.applyEffects(r.getEffects(2)),t=r.container.styles,n=!$A(t.backgroundColor)||t.backgroundImage.length,s=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],i=Lu(me(t.backgroundClip,0),r.curves),n||t.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),$A(t.backgroundColor)||(this.ctx.fillStyle=iA(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(r.container)]):[3,2];case 1:f.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(C){u.ctx.save();var g=Gt(r.curves),w=C.inset?0:bu,x=du(g,-w+(C.inset?1:-1)*C.spread.number,(C.inset?1:-1)*C.spread.number,C.spread.number*(C.inset?-2:2),C.spread.number*(C.inset?-2:2));C.inset?(u.path(g),u.ctx.clip(),u.mask(x)):(u.mask(g),u.ctx.clip(),u.path(x)),u.ctx.shadowOffsetX=C.offsetX.number+w,u.ctx.shadowOffsetY=C.offsetY.number,u.ctx.shadowColor=iA(C.color),u.ctx.shadowBlur=C.blur.number,u.ctx.fillStyle=C.inset?iA(C.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()}),f.label=2;case 2:o=0,a=0,B=s,f.label=3;case 3:return a<B.length?(l=B[a],l.style!==0&&!$A(l.color)&&l.width>0?l.style!==2?[3,5]:[4,this.renderDashedDottedBorder(l.color,l.width,o,r.curves,2)]:[3,11]):[3,13];case 4:return f.sent(),[3,11];case 5:return l.style!==3?[3,7]:[4,this.renderDashedDottedBorder(l.color,l.width,o,r.curves,3)];case 6:return f.sent(),[3,11];case 7:return l.style!==4?[3,9]:[4,this.renderDoubleBorder(l.color,l.width,o,r.curves)];case 8:return f.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,o,r.curves)];case 10:f.sent(),f.label=11;case 11:o++,f.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(r,t,n,s,i){return wA(this,void 0,void 0,function(){var o,a,B,l,u,f,C,g,w,x,F,p,L,m,I,h,I,h;return cA(this,function(y){return this.ctx.save(),o=pu(s,n),a=Ss(s,n),i===2&&(this.path(a),this.ctx.clip()),vA(a[0])?(B=a[0].start.x,l=a[0].start.y):(B=a[0].x,l=a[0].y),vA(a[1])?(u=a[1].end.x,f=a[1].end.y):(u=a[1].x,f=a[1].y),n===0||n===2?C=Math.abs(B-u):C=Math.abs(l-f),this.ctx.beginPath(),i===3?this.formatPath(o):this.formatPath(a.slice(0,2)),g=t<3?t*3:t*2,w=t<3?t*2:t,i===3&&(g=t,w=t),x=!0,C<=g*2?x=!1:C<=g*2+w?(F=C/(2*g+w),g*=F,w*=F):(p=Math.floor((C+w)/(g+w)),L=(C-p*g)/(p-1),m=(C-(p+1)*g)/p,w=m<=0||Math.abs(w-L)<Math.abs(w-m)?L:m),x&&(i===3?this.ctx.setLineDash([0,g+w]):this.ctx.setLineDash([g,w])),i===3?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=t*2+1.1,this.ctx.strokeStyle=iA(r),this.ctx.stroke(),this.ctx.setLineDash([]),i===2&&(vA(a[0])&&(I=a[3],h=a[0],this.ctx.beginPath(),this.formatPath([new v(I.end.x,I.end.y),new v(h.start.x,h.start.y)]),this.ctx.stroke()),vA(a[1])&&(I=a[1],h=a[2],this.ctx.beginPath(),this.formatPath([new v(I.end.x,I.end.y),new v(h.start.x,h.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(r){return wA(this,void 0,void 0,function(){var t;return cA(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=iA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=hu(r),[4,this.renderStack(t)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},e})(Mi),Tu=function(A){return A instanceof Ui||A instanceof hi?!0:A instanceof cn&&A.type!==Mt&&A.type!==_t},Lu=function(A,e){switch(A){case 0:return Gt(e);case 2:return fu(e);default:return Nt(e)}},Su=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},Ku=["-apple-system","system-ui"],Du=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(e){return Ku.indexOf(e)===-1}):A},_u=(function(A){LA(e,A);function e(r,t){var n=A.call(this,r,t)||this;return n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=t,n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+t.width+"x"+t.height+" at "+t.x+","+t.y+") with scale "+t.scale),n}return e.prototype.render=function(r){return wA(this,void 0,void 0,function(){var t,n;return cA(this,function(s){switch(s.label){case 0:return t=jr(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,r),[4,Mu(t)];case 1:return n=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=iA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e})(Mi),Mu=function(A){return new Promise(function(e,r){var t=new Image;t.onload=function(){e(t)},t.onerror=r,t.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(A))})},Ru=(function(){function A(e){var r=e.id,t=e.enabled;this.id=r,this.enabled=t,this.start=Date.now()}return A.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,lt([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.prototype.getTime=function(){return Date.now()-this.start},A.prototype.info=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,lt([this.id,this.getTime()+"ms"],e))},A.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,lt([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,lt([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.instances={},A})(),Ou=(function(){function A(e,r){var t;this.windowBounds=r,this.instanceName="#"+A.instanceCount++,this.logger=new Ru({id:this.instanceName,enabled:e.logging}),this.cache=(t=e.cache)!==null&&t!==void 0?t:new su(this,e)}return A.instanceCount=1,A})(),Gu=function(A,e){return e===void 0&&(e={}),Nu(A,e)};typeof window<"u"&&Ti.setContext(window);var Nu=function(A,e){return wA(void 0,void 0,void 0,function(){var r,t,n,s,i,o,a,B,l,u,f,C,g,w,x,F,p,L,m,I,y,h,y,M,S,Y,K,R,_,O,q,k,P,uA,$,eA,UA,MA,QA,yA;return cA(this,function(FA){switch(FA.label){case 0:if(!A||typeof A!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(r=A.ownerDocument,!r)throw new Error("Element is not attached to a Document");if(t=r.defaultView,!t)throw new Error("Document is not attached to a Window");return n={allowTaint:(M=e.allowTaint)!==null&&M!==void 0?M:!1,imageTimeout:(S=e.imageTimeout)!==null&&S!==void 0?S:15e3,proxy:e.proxy,useCORS:(Y=e.useCORS)!==null&&Y!==void 0?Y:!1},s=_r({logging:(K=e.logging)!==null&&K!==void 0?K:!0,cache:e.cache},n),i={windowWidth:(R=e.windowWidth)!==null&&R!==void 0?R:t.innerWidth,windowHeight:(_=e.windowHeight)!==null&&_!==void 0?_:t.innerHeight,scrollX:(O=e.scrollX)!==null&&O!==void 0?O:t.pageXOffset,scrollY:(q=e.scrollY)!==null&&q!==void 0?q:t.pageYOffset},o=new PA(i.scrollX,i.scrollY,i.windowWidth,i.windowHeight),a=new Ou(s,o),B=(k=e.foreignObjectRendering)!==null&&k!==void 0?k:!1,l={allowTaint:(P=e.allowTaint)!==null&&P!==void 0?P:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:B,copyStyles:B},a.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),u=new xs(a,A,l),f=u.clonedReferenceElement,f?[4,u.toIFrame(r,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return C=FA.sent(),g=ln(f)||Vl(f)?Co(f.ownerDocument):Pt(a,f),w=g.width,x=g.height,F=g.left,p=g.top,L=Vu(a,f,e.backgroundColor),m={canvas:e.canvas,backgroundColor:L,scale:($=(uA=e.scale)!==null&&uA!==void 0?uA:t.devicePixelRatio)!==null&&$!==void 0?$:1,x:((eA=e.x)!==null&&eA!==void 0?eA:0)+F,y:((UA=e.y)!==null&&UA!==void 0?UA:0)+p,width:(MA=e.width)!==null&&MA!==void 0?MA:Math.ceil(w),height:(QA=e.height)!==null&&QA!==void 0?QA:Math.ceil(x)},B?(a.logger.debug("Document cloned, using foreign object rendering"),y=new _u(a,m),[4,y.render(f)]):[3,3];case 2:return I=FA.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at "+F+","+p+" with size "+w+"x"+x+" using computed rendering"),a.logger.debug("Starting DOM parsing"),h=mi(a,f),L===h.styles.backgroundColor&&(h.styles.backgroundColor=VA.TRANSPARENT),a.logger.debug("Starting renderer for element at "+m.x+","+m.y+" with size "+m.width+"x"+m.height),y=new xu(a,m),[4,y.render(h)];case 4:I=FA.sent(),FA.label=5;case 5:return(!((yA=e.removeContainer)!==null&&yA!==void 0)||yA)&&(xs.destroy(C)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,I]}})})},Vu=function(A,e,r){var t=e.ownerDocument,n=t.documentElement?Je(A,getComputedStyle(t.documentElement).backgroundColor):VA.TRANSPARENT,s=t.body?Je(A,getComputedStyle(t.body).backgroundColor):VA.TRANSPARENT,i=typeof r=="string"?Je(A,r):r===null?VA.TRANSPARENT:4294967295;return e===t.documentElement?$A(n)?$A(s)?i:s:n:i},Ri=Gu;var Oi=!1,Pu=new Set(["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","LINK","META","PARAM","SOURCE","TRACK","WBR"]);function ku(){if(Oi)return;Oi=!0;let A=CanvasRenderingContext2D.prototype.createPattern;CanvasRenderingContext2D.prototype.createPattern=function(e,r){return e&&"width"in e&&"height"in e&&(e.width===0||e.height===0)?null:A.call(this,e,r)}}function Ni(){ku()}function Xu(A,e){if(!A.id)return;let r=e.getElementById(A.id);r instanceof HTMLElement&&(r.style.opacity="1",r.style.visibility="visible",r.querySelectorAll("[data-start]").forEach(t=>{t.style.visibility="visible"}))}function Wu(A){let e=A.ownerDocument.defaultView;e&&[A,...Array.from(A.querySelectorAll("*"))].forEach(r=>{if(Pu.has(r.tagName))return;let t=e.getComputedStyle(r);if(t.boxShadow==="none"||t.transform==="none")return;let n=A.ownerDocument.createElement("div");n.setAttribute("data-hyper-shader-shadow-shim",""),n.style.cssText=["position:absolute","inset:0","border-radius:inherit",`box-shadow:${t.boxShadow}`,"background:transparent","pointer-events:none","z-index:0"].join(";"),t.position==="static"&&(r.style.position="relative"),r.style.boxShadow="none",r.insertBefore(n,r.firstChild)})}function $t(){if(typeof document>"u")return!1;let A=document.createElement("canvas");if(A.setAttribute("layoutsubtree",""),!("layoutSubtree"in A))return!1;let e=A.getContext("2d");return e!=null&&typeof e.drawElementImage=="function"}async function Ju(A,e,r,t){let n=document.createElement("canvas");n.width=r,n.height=t,n.setAttribute("layoutsubtree",""),n.style.cssText=`position:fixed;top:0;left:0;width:${r}px;height:${t}px;z-index:-9999;pointer-events:none;opacity:0`,n.appendChild(A.cloneNode(!0)),document.body.appendChild(n);try{await new Promise(a=>requestAnimationFrame(()=>requestAnimationFrame(()=>a())));let s=n.getContext("2d");s.fillStyle=e,s.fillRect(0,0,r,t);let i=n.firstElementChild;i&&s.drawElementImage(i,0,0,r,t);let o=document.createElement("canvas");return o.width=r,o.height=t,o.getContext("2d").drawImage(n,0,0),n.remove(),o}catch(s){throw n.remove(),s}}function Vi(A,e,r=fe,t=ge,n={}){return $t()&&!n.preferBrowserPaint?Ju(A,e,r,t).catch(()=>Gi(A,e,r,t,n)):Gi(A,e,r,t,n)}function Gi(A,e,r,t,n={}){let s=i=>Ri(A,{width:r,height:t,scale:n.scale??1,backgroundColor:e,logging:!1,foreignObjectRendering:i,useCORS:!0,allowTaint:!0,onclone:o=>{if(!A.id)return;let a=o.getElementById(A.id);a instanceof HTMLElement&&Wu(a),n.forceVisible&&Xu(A,o)},ignoreElements:o=>o.tagName==="CANVAS"||o.hasAttribute("data-no-capture")});return n.preferBrowserPaint===!0?s(!0).catch(()=>s(!1)):s(!1)}var un="__hf-page-side-compositor",ki="__hf_page_compositor_v1__";function Pi(A){return{left:`${A.left}px`,top:`${A.top}px`,width:`${A.width}px`,height:`${A.height}px`}}function Xi(){if(typeof window>"u"||typeof document>"u"||!$t())return!1;let A=document.createElement("canvas"),e=A.getContext("webgl")||A.getContext("experimental-webgl");return e?(e.getExtension("WEBGL_lose_context")?.loseContext(),!0):!1}function fn(A){if(typeof window>"u")return!1;if(window.__HF_PAGE_COMPOSITOR_CANARY__=ki,!Xi())return console.warn("[HyperShader] page-side compositing requested but drawElementImage/WebGL is not available; falling back to opacity-flip mode (Node-side layered pipeline will handle the blend)."),!1;if(document.getElementById(un))return!0;let{scenes:e,transitions:r,accentColors:t,width:n,height:s,defaultDuration:i}=A,o=document.createElement("canvas");o.id=un,o.width=n,o.height=s,o.style.cssText="position:fixed;top:0;left:0;width:100%;height:100%;z-index:2147483646;pointer-events:none;display:none;",document.body.appendChild(o);let a=it(o,n,s);if(!a)return console.warn("[HyperShader] page-side compositor: WebGL context unavailable."),o.remove(),!1;let B=ot(a),l=new Map;for(let K of r)if(K.shader!==void 0&&!l.has(K.shader))try{l.set(K.shader,at(a,ct(K.shader)))}catch(R){console.warn(`[HyperShader] page-side compositor: failed to compile "${K.shader}":`,R)}let u=[];for(let K=0;K<r.length;K++){let R=r[K];if(!R||R.shader===void 0)continue;let _=e[K],O=e[K+1],q=l.get(R.shader);!_||!O||!q||u.push({time:R.time,duration:R.duration??i,shader:R.shader,fromSceneId:_,toSceneId:O,prog:q})}if(u.length===0)return o.remove(),!1;let f=ne(a),C=ne(a),g=document.createElement("canvas"),w=document.createElement("canvas");for(let K of[g,w])K.width=n,K.height=s,K.setAttribute("layoutsubtree",""),K.style.cssText="position:fixed;top:0;left:0;width:"+n+"px;height:"+s+"px;z-index:-9998;pointer-events:none;",document.body.appendChild(K);function x(K){for(let R of u)if(K>=R.time&&K<=R.time+R.duration)return R;return null}function F(K){let R=0;for(let _ of r)K>=_.time+(_.duration??i)&&(R+=1);return e[Math.min(R,e.length-1)]}let p=null,L=0,m=window;async function I(){let K=p;if(!K)return m.__hf_page_composite_pending=!1,!1;let R=document.getElementById(K.fromSceneId),_=document.getElementById(K.toSceneId);if(!(R instanceof HTMLElement)||!(_ instanceof HTMLElement))return m.__hf_page_composite_pending=!1,!1;let O=Pi(R.getBoundingClientRect()),q=Pi(_.getBoundingClientRect());for(;g.firstChild;)g.removeChild(g.firstChild);for(;w.firstChild;)w.removeChild(w.firstChild);let k=R.cloneNode(!0),P=_.cloneNode(!0);g.appendChild(k),w.appendChild(P);for(let[$,eA]of[[k,O],[P,q]])$.style.opacity="1",$.style.visibility="visible",$.style.position="absolute",$.style.left=eA.left,$.style.top=eA.top,$.style.width=eA.width,$.style.height=eA.height,$.querySelectorAll("[data-start]").forEach(UA=>{UA.style.opacity="1",UA.style.visibility="visible"});let uA=[];for(let $ of[g,w])for(let eA of $.querySelectorAll("img"))eA.src&&eA.src.startsWith("data:")&&typeof eA.decode=="function"&&uA.push(eA.decode().catch(()=>{}));return uA.length>0&&await Promise.all(uA),!0}function h(){let K=p;if(!K)return m.__hf_page_composite_pending=!1,!1;let R=g.firstElementChild,_=w.firstElementChild;if(!R||!_)return m.__hf_page_composite_pending=!1,!1;let O=g.getContext("2d"),q=w.getContext("2d");if(!O?.drawElementImage||!q?.drawElementImage)return m.__hf_page_composite_pending=!1,!1;try{O.fillStyle=A.bgColor,O.fillRect(0,0,n,s),O.drawElementImage(R,0,0,n,s),q.fillStyle=A.bgColor,q.fillRect(0,0,n,s),q.drawElementImage(_,0,0,n,s)}catch(k){return console.warn("[HyperShader] page-side compositor: drawElementImage failed:",k),m.__hf_page_composite_pending=!1,!1}we(a,f,g),we(a,C,w);try{Bt(a,B,K.prog,f,C,L,t,n,s),o.style.display="block"}catch(k){console.warn("[HyperShader] page-side compositor: renderShader failed:",k),o.style.display="none"}return m.__hf_page_composite_pending=!1,!0}m.__hf_page_composite_resolve=h,m.__hf_page_composite_prepare=I;let y=window,M=()=>{if(!y.__hf)return;let K=y.__hf.seek;if(typeof K!="function")return;let R=_=>{let O=K.call(y.__hf,_),q=x(_);if(!q){for(o.style.display="none",m.__hf_page_composite_pending=!1;g.firstChild;)g.removeChild(g.firstChild);for(;w.firstChild;)w.removeChild(w.firstChild);let k=F(_),P=k?document.getElementById(k):null;return P instanceof HTMLElement&&P.style.visibility==="hidden"&&(P.style.visibility="visible"),O}return p=q,L=q.duration===0?1:Math.min(1,Math.max(0,(_-q.time)/q.duration)),m.__hf_page_composite_pending=!0,O};y.__hf.seek=R},S=0,Y=window.setInterval(()=>{S+=1,y.__hf?.seek?(M(),window.clearInterval(Y)):S>200&&(window.clearInterval(Y),console.warn("[HyperShader] page-side compositor: window.__hf.seek never appeared after 10s; the engine bridge did not initialize. Falling back to opacity-flip mode."))},50);return!0}var tr=.7,wn="power2.inOut",Yu="attribute vec2 a_pos; varying vec2 v_uv; void main(){v_uv=a_pos*0.5+0.5; gl_Position=vec4(a_pos,0,1);}",Ar=["Preparing scene transitions","Sampling outgoing scene motion","Sampling incoming scene motion","Caching transition frames","Finalizing transition preview"],Zu="hyper-shader-preview-cache",_A="frames",qu=1,ju="v1",Wi=2,Ji=1.25,zu=1200;function $u(A){let e=A.replace("#","");if(e.length<6)return[.5,.5,.5];let r=parseInt(e.slice(0,2),16)/255,t=parseInt(e.slice(2,4),16)/255,n=parseInt(e.slice(4,6),16)/255;return Number.isNaN(r)||Number.isNaN(t)||Number.isNaN(n)?[.5,.5,.5]:[r,t,n]}function eo(A){let[e,r,t]=$u(A);return{accent:[e,r,t],dark:[e*.35,r*.35,t*.35],bright:[Math.min(1,e*1.5+.2),Math.min(1,r*1.5+.2),Math.min(1,t*1.5+.2)]}}function ce(A,e,r){return Math.min(r,Math.max(e,A))}function Af(A,e){return A===void 0?e:Number.isFinite(A)&&A>0?A:e}var ef="__hf_shader_capture_scale",tf="__hf_shader_loading";function to(A,e){let r=window[A];if(typeof r=="string")return r;if(typeof r=="number"&&Number.isFinite(r))return String(r);try{return new URLSearchParams(window.location.search).get(e)}catch{return null}}function rf(){let A=to("__HF_SHADER_CAPTURE_SCALE",ef),e=A===null?NaN:Number(A);return ce(Number.isFinite(e)&&e>0?e:1,.25,1)}function nf(){let A=to("__HF_SHADER_LOADING",tf)?.trim().toLowerCase();return A==="player"||A==="true"||A==="1"?"player":A==="none"||A==="false"||A==="0"||A==="off"?"none":"internal"}function nr(A){let e=2166136261;for(let r=0;r<A.length;r+=1)e^=A.charCodeAt(r),e=Math.imul(e,16777619);return(e>>>0).toString(16).padStart(8,"0")}function sf(A){let e=Array.from(A.querySelectorAll("style")).map(t=>t.textContent||"").join(`
|
|
6
|
+
.`+tn+tu+Ts)},nu=function(A,e){var r=A.ownerDocument;if(r){var t=r.createElement("style");t.textContent=e,A.appendChild(t)}},Ti=(function(){function A(){}return A.getOrigin=function(e){var r=A._link;return r?(r.href=e,r.href=r.href,r.protocol+r.hostname+r.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A})(),su=(function(){function A(e,r){this.context=e,this._options=r,this._cache={}}return A.prototype.addImage=function(e){var r=Promise.resolve();return this.has(e)||(Sr(e)||Bu(e))&&(this._cache[e]=this.loadImage(e)).catch(function(){}),r},A.prototype.match=function(e){return this._cache[e]},A.prototype.loadImage=function(e){return wA(this,void 0,void 0,function(){var r,t,n,s,i=this;return cA(this,function(o){switch(o.label){case 0:return r=Ti.isSameOrigin(e),t=!Lr(e)&&this._options.useCORS===!0&&aA.SUPPORT_CORS_IMAGES&&!r,n=!Lr(e)&&!r&&!Sr(e)&&typeof this._options.proxy=="string"&&aA.SUPPORT_CORS_XHR&&!t,!r&&this._options.allowTaint===!1&&!Lr(e)&&!Sr(e)&&!n&&!t?[2]:(s=e,n?[4,this.proxy(s)]:[3,2]);case 1:s=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise(function(a,B){var l=new Image;l.onload=function(){return a(l)},l.onerror=B,(cu(s)||t)&&(l.crossOrigin="anonymous"),l.src=s,l.complete===!0&&setTimeout(function(){return a(l)},500),i._options.imageTimeout>0&&setTimeout(function(){return B("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},A.prototype.has=function(e){return typeof this._cache[e]<"u"},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(e){var r=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var n=e.substring(0,256);return new Promise(function(s,i){var o=aA.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(o==="text")s(a.response);else{var u=new FileReader;u.addEventListener("load",function(){return s(u.result)},!1),u.addEventListener("error",function(f){return i(f)},!1),u.readAsDataURL(a.response)}else i("Failed to proxy resource "+n+" with status code "+a.status)},a.onerror=i;var B=t.indexOf("?")>-1?"&":"?";if(a.open("GET",""+t+B+"url="+encodeURIComponent(e)+"&responseType="+o),o!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=o),r._options.imageTimeout){var l=r._options.imageTimeout;a.timeout=l,a.ontimeout=function(){return i("Timed out ("+l+"ms) proxying "+n)}}a.send()})},A})(),iu=/^data:image\/svg\+xml/i,ou=/^data:image\/.*;base64,/i,au=/^data:image\/.*/i,Bu=function(A){return aA.SUPPORT_SVG_DRAWING||!lu(A)},Lr=function(A){return au.test(A)},cu=function(A){return ou.test(A)},Sr=function(A){return A.substr(0,4)==="blob"},lu=function(A){return A.substr(-3).toLowerCase()==="svg"||iu.test(A)},v=(function(){function A(e,r){this.type=0,this.x=e,this.y=r}return A.prototype.add=function(e,r){return new A(this.x+e,this.y+r)},A})(),Ue=function(A,e,r){return new v(A.x+(e.x-A.x)*r,A.y+(e.y-A.y)*r)},Et=(function(){function A(e,r,t,n){this.type=1,this.start=e,this.startControl=r,this.endControl=t,this.end=n}return A.prototype.subdivide=function(e,r){var t=Ue(this.start,this.startControl,e),n=Ue(this.startControl,this.endControl,e),s=Ue(this.endControl,this.end,e),i=Ue(t,n,e),o=Ue(n,s,e),a=Ue(i,o,e);return r?new A(this.start,t,i,a):new A(a,o,s,this.end)},A.prototype.add=function(e,r){return new A(this.start.add(e,r),this.startControl.add(e,r),this.endControl.add(e,r),this.end.add(e,r))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A})(),vA=function(A){return A.type===1},uu=(function(){function A(e){var r=e.styles,t=e.bounds,n=Pe(r.borderTopLeftRadius,t.width,t.height),s=n[0],i=n[1],o=Pe(r.borderTopRightRadius,t.width,t.height),a=o[0],B=o[1],l=Pe(r.borderBottomRightRadius,t.width,t.height),u=l[0],f=l[1],C=Pe(r.borderBottomLeftRadius,t.width,t.height),g=C[0],w=C[1],x=[];x.push((s+a)/t.width),x.push((g+u)/t.width),x.push((i+w)/t.height),x.push((B+f)/t.height);var F=Math.max.apply(Math,x);F>1&&(s/=F,i/=F,a/=F,B/=F,u/=F,f/=F,g/=F,w/=F);var p=t.width-a,L=t.height-f,m=t.width-u,I=t.height-w,h=r.borderTopWidth,y=r.borderRightWidth,M=r.borderBottomWidth,S=r.borderLeftWidth,Y=z(r.paddingTop,e.bounds.width),K=z(r.paddingRight,e.bounds.width),R=z(r.paddingBottom,e.bounds.width),_=z(r.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=s>0||i>0?AA(t.left+S/3,t.top+h/3,s-S/3,i-h/3,J.TOP_LEFT):new v(t.left+S/3,t.top+h/3),this.topRightBorderDoubleOuterBox=s>0||i>0?AA(t.left+p,t.top+h/3,a-y/3,B-h/3,J.TOP_RIGHT):new v(t.left+t.width-y/3,t.top+h/3),this.bottomRightBorderDoubleOuterBox=u>0||f>0?AA(t.left+m,t.top+L,u-y/3,f-M/3,J.BOTTOM_RIGHT):new v(t.left+t.width-y/3,t.top+t.height-M/3),this.bottomLeftBorderDoubleOuterBox=g>0||w>0?AA(t.left+S/3,t.top+I,g-S/3,w-M/3,J.BOTTOM_LEFT):new v(t.left+S/3,t.top+t.height-M/3),this.topLeftBorderDoubleInnerBox=s>0||i>0?AA(t.left+S*2/3,t.top+h*2/3,s-S*2/3,i-h*2/3,J.TOP_LEFT):new v(t.left+S*2/3,t.top+h*2/3),this.topRightBorderDoubleInnerBox=s>0||i>0?AA(t.left+p,t.top+h*2/3,a-y*2/3,B-h*2/3,J.TOP_RIGHT):new v(t.left+t.width-y*2/3,t.top+h*2/3),this.bottomRightBorderDoubleInnerBox=u>0||f>0?AA(t.left+m,t.top+L,u-y*2/3,f-M*2/3,J.BOTTOM_RIGHT):new v(t.left+t.width-y*2/3,t.top+t.height-M*2/3),this.bottomLeftBorderDoubleInnerBox=g>0||w>0?AA(t.left+S*2/3,t.top+I,g-S*2/3,w-M*2/3,J.BOTTOM_LEFT):new v(t.left+S*2/3,t.top+t.height-M*2/3),this.topLeftBorderStroke=s>0||i>0?AA(t.left+S/2,t.top+h/2,s-S/2,i-h/2,J.TOP_LEFT):new v(t.left+S/2,t.top+h/2),this.topRightBorderStroke=s>0||i>0?AA(t.left+p,t.top+h/2,a-y/2,B-h/2,J.TOP_RIGHT):new v(t.left+t.width-y/2,t.top+h/2),this.bottomRightBorderStroke=u>0||f>0?AA(t.left+m,t.top+L,u-y/2,f-M/2,J.BOTTOM_RIGHT):new v(t.left+t.width-y/2,t.top+t.height-M/2),this.bottomLeftBorderStroke=g>0||w>0?AA(t.left+S/2,t.top+I,g-S/2,w-M/2,J.BOTTOM_LEFT):new v(t.left+S/2,t.top+t.height-M/2),this.topLeftBorderBox=s>0||i>0?AA(t.left,t.top,s,i,J.TOP_LEFT):new v(t.left,t.top),this.topRightBorderBox=a>0||B>0?AA(t.left+p,t.top,a,B,J.TOP_RIGHT):new v(t.left+t.width,t.top),this.bottomRightBorderBox=u>0||f>0?AA(t.left+m,t.top+L,u,f,J.BOTTOM_RIGHT):new v(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=g>0||w>0?AA(t.left,t.top+I,g,w,J.BOTTOM_LEFT):new v(t.left,t.top+t.height),this.topLeftPaddingBox=s>0||i>0?AA(t.left+S,t.top+h,Math.max(0,s-S),Math.max(0,i-h),J.TOP_LEFT):new v(t.left+S,t.top+h),this.topRightPaddingBox=a>0||B>0?AA(t.left+Math.min(p,t.width-y),t.top+h,p>t.width+y?0:Math.max(0,a-y),Math.max(0,B-h),J.TOP_RIGHT):new v(t.left+t.width-y,t.top+h),this.bottomRightPaddingBox=u>0||f>0?AA(t.left+Math.min(m,t.width-S),t.top+Math.min(L,t.height-M),Math.max(0,u-y),Math.max(0,f-M),J.BOTTOM_RIGHT):new v(t.left+t.width-y,t.top+t.height-M),this.bottomLeftPaddingBox=g>0||w>0?AA(t.left+S,t.top+Math.min(I,t.height-M),Math.max(0,g-S),Math.max(0,w-M),J.BOTTOM_LEFT):new v(t.left+S,t.top+t.height-M),this.topLeftContentBox=s>0||i>0?AA(t.left+S+_,t.top+h+Y,Math.max(0,s-(S+_)),Math.max(0,i-(h+Y)),J.TOP_LEFT):new v(t.left+S+_,t.top+h+Y),this.topRightContentBox=a>0||B>0?AA(t.left+Math.min(p,t.width+S+_),t.top+h+Y,p>t.width+S+_?0:a-S+_,B-(h+Y),J.TOP_RIGHT):new v(t.left+t.width-(y+K),t.top+h+Y),this.bottomRightContentBox=u>0||f>0?AA(t.left+Math.min(m,t.width-(S+_)),t.top+Math.min(L,t.height+h+Y),Math.max(0,u-(y+K)),f-(M+R),J.BOTTOM_RIGHT):new v(t.left+t.width-(y+K),t.top+t.height-(M+R)),this.bottomLeftContentBox=g>0||w>0?AA(t.left+S+_,t.top+I,Math.max(0,g-(S+_)),w-(M+R),J.BOTTOM_LEFT):new v(t.left+S+_,t.top+t.height-(M+R))}return A})(),J;(function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(J||(J={}));var AA=function(A,e,r,t,n){var s=4*((Math.sqrt(2)-1)/3),i=r*s,o=t*s,a=A+r,B=e+t;switch(n){case J.TOP_LEFT:return new Et(new v(A,B),new v(A,B-o),new v(a-i,e),new v(a,e));case J.TOP_RIGHT:return new Et(new v(A,e),new v(A+i,e),new v(a,B-o),new v(a,B));case J.BOTTOM_RIGHT:return new Et(new v(a,e),new v(a,e+o),new v(A+i,B),new v(A,B));case J.BOTTOM_LEFT:default:return new Et(new v(a,B),new v(a-i,B),new v(A,e+o),new v(A,e))}},Gt=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},fu=function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]},Nt=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},gu=(function(){function A(e,r,t){this.offsetX=e,this.offsetY=r,this.matrix=t,this.type=0,this.target=6}return A})(),Ht=(function(){function A(e,r){this.path=e,this.target=r,this.type=1}return A})(),wu=(function(){function A(e){this.opacity=e,this.type=2,this.target=6}return A})(),Qu=function(A){return A.type===0},Li=function(A){return A.type===1},Cu=function(A){return A.type===2},Ls=function(A,e){return A.length===e.length?A.some(function(r,t){return r===e[t]}):!1},du=function(A,e,r,t,n){return A.map(function(s,i){switch(i){case 0:return s.add(e,r);case 1:return s.add(e+t,r);case 2:return s.add(e+t,r+n);case 3:return s.add(e,r+n)}return s})},Si=(function(){function A(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return A})(),Ki=(function(){function A(e,r){if(this.container=e,this.parent=r,this.effects=[],this.curves=new uu(this.container),this.container.styles.opacity<1&&this.effects.push(new wu(this.container.styles.opacity)),this.container.styles.transform!==null){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,s=this.container.styles.transform;this.effects.push(new gu(t,n,s))}if(this.container.styles.overflowX!==0){var i=Gt(this.curves),o=Nt(this.curves);Ls(i,o)?this.effects.push(new Ht(i,6)):(this.effects.push(new Ht(i,2)),this.effects.push(new Ht(o,4)))}}return A.prototype.getEffects=function(e){for(var r=[2,3].indexOf(this.container.styles.position)===-1,t=this.parent,n=this.effects.slice(0);t;){var s=t.effects.filter(function(a){return!Li(a)});if(r||t.container.styles.position!==0||!t.parent){if(n.unshift.apply(n,s),r=[2,3].indexOf(t.container.styles.position)===-1,t.container.styles.overflowX!==0){var i=Gt(t.curves),o=Nt(t.curves);Ls(i,o)||n.unshift(new Ht(o,6))}}else n.unshift.apply(n,s);t=t.parent}return n.filter(function(a){return sA(a.target,e)})},A})(),rn=function(A,e,r,t){A.container.elements.forEach(function(n){var s=sA(n.flags,4),i=sA(n.flags,2),o=new Ki(n,A);sA(n.styles.display,2048)&&t.push(o);var a=sA(n.flags,8)?[]:t;if(s||i){var B=s||n.styles.isPositioned()?r:e,l=new Si(o);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var u=n.styles.zIndex.order;if(u<0){var f=0;B.negativeZIndex.some(function(g,w){return u>g.element.container.styles.zIndex.order?(f=w,!1):f>0}),B.negativeZIndex.splice(f,0,l)}else if(u>0){var C=0;B.positiveZIndex.some(function(g,w){return u>=g.element.container.styles.zIndex.order?(C=w+1,!1):C>0}),B.positiveZIndex.splice(C,0,l)}else B.zeroOrAutoZIndexOrTransformedOrOpacity.push(l)}else n.styles.isFloating()?B.nonPositionedFloats.push(l):B.nonPositionedInlineLevel.push(l);rn(o,l,s?l:r,a)}else n.styles.isInlineLevel()?e.inlineLevel.push(o):e.nonInlineLevel.push(o),rn(o,e,r,a);sA(n.flags,8)&&Di(n,a)})},Di=function(A,e){for(var r=A instanceof zr?A.start:1,t=A instanceof zr?A.reversed:!1,n=0;n<e.length;n++){var s=e[n];s.container instanceof di&&typeof s.container.value=="number"&&s.container.value!==0&&(r=s.container.value),s.listValue=$e(r,s.container.styles.listStyleType,!0),r+=t?-1:1}},hu=function(A){var e=new Ki(A,null),r=new Si(e),t=[];return rn(e,r,r,t),Di(e.container,t),r},Ss=function(A,e){switch(e){case 0:return HA(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return HA(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return HA(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return HA(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},Uu=function(A,e){switch(e){case 0:return HA(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return HA(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return HA(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return HA(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}},Fu=function(A,e){switch(e){case 0:return HA(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return HA(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return HA(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return HA(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}},pu=function(A,e){switch(e){case 0:return yt(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return yt(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return yt(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return yt(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}},yt=function(A,e){var r=[];return vA(A)?r.push(A.subdivide(.5,!1)):r.push(A),vA(e)?r.push(e.subdivide(.5,!0)):r.push(e),r},HA=function(A,e,r,t){var n=[];return vA(A)?n.push(A.subdivide(.5,!1)):n.push(A),vA(r)?n.push(r.subdivide(.5,!0)):n.push(r),vA(t)?n.push(t.subdivide(.5,!0).reverse()):n.push(t),vA(e)?n.push(e.subdivide(.5,!1).reverse()):n.push(e),n},_i=function(A){var e=A.bounds,r=A.styles;return e.add(r.borderLeftWidth,r.borderTopWidth,-(r.borderRightWidth+r.borderLeftWidth),-(r.borderTopWidth+r.borderBottomWidth))},Vt=function(A){var e=A.styles,r=A.bounds,t=z(e.paddingLeft,r.width),n=z(e.paddingRight,r.width),s=z(e.paddingTop,r.width),i=z(e.paddingBottom,r.width);return r.add(t+e.borderLeftWidth,s+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+t+n),-(e.borderTopWidth+e.borderBottomWidth+s+i))},mu=function(A,e){return A===0?e.bounds:A===2?Vt(e):_i(e)},vu=function(A,e){return A===0?e.bounds:A===2?Vt(e):_i(e)},Kr=function(A,e,r){var t=mu(me(A.styles.backgroundOrigin,e),A),n=vu(me(A.styles.backgroundClip,e),A),s=Eu(me(A.styles.backgroundSize,e),r,t),i=s[0],o=s[1],a=Pe(me(A.styles.backgroundPosition,e),t.width-i,t.height-o),B=Hu(me(A.styles.backgroundRepeat,e),a,s,t,n),l=Math.round(t.left+a[0]),u=Math.round(t.top+a[1]);return[B,l,u,i,o]},Fe=function(A){return Z(A)&&A.value===Ee.AUTO},It=function(A){return typeof A=="number"},Eu=function(A,e,r){var t=e[0],n=e[1],s=e[2],i=A[0],o=A[1];if(!i)return[0,0];if(nA(i)&&o&&nA(o))return[z(i,r.width),z(o,r.height)];var a=It(s);if(Z(i)&&(i.value===Ee.CONTAIN||i.value===Ee.COVER)){if(It(s)){var B=r.width/r.height;return B<s!=(i.value===Ee.COVER)?[r.width,r.width/s]:[r.height*s,r.height]}return[r.width,r.height]}var l=It(t),u=It(n),f=l||u;if(Fe(i)&&(!o||Fe(o))){if(l&&u)return[t,n];if(!a&&!f)return[r.width,r.height];if(f&&a){var C=l?t:n*s,g=u?n:t/s;return[C,g]}var w=l?t:r.width,x=u?n:r.height;return[w,x]}if(a){var F=0,p=0;return nA(i)?F=z(i,r.width):nA(o)&&(p=z(o,r.height)),Fe(i)?F=p*s:(!o||Fe(o))&&(p=F/s),[F,p]}var L=null,m=null;if(nA(i)?L=z(i,r.width):o&&nA(o)&&(m=z(o,r.height)),L!==null&&(!o||Fe(o))&&(m=l&&u?L/t*n:r.height),m!==null&&Fe(i)&&(L=l&&u?m/n*t:r.width),L!==null&&m!==null)return[L,m];throw new Error("Unable to calculate background-size for element")},me=function(A,e){var r=A[e];return typeof r>"u"?A[0]:r},Hu=function(A,e,r,t,n){var s=e[0],i=e[1],o=r[0],a=r[1];switch(A){case 2:return[new v(Math.round(t.left),Math.round(t.top+i)),new v(Math.round(t.left+t.width),Math.round(t.top+i)),new v(Math.round(t.left+t.width),Math.round(a+t.top+i)),new v(Math.round(t.left),Math.round(a+t.top+i))];case 3:return[new v(Math.round(t.left+s),Math.round(t.top)),new v(Math.round(t.left+s+o),Math.round(t.top)),new v(Math.round(t.left+s+o),Math.round(t.height+t.top)),new v(Math.round(t.left+s),Math.round(t.height+t.top))];case 1:return[new v(Math.round(t.left+s),Math.round(t.top+i)),new v(Math.round(t.left+s+o),Math.round(t.top+i)),new v(Math.round(t.left+s+o),Math.round(t.top+i+a)),new v(Math.round(t.left+s),Math.round(t.top+i+a))];default:return[new v(Math.round(n.left),Math.round(n.top)),new v(Math.round(n.left+n.width),Math.round(n.top)),new v(Math.round(n.left+n.width),Math.round(n.height+n.top)),new v(Math.round(n.left),Math.round(n.height+n.top))]}},yu="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Ks="Hidden Text",Iu=(function(){function A(e){this._data={},this._document=e}return A.prototype.parseMetrics=function(e,r){var t=this._document.createElement("div"),n=this._document.createElement("img"),s=this._document.createElement("span"),i=this._document.body;t.style.visibility="hidden",t.style.fontFamily=e,t.style.fontSize=r,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",i.appendChild(t),n.src=yu,n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",s.style.fontFamily=e,s.style.fontSize=r,s.style.margin="0",s.style.padding="0",s.appendChild(this._document.createTextNode(Ks)),t.appendChild(s),t.appendChild(n);var o=n.offsetTop-s.offsetTop+2;t.removeChild(s),t.appendChild(this._document.createTextNode(Ks)),t.style.lineHeight="normal",n.style.verticalAlign="super";var a=n.offsetTop-t.offsetTop+2;return i.removeChild(t),{baseline:o,middle:a}},A.prototype.getMetrics=function(e,r){var t=e+" "+r;return typeof this._data[t]>"u"&&(this._data[t]=this.parseMetrics(e,r)),this._data[t]},A})(),Mi=(function(){function A(e,r){this.context=e,this.options=r}return A})(),bu=1e4,xu=(function(A){LA(e,A);function e(r,t){var n=A.call(this,r,t)||this;return n._activeEffects=[],n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),t.canvas||(n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px"),n.fontMetrics=new Iu(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+t.width+"x"+t.height+") with scale "+t.scale),n}return e.prototype.applyEffects=function(r){for(var t=this;this._activeEffects.length;)this.popEffect();r.forEach(function(n){return t.applyEffect(n)})},e.prototype.applyEffect=function(r){this.ctx.save(),Cu(r)&&(this.ctx.globalAlpha=r.opacity),Qu(r)&&(this.ctx.translate(r.offsetX,r.offsetY),this.ctx.transform(r.matrix[0],r.matrix[1],r.matrix[2],r.matrix[3],r.matrix[4],r.matrix[5]),this.ctx.translate(-r.offsetX,-r.offsetY)),Li(r)&&(this.path(r.path),this.ctx.clip()),this._activeEffects.push(r)},e.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},e.prototype.renderStack=function(r){return wA(this,void 0,void 0,function(){var t;return cA(this,function(n){switch(n.label){case 0:return t=r.element.container.styles,t.isVisible()?[4,this.renderStackContent(r)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}})})},e.prototype.renderNode=function(r){return wA(this,void 0,void 0,function(){return cA(this,function(t){switch(t.label){case 0:if(sA(r.container.flags,16))debugger;return r.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(r)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(r)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},e.prototype.renderTextWithLetterSpacing=function(r,t,n){var s=this;if(t===0)this.ctx.fillText(r.text,r.bounds.left,r.bounds.top+n);else{var i=Bn(r.text);i.reduce(function(o,a){return s.ctx.fillText(a,o,r.bounds.top+n),o+s.ctx.measureText(a).width},r.bounds.left)}},e.prototype.createFontStyle=function(r){var t=r.fontVariant.filter(function(i){return i==="normal"||i==="small-caps"}).join(""),n=Du(r.fontFamily).join(", "),s=et(r.fontSize)?""+r.fontSize.number+r.fontSize.unit:r.fontSize.number+"px";return[[r.fontStyle,t,r.fontWeight,s,n].join(" "),n,s]},e.prototype.renderTextNode=function(r,t){return wA(this,void 0,void 0,function(){var n,s,i,o,a,B,l,u,f=this;return cA(this,function(C){return n=this.createFontStyle(t),s=n[0],i=n[1],o=n[2],this.ctx.font=s,this.ctx.direction=t.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(i,o),B=a.baseline,l=a.middle,u=t.paintOrder,r.textBounds.forEach(function(g){u.forEach(function(w){switch(w){case 0:f.ctx.fillStyle=iA(t.color),f.renderTextWithLetterSpacing(g,t.letterSpacing,B);var x=t.textShadow;x.length&&g.text.trim().length&&(x.slice(0).reverse().forEach(function(F){f.ctx.shadowColor=iA(F.color),f.ctx.shadowOffsetX=F.offsetX.number*f.options.scale,f.ctx.shadowOffsetY=F.offsetY.number*f.options.scale,f.ctx.shadowBlur=F.blur.number,f.renderTextWithLetterSpacing(g,t.letterSpacing,B)}),f.ctx.shadowColor="",f.ctx.shadowOffsetX=0,f.ctx.shadowOffsetY=0,f.ctx.shadowBlur=0),t.textDecorationLine.length&&(f.ctx.fillStyle=iA(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(F){switch(F){case 1:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top+B),g.bounds.width,1);break;case 2:f.ctx.fillRect(g.bounds.left,Math.round(g.bounds.top),g.bounds.width,1);break;case 3:f.ctx.fillRect(g.bounds.left,Math.ceil(g.bounds.top+l),g.bounds.width,1);break}}));break;case 1:t.webkitTextStrokeWidth&&g.text.trim().length&&(f.ctx.strokeStyle=iA(t.webkitTextStrokeColor),f.ctx.lineWidth=t.webkitTextStrokeWidth,f.ctx.lineJoin=window.chrome?"miter":"round",f.ctx.strokeText(g.text,g.bounds.left,g.bounds.top+B)),f.ctx.strokeStyle="",f.ctx.lineWidth=0,f.ctx.lineJoin="miter";break}})}),[2]})})},e.prototype.renderReplacedElement=function(r,t,n){if(n&&r.intrinsicWidth>0&&r.intrinsicHeight>0){var s=Vt(r),i=Nt(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,r.intrinsicWidth,r.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(r){return wA(this,void 0,void 0,function(){var t,n,s,i,o,a,p,p,B,l,u,f,m,C,g,I,w,x,F,p,L,m,I;return cA(this,function(h){switch(h.label){case 0:this.applyEffects(r.getEffects(4)),t=r.container,n=r.curves,s=t.styles,i=0,o=t.textNodes,h.label=1;case 1:return i<o.length?(a=o[i],[4,this.renderTextNode(a,s)]):[3,4];case 2:h.sent(),h.label=3;case 3:return i++,[3,1];case 4:if(!(t instanceof wi))return[3,8];h.label=5;case 5:return h.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return p=h.sent(),this.renderReplacedElement(t,n,p),[3,8];case 7:return h.sent(),this.context.logger.error("Error loading image "+t.src),[3,8];case 8:if(t instanceof Qi&&this.renderReplacedElement(t,n,t.canvas),!(t instanceof Ci))return[3,12];h.label=9;case 9:return h.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return p=h.sent(),this.renderReplacedElement(t,n,p),[3,12];case 11:return h.sent(),this.context.logger.error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof Fi&&t.tree?(B=new e(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}),[4,B.render(t.tree)]):[3,14];case 13:l=h.sent(),t.width&&t.height&&this.ctx.drawImage(l,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),h.label=14;case 14:if(t instanceof cn&&(u=Math.min(t.bounds.width,t.bounds.height),t.type===_t?t.checked&&(this.ctx.save(),this.path([new v(t.bounds.left+u*.39363,t.bounds.top+u*.79),new v(t.bounds.left+u*.16,t.bounds.top+u*.5549),new v(t.bounds.left+u*.27347,t.bounds.top+u*.44071),new v(t.bounds.left+u*.39694,t.bounds.top+u*.5649),new v(t.bounds.left+u*.72983,t.bounds.top+u*.23),new v(t.bounds.left+u*.84,t.bounds.top+u*.34085),new v(t.bounds.left+u*.39363,t.bounds.top+u*.79)]),this.ctx.fillStyle=iA(Fs),this.ctx.fill(),this.ctx.restore()):t.type===Mt&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+u/2,t.bounds.top+u/2,u/4,0,Math.PI*2,!0),this.ctx.fillStyle=iA(Fs),this.ctx.fill(),this.ctx.restore())),Tu(t)&&t.value.length){switch(f=this.createFontStyle(s),m=f[0],C=f[1],g=this.fontMetrics.getMetrics(m,C).baseline,this.ctx.font=m,this.ctx.fillStyle=iA(s.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Su(t.styles.textAlign),I=Vt(t),w=0,t.styles.textAlign){case 1:w+=I.width/2;break;case 2:w+=I.width;break}x=I.add(w,0,0,-I.height/2+1),this.ctx.save(),this.path([new v(I.left,I.top),new v(I.left+I.width,I.top),new v(I.left+I.width,I.top+I.height),new v(I.left,I.top+I.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Ze(t.value,x),s.letterSpacing,g),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!sA(t.styles.display,2048))return[3,20];if(t.styles.listStyleImage===null)return[3,19];if(F=t.styles.listStyleImage,F.type!==0)return[3,18];p=void 0,L=F.url,h.label=15;case 15:return h.trys.push([15,17,,18]),[4,this.context.cache.match(L)];case 16:return p=h.sent(),this.ctx.drawImage(p,t.bounds.left-(p.width+10),t.bounds.top),[3,18];case 17:return h.sent(),this.context.logger.error("Error loading list-style-image "+L),[3,18];case 18:return[3,20];case 19:r.listValue&&t.styles.listStyleType!==-1&&(m=this.createFontStyle(s)[0],this.ctx.font=m,this.ctx.fillStyle=iA(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",I=new PA(t.bounds.left,t.bounds.top+z(t.styles.paddingTop,t.bounds.width),t.bounds.width,ns(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Ze(r.listValue,I),s.letterSpacing,ns(s.lineHeight,s.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),h.label=20;case 20:return[2]}})})},e.prototype.renderStackContent=function(r){return wA(this,void 0,void 0,function(){var t,n,F,s,i,F,o,a,F,B,l,F,u,f,F,C,g,F,w,x,F;return cA(this,function(p){switch(p.label){case 0:if(sA(r.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(r.element)];case 1:p.sent(),t=0,n=r.negativeZIndex,p.label=2;case 2:return t<n.length?(F=n[t],[4,this.renderStack(F)]):[3,5];case 3:p.sent(),p.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(r.element)];case 6:p.sent(),s=0,i=r.nonInlineLevel,p.label=7;case 7:return s<i.length?(F=i[s],[4,this.renderNode(F)]):[3,10];case 8:p.sent(),p.label=9;case 9:return s++,[3,7];case 10:o=0,a=r.nonPositionedFloats,p.label=11;case 11:return o<a.length?(F=a[o],[4,this.renderStack(F)]):[3,14];case 12:p.sent(),p.label=13;case 13:return o++,[3,11];case 14:B=0,l=r.nonPositionedInlineLevel,p.label=15;case 15:return B<l.length?(F=l[B],[4,this.renderStack(F)]):[3,18];case 16:p.sent(),p.label=17;case 17:return B++,[3,15];case 18:u=0,f=r.inlineLevel,p.label=19;case 19:return u<f.length?(F=f[u],[4,this.renderNode(F)]):[3,22];case 20:p.sent(),p.label=21;case 21:return u++,[3,19];case 22:C=0,g=r.zeroOrAutoZIndexOrTransformedOrOpacity,p.label=23;case 23:return C<g.length?(F=g[C],[4,this.renderStack(F)]):[3,26];case 24:p.sent(),p.label=25;case 25:return C++,[3,23];case 26:w=0,x=r.positiveZIndex,p.label=27;case 27:return w<x.length?(F=x[w],[4,this.renderStack(F)]):[3,30];case 28:p.sent(),p.label=29;case 29:return w++,[3,27];case 30:return[2]}})})},e.prototype.mask=function(r){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(r.slice(0).reverse()),this.ctx.closePath()},e.prototype.path=function(r){this.ctx.beginPath(),this.formatPath(r),this.ctx.closePath()},e.prototype.formatPath=function(r){var t=this;r.forEach(function(n,s){var i=vA(n)?n.start:n;s===0?t.ctx.moveTo(i.x,i.y):t.ctx.lineTo(i.x,i.y),vA(n)&&t.ctx.bezierCurveTo(n.startControl.x,n.startControl.y,n.endControl.x,n.endControl.y,n.end.x,n.end.y)})},e.prototype.renderRepeat=function(r,t,n,s){this.path(r),this.ctx.fillStyle=t,this.ctx.translate(n,s),this.ctx.fill(),this.ctx.translate(-n,-s)},e.prototype.resizeImage=function(r,t,n){var s;if(r.width===t&&r.height===n)return r;var i=(s=this.canvas.ownerDocument)!==null&&s!==void 0?s:document,o=i.createElement("canvas");o.width=Math.max(1,t),o.height=Math.max(1,n);var a=o.getContext("2d");return a.drawImage(r,0,0,r.width,r.height,0,0,t,n),o},e.prototype.renderBackgroundImage=function(r){return wA(this,void 0,void 0,function(){var t,n,s,i,o,a;return cA(this,function(B){switch(B.label){case 0:t=r.styles.backgroundImage.length-1,n=function(l){var u,f,C,Y,k,P,_,O,M,g,Y,k,P,_,O,w,x,F,p,L,m,I,h,y,M,S,Y,K,R,_,O,q,k,P,uA,$,eA,UA,MA,QA,yA,FA;return cA(this,function(RA){switch(RA.label){case 0:if(l.type!==0)return[3,5];u=void 0,f=l.url,RA.label=1;case 1:return RA.trys.push([1,3,,4]),[4,s.context.cache.match(f)];case 2:return u=RA.sent(),[3,4];case 3:return RA.sent(),s.context.logger.error("Error loading background-image "+f),[3,4];case 4:return u&&(C=Kr(r,t,[u.width,u.height,u.width/u.height]),Y=C[0],k=C[1],P=C[2],_=C[3],O=C[4],M=s.ctx.createPattern(s.resizeImage(u,_,O),"repeat"),s.renderRepeat(Y,M,k,P)),[3,6];case 5:QB(l)?(g=Kr(r,t,[null,null,null]),Y=g[0],k=g[1],P=g[2],_=g[3],O=g[4],w=lB(l.angle,_,O),x=w[0],F=w[1],p=w[2],L=w[3],m=w[4],I=document.createElement("canvas"),I.width=_,I.height=O,h=I.getContext("2d"),y=h.createLinearGradient(F,L,p,m),ts(l.stops,x).forEach(function(ee){return y.addColorStop(ee.stop,iA(ee.color))}),h.fillStyle=y,h.fillRect(0,0,_,O),_>0&&O>0&&(M=s.ctx.createPattern(I,"repeat"),s.renderRepeat(Y,M,k,P))):CB(l)&&(S=Kr(r,t,[null,null,null]),Y=S[0],K=S[1],R=S[2],_=S[3],O=S[4],q=l.position.length===0?[sn]:l.position,k=z(q[0],_),P=z(q[q.length-1],O),uA=uB(l,k,P,_,O),$=uA[0],eA=uA[1],$>0&&eA>0&&(UA=s.ctx.createRadialGradient(K+k,R+P,0,K+k,R+P,$),ts(l.stops,$*2).forEach(function(ee){return UA.addColorStop(ee.stop,iA(ee.color))}),s.path(Y),s.ctx.fillStyle=UA,$!==eA?(MA=r.bounds.left+.5*r.bounds.width,QA=r.bounds.top+.5*r.bounds.height,yA=eA/$,FA=1/yA,s.ctx.save(),s.ctx.translate(MA,QA),s.ctx.transform(1,0,0,yA,0,0),s.ctx.translate(-MA,-QA),s.ctx.fillRect(K,FA*(R-QA)+QA,_,O*FA),s.ctx.restore()):s.ctx.fill())),RA.label=6;case 6:return t--,[2]}})},s=this,i=0,o=r.styles.backgroundImage.slice(0).reverse(),B.label=1;case 1:return i<o.length?(a=o[i],[5,n(a)]):[3,4];case 2:B.sent(),B.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},e.prototype.renderSolidBorder=function(r,t,n){return wA(this,void 0,void 0,function(){return cA(this,function(s){return this.path(Ss(n,t)),this.ctx.fillStyle=iA(r),this.ctx.fill(),[2]})})},e.prototype.renderDoubleBorder=function(r,t,n,s){return wA(this,void 0,void 0,function(){var i,o;return cA(this,function(a){switch(a.label){case 0:return t<3?[4,this.renderSolidBorder(r,n,s)]:[3,2];case 1:return a.sent(),[2];case 2:return i=Uu(s,n),this.path(i),this.ctx.fillStyle=iA(r),this.ctx.fill(),o=Fu(s,n),this.path(o),this.ctx.fill(),[2]}})})},e.prototype.renderNodeBackgroundAndBorders=function(r){return wA(this,void 0,void 0,function(){var t,n,s,i,o,a,B,l,u=this;return cA(this,function(f){switch(f.label){case 0:return this.applyEffects(r.getEffects(2)),t=r.container.styles,n=!$A(t.backgroundColor)||t.backgroundImage.length,s=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],i=Lu(me(t.backgroundClip,0),r.curves),n||t.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),$A(t.backgroundColor)||(this.ctx.fillStyle=iA(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(r.container)]):[3,2];case 1:f.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(C){u.ctx.save();var g=Gt(r.curves),w=C.inset?0:bu,x=du(g,-w+(C.inset?1:-1)*C.spread.number,(C.inset?1:-1)*C.spread.number,C.spread.number*(C.inset?-2:2),C.spread.number*(C.inset?-2:2));C.inset?(u.path(g),u.ctx.clip(),u.mask(x)):(u.mask(g),u.ctx.clip(),u.path(x)),u.ctx.shadowOffsetX=C.offsetX.number+w,u.ctx.shadowOffsetY=C.offsetY.number,u.ctx.shadowColor=iA(C.color),u.ctx.shadowBlur=C.blur.number,u.ctx.fillStyle=C.inset?iA(C.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()}),f.label=2;case 2:o=0,a=0,B=s,f.label=3;case 3:return a<B.length?(l=B[a],l.style!==0&&!$A(l.color)&&l.width>0?l.style!==2?[3,5]:[4,this.renderDashedDottedBorder(l.color,l.width,o,r.curves,2)]:[3,11]):[3,13];case 4:return f.sent(),[3,11];case 5:return l.style!==3?[3,7]:[4,this.renderDashedDottedBorder(l.color,l.width,o,r.curves,3)];case 6:return f.sent(),[3,11];case 7:return l.style!==4?[3,9]:[4,this.renderDoubleBorder(l.color,l.width,o,r.curves)];case 8:return f.sent(),[3,11];case 9:return[4,this.renderSolidBorder(l.color,o,r.curves)];case 10:f.sent(),f.label=11;case 11:o++,f.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},e.prototype.renderDashedDottedBorder=function(r,t,n,s,i){return wA(this,void 0,void 0,function(){var o,a,B,l,u,f,C,g,w,x,F,p,L,m,I,h,I,h;return cA(this,function(y){return this.ctx.save(),o=pu(s,n),a=Ss(s,n),i===2&&(this.path(a),this.ctx.clip()),vA(a[0])?(B=a[0].start.x,l=a[0].start.y):(B=a[0].x,l=a[0].y),vA(a[1])?(u=a[1].end.x,f=a[1].end.y):(u=a[1].x,f=a[1].y),n===0||n===2?C=Math.abs(B-u):C=Math.abs(l-f),this.ctx.beginPath(),i===3?this.formatPath(o):this.formatPath(a.slice(0,2)),g=t<3?t*3:t*2,w=t<3?t*2:t,i===3&&(g=t,w=t),x=!0,C<=g*2?x=!1:C<=g*2+w?(F=C/(2*g+w),g*=F,w*=F):(p=Math.floor((C+w)/(g+w)),L=(C-p*g)/(p-1),m=(C-(p+1)*g)/p,w=m<=0||Math.abs(w-L)<Math.abs(w-m)?L:m),x&&(i===3?this.ctx.setLineDash([0,g+w]):this.ctx.setLineDash([g,w])),i===3?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=t*2+1.1,this.ctx.strokeStyle=iA(r),this.ctx.stroke(),this.ctx.setLineDash([]),i===2&&(vA(a[0])&&(I=a[3],h=a[0],this.ctx.beginPath(),this.formatPath([new v(I.end.x,I.end.y),new v(h.start.x,h.start.y)]),this.ctx.stroke()),vA(a[1])&&(I=a[1],h=a[2],this.ctx.beginPath(),this.formatPath([new v(I.end.x,I.end.y),new v(h.start.x,h.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},e.prototype.render=function(r){return wA(this,void 0,void 0,function(){var t;return cA(this,function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=iA(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=hu(r),[4,this.renderStack(t)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}})})},e})(Mi),Tu=function(A){return A instanceof Ui||A instanceof hi?!0:A instanceof cn&&A.type!==Mt&&A.type!==_t},Lu=function(A,e){switch(A){case 0:return Gt(e);case 2:return fu(e);default:return Nt(e)}},Su=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},Ku=["-apple-system","system-ui"],Du=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(e){return Ku.indexOf(e)===-1}):A},_u=(function(A){LA(e,A);function e(r,t){var n=A.call(this,r,t)||this;return n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=t,n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+t.width+"x"+t.height+" at "+t.x+","+t.y+") with scale "+t.scale),n}return e.prototype.render=function(r){return wA(this,void 0,void 0,function(){var t,n;return cA(this,function(s){switch(s.label){case 0:return t=jr(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,r),[4,Mu(t)];case 1:return n=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=iA(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},e})(Mi),Mu=function(A){return new Promise(function(e,r){var t=new Image;t.onload=function(){e(t)},t.onerror=r,t.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(A))})},Ru=(function(){function A(e){var r=e.id,t=e.enabled;this.id=r,this.enabled=t,this.start=Date.now()}return A.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,lt([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.prototype.getTime=function(){return Date.now()-this.start},A.prototype.info=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,lt([this.id,this.getTime()+"ms"],e))},A.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,lt([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,lt([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},A.instances={},A})(),Ou=(function(){function A(e,r){var t;this.windowBounds=r,this.instanceName="#"+A.instanceCount++,this.logger=new Ru({id:this.instanceName,enabled:e.logging}),this.cache=(t=e.cache)!==null&&t!==void 0?t:new su(this,e)}return A.instanceCount=1,A})(),Gu=function(A,e){return e===void 0&&(e={}),Nu(A,e)};typeof window<"u"&&Ti.setContext(window);var Nu=function(A,e){return wA(void 0,void 0,void 0,function(){var r,t,n,s,i,o,a,B,l,u,f,C,g,w,x,F,p,L,m,I,y,h,y,M,S,Y,K,R,_,O,q,k,P,uA,$,eA,UA,MA,QA,yA;return cA(this,function(FA){switch(FA.label){case 0:if(!A||typeof A!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(r=A.ownerDocument,!r)throw new Error("Element is not attached to a Document");if(t=r.defaultView,!t)throw new Error("Document is not attached to a Window");return n={allowTaint:(M=e.allowTaint)!==null&&M!==void 0?M:!1,imageTimeout:(S=e.imageTimeout)!==null&&S!==void 0?S:15e3,proxy:e.proxy,useCORS:(Y=e.useCORS)!==null&&Y!==void 0?Y:!1},s=_r({logging:(K=e.logging)!==null&&K!==void 0?K:!0,cache:e.cache},n),i={windowWidth:(R=e.windowWidth)!==null&&R!==void 0?R:t.innerWidth,windowHeight:(_=e.windowHeight)!==null&&_!==void 0?_:t.innerHeight,scrollX:(O=e.scrollX)!==null&&O!==void 0?O:t.pageXOffset,scrollY:(q=e.scrollY)!==null&&q!==void 0?q:t.pageYOffset},o=new PA(i.scrollX,i.scrollY,i.windowWidth,i.windowHeight),a=new Ou(s,o),B=(k=e.foreignObjectRendering)!==null&&k!==void 0?k:!1,l={allowTaint:(P=e.allowTaint)!==null&&P!==void 0?P:!1,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:B,copyStyles:B},a.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),u=new xs(a,A,l),f=u.clonedReferenceElement,f?[4,u.toIFrame(r,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return C=FA.sent(),g=ln(f)||Vl(f)?Co(f.ownerDocument):Pt(a,f),w=g.width,x=g.height,F=g.left,p=g.top,L=Vu(a,f,e.backgroundColor),m={canvas:e.canvas,backgroundColor:L,scale:($=(uA=e.scale)!==null&&uA!==void 0?uA:t.devicePixelRatio)!==null&&$!==void 0?$:1,x:((eA=e.x)!==null&&eA!==void 0?eA:0)+F,y:((UA=e.y)!==null&&UA!==void 0?UA:0)+p,width:(MA=e.width)!==null&&MA!==void 0?MA:Math.ceil(w),height:(QA=e.height)!==null&&QA!==void 0?QA:Math.ceil(x)},B?(a.logger.debug("Document cloned, using foreign object rendering"),y=new _u(a,m),[4,y.render(f)]):[3,3];case 2:return I=FA.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at "+F+","+p+" with size "+w+"x"+x+" using computed rendering"),a.logger.debug("Starting DOM parsing"),h=mi(a,f),L===h.styles.backgroundColor&&(h.styles.backgroundColor=VA.TRANSPARENT),a.logger.debug("Starting renderer for element at "+m.x+","+m.y+" with size "+m.width+"x"+m.height),y=new xu(a,m),[4,y.render(h)];case 4:I=FA.sent(),FA.label=5;case 5:return(!((yA=e.removeContainer)!==null&&yA!==void 0)||yA)&&(xs.destroy(C)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,I]}})})},Vu=function(A,e,r){var t=e.ownerDocument,n=t.documentElement?Je(A,getComputedStyle(t.documentElement).backgroundColor):VA.TRANSPARENT,s=t.body?Je(A,getComputedStyle(t.body).backgroundColor):VA.TRANSPARENT,i=typeof r=="string"?Je(A,r):r===null?VA.TRANSPARENT:4294967295;return e===t.documentElement?$A(n)?$A(s)?i:s:n:i},Ri=Gu;var Oi=!1,Pu=new Set(["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","LINK","META","PARAM","SOURCE","TRACK","WBR"]);function ku(){if(Oi)return;Oi=!0;let A=CanvasRenderingContext2D.prototype.createPattern;CanvasRenderingContext2D.prototype.createPattern=function(e,r){return e&&"width"in e&&"height"in e&&(e.width===0||e.height===0)?null:A.call(this,e,r)}}function Ni(){ku()}function Xu(A,e){if(!A.id)return;let r=e.getElementById(A.id);r instanceof HTMLElement&&(r.style.opacity="1",r.style.setProperty("visibility","visible","important"),r.querySelectorAll("[data-start]").forEach(t=>{t.style.setProperty("visibility","visible","important")}))}function Wu(A){let e=A.ownerDocument.defaultView;e&&[A,...Array.from(A.querySelectorAll("*"))].forEach(r=>{if(Pu.has(r.tagName))return;let t=e.getComputedStyle(r);if(t.boxShadow==="none"||t.transform==="none")return;let n=A.ownerDocument.createElement("div");n.setAttribute("data-hyper-shader-shadow-shim",""),n.style.cssText=["position:absolute","inset:0","border-radius:inherit",`box-shadow:${t.boxShadow}`,"background:transparent","pointer-events:none","z-index:0"].join(";"),t.position==="static"&&(r.style.position="relative"),r.style.boxShadow="none",r.insertBefore(n,r.firstChild)})}function $t(){if(typeof document>"u")return!1;let A=document.createElement("canvas");if(A.setAttribute("layoutsubtree",""),!("layoutSubtree"in A))return!1;let e=A.getContext("2d");return e!=null&&typeof e.drawElementImage=="function"}async function Ju(A,e,r,t){let n=document.createElement("canvas");n.width=r,n.height=t,n.setAttribute("layoutsubtree",""),n.style.cssText=`position:fixed;top:0;left:0;width:${r}px;height:${t}px;z-index:-9999;pointer-events:none;opacity:0`,n.appendChild(A.cloneNode(!0)),document.body.appendChild(n);try{await new Promise(a=>requestAnimationFrame(()=>requestAnimationFrame(()=>a())));let s=n.getContext("2d");s.fillStyle=e,s.fillRect(0,0,r,t);let i=n.firstElementChild;i&&s.drawElementImage(i,0,0,r,t);let o=document.createElement("canvas");return o.width=r,o.height=t,o.getContext("2d").drawImage(n,0,0),n.remove(),o}catch(s){throw n.remove(),s}}function Vi(A,e,r=fe,t=ge,n={}){return $t()&&!n.preferBrowserPaint?Ju(A,e,r,t).catch(()=>Gi(A,e,r,t,n)):Gi(A,e,r,t,n)}function Gi(A,e,r,t,n={}){let s=i=>Ri(A,{width:r,height:t,scale:n.scale??1,backgroundColor:e,logging:!1,foreignObjectRendering:i,useCORS:!0,allowTaint:!0,onclone:o=>{if(!A.id)return;let a=o.getElementById(A.id);a instanceof HTMLElement&&Wu(a),n.forceVisible&&Xu(A,o)},ignoreElements:o=>o.tagName==="CANVAS"||o.hasAttribute("data-no-capture")});return n.preferBrowserPaint===!0?s(!0).catch(()=>s(!1)):s(!1)}var un="__hf-page-side-compositor",ki="__hf_page_compositor_v1__";function Pi(A){return{left:`${A.left}px`,top:`${A.top}px`,width:`${A.width}px`,height:`${A.height}px`}}function Xi(){if(typeof window>"u"||typeof document>"u"||!$t())return!1;let A=document.createElement("canvas"),e=A.getContext("webgl")||A.getContext("experimental-webgl");return e?(e.getExtension("WEBGL_lose_context")?.loseContext(),!0):!1}function fn(A){if(typeof window>"u")return!1;if(window.__HF_PAGE_COMPOSITOR_CANARY__=ki,!Xi())return console.warn("[HyperShader] page-side compositing requested but drawElementImage/WebGL is not available; falling back to opacity-flip mode (Node-side layered pipeline will handle the blend)."),!1;if(document.getElementById(un))return!0;let{scenes:e,transitions:r,accentColors:t,width:n,height:s,defaultDuration:i}=A,o=document.createElement("canvas");o.id=un,o.width=n,o.height=s,o.style.cssText="position:fixed;top:0;left:0;width:100%;height:100%;z-index:2147483646;pointer-events:none;display:none;",document.body.appendChild(o);let a=it(o,n,s);if(!a)return console.warn("[HyperShader] page-side compositor: WebGL context unavailable."),o.remove(),!1;let B=ot(a),l=new Map;for(let K of r)if(K.shader!==void 0&&!l.has(K.shader))try{l.set(K.shader,at(a,ct(K.shader)))}catch(R){console.warn(`[HyperShader] page-side compositor: failed to compile "${K.shader}":`,R)}let u=[];for(let K=0;K<r.length;K++){let R=r[K];if(!R||R.shader===void 0)continue;let _=e[K],O=e[K+1],q=l.get(R.shader);!_||!O||!q||u.push({time:R.time,duration:R.duration??i,shader:R.shader,fromSceneId:_,toSceneId:O,prog:q})}if(u.length===0)return o.remove(),!1;let f=ne(a),C=ne(a),g=document.createElement("canvas"),w=document.createElement("canvas");for(let K of[g,w])K.width=n,K.height=s,K.setAttribute("layoutsubtree",""),K.style.cssText="position:fixed;top:0;left:0;width:"+n+"px;height:"+s+"px;z-index:-9998;pointer-events:none;",document.body.appendChild(K);function x(K){for(let R of u)if(K>=R.time&&K<=R.time+R.duration)return R;return null}function F(K){let R=0;for(let _ of r)K>=_.time+(_.duration??i)&&(R+=1);return e[Math.min(R,e.length-1)]}let p=null,L=0,m=window;async function I(){let K=p;if(!K)return m.__hf_page_composite_pending=!1,!1;let R=document.getElementById(K.fromSceneId),_=document.getElementById(K.toSceneId);if(!(R instanceof HTMLElement)||!(_ instanceof HTMLElement))return m.__hf_page_composite_pending=!1,!1;let O=Pi(R.getBoundingClientRect()),q=Pi(_.getBoundingClientRect());for(;g.firstChild;)g.removeChild(g.firstChild);for(;w.firstChild;)w.removeChild(w.firstChild);let k=R.cloneNode(!0),P=_.cloneNode(!0);g.appendChild(k),w.appendChild(P);for(let[$,eA]of[[k,O],[P,q]])$.style.opacity="1",$.style.visibility="visible",$.style.position="absolute",$.style.left=eA.left,$.style.top=eA.top,$.style.width=eA.width,$.style.height=eA.height,$.querySelectorAll("[data-start]").forEach(UA=>{UA.style.opacity="1",UA.style.visibility="visible"});let uA=[];for(let $ of[g,w])for(let eA of $.querySelectorAll("img"))eA.src&&eA.src.startsWith("data:")&&typeof eA.decode=="function"&&uA.push(eA.decode().catch(()=>{}));return uA.length>0&&await Promise.all(uA),!0}function h(){let K=p;if(!K)return m.__hf_page_composite_pending=!1,!1;let R=g.firstElementChild,_=w.firstElementChild;if(!R||!_)return m.__hf_page_composite_pending=!1,!1;let O=g.getContext("2d"),q=w.getContext("2d");if(!O?.drawElementImage||!q?.drawElementImage)return m.__hf_page_composite_pending=!1,!1;try{O.fillStyle=A.bgColor,O.fillRect(0,0,n,s),O.drawElementImage(R,0,0,n,s),q.fillStyle=A.bgColor,q.fillRect(0,0,n,s),q.drawElementImage(_,0,0,n,s)}catch(k){return console.warn("[HyperShader] page-side compositor: drawElementImage failed:",k),m.__hf_page_composite_pending=!1,!1}we(a,f,g),we(a,C,w);try{Bt(a,B,K.prog,f,C,L,t,n,s),o.style.display="block"}catch(k){console.warn("[HyperShader] page-side compositor: renderShader failed:",k),o.style.display="none"}return m.__hf_page_composite_pending=!1,!0}m.__hf_page_composite_resolve=h,m.__hf_page_composite_prepare=I;let y=window,M=()=>{if(!y.__hf)return;let K=y.__hf.seek;if(typeof K!="function")return;let R=_=>{let O=K.call(y.__hf,_),q=x(_);if(!q){for(o.style.display="none",m.__hf_page_composite_pending=!1;g.firstChild;)g.removeChild(g.firstChild);for(;w.firstChild;)w.removeChild(w.firstChild);let k=F(_),P=k?document.getElementById(k):null;return P instanceof HTMLElement&&P.style.visibility==="hidden"&&(P.style.visibility="visible"),O}return p=q,L=q.duration===0?1:Math.min(1,Math.max(0,(_-q.time)/q.duration)),m.__hf_page_composite_pending=!0,O};y.__hf.seek=R},S=0,Y=window.setInterval(()=>{S+=1,y.__hf?.seek?(M(),window.clearInterval(Y)):S>200&&(window.clearInterval(Y),console.warn("[HyperShader] page-side compositor: window.__hf.seek never appeared after 10s; the engine bridge did not initialize. Falling back to opacity-flip mode."))},50);return!0}var tr=.7,wn="power2.inOut",Yu="attribute vec2 a_pos; varying vec2 v_uv; void main(){v_uv=a_pos*0.5+0.5; gl_Position=vec4(a_pos,0,1);}",Ar=["Preparing scene transitions","Sampling outgoing scene motion","Sampling incoming scene motion","Caching transition frames","Finalizing transition preview"],Zu="hyper-shader-preview-cache",_A="frames",qu=1,ju="v1",Wi=2,Ji=1.25,zu=1200;function $u(A){let e=A.replace("#","");if(e.length<6)return[.5,.5,.5];let r=parseInt(e.slice(0,2),16)/255,t=parseInt(e.slice(2,4),16)/255,n=parseInt(e.slice(4,6),16)/255;return Number.isNaN(r)||Number.isNaN(t)||Number.isNaN(n)?[.5,.5,.5]:[r,t,n]}function eo(A){let[e,r,t]=$u(A);return{accent:[e,r,t],dark:[e*.35,r*.35,t*.35],bright:[Math.min(1,e*1.5+.2),Math.min(1,r*1.5+.2),Math.min(1,t*1.5+.2)]}}function ce(A,e,r){return Math.min(r,Math.max(e,A))}function Af(A,e){return A===void 0?e:Number.isFinite(A)&&A>0?A:e}var ef="__hf_shader_capture_scale",tf="__hf_shader_loading";function to(A,e){let r=window[A];if(typeof r=="string")return r;if(typeof r=="number"&&Number.isFinite(r))return String(r);try{return new URLSearchParams(window.location.search).get(e)}catch{return null}}function rf(){let A=to("__HF_SHADER_CAPTURE_SCALE",ef),e=A===null?NaN:Number(A);return ce(Number.isFinite(e)&&e>0?e:1,.25,1)}function nf(){let A=to("__HF_SHADER_LOADING",tf)?.trim().toLowerCase();return A==="player"||A==="true"||A==="1"?"player":A==="none"||A==="false"||A==="0"||A==="off"?"none":"internal"}function nr(A){let e=2166136261;for(let r=0;r<A.length;r+=1)e^=A.charCodeAt(r),e=Math.imul(e,16777619);return(e>>>0).toString(16).padStart(8,"0")}function sf(A){let e=Array.from(A.querySelectorAll("style")).map(t=>t.textContent||"").join(`
|
|
7
7
|
`),r=Array.from(A.querySelectorAll('link[rel~="stylesheet"]')).map(t=>`${t.href}:${t.getAttribute("integrity")||""}`).join(`
|
|
8
8
|
`);return nr(`${e}
|
|
9
9
|
${r}`)}function of(A){return A.includes("gsap.timeline")||A.includes("__timelines")||A.includes(".to(")||A.includes(".set(")?!A.includes("HyperShader")&&!A.includes("hyper-shader")&&!A.includes("hyperShader"):!1}function af(A){let e=Array.from(A.querySelectorAll('meta[name="hyperframes-project-signature"]')).map(t=>t.getAttribute("content")||"").join(`
|