1var le=Object.defineProperty;var ce=(t,e,n)=>e in t?le(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var de=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var M=(t,e,n)=>(ce(t,typeof e!="symbol"?e+"":e,n),n);import{S as ue,U as fe,H as pe,t as ge}from"./vendor.js?v=0.0.0";import{a as O}from"./msg.js?v=0.0.0";import{s as Yt}from"./seperateStyleFromInnerHtml.js?v=0.0.0";var Pe=de((We,St)=>{(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="fd476273-da12-4f0a-8e53-f48389012fcb",t._sentryDebugIdIdentifier="sentry-dbid-fd476273-da12-4f0a-8e53-f48389012fcb")}catch{}})();/*! iFrame Resizer (iframeSizer.contentWindow.min.js) - v4.3.7 - 2023-09-14 2 * Desc: Include this file in any page being loaded into an iframe 3 * to force the iframe to resize to the content size. 4 * Requires: iframeResizer.min.js on host page. 5 * Copyright: (c) 2023 David J. Bradshaw - [email protected] 6 * License: MIT 7 */(function(t){if(typeof window<"u"){var e=!0,n="",o=0,a="",r=null,l="",f=!1,y={resize:1,click:1},E=128,w=!0,v=1,h="bodyOffset",u=h,S=!0,C="",H={},I=32,k=null,ot=!1,it=!1,K="[iFrameSizer]",Tt=K.length,Z="",xt={max:1,min:1,bodyScroll:1,documentElementScroll:1},rt="child",ne=!0,Ct=window.parent,j="*",at=0,G=!1,At=null,Q=16,tt=1,Lt="scroll",R=Lt,oe=window,st=function(){P("onMessage function not defined")},lt=function(){},ct=function(){},dt={height:function(){return P("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return P("Custom width calculation function not defined"),document.body.scrollWidth}},ut={},It=!1;try{var kt=Object.create({},{passive:{get:function(){It=!0}}});window.addEventListener("test",Nt,kt),window.removeEventListener("test",Nt,kt)}catch{}var ft,V,X,pt,z,Y,D={bodyOffset:function(){return document.body.offsetHeight+ht("marginTop")+ht("marginBottom")},offset:function(){return D.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return dt.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,et(D))},min:function(){return Math.min.apply(null,et(D))},grow:function(){return D.max()},lowestElement:function(){return Math.max(D.bodyOffset()||D.documentElementOffset(),mt("bottom",Ft()))},taggedElement:function(){return _t("bottom","data-iframe-height")}},_={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return dt.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(_.bodyScroll(),_.documentElementScroll())},max:function(){return Math.max.apply(null,et(_))},min:function(){return Math.min.apply(null,et(_))},rightMostElement:function(){return mt("right",Ft())},taggedElement:function(){return _t("right","data-iframe-width")}},ie=(ft=Bt,z=null,Y=0,function(){var i=Date.now(),c=Q-(i-(Y=Y||i));return V=this,X=arguments,c<=0||Q<c?(z&&(clearTimeout(z),z=null),Y=i,pt=ft.apply(V,X),z||(V=X=null)):z=z||setTimeout(se,c),pt});$(window,"message",function(i){var c={init:function(){C=i.data,Ct=i.source,re(),w=!1,setTimeout(function(){S=!1},E)},reset:function(){S?g("Page reset ignored by init"):(g("Page size reset by host page"),Wt("resetPage"))},resize:function(){F("resizeParent","Parent window requested size check")},moveToAnchor:function(){H.findTarget(m())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var p=m();g("PageInfoFromParent called from parent: "+p),ct(JSON.parse(p)),g(" --")},message:function(){var p=m();g("onMessage called from parent: "+p),st(JSON.parse(p)),g(" --")}};function s(){return i.data.split("]")[1].split(":")[0]}function m(){return i.data.slice(i.data.indexOf(":")+1)}function A(){return i.data.split(":")[2]in{true:1,false:1}}function d(){var p=s();p in c?c[p]():(typeof St>"u"||!St.exports)&&"iFrameResize"in window||window.jQuery!==t&&"iFrameResize"in window.jQuery.prototype||A()||P("Unexpected message ("+i.data+")")}K===(""+i.data).slice(0,Tt)&&(w===!1?d():A()?c.init():g('Ignored message of type "'+s()+'". Received before initialization.'))}),$(window,"readystatechange",jt),jt()}function Nt(){}function $(i,c,s,m){i.addEventListener(c,s,!!It&&(m||{}))}function Mt(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Ot(i){return K+"["+Z+"] "+i}function g(i){ot&&typeof window.console=="object"&&console.log(Ot(i))}function P(i){typeof window.console=="object"&&console.warn(Ot(i))}function re(){function i(d){return d==="true"}function c(d,p){return typeof d=="function"&&(g("Setup custom "+p+"CalcMethod"),dt[p]=d,d="custom"),d}{var s;s=C.slice(Tt).split(":"),Z=s[0],o=t===s[1]?o:Number(s[1]),f=t===s[2]?f:i(s[2]),ot=t===s[3]?ot:i(s[3]),I=t===s[4]?I:Number(s[4]),e=t===s[6]?e:i(s[6]),a=s[7],u=t===s[8]?u:s[8],n=s[9],l=s[10],at=t===s[11]?at:Number(s[11]),H.enable=t!==s[12]&&i(s[12]),rt=t===s[13]?rt:s[13],R=t===s[14]?R:s[14],it=t===s[15]?it:i(s[15]),g("Initialising iFrame ("+window.location.href+")"),"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(s=window.iFrameResizer,g("Reading data from page: "+JSON.stringify(s)),Object.keys(s).forEac
7h(ae,s),st="onMessage"in s?s.onMessage:st,lt="onReady"in s?s.onReady:lt,j="targetOrigin"in s?s.targetOrigin:j,u="heightCalculationMethod"in s?s.heightCalculationMethod:u,R="widthCalculationMethod"in s?s.widthCalculationMethod:R,u=c(u,"height"),R=c(R,"width"))}function m(d){q(0,0,d.type,d.screenY+":"+d.screenX)}function A(d,p){g("Add event listener: "+p),$(window.document,d,m)}g("TargetOrigin for parent set to: "+j),gt("margin",function(d,p){return p.indexOf("-")!==-1&&(P("Negative CSS value ignored for "+d),p=""),p}("margin",a=t===a?o+"px":a)),gt("background",n),gt("padding",l),(s=document.createElement("div")).style.clear="both",s.style.display="block",s.style.height="0",document.body.appendChild(s),Ht(),zt(),document.documentElement.style.height="",document.body.style.height="",g('HTML & body height set to "auto"'),g("Enable public methods"),oe.parentIFrame={autoResize:function(d){return d===!0&&e===!1?(e=!0,Dt()):d===!1&&e===!0&&(e=!1,Rt("remove"),r!==null&&r.disconnect(),clearInterval(k)),q(0,0,"autoResize",JSON.stringify(e)),e},close:function(){q(0,0,"close")},getId:function(){return Z},getPageInfo:function(d){typeof d=="function"?(ct=d,q(0,0,"pageInfo")):(ct=function(){},q(0,0,"pageInfoStop"))},moveToAnchor:function(d){H.findTarget(d)},reset:function(){$t("parentIFrame.reset")},scrollTo:function(d,p){q(p,d,"scrollTo")},scrollToOffset:function(d,p){q(p,d,"scrollToOffset")},sendMessage:function(d,p){q(0,0,"message",JSON.stringify(d),p)},setHeightCalculationMethod:function(d){u=d,Ht()},setWidthCalculationMethod:function(d){R=d,zt()},setTargetOrigin:function(d){g("Set targetOrigin: "+d),j=d},size:function(d,p){F("size","parentIFrame.size("+((d||"")+(p?","+p:""))+")",d,p)}},it===!0&&(A("mouseenter","Mouse Enter"),A("mouseleave","Mouse Leave")),Dt(),H=function(){function d(x){var x=x.getBoundingClientRect(),T={x:window.pageXOffset===t?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===t?document.documentElement.scrollTop:window.pageYOffset};return{x:parseInt(x.left,10)+parseInt(T.x,10),y:parseInt(x.top,10)+parseInt(T.y,10)}}function p(x){var x=x.split("#")[1]||x,T=decodeURIComponent(x),T=document.getElementById(T)||document.getElementsByName(T)[0];t===T?(g("In page link (#"+x+") not found in iFrame, so sending to parent"),q(0,0,"inPageLink","#"+x)):(T=d(T=T),g("Moving to in page link (#"+x+") at x: "+T.x+" y: "+T.y),q(T.y,T.x,"scrollToOffset"))}function N(){var b=window.location.hash,x=window.location.href;b!==""&&b!=="#"&&p(x)}function yt(){Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(b){b.getAttribute("href")!=="#"&&$(b,"click",function(x){x.preventDefault(),p(this.getAttribute("href"))})})}function B(){Array.prototype.forEach&&document.querySelectorAll?(g("Setting up location.hash handlers"),yt(),$(window,"hashchange",N),setTimeout(N,E)):P("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return H.enable?B():g("In page linking not enabled"),{findTarget:p}}(),F("init","Init message from host page"),lt()}function ae(i){var c=i.split("Callback");c.length===2&&(this[c="on"+c[0].charAt(0).toUpperCase()+c[0].slice(1)]=this[i],delete this[i],P("Deprecated: '"+i+"' has been renamed '"+c+"'. The old method will be removed in the next major version."))}function gt(i,c){t!==c&&c!==""&&c!=="null"&&g("Body "+i+' set to "'+(document.body.style[i]=c)+'"')}function L(i){var c={add:function(s){function m(){F(i.eventName,i.eventType)}ut[s]=m,$(window,s,m,{passive:!0})},remove:function(s){var m=ut[s];delete ut[s],window.removeEventListener(s,m,!1)}};i.eventNames&&Array.prototype.map?(i.eventName=i.eventNames[0],i.eventNames.map(c[i.method])):c[i.method](i.eventName),g(Mt(i.method)+" event listener: "+i.eventType)}function Rt(i){L({method:i,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),L({method:i,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),L({method:i,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),L({method:i,eventType:"Input",eventName:"input"}),L({method:i,eventType:"Mouse Up",eventName:"mouseup"}),L({method:i,eventType:"Mouse Down",eventName:"mousedown"}),L({method:i,eventType:"Orientation Change",eventName:"orientationchange"}),L({method:i,eventType:"Print",eventNames:["afterprint","beforeprint"]}),L({method:i,eventType:"Ready State Change",eventName:"readystatechange"}),L({method:i,eventType:"Touch Start",eventName:"touchstart"}),L({method:i,eventType:"Touch End",eventName:"touchend"}),L({method:i,eventType:"Touch Cancel",eventName:"touchcancel"}),L({method:i,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),L({method:i,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),L({method:i,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}
7),rt==="child"&&L({method:i,eventType:"IFrame Resized",eventName:"resize"})}function qt(i,c,s,m){return c!==i&&(i in s||(P(i+" is not a valid option for "+m+"CalculationMethod."),i=c),g(m+' calculation method set to "'+i+'"')),i}function Ht(){u=qt(u,h,D,"height")}function zt(){R=qt(R,Lt,_,"width")}function Dt(){var i;e===!0?(Rt("add"),i=I<0,window.MutationObserver||window.WebKitMutationObserver?i?Pt():r=function(){function c(b){function x(T){T.complete===!1&&(g("Attach listeners to "+T.src),T.addEventListener("load",A,!1),T.addEventListener("error",d,!1),N.push(T))}b.type==="attributes"&&b.attributeName==="src"?x(b.target):b.type==="childList"&&Array.prototype.forEach.call(b.target.querySelectorAll("img"),x)}function s(b){g("Remove listeners from "+b.src),b.removeEventListener("load",A,!1),b.removeEventListener("error",d,!1),N.splice(N.indexOf(b),1)}function m(b,x,T){s(b.target),F(x,T+": "+b.target.src)}function A(b){m(b,"imageLoad","Image loaded")}function d(b){m(b,"imageLoadFailed","Image load failed")}function p(b){F("mutationObserver","mutationObserver: "+b[0].target+" "+b[0].type),b.forEach(c)}var N=[],yt=window.MutationObserver||window.WebKitMutationObserver,B=function(){var b=document.querySelector("body");return B=new yt(p),g("Create body MutationObserver"),B.observe(b,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),B}();return{disconnect:function(){"disconnect"in B&&(g("Disconnect body MutationObserver"),B.disconnect(),N.forEach(s))}}}():(g("MutationObserver not supported in this browser!"),Pt())):g("Auto Re
7size disabled")}function Pt(){I!==0&&(g("setInterval: "+I+"ms"),k=setInterval(function(){F("interval","setInterval: "+I)},Math.abs(I)))}function ht(i,c){return c=c||document.body,c=(c=document.defaultView.getComputedStyle(c,null))===null?0:c[i],parseInt(c,10)}function mt(i,c){for(var s,m=c.length,A=0,d=Mt(i),p=Date.now(),N=0;N<m;N++)A<(s=c[N].getBoundingClientRect()[i]+ht("margin"+d,c[N]))&&(A=s);return p=Date.now()-p,g("Parsed "+m+" HTML elements"),g("Element position calculated in "+p+"ms"),Q/2<(p=p)&&g("Event throttle increased to "+(Q=2*p)+"ms"),A}function et(i){return[i.bodyOffset(),i.bodyScroll(),i.documentElementOffset(),i.documentElementScroll()]}function _t(i,c){var s=document.querySelectorAll("["+c+"]");return s.length===0&&(P("No tagged elements ("+c+") found on page"),document.querySelectorAll("body *")),mt(i,s)}function Ft(){return document.querySelectorAll("body *")}function Bt(i,c,s,m){function A(){i in{init:1,interval:1,size:1}||!(u in xt||f&&R in xt)?i in{interval:1}||g("No change in size detected"):$t(c)}function d(p,N){return!(Math.abs(p-N)<=at)}s=t===s?D[u]():s,m=t===m?_[R]():m,d(v,s)||f&&d(tt,m)||i==="init"?(Ut(),q(v=s,tt=m,i)):A()}function se(){Y=Date.now(),z=null,pt=ft.apply(V,X),z||(V=X=null)}function F(i,c,s,m){G&&i in y?g("Trigger event cancelled: "+i):(i in{reset:1,resetPage:1,init:1}||g("Trigger event: "+c),(i==="init"?Bt:ie)(i,c,s,m))}function Ut(){G||(G=!0,g("Trigger event lock on")),clearTimeout(At),At=setTimeout(function(){G=!1,g("Trigger event lock off"),g("--")},E)}function Wt(i){v=D[u](),tt=_[R](),q(v,tt,i)}function $t(i){var c=u;u=h,g("Reset trigger event: "+i),Ut(),Wt("reset"),u=c}function q(i,c,s,m,A){ne===!0&&(t===A?A=j:g("Message targetOrigin: "+A),g("Sending message to host page ("+(i=Z+":"+(i+":"+c)+":"+s+(t===m?"":":"+m))+")"),Ct.postMessage(K+i,A))}function jt(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}})();class vt{constructor({api:e,config:n}){M(this,"api");M(this,"config");M(this,"button");M(this,"styleInput");M(this,"_state");M(this,"tag");M(this,"tagForHighlight");M(this,"class");this.api=e,this.config=n,this.button=null,this.styleInput=null,this._state=!1,this.tag="SPAN",this.tagForHighlight="MARK",this.class=["upf-styled",n.toolClass]}static get isInline(){return!0}get state(){return this._state}set state(e){var n;this._state=e,(n=this.button)==null||n.classList.toggle("is-active",e)}render(){const e=document.createElement("span");return this.button=document.createElement("button"),this.button.type="button",this.button.innerHTML="S",this.button.id="marker-button",this.styleInput=document.createElement("input"),this.styleInput.type="hidden",this.styleInput.name="upf-style-input",e.appendChild(this.button),e.appendChild(this.styleInput),e}surround(e){this.handleWrap(e),window.postMessageOnParentTrigger(this.config.elementSelector)}wrapStyleNode(e,n,o,a=""){const r=document.createElement(n);return r.classList.add(...o),r.setAttribute("style",a),r.appendChild(e),r}checkRangeInParent(e,n){const o=e.startContainer.parentNode===n,a=e.endContainer.parentNode===n;return o&&a}highlightNodeSplitting(e,n){var l;const o=n.getAttribute("style")||"",a=n.textContent||"";return[[a.substring(0,e.startOffset),o],[a.substring(e.startOffset,e.endOffset),((l=this.styleInput)==null?void 0:l.value)??""],[a.substring(e.endOffset),o]].map(([f,y])=>this.wrapStyleNode(document.createTextNode(f),this.tagForHighlight,this.class,y))}wrapColorNodeIntoAllHighlight(e,n){var a;let o={name:this.tag,class:this.class,style:(a=this.styleInput)==null?void 0:a.value};n&&(o={name:n.tagName.toLowerCase(),class:[...n.classList],style:n.getAttribute("style")||""}),e.querySelectorAll(this.tagForHighlight.toLowerCase()).forEach(r=>{const l=r.textContent||"";r.innerHTML="",r.appendChild(this.wrapStyleNode(document.createTextNode(l),o.name,o.class,o.style))})}getAnchorsInRange(e){const n=new Set,o=e.commonAncestorContainer.nodeType===Node.ELEMENT_NODE?e.commonAncestorContainer:e.commonAncestorContainer.parentElement;return o&&o.querySelectorAll("a").forEach(a=>{e.intersectsNode(a)&&n.add(a)}),n}setAnchorsColorInherit(e,n){e.querySelectorAll("a").forEach(o=>{var E;if(n&&!n.has(o))return;const a=o,f=(((E=a.getAttribute("style"))==null?void 0:E.trim())??"").replace(/\s*color\s*:\s*[^;]+;
7?\s*/gi,"").trim().replace(/\s*text-decoration\s*:\s*[^;]+;?\s*/gi,"").trim(),y=f?`; ${f}`:"";a.setAttribute("style",`color: inherit; text-decoration: none${y}`)})}hoistStyleNodeOutOfAnchor(e,n){const o=w=>{["href","target","rel","title","class"].forEach(h=>{const u=n.getAttribute(h);u!=null&&w.setAttribute(h,u)});const v=n.getAttribute("style");v&&w.setAttribute("style",v)},a=[],r=[];let l=!1;n.childNodes.forEach(w=>{w===e?l=!0:(l?r:a).push(w)});const f=w=>w.some(v=>{var h;return v.nodeType!==Node.TEXT_NODE||(((h=v.textContent)==null?void 0:h.length)??0)>0}),y=w=>{const v=document.createElement("a");return o(v),w.forEach(h=>v.appendChild(h)),v},E=document.createElement("a");for(o(E);e.firstChild;)E.appendChild(e.firstChild);e.appendChild(E),n.replaceWith(...a.length&&f(a)?[y(a)]:[],e,...r.length&&f(r)?[y(r)]:[])}ensureStyleWrapsAnchors(e,n){const o=[this.tag,this.tagForHighlight].map(r=>`${r.toLowerCase()}.${this.class[1]}`).join(", ");[...e.querySelectorAll(o)].filter(r=>{const l=r.parentElement;if(!l||l.tagName!=="A")return!1;const f=l;return!(n&&!n.has(f))}).forEach(r=>{const l=r.parentElement;if(!l||l.tagName!=="A")return;const f=u=>{["href","target","rel","title","class"].forEach(C=>{const H=l.getAttribute(C);H!=null&&u.setAttribute(C,H)});const S=l.getAttribute("style");S&&u.setAttribute("style",S)},y=[],E=[];let w=!1;l.childNodes.forEach(u=>{u===r?w=!0:(w?E:y).push(u)});const v=u=>{const S=document.createElement("a");return f(S),u.forEach(C=>S.appendChild(C)),S},h=document.createElement("a");for(f(h);r.firstChild;)h.appendChild(r.firstChild);r.appendChild(h),l.replaceWith(...y.length?[v(y)]:[],r,...E.length?[v(E)]:[])})}cleanEmptyStyleNodes(e){const n=e.closest(".upf-unit-edit");if(n){const o=a=>{var l;for(let f=a.childNodes.length-1;f>=0;f--)o(a.childNodes[f]);a instanceof HTMLElement&&a.classList.contains("upf-styled")&&(!a.textContent||a.textContent.trim()==="")&&((l=a.parentNode)==null||l.removeChild(a))};o(n)}}handleWrap(e){var E,w,v,h;const n=this.getAnchorsInRange(e),o=this.class[1]==="upf-highlight",a=o?this.tagForHighlight:this.tag;let r=this.api.selection.findParentTag(a,this.class[1]);if(r&&e.toString()===r.innerText)r.setAttribute("style",((E=this.styleInput)==null?void 0:E.value)??"");else if(o&&this.checkRangeInParent(e,r)){const u=this.highlightNodeSplitting(e,r);r.replaceWith(...u),r=u[1]}else{const u=n.size>0;let S=null,C=null;if(u){const I=e.startContainer;if(I.nodeType===Node.TEXT_NODE&&I.parentNode){S=I.parentNode;let k=I.nextSibling;for(;k&&e.intersectsNode(k);)k=k.nextSibling;C=k}else if(I.nodeType===Node.ELEMENT_NODE){S=I;let k=I.firstChild;for(;k&&e.intersectsNode(k);)k=k.nextSibling;C=k}}const H=e.extractContents();r=this.wrapStyleNode(H,a,this.class,(w=this.styleInput)==null?void 0:w.value),S?S.insertBefore(r,C):e.insertNode(r)}r.querySelectorAll(`.${this.class.join(".")}`).forEach(u=>{var S;return(S=u.parentNode)==null?void 0:S.replaceChild(document.createTextNode((u==null?void 0:u.textContent)||""),u)});const l=r.closest(".upf-color");o&&r.parentElement&&l?this.wrapColorNodeIntoAllHighlight(r.parentElement,l):this.wrapColorNodeIntoAllHighlight(r),this.setAnchorsColorInherit(r,n);const f=(h=(v=r.parentElement)==null?void 0:v.closest)==null?void 0:h.call(v,"a");f&&r.classList.contains(this.class[1])&&(!n.size||n.has(f))&&(this.hoistStyleNodeOutOfAnchor(r,f),this.setAnchorsColorInherit(r));const y=r.closest(".upf-unit-edit")??r.parentElement??r;this.ensureStyleWrapsAnchors(y,n),this.cleanEmptyStyleNodes(r),this.api.selection.expandToTag(r)}checkState(){const e=this.api.selection.findParentTag(this.tag);return this.state=!!e}static get sanitize(){return{span:{class:!0,style:!0},mark:{class:!0,style:!0},a:{style:!0,href:!0,target:!0,rel:!0,title:!0,class:!0}}}}class he{constructor({data:e,config:n}){M(this,"_data");M(this,"_element");M(this,"_inputHandler");M(this,"_boundPasteOverride");this._data={text:""};const o=n==null?void 0:n.onInputSyncRequest;this._inputHandler=()=>{var a;((a=this._element.textContent)==null?void 0:a.length)===0&&(this._element.innerHTML=""),o==null||o()},this._boundPasteOverride=this.pasteOverride.bind(this),this._element=this.drawView(),this.data=e}static get enableLineBreaks(){return!0}drawView(){const e=document.createElement("div");return e.classList.add("upf-unit-edit"),e.innerHTML=this._data.text||"",e.contentEditable="true",e.addEventListener("paste",this._boundPasteOverride),e.addEventListener("input",this._inputHandler),e}destroy(){this._element.removeEventListener("paste",this._boundPasteOverride),this._element.removeEventListener("input",this._inputHandler)}pasteOverride(e){e.preventDefault(),e.stopPropagation();const n=e.clipboardData;let o="";if(n){const r=n.getData("text");try{const f=JSON.parse(r);o=(f==null?void 0:f.textValue)??r}catch{o=r}const l=document.createElement("div");l.innerHTML=o,o=l.textContent||l.innerText||""}const a=window.getSelection();a&&a.rangeCount>0&&(a.deleteFromDocument(),a.getRangeAt(0).insertNode(document.createTextNode(o)),a.collapseToEnd())}render(){return this._element}save(e){return{text:e.innerHTML}}onPaste(e){const n={text:e.detail.data.innerHTML};this.data=n}static get pasteConfig(){return{tags:["div"],patterns:{}}}static get toolbox(){return{title:"Text-Unit"}}static get sanitize(){return{text:{br:!0,span:!0}}}get data(){return this._data}set data(e){this._data=e,this._element.innerHTML=e.text||""}}const me=(t,e,n,o)=>({holder:t.id,hideToolbar:!0,autofocus:!1,minHeight:0,defaultBlock:"upflowy-unit",tools:{"upflowy-unit":{class:he,inlineToolbar:!0,
7config:{onInputSyncRequest:o==null?void 0:o.onInputSyncRequest}},"font-size":{class:vt,config:{toolClass:"upf-font-size",elementSelector:t.dataset.selector}},color:{class:vt,config:{toolClass:"upf-color",elementSelector:t.dataset.selector}},highlight:{class:vt,config:{toolClass:"upf-highlight",elementSelector:t.dataset.selector}},strikethrough:{class:ue,shortcut:"CMD+SHIFT+X"},underline:fe,link:{class:pe,config:{shortcut:"CMD+L",target:"_blank",rel:"nofollow",availableTargets:["_blank","_self"],availableRels:["author","noreferrer"],validate:!1}}},data:{time:1550476186479,blocks:[{id:t.dataset.selector,type:"upflowy-unit",data:{text:e,alignment:n.textAlign}}],version:"2.8.1"},onChange:a=>{a.saver.save().then(r=>{O({type:"editing-performed",outputData:r,fromSelector:t.dataset.selector,variantNodeId:t.dataset.variantNodeId})})}}),nt=t=>{const e=t.getRootNode();if(e instanceof ShadowRoot)return e.host;if(e instanceof HTMLElement)return};let Vt="",Xt=0,W={};function U(t){const e=t;e.addEventListener("mousedown",n=>Jt(n,e))}function Jt(t,e){t.stopPropagation(),Zt(e)}const Kt=t=>async e=>{Jt(e,t),t.removeEventListener("mousedown",Kt(t));const n=`append-editor-${Xt-1}`;t.id!==n&&(W&&Object.keys(W).length!==0&&Gt(W),W=await xe(t,Xt++))};function ye(t){const e=t;e.addEventListener("mousedown",Kt(e))}function ve(t){if(t.classList.contains("tab")){const o=t.getAttribute("class"),a=parseInt((o==null?void 0:o.split("-")[1])||"",10);return{meaningUnitInnerComponentType:`tab-${a}`,itemNo:a}}if(t.tagName==="SECTION")return{columnLayoutInnerComponentType:"section"};const e=["nav-bar","mobile-dropdown-button","container"];for(const o of e)if(t.classList.contains(String(o)))return{columnLayoutInnerComponentType:o};const n=t.querySelector("slot");return n?{columnLayoutInnerComponentType:n.getAttribute("name")}:{}}function be(t,e){return Array.from((t==null?void 0:t.querySelectorAll("*[slot]"))||[]).filter(n=>n.getAttribute("slot")===e).map(n=>n.getAttribute("data-selector")||"")}function Zt(t,e){var y,E,w,v,h;const n=nt(t);let o=ve(t);(n==null?void 0:n.tagName)==="NAVIGATION-BAR"&&!o.columnLayoutInnerComponentType&&(o={...o,columnLayoutInnerComponentType:"nav-bar"});const a=be(n,o.columnLayoutInnerComponentType??""),r=(y=window.frameElement)==null?void 0:y.getAttribute("data-viewer-type");O({type:"element-bounding-client-update",viewer:(E=window.frameElement)==null?void 0:E.id,viewerType:r,tagName:t.tagName,elementSelector:t.dataset.selector,id:t.id,findString:bt(t),rect:t.getBoundingClientRect(),slot:t.slot,rootNodeHost:n==null?void 0:n.dataset.selector,relatedColumnElementSelectors:a,...o});const l=u=>getComputedStyle(t,null).getPropertyValue(u),f=t instanceof HTMLAnchorElement&&t.dataset.imageLink&&t.querySelector("img");e||(O({type:"element-selected-in-viewer",viewer:(w=window.frameElement)==null?void 0:w.id,viewerType:r,tagName:t.tagName,elementSelector:t.dataset.selector,variantNodeId:t.dataset.variantNodeId,findString:bt(t),slot:t.slot,rootNodeHost:n==null?void 0:n.dataset.selector,relatedColumnElementSelectors:a,...o,textValue:t.querySelector(".upf-unit-edit")?((v=t.querySelector(".upf-unit-edit"))==null?void 0:v.textContent)||"":(h=Yt(t.innerHTML).content)==null?void 0:h.replace(/<\/?up-markup>/g,""),editorState:{padding:[l("padding-top"),l("padding-right"),l("padding-bottom"),l("padding-left")],textAlign:l("text-align"),alignSelf:l("align-self"),justifyContent:l("justify-content"),color:l("color"),fontSize:l("font-size"),backgroundColor:l("background-color"),backgroundImage:l("background-image"),backgroundSize:l("background-size"),backgroundRepeat:l("background-repeat"),backgroundPosition:l("background-position"),border:l("border"),borderRadius:l("border-radius"),ancestorBgColor:Ee(t)},...t.tagName==="IMG"&&t instanceof HTMLImageElement&&{imgAttr:{src:t.src,alt:t.alt,isReplacingImage:!!t.dataset.dataImageSrc,referenceImageSrc:t.dataset.referenceImageSrc}},...t.dataset.imageLink&&t instanceof HTMLAnchorElement&&f instanceof HTMLImageElement&&{isLinkWrappedMedia:!0,imgAttr:{anchorHref:t.href,anchorTarget:t.target,src:f.src,alt:f.alt,isReplacingImage:!!f.dataset.dataImageSrc,referenceImageSrc:f.dataset.referenceImageSrc}},...t.tagName==="A"&&t instanceof HTMLAnchorElement&&{buttonAttr:{textValue:t.innerText,anchorHref:t.getAttribute("href")||"",anchorTarget:t.target}}}),Vt!==t.dataset.selector&&(O({type:"editor-sync"}),Vt=t.dataset.selector??""),Se(t))}function we(t="",e,n){var a;let o;if(e){const r=(e!=="section"?".":"")+e,l=(a=document.querySelector(`[data-selector=${t}]`))==null?void 0:a.shadowRoot;o=l==null?void 0:l.querySelector(r)}else o=document.querySelector(`[data-selector=${t}]`);o&&Zt(o,!n)}function bt(t){var e,n;return t?((e=t.closest("[data-selector]"))==null?void 0:e.dataset.selector)||t.id&&`"category": "${t.id}"`||t.innerHTML.split("<")[0]||((n=t.getAttribute("src"))==null?void 0:n.split("/").pop())||t.tagName.toLowerCase():""}function Ee(t){var l;const e=f=>f?{background:getComputedStyle(f).background}:{background:""},n=(l=t.assignedSlot)==null?void 0:l.parentElement,o=n==null?void 0:n.closest(".column"),a=n==null?void 0:n.closest(".container"),r=n==null?void 0:n.closest("section");return[e(o),e(a),e(r)]}function Se(t){const e=nt(t);(!Te(t)||e)&&setTimeout(()=>{window.parent.focus()},50)}function Te(t){return["span","div","p","h1","h2","h3","h4","h5","h6","a","button"].includes(t.tagName.toLowerCase())}async function xe(t,e){const n={...getComputedStyle(t)};t.id=`append-editor-${e}`;const o=t.innerHTML,{styles:a,content:r}=Yt(o);return t.innerHTML=a??"",new ge(me(t,r,n,{onInputSyncRequest:Ae}))}function Gt(t){var n;const{holder:e}=t==null?void 0:t.configuration;if(e){const o=(n=document.querySelector(`#${e} .upf-unit-edit`))==null?void 0:n.innerHTML,a=document.querySelectorAll(`#${e} style`);let r="";a.forEach(f=>{r+=f.outerHTML||"",f.remove()}),t.destroy(),window.dispatchEvent(new CustomEvent("editor-reverted"));const l=document.querySelector("#"+e);l&&(l.innerHTML+=r+=o,l.removeAttribute("id"))}}function Ce(){W.destroy&&Gt(W)}function Ae(){var a;const t=W;if(!(t!=null&&t.save))return;const e=t==null?void 0:t.configuration,n=typeof(e==null?void 0:e.holder)=="string"?e.holder:(a=e==null?void 0:e.holder)==null?void 0:a.id;if(!n)return;const o=document.getElementById(n);
7o&&t.save().then(r=>{O({type:"editing-performed",outputData:r,fromSelector:o.dataset.selector,variantNodeId:o.dataset.variantNodeId})})}function Le(){document.querySelectorAll("p, h1, h2, h3, h4, h5, h6, span[slot], div[slot], a[slot]:not([data-image-link]), button[slot]").forEach(ye),[...document.querySelectorAll("img[slot], a[data-image-link], picture[slot], embed[slot], object[slot], iframe[slot]"),...[...document.querySelectorAll("*[slot]")].filter(n=>n.tagName.includes("-"))].forEach(U),document.querySelectorAll("column-layout").forEach(n=>{var o,a,r;(o=n.shadowRoot)==null||o.querySelectorAll("section").forEach(U),(a=n.shadowRoot)==null||a.querySelectorAll(".container").forEach(U),(r=n.shadowRoot)==null||r.querySelectorAll(".column").forEach(U)}),document.querySelectorAll("navigation-bar").forEach(n=>{var o,a;(o=n.shadowRoot)==null||o.querySelectorAll(".nav-bar").forEach(U),(a=n.shadowRoot)==null||a.querySelectorAll(".mobile-dropdown-button").forEach(U)}),document.querySelectorAll("[data-editing-mode]").forEach(n=>{var o;(o=n.shadowRoot)==null||o.querySelectorAll(".tab").forEach(U)})}function wt(t){var o,a,r,l,f,y,E,w,v;t.preventDefault();const e=t.target,n=(o=e.assignedSlot)==null?void 0:o.assignedNodes().indexOf(e);if(e&&e.classList.contains("column")||e.tagName==="SECTION"||e.slot){const h=nt(e),u={type:"hover-dropzone",slottedIndex:n,viewer:(a=window.frameElement)==null?void 0:a.id,tagName:e.tagName,rootNodeId:h==null?void 0:h.id,rootNodeHost:(h==null?void 0:h.dataset.selector)||((r=e.parentElement)==null?void 0:r.dataset.selector),rootNodeHostBefore:((l=h==null?void 0:h.previousElementSibling)==null?void 0:l.dataset.selector)||((y=(f=e.parentElement)==null?void 0:f.previousElementSibling)==null?void 0:y.dataset.selector),rect:e.getBoundingClientRect(),isLinkWrappedMedia:!!e.dataset.imageLink};if(e.tagName!=="SECTION"&&!e.slot&&(u.slot=(E=e.querySelector("slot"))==null?void 0:E.name,u.containerRect=(w=e.closest(".container"))==null?void 0:w.getBoundingClientRect()),e.slot){u.slot=e.slot,u.elementSelector=e.dataset.selector;const{shadowRoot:S}=e.parentElement||{};S&&(u.containerRect=(v=S==null?void 0:S.querySelector(`.${e.slot}`))==null?void 0:v.getBoundingClientRect())}O(u)}}function Qt(t){document.querySelectorAll("column-layout").forEach(e=>{var n;t((n=e.shadowRoot)==null?void 0:n.querySelector("section"))})}window.addListenerForDropzones=()=>{Qt(t=>{t==null||t.removeEventListener("dragenter",wt),t==null||t.addEventListener("dragenter",wt)}),document.querySelectorAll("style[data-disable-slot-pointer-event]").forEach(t=>t.remove()),document.body.appendChild((t=>(t.textContent="*[slot] .codex-editor { pointer-events: none !important; }",t.setAttribute("data-disable-slot-pointer-event","true"),t))(document.createElement("style")))};window.removeListenerForDropzones=()=>{Qt(t=>{t==null||t.removeEventListener("dragenter",wt)}),document.querySelectorAll("style[data-disable-slot-pointer-event]").forEach(t=>t.remove())};function Et(t){var o;t.preventDefault();const e=t.currentTarget,n=nt(e);if(n){const a={type:"hover-dropzone",itemNo:parseInt(e.className.split("tab-")[1],10),viewer:(o=window.frameElement)==null?void 0:o.id,rect:e.getBoundingClientRect(),containerRect:n.getBoundingClientRect()};O(a)}}function te(t,e){var n,o;(o=(n=document.querySelector(`[data-selector=${t}]`))==null?void 0:n.shadowRoot)==null||o.querySelectorAll(".unit .tab").forEach(a=>{e(a)})}window.addListenerForUnitDropzones=t=>{te(t,e=>{e==null||e.removeEventListener("dragenter",Et),e==null||e.addEventListener("dragenter",Et)})};window.removeListenerForUnitDropzones=t=>{te(t,e=>{e==null||e.removeEventListener("dragenter",Et)})};class Ie extends HTMLElement{constructor(){super();const e=this.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=` 8 div { 9 display: flex; 10 justify-content: center; 11 align-items: center; 12 background: #dddddd; 13 height: 64px; 14 width: 100%; 15 } 16 17 svg { 18 width: 48px; 19 height: 48px; 20 margin-right: 16px; 21 } 22 23 span { 24 user-select: none; 25 font-size: 32px; 26 font-family: Nunito, sans-serif; 27 color: #999999; 28 } 29 `;const o=document.createElement("div");o.innerHTML=`
30 <svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg"> 31 <path fill-rule="evenodd" clip-rule="evenodd" d="M14.2425 3.61896C14.7783 3.75291 15.1041 4.29584 14.9701 4.83164L10.9701 20.8316C10.8362 21.3674 10.2933 21.6932 9.75746 21.5592C9.22167 21.4253 8.89591 20.8824 9.02986 20.3466L13.0299 4.34657C13.1638 3.81077 13.7067 3.48501 14.2425 3.61896ZM7.70711 7.882C8.09763 8.27252 8.09763 8.90569 7.70711 9.29621L4.41421 12.5891L7.70711 15.882C8.09763 16.2725 8.09763 16.9057 7.70711 17.2962C7.31658 17.6867 6.68342 17.6867 6.29289 17.2962L2.29289 13.2962C1.90237 12.9057 1.90237 12.2725 2.29289 11.882L6.29289 7.882C6.68342 7.49147 7.31658 7.49147 7.70711 7.882ZM16.2929 7.882C16.6834 7.49147 17.3166 7.49147 17.7071 7.882L21.7071 11.882C22.0976 12.2725 22.0976 12.9057 21.7071 13.2962L17.7071 17.2962C17.3166 17.6867 16.6834 17.6867 16.2929 17.2962C15.9024 16.9057 15.9024 16.2725 16.2929 15.882L19.5858 12.5891L16.2929 9.29621C15.9024 8.90569 15.9024 8.27252 16.2929 7.882Z" fill="#999999"/> 32 </svg> 33 34 <span>Custom Code</span> 35 `,e.appendChild(n),e.appendChild(o)}}customElements.define("code-embed",Ie);const ke=()=>{const t=document.querySelectorAll("img");let e=0;t.forEach(n=>{var o;if(n.complete)e++,e===t.length&&O({type:"image-fully-loaded",viewer:(o=window.frameElement)==null?void 0:o.id});else{const a=()=>{var r;e++,n.removeEventListener("load",a),e===t.length&&O({type:"image-fully-loaded",viewer:(r=window.frameElement)==null?void 0:r.id})};n.addEventListener("load",a)}})},Ne=`@import"https://fonts.googleapis.com/css2?family=Nunito:wght@700&display=swap";body,html{overflow:hidden;overscroll-behavior-x:none!important;backface-visibility:hidden!important;caret-color:#000!important}.codex-editor--narrow .codex-editor__redactor{margin-right:0!important}.ce-popover--opened{text-align:left!important}.ce-toolbar{display:none!important}.ce-block__content,.ce-toolbar__content{max-width:unset!important;transition:unset!important}.ce-inline-toolbar{visibility:hidden!important}.ce-block{animation:unset!important}.ce-block a{text-decoration:unset!important}.upf-unit-edit{display:inline-block;outline:none}*::selection{background-color:#accef7bb!important}up-markup:not(.upf-unit-edit:focus-within up-markup){background-color:#e0d2ff!important;border:2px solid #9871f4!important;border-radius:8px!important;padding:4px!important}[contenteditable=true]:empty{padding-left:3px!important}[contenteditable=true]:empty:after{content:"Enter text here..."!important;pointer-events:none;display:inline-block;color:#888!important}[data-text-value-is-blank][id^=append-editor]:after{content:none!important}.upf-styled.upf-color{background-color:inherit}*[data-editing-mode]{position:relative;z-index:1}*[data-editing-mode]:before{content:"";position:absolute;top:-16px;left:-16px;width:100%;height:100%;background:transparent;z-index:0;padding:16px}a[data-image-link] img[data-wrapped-element]{pointer-events:none}[data-image-src]>img,[data-image-src]>a{width:inherit}[data-image-src]{position:relative;pointer-events:none}[data-image-src]:before{content:" ";display:block;width:100%;height:100%;background:rgba(105,49,237,.2);position:absolute;top:0;left:0;z-index:2}[data-image-src]:after{content:" ";display:block;width:36px;height:36px;border:4px solid rgba(105,49,237,1);border-radius:50%;border-left-color:transparent;animation:spin 1s linear infinite;position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;z-index:3}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}} 36`;function Me(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function Oe(t){const n=`<svg xmlns="http://www.w3.org/2000/svg" width="300" height="200" viewBox="0 0 300 200"> 37 <rect width="300" height="200" fill="#f1f3f5" stroke="#adb5bd" stroke-width="2" stroke-dasharray="6 4" rx="8"/> 38 <rect x="20" y="24" width="86" height="24" fill="#4263eb" rx="12"/> 39 <text x="63" y="41" font-family="sans-serif" font-size="13" font-weight="700" 40 fill="#ffffff" text-anchor="middle">DATASET</text> 41 <text x="150" y="118" font-family="sans-serif" font-size="14" 42 fill="#495057" text-anchor="middle">${Me(t||"Dataset image")}</text> 43 <text x="150" y="142" font-family="sans-serif" font-size="11" 44 fill="#868e96" text-anchor="middle">Visible in Preview & Publish</text> 45 </svg>`;return`data:image/svg+xml,${encodeURIComponent(n)}`}function Re(){[...document.querySelectorAll("img[data-external-src]")].forEac
45h(t=>{if(t instanceof HTMLImageElement){const e=t.getAttribute("data-external-src")??"";t.src=Oe(e),t.setAttribute("data-dataset-image","true"),t.alt||(t.alt=`Dataset image: ${e}`),t.title=`Dataset image: ${e} (resolves in Preview and Publish)`}})}let J=null;function qe(){J=null}function He(){if(!J)return!1;const t=window.getSelection();if(!t)return!1;try{t.removeAllRanges(),t.addRange(J);const e=document.querySelector('.upf-unit-edit, [contenteditable="true"]');return e==null||e.focus(),!0}catch{return!1}}const ee=()=>{var u,S;const t=window.getSelection();if(!t)return;const{isCollapsed:e,anchorNode:n}=t;if(e){J=null;return}if(!n)return;let o=n.parentElement;if(o!=null&&o.hasAttribute("contenteditable")&&(o=o.closest("*[slot]")),!o)return;t.rangeCount>0&&(J=t.getRangeAt(0).cloneRange());const a=getComputedStyle(o,null),r=C=>a.getPropertyValue(C),l=(u=n.parentElement)==null?void 0:u.closest("*[slot]"),f=l&&getComputedStyle(l,null),y=C=>f==null?void 0:f.getPropertyValue(C),E=(S=n.parentElement)==null?void 0:S.closest("mark"),w=E&&getComputedStyle(E,null),v=C=>w==null?void 0:w.getPropertyValue(C);setTimeout(()=>{var C;O({type:"text-range-selected-in-viewer",viewer:(C=window.frameElement)==null?void 0:C.id,tagName:l==null?void 0:l.tagName,elementSelector:l==null?void 0:l.dataset.selector,findString:bt(o),slot:o==null?void 0:o.slot,editorState:{padding:[y("padding-top"),y("padding-right"),y("padding-bottom"),y("padding-left")],textAlign:r("text-align"),fontSize:r("font-size"),color:r("color"),textGradient:r("background-clip")==="text"?r("background-image"):void 0,highlightGradient:v("background-image"),highlightColor:v("background-color"),backgroundColor:y("background-color"),backgroundImage:y("background-image"),backgroundSize:y("background-size"),backgroundRepeat:y("background-repeat"),backgroundPosition:y("background-position"),link:(o==null?void 0:o.getAttribute("href"))||"",isBlank:((o==null?void 0:o.getAttribute("target"))||"")==="_blank"}})},30)};addEventListener("DOMContentLoaded",()=>{var t;window.postMessageOnParentTrigger=we,window.revertCurrentEditorToUnit=Ce,window.restoreSelectionAndFocusForInlineToolbar=He,addEventListener("editor-reverted",qe),Le(),document.body.insertAdjacentHTML("beforeend",`<style>${Ne}</style>`),document.body.insertAdjacentHTML("beforeend","<span data-iframe-height></span>"),setTimeout(()=>{var e;(e=document.querySelector("span[data-iframe-height]"))==null||e.remove(),document.body.insertAdjacentHTML("beforeend","<span data-iframe-height></span>")},1e3),Re(),ke(),O({type:"viewer-refreshed",viewer:(t=window.frameElement)==null?void 0:t.id})});addEventListener("keydown",t=>t.metaKey&&t.key==="c"&&O({type:"viewer-trigger-keydown-copy"}));window.onkeyup=ee;window.onmouseup=()=>setTimeout(ee,30);function ze(t,e){const{screenX:n,screenY:o,outerWidth:a,innerWidth:r}=window.parent,l=Math.round(a/r*100)/100;return{clientX:(t-n)/l,clientY:(e-o)/l}}const De=navigator.userAgent.toLowerCase().includes("firefox");addEventListener("wheel",t=>{(De||t.ctrlKey)&&t.preventDefault();const e=ze(t.screenX,t.screenY),n={deltaX:t.deltaX,deltaY:t.deltaY,ctrlKey:t.ctrlKey,clientX:e.clientX,clientY:e.clientY,from:"viewer"};O({type:"wheel-to-pan",partialWheelEvent:n})},{passive:!1});addEventListener("dragenter",({dataTransfer:t})=>{(t==null?void 0:t.types[0])==="Files"&&window.addListenerForDropzones()});addEventListener("dragover",function(t){t.preventDefault()},!1);addEventListener("drop",function(t){t.preventDefault()},!1)});export default Pe(); 46//# sourceMappingURL=scriptsForViewer.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.