(()=>{var Gt=Object.create;var D=Object.defineProperty,Wt=Object.defineProperties,Rt=Object.getOwnPropertyDescriptor,pt=Object.getOwnPropertyDescriptors,ut=Object.getOwnPropertyNames,q=Object.getOwnPropertySymbols,Zt=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable;var $=(n,t,i)=>t in n?D(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,O=(n,t)=>{for(var i in t||(t={}))tt.call(t,i)&&$(n,i,t[i]);if(q)for(var i of q(t))gt.call(t,i)&&$(n,i,t[i]);return n},et=(n,t)=>Wt(n,pt(t));var v=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports);var Ut=(n,t,i,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of ut(t))!tt.call(n,a)&&a!==i&&D(n,a,{get:()=>t[a],enumerable:!(e=Rt(t,a))||e.enumerable});return n};var j=(n,t,i)=>(i=n!=null?Gt(Zt(n)):{},Ut(t||!n||!n.__esModule?D(i,"default",{value:n,enumerable:!0}):i,n));var it=(n,t,i)=>new Promise((e,a)=>{var o=c=>{try{d(i.next(c))}catch(h){a(h)}},l=c=>{try{d(i.throw(c))}catch(h){a(h)}},d=c=>c.done?e(c.value):Promise.resolve(c.value).then(o,l);d((i=i.apply(n,t)).next())});var at=v((A,L)=>{(function(n){"use strict";var t=function(){},i=n.requestAnimationFrame||n.webkitRequestAnimationFrame||n.mozRequestAnimationFrame||n.msRequestAnimationFrame||function(h){return setTimeout(h,16)};function e(){var h=this;h.reads=[],h.writes=[],h.raf=i.bind(n),t("initialized",h)}e.prototype={constructor:e,runTasks:function(h){t("run tasks");for(var s;s=h.shift();)s()},measure:function(h,s){t("measure");var r=s?h.bind(s):h;return this.reads.push(r),a(this),r},mutate:function(h,s){t("mutate");var r=s?h.bind(s):h;return this.writes.push(r),a(this),r},clear:function(h){return t("clear",h),l(this.reads,h)||l(this.writes,h)},extend:function(h){if(t("extend",h),typeof h!="object")throw new Error("expected object");var s=Object.create(this);return d(s,h),s.fastdom=this,s.initialize&&s.initialize(),s},catch:null};function a(h){h.scheduled||(h.scheduled=!0,h.raf(o.bind(null,h)),t("flush scheduled"))}function o(h){t("flush");var s=h.writes,r=h.reads,b;try{t("flushing reads",r.length),h.runTasks(r),t("flushing writes",s.length),h.runTasks(s)}catch(m){b=m}if(h.scheduled=!1,(r.length||s.length)&&a(h),b)if(t("task errored",b.message),h.catch)h.catch(b);else throw b}function l(h,s){var r=h.indexOf(s);return!!~r&&!!h.splice(r,1)}function d(h,s){for(var r in s)s.hasOwnProperty(r)&&(h[r]=s[r])}var c=n.fastdom=n.fastdom||new e;typeof L=="object"&&(L.exports=c)})(typeof window!="undefined"?window:typeof A!="undefined"?A:globalThis)});var nt=v((Bt,E)=>{(function(){"use strict";var n=function(){function t(){}t.prototype=Object.create(null);function i(s,r){for(var b=r.length,m=0;m<b;++m)c(s,r[m])}var e={}.hasOwnProperty;function a(s,r){s[r]=!0}function o(s,r){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){s[r.toString()]=!0;return}for(var b in r)e.call(r,b)&&(s[b]=!!r[b])}var l=/\s+/;function d(s,r){for(var b=r.split(l),m=b.length,G=0;G<m;++G)s[b[G]]=!0}function c(s,r){if(r){var b=typeof r;b==="string"?d(s,r):Array.isArray(r)?i(s,r):b==="object"?o(s,r):b==="number"&&a(s,r)}}function h(){for(var s=arguments.length,r=Array(s),b=0;b<s;b++)r[b]=arguments[b];var m=new t;i(m,r);var G=[];for(var x in m)m[x]&&G.push(x);return G.join(" ")}return h}();typeof E!="undefined"&&E.exports?(n.default=n,E.exports=n):window.classNames=n})()});var ot=v((lt,z)=>{(function(n){var t={browser:[[/msie ([\.\_\d]+)/,"ie"],[/trident\/.*?rv:([\.\_\d]+)/,"ie"],[/firefox\/([\.\_\d]+)/,"firefox"],[/chrome\/([\.\_\d]+)/,"chrome"],[/version\/([\.\_\d]+).*?safari/,"safari"],[/mobile safari ([\.\_\d]+)/,"safari"],[/android.*?version\/([\.\_\d]+).*?safari/,"com.android.browser"],[/crios\/([\.\_\d]+).*?safari/,"chrome"],[/opera/,"opera"],[/opera\/([\.\_\d]+)/,"opera"],[/opera ([\.\_\d]+)/,"opera"],[/opera mini.*?version\/([\.\_\d]+)/,"opera.mini"],[/opios\/([a-z\.\_\d]+)/,"opera"],[/blackberry/,"blackberry"],[/blackberry.*?version\/([\.\_\d]+)/,"blackberry"],[/bb\d+.*?version\/([\.\_\d]+)/,"blackberry"],[/rim.*?version\/([\.\_\d]+)/,"blackberry"],[/iceweasel\/([\.\_\d]+)/,"iceweasel"],[/edge\/([\.\d]+)/,"edge"]],os:[[/linux ()([a-z\.\_\d]+)/,"linux"],[/mac os x/,"macos"],[/mac os x.*?([\.\_\d]+)/,"macos"],[/os ([\.\_\d]+) like mac os/,"ios"],[/openbsd ()([a-z\.\_\d]+)/,"openbsd"],[/android/,"android"],[/android ([a-z\.\_\d]+);/,"android"],[/mozilla\/[a-z\.\_\d]+ \((?:mobile)|(?:tablet)/,"firefoxos"],[/windows\s*(?:nt)?\s*([\.\_\d]+)/,"windows"],[/windows phone.*?([\.\_\d]+)/,"windows.phone"],[/windows mobile/,"windows.mobile"],[/blackberry/,"blackberryos"],[/bb\d+/,"blackberryos"],[/rim.*?os\s*([\.\_\d]+)/,"blackberryos"]],device:[[/ipad/,"ipad"],[/iphone/,"iphone"],[/lumia/,"lumia"],[/htc/,"htc"],[/nexus/,"nexus"],[/galaxy nexus/,"galaxy.nexus"],[/nokia/,"nokia"],[/ gt\-/,"galaxy"],[/ sm\-/,"galaxy"],[/xbox/,"xbox"],[/(?:bb\d+)|(?:blackberry)|(?: rim )/,"blackberry"]]},i="Unknown",e=Object.keys(t);function a(){var d=this;e.forEach(function(c){d[c]={name:i,version:[],versionString:i}})}function o(d,c,h){t[c].forEach(function(s){var r=s[0],b=s[1],m=h.match(r);m&&(d[c].name=b,m[2]?(d[c].versionString=m[2],d[c].version=[]):m[1]?(d[c].versionString=m[1].replace(/_/g,"."),d[c].version=l(m[1])):(d[c].versionString=i,d[c].version=[]))})}function l(d){return d.split(/[\._]/).map(function(c){return parseInt(c)})}a.prototype.sniff=function(d){var c=this,h=typeof window!="undefined",s=h?navigator.userAgent:"",r=(d||s).toLowerCase();return e.forEach(function(b){o(c,b,r)}),this},typeof z!="undefined"&&z.exports?z.exports=a:(n.Sniffr=new a,n.Sniffr.sniff(navigator.userAgent))})(lt)});var ht=v((ie,dt)=>{dt.exports=Nt;function Nt(n,t,i){return t<i?n<t?t:n>i?i:n:n<i?i:n>t?t:n}});window.hasOwnProperty("Shorthand")||(window.Shorthand={});var Ft=j(at());var xt=j(nt());var vt=ot();function M(n,t=null){let e=Yt(t).querySelectorAll(n);return Array.from(e)}function Yt(n){return n||(window.__shadowRoot?window.__shadowRoot.querySelector("article"):document)}var C={getOrientation(){return window.Shorthand.displayContainer?C.getWidth()>C.getHeight()?"landscape":"portrait":window.innerWidth>window.innerHeight?"landscape":"portrait"},getHeight(){return window.Shorthand.displayContainer.getCache().height},getWidth(){return window.Shorthand.displayContainer.getCache().width},getTop(){return window.Shorthand.displayContainer.getCache().top},getBottom(){return window.Shorthand.displayContainer.getCache().bottom},getVhUnitsInPixels(n){return C.getHeight()*(n/100)},getDisplayContainer(){return window.Shorthand.displayContainer}},N=C;var K=j(ht());function V(n){return typeof n=="number"?Math.round(n):{x:V(n.x),y:V(n.y),z:n.z}}function P(){return{noHighlightsBehaviour:"contain",lineWidth:10,lineColor:"#12bf9c",markerSize:30,markerColor:"#12bf9c",transitionDuration:1}}var T=null;function f(n=!1){return new Promise(t=>{if(T===null||n){T=P();let i=document.createElement("div");i.className="Theme-Scrollpoints-Highlight",i.style.display="none",i.style.pointerEvents="none",document.body.appendChild(i);let e=document.createElement("div");e.className="Theme-Scrollpoints-Marker",e.style.display="none",e.style.pointerEvents="none",document.body.appendChild(e),setTimeout(()=>{let a=window.getComputedStyle(e);return T.markerSize=parseInt(a.getPropertyValue("width"),10),T.markerColor=a.getPropertyValue("background-color"),a=window.getComputedStyle(i),T.lineWidth=parseInt(a.getPropertyValue("border-width"),10),T.lineColor=a.getPropertyValue("border-color"),T.noHighlightsBehaviour=a.getPropertyValue("background-size")==="cover"?"cover":"contain",t(T)},50)}else return t(T)})}function st(n,t){if(t<=0)return;let{height:i,width:e}=n.canvas,a=n.getImageData(0,0,e,i),{data:o}=a,l=e-1,d=i-1,c=t+1,s=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1][t],b=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18][t],m=[],G=[],x=[],X=[],W=[],Q=[],Vt=3,u,Y,F,y;for(;Vt-- >0;){let I=0,p=0;for(let U=0;U<i;U++){let Z=o[I]*c,k=o[I+1]*c,S=o[I+2]*c,H=o[I+3]*c;for(let R=1;R<=t;R++)u=I+((R>l?l:R)<<2),Z+=o[u++],k+=o[u++],S+=o[u++],H+=o[u];for(let R=0;R<e;R++)m[p]=Z,G[p]=k,x[p]=S,X[p]=H,U===0&&(W[R]=((u=R+c)<l?u:l)<<2,Q[R]=(u=R-t)>0?u<<2:0),Y=I+W[R],F=I+Q[R],Z+=o[Y++]-o[F++],k+=o[Y++]-o[F++],S+=o[Y++]-o[F++],H+=o[Y]-o[F],p++;I+=e<<2}for(let U=0;U<e;U++){let Z=U,k=m[Z]*c,S=G[Z]*c,H=x[Z]*c,R=X[Z]*c;for(let g=1;g<=t;g++)Z+=g>d?0:e,k+=m[Z],S+=G[Z],H+=x[Z],R+=X[Z];p=U<<2;for(let g=0;g<i;g++)o[p+3]=y=R*s>>>b,y>0?(y=255/y,o[p]=(k*s>>>b)*y,o[p+1]=(S*s>>>b)*y,o[p+2]=(H*s>>>b)*y):o[p]=o[p+1]=o[p+2]=0,U===0&&(W[g]=((u=g+c)<d?u:d)*e,Q[g]=(u=g-t)>0?u*e:0),Y=U+W[g],F=U+Q[g],k+=m[Y]-m[F],S+=G[Y]-G[F],H+=x[Y]-x[F],R+=X[Y]-X[F],p+=e<<2}}n.putImageData(a,0,0)}var B=class{constructor(t){this.onTick=t}start(t,i,e){this.from=V(t),this.to=V(i),this.duration=e,!(isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(i.x)||isNaN(i.y)||isNaN(i.z))&&(this.secondsRemaining=this.duration,this.lastTickAt=new Date().getTime(),this.tick=this.tick.bind(this),this.tick())}tick(){if(this.duration===0)this.onTick({x:this.to.x,y:this.to.y,z:this.to.z});else{let t=new Date().getTime(),i=(t-this.lastTickAt)/1e3;if(this.lastTickAt=t,this.secondsRemaining>0){this.secondsRemaining=this.secondsRemaining-i;let e=1-Math.max(0,this.secondsRemaining)/this.duration,a=ct(e);this.onTick({x:V(this.from.x+(this.to.x-this.from.x)*a),y:V(this.from.y+(this.to.y-this.from.y)*a),z:this.from.z+(this.to.z-this.from.z)*ct(e)}),requestAnimationFrame(this.tick)}}}},ct=n=>1-(1-n)*(1-n);var rt=.01,bt=2.5,w=class{constructor(t,i,e,a){this.isHidden=!1;this.pixelDensity=1;this.canvasWidth=0;this.canvasHeight=0;this.x=0;this.y=0;this.zoom=1;this.noHighlightsBehaviour="contain";this.maxX=0;this.maxY=0;this.setHighlightsAt=0;this._style=P();this._isReady=!1;this._isRendering=!1;typeof window.devicePixelRatio=="number"&&(this.pixelDensity=Math.min(2,window.devicePixelRatio)),this.canvas=t,this.initStyle().catch(console.error),this.offscreenCanvas=document.createElement("canvas"),this.ctx=this.offscreenCanvas.getContext("2d",{alpha:!1}),this.ctx.imageSmoothingEnabled=!0,this.finalCtx=this.canvas.getContext("2d",{alpha:!1}),this.image=i,this.highlights=[],this.backgroundColor=e,this.backgroundOpacity=a,this.bias="none",this.x=0,this.y=0,this.zoom=1,this.maxX=0,this.maxY=0,this.tween=new B(this.onTweenTick.bind(this)),this._render=this._render.bind(this),this.render=this.render.bind(this),this.adjustSize(),this._isReady=!0,this.render()}initStyle(){return it(this,null,function*(){this._computedStyle=getComputedStyle(this.canvas),this._style=yield f(!0)})}getColor(t,i){return t?this._computedStyle.getPropertyValue(`--${t}`):i}hide(){this.isHidden=!0,this.canvas.style.display="none"}show(){this.isHidden&&this.render(),this.isHidden=!1,this.canvas.style.display="initial"}setInstantSrc(t){if(t===this.backgroundImageSrc)return;this.backgroundImageSrc=t,this.isBackgroundImageReady=!1,this.backgroundImage||(this.backgroundImage=document.createElement("canvas"));let i=document.createElement("img");i.crossOrigin="use-credentials",i.addEventListener("load",()=>{if(i.width<=0)return;this.backgroundImage.width=300,this.backgroundImage.height=300;let e=this.backgroundImage.getContext("2d",{alpha:!1});e.drawImage(i,0,0,this.backgroundImage.width,this.backgroundImage.height),st(e,10),this.isBackgroundImageReady=!0}),i.src=t}adjustSize(){let{width:t}=this.canvas.parentElement.getBoundingClientRect(),i=window.innerHeight;this.canvas.width=t*this.pixelDensity,this.canvas.height=i*this.pixelDensity,this.canvas.style.width=`${t}px`,this.canvas.style.height=`${i}px`,this.canvasWidth=t*this.pixelDensity,this.canvasHeight=i*this.pixelDensity,this.offscreenCanvas.width=t*this.pixelDensity,this.offscreenCanvas.height=i*this.pixelDensity}render(){this._isReady?requestAnimationFrame(this._render):requestAnimationFrame(this.render)}_render(t){if(!this.isHidden){if(!this._isRendering){this._isRendering=!0;let i=(t-this.setHighlightsAt)/60,e=this.ctx;e.fillStyle="black",e.fillRect(0,0,this.canvasWidth,this.canvasHeight),this.isBackgroundImageReady&&this.backgroundImage.width>0&&this.backgroundOpacity<1&&e.drawImage(this.backgroundImage,0,0,this.backgroundImage.width,this.backgroundImage.height,0,0,this.canvasWidth,this.canvasHeight);let a=this.highlights.filter(l=>l.darkenAroundHighlight);a.length>0&&(e.fillStyle="rgba(0,0,0,0.6)",e.fillRect(0,0,this.canvasWidth,this.canvasHeight)),e.fillStyle=this.backgroundColor,e.globalAlpha=this.backgroundOpacity,e.fillRect(0,0,this.canvasWidth,this.canvasHeight),e.globalAlpha=1,e.transform(this.zoom,0,0,this.zoom,V(this.canvasWidth/2),V(this.canvasHeight/2)),this.image.width>0&&e.drawImage(this.image,-this.x,-this.y);let o=10*this.pixelDensity/this.zoom;if(a.length>0){e.fillStyle="rgba(0,0,0,0.6)",e.setTransform(1,0,0,1,0,0),e.fillRect(0,0,this.canvasWidth,this.canvasHeight),e.transform(this.zoom,0,0,this.zoom,V(this.canvasWidth/2),V(this.canvasHeight/2)),e.save();let l=new Path2D;a.forEach(d=>{J(l,-this.x+d.x,-this.y+d.y,d.width,d.height,o)}),e.clip(l),this.image.width>0&&e.drawImage(this.image,-this.x,-this.y),e.restore()}this.highlights.forEach(l=>{var h;let d=new Path2D;switch(e.lineWidth=V(this._style.lineWidth/2*this.pixelDensity/this.zoom),(h=l.effect)!=null?h:l.isHidden?"hidden":"solid"){case"hidden":break;case"ants":e.strokeStyle=this.getColor(l.color,this._style.lineColor),e.setLineDash([40/this.zoom,20/this.zoom]),e.lineDashOffset=-(i*5%60)/this.zoom,J(d,-this.x+l.x,-this.y+l.y,l.width,l.height,o),e.stroke(d);break;case"draw":let s=(l.width+l.height)*2;e.strokeStyle=this.getColor(l.color,this._style.lineColor),e.setLineDash([s]),e.lineDashOffset=Math.max(0,s-i*(s/60)),J(d,-this.x+l.x,-this.y+l.y,l.width,l.height,o),e.stroke(d);break;case"flash":e.strokeStyle=this.getColor(l.color,this._style.lineColor),e.setLineDash([]),J(d,-this.x+l.x,-this.y+l.y,l.width,l.height,o),e.globalAlpha=(1+Math.sin(i/4))/2,e.stroke(d),e.globalAlpha=1;break;case"solid":default:e.strokeStyle=this.getColor(l.color,this._style.lineColor),e.setLineDash([]),J(d,-this.x+l.x,-this.y+l.y,l.width,l.height,o),e.stroke(d);break}e.setLineDash([]),e.lineDashOffset=0}),this.highlights.forEach(l=>{if(l.hasDot){let d=(this._style.markerSize/2-2)*this.pixelDensity/this.zoom,c=2*this.pixelDensity*((1+Math.sin(i/4))/2)/this.zoom,h=new Path2D;h.arc(-this.x+l.dotX,-this.y+l.dotY,V(d+c),0,2*Math.PI),e.fillStyle=this.getColor(l.dotColor,this._style.lineColor),e.fill(h),e.lineWidth=4*this.pixelDensity/this.zoom,e.strokeStyle="black",e.stroke(h)}}),this.ctx.lineJoin="round",this.ctx.lineCap="square",this.highlights.forEach(l=>{let d=18*this.pixelDensity-4;if(e.font=`bold ${d/this.zoom}px Arial`,e.textAlign="center",e.fillStyle="white",e.strokeStyle="black",e.lineWidth=6*this.pixelDensity/this.zoom,l.label){let c=this.ensureLabelXIsInsideBoundaries(e.measureText(l.label).width,-this.x+l.x+l.width*.5);e.strokeText(l.label,c,-this.y+l.y+l.height-(d+5)/this.zoom),e.fillText(l.label,c,-this.y+l.y+l.height-(d+5)/this.zoom)}if(l.dotLabel){let c=this.ensureLabelXIsInsideBoundaries(e.measureText(l.dotLabel).width,-this.x+l.dotX);e.strokeText(l.dotLabel,c,-this.y+l.dotY-(d+10)/this.zoom),e.fillText(l.dotLabel,c,-this.y+l.dotY-(d+10)/this.zoom)}}),e.setTransform(1,0,0,1,0,0),this.offscreenCanvas.width>0&&this.finalCtx.drawImage(this.offscreenCanvas,0,0),this._isRendering=!1}this.render()}}setBounds(t,i){this.maxX=t,this.maxY=i}setHighlights(t,i){var l;this.noHighlightsBehaviour=this._style.noHighlightsBehaviour,this.highlights=[];let e=this.getDimensions(),a=this.getAutoZoom(e.width,e.height),o=window.__prefersReducedMotion||(l=window.matchMedia("(prefers-reduced-motion: reduce)"))!=null&&l.matches?0:this._style.transitionDuration;t.length>0&&(this.highlights=t.map(d=>et(O({},d),{x:V(d.x/100*this.maxX),y:V(d.y/100*this.maxY),width:V(d.width/100*this.maxX),height:V(d.height/100*this.maxY),dotX:V(d.dotX/100*this.maxX),dotY:V(d.dotY/100*this.maxY)})),e=this.getDimensions(),a=this.getAutoZoom(e.width,e.height)),this.tween.start({x:this.x,y:this.y,z:this.zoom},{x:e.x+e.width/2,y:e.y+e.height/2,z:a},i===this.key?0:o),this.key=i,this.setHighlightsAt=performance.now()}getDimensions(){let t=this.highlights.reduce((i,e)=>{let a=O({},i);return(a.x===-1||e.x<a.x)&&(a.width=a.x+a.width-e.x,a.x=e.x),(a.y===-1||e.y<a.y)&&(a.height=a.y+a.height-e.y,a.y=e.y),e.x+e.width>a.x+a.width&&(a.width=e.x-a.x+e.width),e.y+e.height>a.y+a.height&&(a.height=e.y-a.y+e.height),a},{x:-1,y:-1,width:0,height:0});return this.highlights.length===0&&(t.x=0,t.y=0,t.width=this.maxX,t.height=this.maxY),this.applyBias(t),t}applyBias(t){if(N.getWidth()<900)return;let i=t.width>t.height;this.bias==="left"?t.width*=i?2.1:2.4:this.bias==="right"&&(t.width*=i?2.1:2.4,t.x-=t.width/(i?1.9:1.7))}getAutoZoom(t,i){(typeof t=="undefined"||typeof i=="undefined")&&(t=this.maxX,i=this.maxY);let e=t===this.maxX,a=this.noHighlightsBehaviour==="contain"||this.highlights.length>0;a&&(t*=e?1.05:1.2,i*=e?1.05:1.2);let o=this.canvasWidth/t,l=this.canvasHeight/i,d=a?Math.min(l,o):Math.max(l,o);return(0,K.default)(d,rt,bt)}setZoom(t){typeof t=="undefined"?this.zoom=this.getAutoZoom():this.zoom=t,this.zoom=(0,K.default)(this.zoom,rt,bt),this.setCenter(this.x,this.y)}setCenter(t,i){typeof t!="undefined"?(this.x=V(t),this.y=V(i)):(this.x=V(this.maxX/2),this.y=V(this.maxY/2))}onTweenTick(t){isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||(this.setCenter(t.x,t.y),this.setZoom(t.z))}hasHighlightAtScreenPosition(t){let i=a=>(a-this.x)*this.zoom+this.canvasWidth/2,e=a=>(a-this.y)*this.zoom+this.canvasHeight/2;return this.highlights.reduce((a,o)=>a?!0:!(t.x<i(o.x)||t.x>i(o.x+o.width)||t.y<e(o.y)||t.y>e(o.y+o.height)),!1)}ensureLabelXIsInsideBoundaries(t,i){let e=this.getDimensions(),a=-this.x+e.x,o=a+e.width;return i-t*.5<a?i=a+t*.5:i+t*.5>o&&(i=o-t*.5),i}};function J(n,t,i,e,a,o){"roundRect"in n?n.roundRect(t,i,e,a,o):n.rect(t,i,e,a,o)}function _(){M("[data-scrollpoints]").forEach(n=>Tt(n))}function Tt(n){let t=n.querySelector("[data-media]"),i=document.createElement("canvas");t.appendChild(i);let e,a,o=new Image;o.addEventListener("load",()=>{l.setBounds(o.naturalWidth,o.naturalHeight),l.adjustSize(),c(!0)}),o.src=t.getAttribute("data-media"),i.setAttribute("role","img"),i.setAttribute("aria-label",t.getAttribute("data-alt-text"));let l=new w(i,o,t.getAttribute("data-color"),parseFloat(t.getAttribute("data-opacity")||"10")/100);l.setInstantSrc(t.getAttribute("data-instant")),It(n,i,l);let d=M("[data-box]",n);l.key=d[0].getAttribute("data-item-id");function c(m=!1){if(a=mt(n),a!==e||m===!0){if(e=a,!a)return;Xt(a,l);let G=a.getAttribute("data-item-id");if(G&&window.dispatchEvent(new CustomEvent("scrollpoint:active-point-changed",{detail:{itemId:G}})),a.getAttribute("data-box")==="")l.setHighlights([],G);else{let{highlights:x}=JSON.parse(a.getAttribute("data-box")),X=x.map(W=>({x:parseFloat(W.x),y:parseFloat(W.y),width:parseFloat(W.width),height:parseFloat(W.height),effect:W.effect,color:W.color||"red",label:W.label||"",hasDot:!!W.hasDot,dotX:parseFloat(W.dotX),dotY:parseFloat(W.dotY),dotColor:W.dotColor,dotLabel:W.dotLabel||"",darkenAroundHighlight:W.darkenAroundHighlight||!1}));l.setHighlights(X,G)}}}function h(){c();let{top:m,bottom:G}=n.getBoundingClientRect();m>N.getHeight()||G<N.getTop()?l.hide():l.show()}let s=0;function r(){clearTimeout(s),s=window.setTimeout(()=>{l.adjustSize(),c(!0)},200)}return(document.getElementById("editor-viewport")||document).addEventListener("scroll",h,{passive:!0}),window.addEventListener("resize",r,{passive:!0}),()=>{f(!0).catch(console.error);let m=t.getAttribute("data-media");o.src!==m&&(o.src=m),l.setInstantSrc(t.getAttribute("data-instant")),d=M("[data-box]",n),l.backgroundColor=t.getAttribute("data-color"),l.backgroundOpacity=parseFloat(t.getAttribute("data-opacity"))/100,c(!0)}}function It(n,t,i){if(!document.getElementById("editor-viewport"))return;let e=n.getAttribute("data-section-id");t.addEventListener("mousemove",a=>{i.hasHighlightAtScreenPosition({x:a.offsetX,y:a.offsetY})?document.body.style.setProperty("cursor","zoom-in"):document.body.style.setProperty("cursor","auto")},{passive:!0}),t.addEventListener("click",a=>{if(i.hasHighlightAtScreenPosition({x:a.offsetX,y:a.offsetY})){let o=mt(n);window.dispatchEvent(new CustomEvent("scrollpoint:manage-highlights",{detail:{sectionId:e,activeItemId:o.getAttribute("data-item-id")}}))}})}function mt(n){let t=window.innerHeight*.9,i=n.querySelector("[data-media]"),e=M("[data-box]",n),a,o=n.getBoundingClientRect();return o.bottom<N.getTop()+N.getHeight()?(a=e[e.length-1],i.setAttribute("data-attach","after")):o.top<N.getTop()?(a=e.reduce((l,d)=>d.getBoundingClientRect().top<t?d:l,e[0]),i.setAttribute("data-attach","during")):(a=e[0],i.setAttribute("data-attach","before")),a}function Xt(n,t){switch(n.getAttribute("data-align")){case"left":t.bias="right";break;case"right":t.bias="left";break;default:t.bias="none"}}_();})();
/*! Bundled license information:

classnames/dedupe.js:
  (*!
  	Copyright (c) 2018 Jed Watson.
  	Licensed under the MIT License (MIT), see
  	http://jedwatson.github.io/classnames
  *)
*/
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="56b5bbb1-f9a4-5d40-b06f-95bae63408de")}catch(e){}}();
//# sourceMappingURL=scrollpoints.356370.min.js.map
//# debugId=56b5bbb1-f9a4-5d40-b06f-95bae63408de
