From d596df93736a396365f35f85126488ed55db088e Mon Sep 17 00:00:00 2001 From: jonatanklosko Date: Mon, 3 Jul 2023 22:53:57 +0000 Subject: [PATCH] Update assets --- static/assets/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/assets/app.js b/static/assets/app.js index d2e1004fc..86a417115 100644 --- a/static/assets/app.js +++ b/static/assets/app.js @@ -568,7 +568,7 @@ ${r.message}`)))}function Lne(){return import("./mermaid.core-JNHMJ5VR.js" `;function woe(i){return LU(i.locale,i.dataStore,i.messages,i.emojiData)}var xoe=0,Jb;function Eoe(){return`picmo-${Date.now()}-${xoe++}`}var Toe=OE();function DU(i){Toe(Coe);let e=ME(i),t=((e==null?void 0:e.custom)||[]).map(s=>Xe(me({},s),{custom:!0,tags:["custom",...s.tags||[]]})),n=new mE;Jb||(Jb=woe(e));let r=new LE(e.i18n);Jb.then(s=>{n.emit("data:ready",s)}).catch(s=>{n.emit("error",s)});let o=new AE({events:n,i18n:r,customEmojis:t,renderer:e.renderer,options:e,emojiData:Jb,pickerId:Eoe()}).create(kE);return o.renderSync(),o}function Od(i){return i.split("-")[0]}function Vu(i){return i.split("-")[1]}function _2(i){return["top","bottom"].includes(Od(i))?"x":"y"}function jU(i){return i==="y"?"height":"width"}function MU(i,e,t){let{reference:n,floating:r}=i,o=n.x+n.width/2-r.width/2,s=n.y+n.height/2-r.height/2,a=_2(e),l=jU(a),c=n[l]/2-r[l]/2,d=Od(e),h=a==="x",u;switch(d){case"top":u={x:o,y:n.y-r.height};break;case"bottom":u={x:o,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:s};break;case"left":u={x:n.x-r.width,y:s};break;default:u={x:n.x,y:n.y}}switch(Vu(e)){case"start":u[a]-=c*(t&&h?-1:1);break;case"end":u[a]+=c*(t&&h?-1:1);break}return u}var Ioe=async(i,e,t)=>{let{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:s}=t,a=await(s.isRTL==null?void 0:s.isRTL(e)),l=await s.getElementRects({reference:i,floating:e,strategy:r}),{x:c,y:d}=MU(l,n,a),h=n,u={},m=0;for(let p=0;pRoe[e])}function VU(i,e,t){t===void 0&&(t=!1);let n=Vu(i),r=_2(i),o=jU(r),s=r==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=p2(s)),{main:s,cross:p2(s)}}var Doe={start:"end",end:"start"};function PE(i){return i.replace(/start|end/g,e=>Doe[e])}var Moe=["top","right","bottom","left"],Ooe=Moe.reduce((i,e)=>i.concat(e,e+"-start",e+"-end"),[]);function Poe(i,e,t){return(i?[...t.filter(n=>Vu(n)===i),...t.filter(n=>Vu(n)!==i)]:t.filter(n=>Od(n)===n)).filter(n=>i?Vu(n)===i||(e?PE(n)!==n:!1):!0)}var Foe=function(i){return i===void 0&&(i={}),{name:"autoPlacement",options:i,async fn(e){var t,n,r,o,s;let{x:a,y:l,rects:c,middlewareData:d,placement:h,platform:u,elements:m}=e,Pe=i,{alignment:p=null,allowedPlacements:f=Ooe,autoAlignment:_=!0}=Pe,b=Ho(Pe,["alignment","allowedPlacements","autoAlignment"]),C=Poe(p,_,f),T=await BE(e,b),w=(t=(n=d.autoPlacement)==null?void 0:n.index)!=null?t:0,A=C[w];if(A==null)return{};let{main:O,cross:D}=VU(A,c,await(u.isRTL==null?void 0:u.isRTL(m.floating)));if(h!==A)return{x:a,y:l,reset:{placement:C[0]}};let j=[T[Od(A)],T[O],T[D]],q=[...(r=(o=d.autoPlacement)==null?void 0:o.overflows)!=null?r:[],{placement:A,overflows:j}],_e=C[w+1];if(_e)return{data:{index:w+1,overflows:q},reset:{placement:_e}};let J=q.slice().sort((et,B)=>et.overflows[0]-B.overflows[0]),ke=(s=J.find(et=>{let{overflows:B}=et;return B.every(Z=>Z<=0)}))==null?void 0:s.placement,Oe=ke!=null?ke:J[0].placement;return Oe!==h?{data:{index:w+1,overflows:q},reset:{placement:Oe}}:{}}}};function Hoe(i){let e=p2(i);return[PE(i),e,PE(e)]}var Boe=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(e){var t;let{placement:n,middlewareData:r,rects:o,initialPlacement:s,platform:a,elements:l}=e,j=i,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:u="bestFit",flipAlignment:m=!0}=j,p=Ho(j,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","flipAlignment"]),f=Od(n),_=h||(f===s||!m?[p2(s)]:Hoe(s)),b=[s,..._],C=await BE(e,p),T=[],w=((t=r.flip)==null?void 0:t.overflows)||[];if(c&&T.push(C[f]),d){let{main:q,cross:_e}=VU(n,o,await(a.isRTL==null?void 0:a.isRTL(l.floating)));T.push(C[q],C[_e])}if(w=[...w,{placement:n,overflows:T}],!T.every(q=>q<=0)){var A,O;let q=((A=(O=r.flip)==null?void 0:O.index)!=null?A:0)+1,_e=b[q];if(_e)return{data:{index:q,overflows:w},reset:{placement:_e}};let J="bottom";switch(u){case"bestFit":{var D;let ke=(D=w.map(Oe=>[Oe,Oe.overflows.filter(Pe=>Pe>0).reduce((Pe,et)=>Pe+et,0)]).sort((Oe,Pe)=>Oe[1]-Pe[1])[0])==null?void 0:D[0].placement;ke&&(J=ke);break}case"initialPlacement":J=s;break}if(n!==J)return{reset:{placement:J}}}return{}}}};async function zoe(i,e){let{placement:t,platform:n,elements:r}=i,o=await(n.isRTL==null?void 0:n.isRTL(r.floating)),s=Od(t),a=Vu(t),l=_2(t)==="x",c=["left","top"].includes(s)?-1:1,d=o&&l?-1:1,h=typeof e=="function"?e(i):e,{mainAxis:u,crossAxis:m,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:me({mainAxis:0,crossAxis:0,alignmentAxis:null},h);return a&&typeof p=="number"&&(m=a==="end"?p*-1:p),l?{x:m*d,y:u*c}:{x:u*c,y:m*d}}var PU=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(e){let{x:t,y:n}=e,r=await zoe(e,i);return{x:t+r.x,y:n+r.y,data:r}}}};function Uoe(i){return i==="x"?"y":"x"}var FU=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(e){let{x:t,y:n,placement:r}=e,_=i,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:b=>{let{x:C,y:T}=b;return{x:C,y:T}}}}=_,l=Ho(_,["mainAxis","crossAxis","limiter"]),c={x:t,y:n},d=await BE(e,l),h=_2(Od(r)),u=Uoe(h),m=c[h],p=c[u];if(o){let b=h==="y"?"top":"left",C=h==="y"?"bottom":"right",T=m+d[b],w=m-d[C];m=OU(T,m,w)}if(s){let b=u==="y"?"top":"left",C=u==="y"?"bottom":"right",T=p+d[b],w=p-d[C];p=OU(T,p,w)}let f=a.fn(Xe(me({},e),{[h]:m,[u]:p}));return Xe(me({},f),{data:{x:f.x-t,y:f.y-n}})}}};function KU(i){return i&&i.document&&i.location&&i.alert&&i.setInterval}function Va(i){if(i==null)return window;if(!KU(i)){let e=i.ownerDocument;return e&&e.defaultView||window}return i}function Fs(i){return Va(i).getComputedStyle(i)}function Wa(i){return KU(i)?"":i?(i.nodeName||"").toLowerCase():""}function qU(){let i=navigator.userAgentData;return i!=null&&i.brands?i.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function Hs(i){return i instanceof Va(i).HTMLElement}function $l(i){return i instanceof Va(i).Element}function Woe(i){return i instanceof Va(i).Node}function Ku(i){if(typeof ShadowRoot>"u")return!1;let e=Va(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function v2(i){let{overflow:e,overflowX:t,overflowY:n}=Fs(i);return/auto|scroll|overlay|hidden/.test(e+n+t)}function joe(i){return["table","td","th"].includes(Wa(i))}function GU(i){let e=/firefox/i.test(qU()),t=Fs(i);return t.transform!=="none"||t.perspective!=="none"||t.contain==="paint"||["transform","perspective"].includes(t.willChange)||e&&t.willChange==="filter"||e&&(t.filter?t.filter!=="none":!1)}function $U(){return!/^((?!chrome|android).)*safari/i.test(qU())}var HU=Math.min,qp=Math.max,f2=Math.round;function ja(i,e,t){var n,r,o,s;e===void 0&&(e=!1),t===void 0&&(t=!1);let a=i.getBoundingClientRect(),l=1,c=1;e&&Hs(i)&&(l=i.offsetWidth>0&&f2(a.width)/i.offsetWidth||1,c=i.offsetHeight>0&&f2(a.height)/i.offsetHeight||1);let d=$l(i)?Va(i):window,h=!$U()&&t,u=(a.left+(h&&(n=(r=d.visualViewport)==null?void 0:r.offsetLeft)!=null?n:0))/l,m=(a.top+(h&&(o=(s=d.visualViewport)==null?void 0:s.offsetTop)!=null?o:0))/c,p=a.width/l,f=a.height/c;return{width:p,height:f,top:m,right:u+p,bottom:m+f,left:u,x:u,y:m}}function Yl(i){return((Woe(i)?i.ownerDocument:i.document)||window.document).documentElement}function b2(i){return $l(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.pageXOffset,scrollTop:i.pageYOffset}}function YU(i){return ja(Yl(i)).left+b2(i).scrollLeft}function Voe(i){let e=ja(i);return f2(e.width)!==i.offsetWidth||f2(e.height)!==i.offsetHeight}function Koe(i,e,t){let n=Hs(e),r=Yl(e),o=ja(i,n&&Voe(e),t==="fixed"),s={scrollLeft:0,scrollTop:0},a={x:0,y:0};if(n||!n&&t!=="fixed")if((Wa(e)!=="body"||v2(r))&&(s=b2(e)),Hs(e)){let l=ja(e,!0);a.x=l.x+e.clientLeft,a.y=l.y+e.clientTop}else r&&(a.x=YU(r));return{x:o.left+s.scrollLeft-a.x,y:o.top+s.scrollTop-a.y,width:o.width,height:o.height}}function XU(i){return Wa(i)==="html"?i:i.assignedSlot||i.parentNode||(Ku(i)?i.host:null)||Yl(i)}function BU(i){return!Hs(i)||Fs(i).position==="fixed"?null:qoe(i)}function qoe(i){let{offsetParent:e}=i,t=i,n=!1;for(;t&&t!==e;){let{assignedSlot:r}=t;if(r){let o=r.offsetParent;if(Fs(r).display==="contents"){let s=r.hasAttribute("style"),a=r.style.display;r.style.display=Fs(t).display,o=r.offsetParent,r.style.display=a,s||r.removeAttribute("style")}t=r,e!==o&&(e=o,n=!0)}else if(Ku(t)&&t.host&&n)break;t=Ku(t)&&t.host||t.parentNode}return e}function Goe(i){let e=XU(i);for(Ku(e)&&(e=e.host);Hs(e)&&!["html","body"].includes(Wa(e));){if(GU(e))return e;{let t=e.parentNode;e=Ku(t)?t.host:t}}return null}function FE(i){let e=Va(i),t=BU(i);for(;t&&joe(t)&&Fs(t).position==="static";)t=BU(t);return t&&(Wa(t)==="html"||Wa(t)==="body"&&Fs(t).position==="static"&&!GU(t))?e:t||Goe(i)||e}function zU(i){if(Hs(i))return{width:i.offsetWidth,height:i.offsetHeight};let e=ja(i);return{width:e.width,height:e.height}}function $oe(i){let{rect:e,offsetParent:t,strategy:n}=i,r=Hs(t),o=Yl(t);if(t===o)return e;let s={scrollLeft:0,scrollTop:0},a={x:0,y:0};if((r||!r&&n!=="fixed")&&((Wa(t)!=="body"||v2(o))&&(s=b2(t)),Hs(t))){let l=ja(t,!0);a.x=l.x+t.clientLeft,a.y=l.y+t.clientTop}return Xe(me({},e),{x:e.x-s.scrollLeft+a.x,y:e.y-s.scrollTop+a.y})}function Yoe(i,e){let t=Va(i),n=Yl(i),r=t.visualViewport,o=n.clientWidth,s=n.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;let c=$U();(c||!c&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a,y:l}}function Xoe(i){var e;let t=Yl(i),n=b2(i),r=(e=i.ownerDocument)==null?void 0:e.body,o=qp(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=qp(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+YU(i),l=-n.scrollTop;return Fs(r||t).direction==="rtl"&&(a+=qp(t.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function QU(i){let e=XU(i);return["html","body","#document"].includes(Wa(e))?i.ownerDocument.body:Hs(e)&&v2(e)?e:QU(e)}function g2(i,e){var t;e===void 0&&(e=[]);let n=QU(i),r=n===((t=i.ownerDocument)==null?void 0:t.body),o=Va(n),s=r?[o].concat(o.visualViewport||[],v2(n)?n:[]):n,a=e.concat(s);return r?a:a.concat(g2(s))}function Qoe(i,e){let t=e.getRootNode==null?void 0:e.getRootNode();if(i.contains(e))return!0;if(t&&Ku(t)){let n=e;do{if(n&&i===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function Joe(i,e){let t=ja(i,!1,e==="fixed"),n=t.top+i.clientTop,r=t.left+i.clientLeft;return{top:n,left:r,x:r,y:n,right:r+i.clientWidth,bottom:n+i.clientHeight,width:i.clientWidth,height:i.clientHeight}}function UU(i,e,t){return e==="viewport"?m2(Yoe(i,t)):$l(e)?Joe(e,t):m2(Xoe(Yl(i)))}function Zoe(i){let e=g2(i),t=["absolute","fixed"].includes(Fs(i).position)&&Hs(i)?FE(i):i;return $l(t)?e.filter(n=>$l(n)&&Qoe(n,t)&&Wa(n)!=="body"):[]}function ese(i){let{element:e,boundary:t,rootBoundary:n,strategy:r}=i,o=[...t==="clippingAncestors"?Zoe(e):[].concat(t),n],s=o[0],a=o.reduce((l,c)=>{let d=UU(e,c,r);return l.top=qp(d.top,l.top),l.right=HU(d.right,l.right),l.bottom=HU(d.bottom,l.bottom),l.left=qp(d.left,l.left),l},UU(e,s,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}var tse={getClippingRect:ese,convertOffsetParentRelativeRectToViewportRelativeRect:$oe,isElement:$l,getDimensions:zU,getOffsetParent:FE,getDocumentElement:Yl,getElementRects:i=>{let{reference:e,floating:t,strategy:n}=i;return{reference:Koe(e,FE(t),n),floating:Xe(me({},zU(t)),{x:0,y:0})}},getClientRects:i=>Array.from(i.getClientRects()),isRTL:i=>Fs(i).direction==="rtl"};function ise(i,e,t,n){n===void 0&&(n={});let{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s=!0,animationFrame:a=!1}=n,l=r&&!a,c=o&&!a,d=l||c?[...$l(i)?g2(i):[],...g2(e)]:[];d.forEach(f=>{l&&f.addEventListener("scroll",t,{passive:!0}),c&&f.addEventListener("resize",t)});let h=null;if(s){let f=!0;h=new ResizeObserver(()=>{f||t(),f=!1}),$l(i)&&!a&&h.observe(i),h.observe(e)}let u,m=a?ja(i):null;a&&p();function p(){let f=ja(i);m&&(f.x!==m.x||f.y!==m.y||f.width!==m.width||f.height!==m.height)&&t(),m=f,u=requestAnimationFrame(p)}return t(),()=>{var f;d.forEach(_=>{l&&_.removeEventListener("scroll",t),c&&_.removeEventListener("resize",t)}),(f=h)==null||f.disconnect(),h=null,a&&cancelAnimationFrame(u)}}var nse=(i,e,t)=>Ioe(i,e,me({platform:tse},t));async function rse(i,e,t,n){if(!n)throw new Error("Must provide a positioning option");return await(typeof n=="string"?ose(i,e,t,n):sse(e,n))}async function ose(i,e,t,n){if(!t)throw new Error("Reference element is required for relative positioning");let r;return n==="auto"?r={middleware:[Foe(),FU(),PU({mainAxis:5,crossAxis:12})]}:r={placement:n,middleware:[Boe(),FU(),PU(5)]},ise(t,e,async()=>{if((!t.isConnected||!t.offsetParent)&&ase(i))return;let{x:o,y:s}=await nse(t,e,r);Object.assign(e.style,{position:"absolute",left:`${o}px`,top:`${s}px`})})}function sse(i,e){return i.style.position="fixed",Object.entries(e).forEach(([t,n])=>{i.style[t]=n}),()=>{}}function ase(i){switch(i.options.onPositionLost){case"close":return i.close(),!0;case"destroy":return i.destroy(),!0;case"hold":return!0}}var lse={hideOnClickOutside:!0,hideOnEmojiSelect:!0,hideOnEscape:!0,position:"auto",showCloseButton:!0,onPositionLost:"none"};function cse(i={}){return me(Xe(me({},lse),{rootElement:document.body}),i)}var dse='',WU=bn("popupContainer","closeButton"),HE=class{constructor(e,t){this.isOpen=!1,this.externalEvents=new Dd,this.options=me(me({},cse(t)),ME(e)),this.popupEl=document.createElement("div"),this.popupEl.classList.add(WU.popupContainer),this.popupEl.classList.add(this.options.theme),t.className&&this.popupEl.classList.add(t.className),this.options.showCloseButton&&(this.closeButton=document.createElement("button"),this.closeButton.type="button",this.closeButton.classList.add(WU.closeButton),this.closeButton.innerHTML=dse,this.closeButton.addEventListener("click",()=>{this.close()}),this.popupEl.appendChild(this.closeButton));let n=document.createElement("div");this.popupEl.appendChild(n),this.picker=DU(Xe(me({},this.options),{rootElement:n})),this.focusTrap=new jp,this.picker.addEventListener("data:ready",()=>{this.focusTrap.activate(this.picker.el),this.picker.setInitialFocus()}),this.options.hideOnEmojiSelect&&this.picker.addEventListener("emoji:select",()=>{var r;this.close(),(r=this.triggerElement)==null||r.focus()}),this.options.hideOnClickOutside&&(this.onDocumentClick=this.onDocumentClick.bind(this),document.addEventListener("click",this.onDocumentClick)),this.options.hideOnEscape&&(this.handleKeydown=this.handleKeydown.bind(this),this.popupEl.addEventListener("keydown",this.handleKeydown)),this.referenceElement=this.options.referenceElement,this.triggerElement=this.options.triggerElement}addEventListener(e,t){this.externalEvents.on(e,t),this.picker.addEventListener(e,t)}removeEventListener(e,t){this.externalEvents.off(e,t),this.picker.removeEventListener(e,t)}handleKeydown(e){var t;e.key==="Escape"&&(this.close(),(t=this.triggerElement)==null||t.focus())}async destroy(){this.isOpen&&await this.close(),document.removeEventListener("click",this.onDocumentClick),this.picker.destroy(),this.externalEvents.removeAll()}toggle(e){return this.isOpen?this.close():this.open(e)}async open({triggerElement:e,referenceElement:t}={}){this.isOpen||(e&&(this.triggerElement=e),t&&(this.referenceElement=t),await this.initiateOpenStateChange(!0),this.popupEl.style.opacity="0",this.options.rootElement.appendChild(this.popupEl),await this.setPosition(),this.picker.reset(!1),await this.animatePopup(!0),await this.animateCloseButton(!0),this.picker.setInitialFocus(),this.externalEvents.emit("picker:open"))}async close(){var e;!this.isOpen||(await this.initiateOpenStateChange(!1),await this.animateCloseButton(!1),await this.animatePopup(!1),this.popupEl.remove(),this.picker.reset(),(e=this.positionCleanup)==null||e.call(this),this.focusTrap.deactivate(),this.externalEvents.emit("picker:close"))}getRunningAnimations(){return this.picker.el.getAnimations().filter(e=>e.playState==="running")}async setPosition(){var e;(e=this.positionCleanup)==null||e.call(this),this.positionCleanup=await rse(this,this.popupEl,this.referenceElement,this.options.position)}awaitPendingAnimations(){return Promise.all(this.getRunningAnimations().map(e=>e.finished))}onDocumentClick(e){var t;let n=e.target,r=(t=this.triggerElement)==null?void 0:t.contains(n);this.isOpen&&!this.picker.isPickerClick(e)&&!r&&this.close()}animatePopup(e){return Nd(this.popupEl,{opacity:[0,1],transform:["scale(0.9)","scale(1)"]},{duration:150,id:e?"show-picker":"hide-picker",easing:"ease-in-out",direction:e?"normal":"reverse",fill:"both"},this.options)}animateCloseButton(e){if(this.closeButton)return Nd(this.closeButton,{opacity:[0,1]},{duration:25,id:e?"show-close":"hide-close",easing:"ease-in-out",direction:e?"normal":"reverse",fill:"both"},this.options)}async initiateOpenStateChange(e){this.isOpen=e,await this.awaitPendingAnimations()}},hse=`.picmo__popupContainer{display:flex;flex-direction:column;position:absolute}.picmo__popupContainer .picmo__closeButton{position:absolute;opacity:0;background:transparent;border:none;z-index:1;right:0;top:0;cursor:pointer;padding:4px;align-self:flex-end;transform:translate(50%,-50%);background:#999999;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:50%}.picmo__popupContainer .picmo__closeButton:hover{background:var(--accent-color)}.picmo__popupContainer .picmo__closeButton svg{fill:#fff;width:1.25rem;height:1.25rem} `,use=OE();function JU(i,e){return use(hse),new HE(me({autoFocus:"auto"},i),e)}var mse={mounted(){let i=this.el.querySelector("[data-emoji-button]"),e=this.el.querySelector("[data-emoji-preview]"),t=this.el.querySelector("[data-emoji-input]"),n=JU({showPreview:!1},{triggerElement:i,referenceElement:i,position:"bottom"});n.addEventListener("emoji:select",({emoji:r})=>{e.innerHTML=r,t.value=r}),i.addEventListener("click",r=>{n.toggle()})}},ZU=mse;var pse={mounted(){this.focus()},updated(){this.el!==document.activeElement&&this.focus()},focus(){vc(document.activeElement)||(this.el.focus(),this.el.selectionStart=this.el.selectionEnd=this.el.value.length,this.el.scrollLeft=this.el.scrollWidth)}},eW=pse;var fse={mounted(){this.props=this.getProps(),this.isFocused=!1,this.insertMode=!1,this.initializeHeadingEl(),this.unsubscribeFromNavigationEvents=Ti.subscribe("navigation",i=>{this.handleNavigationEvent(i)})},updated(){this.props=this.getProps(),this.initializeHeadingEl()},destroyed(){this.unsubscribeFromNavigationEvents()},getProps(){return{focusableId:We(this.el,"data-focusable-id"),onValueChange:We(this.el,"data-on-value-change"),metadata:We(this.el,"data-metadata")}},initializeHeadingEl(){let i=this.el.querySelector("[data-el-heading]");i!==this.headingEl&&(this.headingEl=i,this.headingEl.addEventListener("paste",e=>{e.preventDefault();let t=e.clipboardData.getData("text/plain").replace(` `," ");document.execCommand("insertText",!1,t)}),this.headingEl.addEventListener("keydown",e=>{e.key==="Enter"&&e.preventDefault()}),this.headingEl.addEventListener("blur",e=>{setTimeout(()=>{this.isFocused&&this.insertMode&&(this.headingEl.focus(),tW(this.headingEl))},0)}))},handleNavigationEvent(i){i.type==="element_focused"?this.handleElementFocused(i.focusableId,i.scroll):i.type==="insert_mode_changed"&&this.handleInsertModeChanged(i.enabled)},handleElementFocused(i,e){this.props.focusableId===i?(this.isFocused=!0,this.el.setAttribute("data-js-focused",""),e&&dl(this.el)):this.isFocused&&(this.isFocused=!1,this.el.removeAttribute("data-js-focused"))},handleInsertModeChanged(i){this.isFocused&&!this.insertMode&&i?(this.insertMode=i,this.el.setAttribute("phx-update","ignore"),this.headingEl.setAttribute("contenteditable",""),this.headingEl.focus(),tW(this.headingEl)):this.insertMode&&!i&&(this.insertMode=i,this.headingEl.removeAttribute("contenteditable"),this.el.removeAttribute("phx-update"),this.pushEvent(this.props.onValueChange,{value:this.headingEl.textContent.trim(),metadata:this.props.metadata}))}};function tW(i){let e=document.createRange();e.selectNodeContents(i),e.collapse(!1);let t=window.getSelection();t.removeAllRanges(),t.addRange(e)}var iW=fse;var gse={mounted(){this.props=this.getProps(),this.sourceEl=_h(this.el,"[data-source]"),this.targetEl=_h(this.el,"[data-target]"),this.updateDOM()},updated(){this.props=this.getProps(),this.updateDOM()},getProps(){return{language:We(this.el,"data-language")}},updateDOM(){let i=this.sourceEl.innerText;Uu(i,this.props.language).then(e=>{this.targetEl.innerHTML=e,this.el.setAttribute("data-highlighted","")})}},nW=gse;var zE=["bg-yellow-100","border-yellow-300"],_se={mounted(){this.props=this.getProps(),this.inputEl=this.el.querySelector("[data-input]"),this.previewEl=this.el.querySelector("[data-preview]"),this.initialPreviewContentEl=this.previewEl.firstElementChild,this.cameraPreviewEl=this.el.querySelector("[data-camera-preview]"),this.cameraListEl=this.el.querySelector("[data-camera-list]"),this.cameraItemTemplateEl=this.cameraListEl.firstElementChild,this.cameraItemTemplateEl.remove(),this.uploadButton=this.el.querySelector("[data-btn-upload]"),this.openCameraButton=this.el.querySelector("[data-btn-open-camera]"),this.captureCameraButton=this.el.querySelector("[data-btn-capture-camera]"),this.cancelButton=this.el.querySelector("[data-btn-cancel]"),this.cameraListPopulated=!1,this.cameraVideoEl=null,this.cameraStream=null,this.handleEvent(`image_input_change:${this.props.id}`,({image_info:i})=>{if(i){let e=yse(i,this.props.format);this.setPreview(e)}else this.setPreview(this.initialPreviewContentEl)}),this.uploadButton.addEventListener("click",i=>{this.inputEl.click()}),this.inputEl.addEventListener("change",i=>{let[e]=i.target.files;e&&this.loadFile(e)}),this.el.addEventListener("dragover",i=>{i.stopPropagation(),i.preventDefault(),i.dataTransfer.dropEffect="copy"}),this.el.addEventListener("drop",i=>{i.stopPropagation(),i.preventDefault();let[e]=i.dataTransfer.files;e&&this.loadFile(e),this.closeCameraView()}),this.el.addEventListener("dragenter",i=>{this.el.classList.add(...zE)}),this.el.addEventListener("dragleave",i=>{this.el.contains(i.relatedTarget)||this.el.classList.remove(...zE)}),this.el.addEventListener("drop",i=>{this.el.classList.remove(...zE)}),this.openCameraButton.addEventListener("click",i=>{this.cameraListPopulated||(this.renderCameraList(),this.cameraListPopulated=!0)}),this.cameraListEl.addEventListener("click",i=>{let e=i.target.closest("[data-camera-id]");if(e){let t=e.dataset.cameraId;this.openCameraView(t)}}),this.captureCameraButton.addEventListener("click",i=>{let e=this.toCanvas(this.cameraVideoEl,this.cameraVideoEl.videoWidth,this.cameraVideoEl.videoHeight);this.pushImage(e),this.closeCameraView()}),this.cancelButton.addEventListener("click",i=>{this.closeCameraView()})},updated(){this.props=this.getProps()},getProps(){return{id:We(this.el,"data-id"),phxTarget:We(this.el,"data-phx-target",Zr),height:di(this.el,"data-height",null,Zr),width:di(this.el,"data-width",null,Zr),format:We(this.el,"data-format"),fit:We(this.el,"data-fit")}},loadFile(i){let e=new FileReader;e.onload=t=>{let n=document.createElement("img");n.addEventListener("load",r=>{let o=this.toCanvas(n,n.width,n.height);this.pushImage(o)}),n.src=t.target.result},e.readAsDataURL(i)},openCameraView(i){this.cameraPreviewEl.classList.remove("hidden"),this.cancelButton.classList.remove("hidden"),this.captureCameraButton.classList.remove("hidden"),this.previewEl.classList.add("hidden"),this.openCameraButton.classList.add("hidden"),this.uploadButton.classList.add("hidden"),navigator.mediaDevices.getUserMedia(this.cameraConstraints(i)).then(e=>{this.cameraStream=e,this.cameraVideoEl=document.createElement("video"),this.cameraVideoEl.autoplay=!0,this.cameraVideoEl.playsinline=!0,this.cameraVideoEl.muted=!0,this.cameraVideoEl.srcObject=e,this.setCameraPreview(this.cameraVideoEl)}).catch(()=>{})},cameraConstraints(i){return i==="system_default"?{audio:!1,video:!0}:{audio:!1,video:{deviceId:i}}},renderCameraList(){navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(i=>navigator.mediaDevices.enumerateDevices().then(e=>(this.stopMediaStream(i),e))).then(i=>{let e=i.filter(t=>t.kind==="videoinput").map(t=>({deviceId:t.deviceId,label:t.label}));[{deviceId:"system_default",label:"System Default"},...e].forEach(({deviceId:t,label:n})=>{let r=this.cameraItemTemplateEl.cloneNode(!0);r.querySelector("[data-camera-id]").setAttribute("data-camera-id",t),r.querySelector("[data-label]").innerHTML=n,this.cameraListEl.appendChild(r)})}).catch(i=>{console.error(i),this.openCameraButton.disabled=!0})},closeCameraView(){return this.cameraStream!==null&&(this.stopMediaStream(this.cameraStream),this.cameraStream=null),this.cameraVideoEl!==null&&(this.cameraVideoEl.remove(),this.cameraVideoEl=null),this.cameraPreviewEl.classList.add("hidden"),this.cancelButton.classList.add("hidden"),this.captureCameraButton.classList.add("hidden"),this.previewEl.classList.remove("hidden"),this.openCameraButton.classList.remove("hidden"),this.uploadButton.classList.remove("hidden"),!0},stopMediaStream(i){i.getTracks().forEach(e=>{e.stop()})},pushImage(i){this.pushEventTo(this.props.phxTarget,"change",{data:vse(i,this.props.format),height:i.height,width:i.width})},toCanvas(i,e,t){let{width:n,height:r}=this.props,o=document.createElement("canvas"),s=o.getContext("2d");if(n===null&&r===null||n===e&&r===t)o.width=e,o.height=t,o.getContext("2d").drawImage(i,0,0,e,t,0,0,e,t);else if(this.props.fit==="contain"){let a=n/e,l=r/t,c=Math.min(a,l),d=Math.round(e*c),h=Math.round(t*c);o.width=d,o.height=h,s.drawImage(i,0,0,e,t,0,0,d,h)}else if(this.props.fit==="crop"){let a=n/e,l=r/t,c=Math.max(a,l),d=Math.round(e*c),h=Math.round(t*c);o.width=n,o.height=r,s.drawImage(i,Math.round((d-n)/c/2),Math.round((h-r)/c/2),e-Math.round((d-n)/c),t-Math.round((h-r)/c),0,0,n,r)}else if(this.props.fit==="pad"){let a=n/e,l=r/t,c=Math.min(a,l),d=Math.round(e*c),h=Math.round(t*c);o.width=n,o.height=r,s.fillStyle="black",s.fillRect(0,0,o.width,o.height),s.drawImage(i,0,0,e,t,Math.round((n-d)/2),Math.round((r-h)/2),d,h)}else o.width=n,o.height=r,s.drawImage(i,0,0,e,t,0,0,n,r);return o},setPreview(i){i.style.maxHeight="300px",i.style.maxWidth="100%",this.previewEl.replaceChildren(i)},setCameraPreview(i){i.style.maxHeight="300px",i.style.maxWidth="100%",this.cameraPreviewEl.replaceChildren(i)}};function vse(i,e){if(e==="png"||e==="jpeg"){let t=`data:image/${e};base64,`;return i.toDataURL(`image/${e}`).slice(t.length)}if(e==="rgb"){let t=i.getContext("2d").getImageData(0,0,i.width,i.height),n=bse(t);return Pg(n)}throw new Error(`Unexpected format: ${e}`)}function bse(i){let e=i.width*i.height,t=new Uint8ClampedArray(e*3);for(let n=0;n{i.sandbox="allow-scripts allow-same-origin allow-downloads allow-modals allow-popups",i.allow="accelerometer; ambient-light-sensor; camera; display-capture; encrypted-media; fullscreen; geolocation; gyroscope; microphone; midi; usb; xr-spatial-tracking; clipboard-read; clipboard-write",i.src=n})}function Ise(i,e){let t=window.location.protocol;return e?e.replace(/^https?:/,t):t==="https:"?"https://livebookusercontent.com/iframe/v4.html":`http://${window.location.hostname}:${i}/iframe/v4.html`}var jE=null;function kse(i){return jE||(jE=fetch(i).then(e=>e.text()).then(e=>{if(mL(e)!==cW)throw new Error(`The iframe loaded from ${i} doesn't have the expected checksum ${cW}`)})),jE}var Ase={mounted(){this.props=this.getProps(),this.id=Dg(),this.childToken=hL(),this.childReadyPromise=null,this.childReady=!1,this.initReceived=!1,this.syncCallbackQueue=[],this.pongCallbackQueue=[],this.initTimeout=setTimeout(()=>this.handleInitTimeout(),2e3),this.channel=sW(this.props.sessionToken),this.iframeActions=this.createIframe(),this.childReadyPromise=new Promise((r,o)=>{this._handleWindowMessage=s=>{s.source===this.iframe.contentWindow&&this.handleChildMessage(s.data,r)},window.addEventListener("message",this._handleWindowMessage)}),this.hiddenInput=document.createElement("input"),this.hiddenInput.style.display="none",this.el.appendChild(this.hiddenInput),this.iframeActions.visibilityPromise.then(()=>{this.loadIframe()});let i=this.channel.on(`init:${this.props.ref}:${this.id}`,r=>{let[,o]=WE(r);this.handleServerInit(o)}),e=this.channel.on(`event:${this.props.ref}`,r=>{let[[o],s]=WE(r);this.handleServerEvent(o,s)}),t=this.channel.on(`error:${this.props.ref}`,({message:r,init:o})=>{this.handleServerError(r,o)}),n=this.channel.on(`pong:${this.props.ref}`,()=>{this.handleServerPong()});this.unsubscribeFromChannelEvents=()=>{this.channel.off(`init:${this.props.ref}:${this.id}`,i),this.channel.off(`event:${this.props.ref}`,e),this.channel.off(`error:${this.props.ref}`,t),this.channel.off(`pong:${this.props.ref}`,n)},this.unsubscribeFromJSViewEvents=Ti.subscribe(`js_views:${this.props.ref}`,r=>this.handleJSViewEvent(r)),this.channel.push("connect",{connect_token:this.props.connectToken,ref:this.props.ref,id:this.id},3e4),this.unsubscribeFromCellEvents=Ti.subscribe("navigation",r=>this.handleNavigationEvent(r))},updated(){this.props=this.getProps(this)},disconnected(){this.el.removeAttribute("id")},destroyed(){window.removeEventListener("message",this._handleWindowMessage),this.iframeActions.remove(),this.unsubscribeFromChannelEvents(),this.channel.push("disconnect",{ref:this.props.ref}),this.unsubscribeFromJSViewEvents(),this.unsubscribeFromCellEvents()},getProps(){return{ref:We(this.el,"data-ref"),assetsBasePath:We(this.el,"data-assets-base-path"),assetsCdnUrl:di(this.el,"data-assets-cdn-url",null),jsPath:We(this.el,"data-js-path"),sessionToken:We(this.el,"data-session-token"),connectToken:We(this.el,"data-connect-token"),iframePort:We(this.el,"data-iframe-local-port",Zr),iframeUrl:di(this.el,"data-iframe-url",null),timeoutMessage:We(this.el,"data-timeout-message")}},createIframe(){this.iframePlaceholder=document.createElement("div"),this.el.appendChild(this.iframePlaceholder),this.iframe=document.createElement("iframe"),this.iframe.className="w-full h-0 absolute z-[1]";let i=document.querySelector("[data-el-notebook]"),e=i.querySelector("[data-el-notebook-content]"),t=new ResizeObserver(a=>{this.repositionIframe()});t.observe(e),t.observe(i);let n=Ti.subscribe("js_views",a=>{a.type==="reposition"&&this.repositionIframe()});this.iframe.addEventListener("mouseenter",a=>{this.iframePlaceholder.dispatchEvent(new MouseEvent("mouseenter",{bubbles:!0}))}),this.iframe.addEventListener("mouseleave",a=>{this.iframePlaceholder.dispatchEvent(new MouseEvent("mouseleave",{bubbles:!0}))});let r=null,o=new Promise((a,l)=>{G9(this.iframePlaceholder)?a():(r=new IntersectionObserver(c=>{G9(this.iframePlaceholder)&&(r.disconnect(),a())}),r.observe(this.iframePlaceholder))});return this.iframe.toggleAttribute("data-js-focused",!!this.el.closest("[data-js-focused]")),{visibilityPromise:o,remove:()=>{t.disconnect(),n(),r&&r.disconnect(),this.iframe.remove(),this.iframePlaceholder.remove()}}},repositionIframe(){let{iframe:i,iframePlaceholder:e}=this,t=document.querySelector("[data-el-notebook]");if(gh(e))i.classList.add("hidden");else{i.classList.remove("hidden");let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o=r.top-n.top+t.scrollTop;i.style.top=`${o}px`;let s=r.left-n.left+t.scrollLeft;i.style.left=`${s}px`,i.style.height=`${r.height}px`,i.style.width=`${r.width}px`}},loadIframe(){let i=document.querySelector("[data-el-js-view-iframes]");dW(this.iframe,this.props.iframePort,this.props.iframeUrl).then(()=>{i.appendChild(this.iframe)})},handleChildMessage(i,e){if(i.type==="ready"&&!this.childReady)this.getAssetsBaseUrl().then(t=>{this.postMessage({type:"readyReply",token:this.childToken,baseUrl:t,jsPath:this.props.jsPath}),this.childReady=!0,e()});else{if(i.token!==this.childToken)throw new Error("Token mismatch");if(i.type==="resize")this.iframePlaceholder.style.height=`${i.height}px`,this.iframe.style.height=`${i.height}px`;else if(i.type==="domEvent"){let t=this.replicateDomEvent(i.event);i.isTargetEditable?this.hiddenInput.dispatchEvent(t):this.el.dispatchEvent(t)}else if(i.type==="event"){let{event:t,payload:n}=i,r=lW([t,this.props.ref],n);this.channel.push("event",r)}else i.type==="syncReply"?(this.pongCallbackQueue.push(this.syncCallbackQueue.shift()),this.channel.push("ping",{ref:this.props.ref})):i.type=="selectSecret"&&this.pushEvent("select_secret",{js_view_ref:this.props.ref,preselect_name:i.preselectName,options:i.options})}},getAssetsBaseUrl(){return y2().then(i=>!i&&this.props.assetsCdnUrl?this.props.assetsCdnUrl:window.location.origin+this.props.assetsBasePath)},postMessage(i){this.iframe.contentWindow.postMessage(i,"*")},replicateDomEvent(i){if(i.type==="focus")return new FocusEvent("focus");if(i.type==="mousedown")return new MouseEvent("mousedown",{bubbles:!0});if(i.type==="keydown")return new KeyboardEvent(i.type,i.props)},handleInitTimeout(){this.initTimeoutContainer=document.createElement("div"),this.initTimeoutContainer.classList.add("info-box"),this.el.prepend(this.initTimeoutContainer),this.initTimeoutContainer.textContent=this.props.timeoutMessage},clearInitTimeout(){clearTimeout(this.initTimeout),this.initTimeoutContainer&&this.initTimeoutContainer.remove()},handleServerInit(i){this.clearInitTimeout(),this.initReceived=!0,this.childReadyPromise.then(()=>{this.postMessage({type:"init",data:i})})},handleServerEvent(i,e){this.initReceived&&this.childReadyPromise.then(()=>{this.postMessage({type:"event",event:i,payload:e})})},handleServerError(i,e){e&&this.clearInitTimeout(),this.errorContainer||(this.errorContainer=document.createElement("div"),this.errorContainer.classList.add("error-box","mb-4"),this.el.prepend(this.errorContainer)),this.errorContainer.textContent=i},handleServerPong(){this.pongCallbackQueue.shift()()},handleJSViewEvent(i){i.type==="sync"?(this.syncCallbackQueue.push(i.callback),this.postMessage({type:"sync"})):i.type=="secretSelected"&&this.postMessage({type:"secretSelected",secretName:i.secretName})},handleNavigationEvent(i){if(i.type==="element_focused"){let e=this.el.closest("[data-focusable-id]"),t=e?e.dataset.focusableId:null;this.iframe.toggleAttribute("data-js-focused",t===i.focusableId)}}};function y2(){return y2.promise=y2.promise||fetch("/public/health").then(i=>i.status===200).catch(i=>!1),y2.promise}var hW=Ase;var Lse={mounted(){this.props=this.getProps(),this._handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this._handleDocumentKeyUp=this.handleDocumentKeyUp.bind(this),this._handleDocumentFocus=this.handleDocumentFocus.bind(this),window.addEventListener("keydown",this._handleDocumentKeyDown,!0),window.addEventListener("keyup",this._handleDocumentKeyUp,!0),window.addEventListener("focus",this._handleDocumentFocus,!0)},updated(){this.props=this.getProps()},destroyed(){window.removeEventListener("keydown",this._handleDocumentKeyDown,!0),window.removeEventListener("keyup",this._handleDocumentKeyUp,!0),window.removeEventListener("focus",this._handleDocumentFocus,!0)},getProps(){return{isKeydownEnabled:We(this.el,"data-keydown-enabled",ea),isKeyupEnabled:We(this.el,"data-keyup-enabled",ea),target:We(this.el,"data-target")}},handleDocumentKeyDown(i){if(this.keyboardEnabled()&&ta(i),this.props.isKeydownEnabled){if(i.repeat)return;let{key:e}=i;this.pushEventTo(this.props.target,"keydown",{key:e})}},handleDocumentKeyUp(i){if(this.keyboardEnabled()&&ta(i),this.props.isKeyupEnabled){let{key:e}=i;this.pushEventTo(this.props.target,"keyup",{key:e})}},handleDocumentFocus(i){this.props.isKeydownEnabled&&vc(i.target)&&this.pushEventTo(this.props.target,"disable_keyboard",{})},keyboardEnabled(){return this.props.isKeydownEnabled||this.props.isKeyupEnabled}},uW=Lse;var Nse={mounted(){this.props=this.getProps();let i=new Vb(this.el,"",{baseUrl:this.props.sessionPath,allowedUriSchemes:this.props.allowedUriSchemes.split(",")});this.handleEvent(`markdown_renderer:${this.props.id}:content`,({content:e})=>{i.setContent(e)})},getProps(){return{id:We(this.el,"data-id"),sessionPath:We(this.el,"data-session-path"),allowedUriSchemes:We(this.el,"data-allowed-uri-schemes")}}},mW=Nse;var Rse={mounted(){this.scroll()},updated(){this.scroll()},scroll(){F1(this.el)}},pW=Rse;var VE=class{constructor(e=2e3){this.resetTimeout=e,this.buffer=[],this.resetTimeoutId=null}push(e){this.buffer.push(e),this.resetTimeoutId&&clearTimeout(this.resetTimeoutId),this.resetTimeoutId=setTimeout(()=>{this.reset()},this.resetTimeout)}reset(){this.resetTimeoutId&&clearTimeout(this.resetTimeoutId),this.resetTimeoutId=null,this.buffer=[]}tryMatch(e){if(e.length>this.buffer.length)return!1;let t=this.buffer.slice(-e.length),n=e.every((r,o)=>r===t[o]);return n&&this.reset(),n}},fW=VE;var Dse={mounted(){this.props=this.getProps(),this.focusedId=null,this.insertMode=!1,this.view=null,this.keyBuffer=new fW,this.clientsMap={},this.lastLocationReportByClientId={},this.followedClientId=null,Og(this.faviconForEvaluationStatus(this.props.globalStatus)),this.updateSectionListHighlight(),this._handleDocumentKeyDown=this.handleDocumentKeyDown.bind(this),this._handleDocumentMouseDown=this.handleDocumentMouseDown.bind(this),this._handleDocumentFocus=this.handleDocumentFocus.bind(this),this._handleDocumentClick=this.handleDocumentClick.bind(this),document.addEventListener("keydown",this._handleDocumentKeyDown,!0),document.addEventListener("mousedown",this._handleDocumentMouseDown),document.addEventListener("focus",this._handleDocumentFocus,!0),document.addEventListener("click",this._handleDocumentClick),this.getElement("sections-list").addEventListener("click",i=>{this.handleSectionsListClick(i),this.handleCellIndicatorsClick(i)}),this.getElement("clients-list").addEventListener("click",i=>this.handleClientsListClick(i)),this.getElement("sections-list-toggle").addEventListener("click",i=>this.toggleSectionsList()),this.getElement("clients-list-toggle").addEventListener("click",i=>this.toggleClientsList()),this.getElement("secrets-list-toggle").addEventListener("click",i=>this.toggleSecretsList()),this.getElement("runtime-info-toggle").addEventListener("click",i=>this.toggleRuntimeInfo()),this.getElement("app-info-toggle").addEventListener("click",i=>this.toggleAppInfo()),this.getElement("notebook").addEventListener("scroll",i=>this.updateSectionListHighlight()),this.getElement("notebook-indicators").addEventListener("click",i=>this.handleCellIndicatorsClick(i)),this.getElement("views").addEventListener("click",i=>{this.handleViewsClick(i)}),this.getElement("section-toggle-collapse-all-button").addEventListener("click",i=>this.toggleCollapseAllSections()),window.addEventListener("phx:page-loading-stop",()=>{this.initializeFocus()},{once:!0}),this.handleEvent("session_init",({clients:i})=>{i.forEach(e=>{this.clientsMap[e.id]=e})}),this.handleEvent("cell_inserted",({cell_id:i})=>{this.handleCellInserted(i)}),this.handleEvent("cell_deleted",({cell_id:i,sibling_cell_id:e})=>{this.handleCellDeleted(i,e)}),this.handleEvent("cell_restored",({cell_id:i})=>{this.handleCellRestored(i)}),this.handleEvent("cell_moved",({cell_id:i})=>{this.handleCellMoved(i)}),this.handleEvent("section_inserted",({section_id:i})=>{this.handleSectionInserted(i)}),this.handleEvent("section_deleted",({section_id:i})=>{this.handleSectionDeleted(i)}),this.handleEvent("section_moved",({section_id:i})=>{this.handleSectionMoved(i)}),this.handleEvent("cell_upload",({cell_id:i,url:e})=>{this.handleCellUpload(i,e)}),this.handleEvent("client_joined",({client:i})=>{this.handleClientJoined(i)}),this.handleEvent("client_left",({client_id:i})=>{this.handleClientLeft(i)}),this.handleEvent("clients_updated",({clients:i})=>{this.handleClientsUpdated(i)}),this.handleEvent("secret_selected",({select_secret_ref:i,secret_name:e})=>{this.handleSecretSelected(i,e)}),this.handleEvent("location_report",({client_id:i,focusable_id:e,selection:t})=>{let n={focusableId:e,selection:this.decodeSelection(t)};this.handleLocationReport(i,n)}),this.unsubscribeFromSessionEvents=Ti.subscribe("session",i=>{this.handleSessionEvent(i)})},updated(){let i=this.props;this.props=this.getProps(),this.props.globalStatus!==i.globalStatus&&Og(this.faviconForEvaluationStatus(this.props.globalStatus))},disconnected(){this.el.removeAttribute("id"),this.keepChannel=!0},destroyed(){this.unsubscribeFromSessionEvents(),document.removeEventListener("keydown",this._handleDocumentKeyDown,!0),document.removeEventListener("mousedown",this._handleDocumentMouseDown),document.removeEventListener("focus",this._handleDocumentFocus,!0),document.removeEventListener("click",this._handleDocumentClick),Og("favicon"),this.keepChannel||aW()},getProps(){return{autofocusCellId:di(this.el,"data-autofocus-cell-id",null),globalStatus:di(this.el,"data-global-status",null)}},faviconForEvaluationStatus(i){return i==="evaluating"?"favicon-evaluating":i==="stale"?"favicon-stale":i==="errored"?"favicon-errored":"favicon"},handleDocumentKeyDown(i){if(i.repeat)return;let e=rL()?i.metaKey:i.ctrlKey,t=i.altKey,n=i.shiftKey,r=i.key,o=this.keyBuffer;if(!(vc(i.target)&&i.target.closest("[data-el-outputs-container]"))){if(e&&n&&!t&&r==="Enter"){ta(i),this.queueFullCellsEvaluation(!0);return}else if(!e&&n&&!t&&r==="Enter"){ta(i),Ad(this.focusedCellType())&&this.queueFocusedCellEvaluation(),this.moveFocus(1);return}else if(e&&!t&&r==="Enter"){ta(i),Ad(this.focusedCellType())&&this.queueFocusedCellEvaluation();return}else if(e&&r==="s"){ta(i),this.saveNotebook();return}else if(e||t)return}this.insertMode?(o.reset(),r==="Escape"&&(this.escapesMonacoWidget(i)||this.escapeInsertMode())):vc(i.target)?(o.reset(),r==="Escape"&&i.target.blur()):(o.push(i.key),o.tryMatch(["d","d"])?this.deleteFocusedCell():o.tryMatch(["e","a"])?this.queueFullCellsEvaluation(!1):o.tryMatch(["e","e"])?Ad(this.focusedCellType())&&this.queueFocusedCellEvaluation():o.tryMatch(["e","s"])?this.queueFocusedSectionEvaluation():o.tryMatch(["s","s"])?this.toggleSectionsList():o.tryMatch(["s","e"])?this.toggleSecretsList():o.tryMatch(["s","a"])?this.toggleAppInfo():o.tryMatch(["s","u"])?this.toggleClientsList():o.tryMatch(["s","r"])?this.toggleRuntimeInfo():o.tryMatch(["s","b"])?this.showBin():o.tryMatch(["s","p"])?this.showPackageSearch():o.tryMatch(["e","x"])?this.cancelFocusedCellEvaluation():o.tryMatch(["0","0"])?this.reconnectRuntime():o.tryMatch(["Escape","Escape"])?this.setFocusedEl(null):o.tryMatch(["?"])?this.showShortcuts():o.tryMatch(["i"])||i.target.matches("body, [data-el-cell-body], [data-el-heading], [data-focusable-id]")&&this.focusedId&&r==="Enter"?(ta(i),this.isInsertModeAvailable()&&this.enterInsertMode()):o.tryMatch(["j"])?this.moveFocus(1):o.tryMatch(["k"])?this.moveFocus(-1):o.tryMatch(["J"])?this.moveFocusedCell(1):o.tryMatch(["K"])?this.moveFocusedCell(-1):o.tryMatch(["n"])?this.insertCellBelowFocused("code"):o.tryMatch(["N"])?this.insertCellAboveFocused("code"):o.tryMatch(["m"])?!this.isViewCodeZen()&&this.insertCellBelowFocused("markdown"):o.tryMatch(["M"])?!this.isViewCodeZen()&&this.insertCellAboveFocused("markdown"):o.tryMatch(["v","z"])?this.toggleView("code-zen"):o.tryMatch(["v","p"])?this.toggleView("presentation"):o.tryMatch(["c"])?!this.isViewCodeZen()&&this.toggleCollapseSection():o.tryMatch(["C"])&&!this.isViewCodeZen()&&this.toggleCollapseAllSections())},escapesMonacoWidget(i){if(i.target.closest(".monaco-inputbox"))return!0;let e=i.target.closest(".monaco-editor.focused");return e?!!(e.querySelector(".editor-widget.parameter-hints-widget.visible")||e.querySelector(".editor-widget.suggest-widget.visible")||e.querySelectorAll(".cursor").length>1):!1},handleDocumentMouseDown(i){if(!i.target.closest("[data-el-notebook]")||i.target.closest(".doctest-details-widget")){this.insertMode&&this.setInsertMode(!1);return}if(i.target.closest("[data-el-insert-buttons] button"))return;let e=i.target.closest("[data-focusable-id]"),t=e?e.dataset.focusableId:null,n=this.editableElementClicked(i,e);t!==this.focusedId&&this.setFocusedEl(t,{scroll:!1,focusElement:!1}),!i.target.closest("[data-el-actions]")&&this.insertMode!==n&&this.setInsertMode(n)},editableElementClicked(i,e){if(e){let t=i.target.closest("[data-el-editor-container], [data-el-heading]");return t&&e.contains(t)}return!1},handleDocumentFocus(i){let e=i.target.closest&&i.target.closest("[data-focusable-id]");if(e){let t=e.dataset.focusableId;t!==this.focusedId&&this.setFocusedEl(t,{scroll:!1,focusElement:!1})}},handleDocumentClick(i){i.target.closest("[data-el-enable-insert-mode-button]")&&this.setInsertMode(!0),i.target.closest("[data-btn-package-search]")&&this.insertMode&&this.setInsertMode(!1);let e=i.target.closest("[data-el-queue-cell-evaluation-button]");if(e){let n=e.getAttribute("data-cell-id"),r=e.hasAttribute("data-disable-dependencies-cache");this.queueCellEvaluation(n,r)}let t=window.location.hash;if(t){let n=t.replace(/^#/,"");!document.getElementById(n).contains(i.target)&&!i.target.closest("a")&&history.pushState(null,document.title,window.location.pathname+window.location.search)}},handleSectionsListClick(i){let e=i.target.closest("[data-el-sections-list-item]");if(e){let t=e.getAttribute("data-section-id");this.getSectionById(t).scrollIntoView({behavior:"smooth",block:"start"})}},handleClientsListClick(i){let e=i.target.closest("[data-el-clients-list-item]");if(e){let t=e.getAttribute("data-client-id");i.target.closest("[data-el-client-link]")&&this.handleClientLinkClick(t),i.target.closest("[data-el-client-follow-toggle]")&&this.handleClientFollowToggleClick(t,e)}},handleClientLinkClick(i){this.mirrorClientFocus(i)},handleClientFollowToggleClick(i,e){let t=this.el.querySelector("[data-el-clients-list-item][data-js-followed]");t&&t.removeAttribute("data-js-followed"),i===this.followedClientId?this.followedClientId=null:(e.setAttribute("data-js-followed",""),this.followedClientId=i,this.mirrorClientFocus(i))},mirrorClientFocus(i){let e=this.lastLocationReportByClientId[i];e&&e.focusableId&&this.setFocusedEl(e.focusableId)},handleCellIndicatorsClick(i){let e=i.target.closest("[data-el-focus-cell-button]");if(e){let t=e.getAttribute("data-target");this.setFocusedEl(t)}},initializeFocus(){let i=window.location.hash;if(i){let e=i.replace(/^#/,""),t=document.getElementById(e);if(t){let n=t.closest("[data-focusable-id]");n?this.setFocusedEl(n.dataset.focusableId):t.scrollIntoView()}}else this.props.autofocusCellId&&(this.setFocusedEl(this.props.autofocusCellId,{scroll:!1}),this.setInsertMode(!0))},updateSectionListHighlight(){let i=this.el.querySelector("[data-el-sections-list-item][data-js-is-viewed]");i&&i.removeAttribute("data-js-is-viewed");let e=this.getSections().reverse().find(t=>{let{top:n}=t.getBoundingClientRect(),r=document.documentElement.scrollTop;return n<=r+window.innerHeight*.35});if(e){let t=e.getAttribute("data-section-id");this.el.querySelector(`[data-el-sections-list-item][data-section-id="${t}"]`).setAttribute("data-js-is-viewed","")}},toggleSectionsList(){this.toggleSidePanelContent("sections-list")},toggleClientsList(){this.toggleSidePanelContent("clients-list")},toggleSecretsList(){this.toggleSidePanelContent("secrets-list")},toggleAppInfo(){this.toggleSidePanelContent("app-info")},toggleRuntimeInfo(){this.toggleSidePanelContent("runtime-info")},toggleSidePanelContent(i){this.el.getAttribute("data-js-side-panel-content")===i?this.el.removeAttribute("data-js-side-panel-content"):this.el.setAttribute("data-js-side-panel-content",i)},showBin(){let i=this.el.querySelector("[data-btn-show-bin]");i&&i.click()},showPackageSearch(){this.setFocusedEl("setup");let i=this.el.querySelector("[data-btn-package-search]");i&&i.click()},saveNotebook(){this.pushEvent("save",{})},deleteFocusedCell(){this.focusedId&&this.isCell(this.focusedId)&&this.pushEvent("delete_cell",{cell_id:this.focusedId})},queueCellEvaluation(i,e){this.dispatchQueueEvaluation(()=>{this.pushEvent("queue_cell_evaluation",{cell_id:i,disable_dependencies_cache:e})})},queueFocusedCellEvaluation(){this.focusedId&&this.isCell(this.focusedId)&&this.dispatchQueueEvaluation(()=>{this.pushEvent("queue_cell_evaluation",{cell_id:this.focusedId})})},queueFullCellsEvaluation(i){let e=i&&this.focusedId&&this.isCell(this.focusedId)?[this.focusedId]:[];this.dispatchQueueEvaluation(()=>{this.pushEvent("queue_full_evaluation",{forced_cell_ids:e})})},queueFocusedSectionEvaluation(){if(this.focusedId){let i=this.getSectionIdByFocusableId(this.focusedId);i&&this.dispatchQueueEvaluation(()=>{this.pushEvent("queue_section_evaluation",{section_id:i})})}},dispatchQueueEvaluation(i){Ad(this.focusedCellType())?Ti.broadcast(`cells:${this.focusedId}`,{type:"dispatch_queue_evaluation",dispatch:i}):i()},cancelFocusedCellEvaluation(){this.focusedId&&this.isCell(this.focusedId)&&this.pushEvent("cancel_cell_evaluation",{cell_id:this.focusedId})},reconnectRuntime(){this.pushEvent("reconnect_runtime",{})},showShortcuts(){let i=this.el.querySelector("[data-btn-show-shortcuts]");i&&i.click()},isInsertModeAvailable(){if(!this.focusedId)return!1;let i=this.getFocusableEl(this.focusedId);return!this.isCell(this.focusedId)||!i.hasAttribute("data-js-insert-mode-disabled")},enterInsertMode(){this.focusedId&&this.setInsertMode(!0)},escapeInsertMode(){this.setInsertMode(!1)},moveFocus(i){let e=this.nearbyFocusableId(this.focusedId,i);this.setFocusedEl(e)},moveFocusedCell(i){this.focusedId&&this.isCell(this.focusedId)&&this.pushEvent("move_cell",{cell_id:this.focusedId,offset:i})},insertCellBelowFocused(i){if(this.focusedId)this.insertCellBelowFocusableId(this.focusedId,i);else{let e=this.getFocusableIds();e.length>0&&this.insertCellBelowFocusableId(e[e.length-1],i)}},insertCellAboveFocused(i){if(this.focusedId){let e=this.nearbyFocusableId(this.focusedId,-1);this.insertCellBelowFocusableId(e,i)}else{let e=this.getFocusableIds();e.length>0&&this.insertCellBelowFocusableId(e[0],i)}},insertCellBelowFocusableId(i,e){if(this.isCell(i))this.pushEvent("insert_cell_below",{type:e,cell_id:i});else if(this.isSection(i))this.pushEvent("insert_cell_below",{type:e,section_id:i});else if(this.isNotebook(i)){let t=this.getSectionIds();t.length>0&&this.pushEvent("insert_cell_below",{type:e,section_id:t[0]})}},setFocusedEl(i,{scroll:e=!0,focusElement:t=!0}={}){if(this.focusedId=i,i){if(!this.isSection(i)){let r=this.getSectionIdByFocusableId(i);r&&this.getSectionById(r).removeAttribute("data-js-collapsed")}let n=this.getFocusableEl(i);t&&(n.querySelector("[data-el-cell-body]")||n.querySelector("[data-el-heading]")||n).focus({preventScroll:!0})}Ti.broadcast("navigation",{type:"element_focused",focusableId:i,scroll:e}),this.setInsertMode(!1)},setInsertMode(i){this.insertMode=i,i?this.el.setAttribute("data-js-insert-mode",""):(this.el.removeAttribute("data-js-insert-mode"),this.sendLocationReport({focusableId:this.focusedId,selection:null})),Ti.broadcast("navigation",{type:"insert_mode_changed",enabled:i})},handleViewsClick(i){let e=i.target.closest("[data-el-view-toggle]");if(e){let t=e.getAttribute("data-el-view-toggle");this.toggleView(t)}},toggleView(i){this.view===i?(this.view=null,this.el.removeAttribute("data-js-view")):(this.view=i,this.el.setAttribute("data-js-view",i));let e=this.focusedId||this.nearbyFocusableId(null,0);if(e){let t=this.ensureVisibleFocusableEl(e);t!==this.focused&&this.setFocusedEl(t,{scroll:!1}),t&&this.getFocusableEl(t).scrollIntoView({block:"center"})}},toggleCollapseSection(){if(this.focusedId){let i=this.getSectionIdByFocusableId(this.focusedId);if(i){let e=this.getSectionById(i);e.hasAttribute("data-js-collapsed")?e.removeAttribute("data-js-collapsed"):(e.setAttribute("data-js-collapsed",""),this.setFocusedEl(i,{scroll:!0}))}}},toggleCollapseAllSections(){let i=this.getSections().every(e=>e.hasAttribute("data-js-collapsed"));if(this.getSections().forEach(e=>{e.toggleAttribute("data-js-collapsed",!i)}),this.focusedId){let e=this.getSectionIdByFocusableId(this.focusedId);e&&this.setFocusedEl(e,{scroll:!0})}},handleCellInserted(i){this.setFocusedEl(i),oU(this.focusedCellType())&&this.setInsertMode(!0)},handleCellDeleted(i,e){if(this.focusedId===i)if(this.isViewCodeZen()){let t=this.ensureVisibleFocusableEl(e);this.setFocusedEl(t)}else this.setFocusedEl(e)},handleCellRestored(i){this.setFocusedEl(i)},handleCellMoved(i){this.repositionJSViews(),this.focusedId===i&&Ti.broadcast("cells",{type:"cell_moved",cellId:i})},handleSectionInserted(i){let t=this.getSectionById(i).querySelector("[data-el-section-headline]"),{focusableId:n}=t.dataset;this.setFocusedEl(n),this.setInsertMode(!0),aL(document.activeElement)},handleSectionDeleted(i){this.focusedId&&!this.getFocusableEl(this.focusedId)&&this.setFocusedEl(null)},handleSectionMoved(i){this.repositionJSViews();let e=this.getSectionById(i);dl(e)},handleCellUpload(i,e){this.focusedId!==i&&this.setFocusedEl(i),this.insertMode||this.setInsertMode(!0),Ti.broadcast("cells",{type:"cell_upload",cellId:i,url:e})},handleClientJoined(i){this.clientsMap[i.id]=i},handleClientLeft(i){let e=this.clientsMap[i];e&&(delete this.clientsMap[i],this.broadcastLocationReport(e,{focusableId:null,selection:null}),e.id===this.followedClientId&&(this.followedClientId=null))},handleClientsUpdated(i){i.forEach(e=>{this.clientsMap[e.id]=e})},handleSecretSelected(i,e){Ti.broadcast(`js_views:${i}`,{type:"secretSelected",secretName:e})},handleLocationReport(i,e){let t=this.clientsMap[i];this.lastLocationReportByClientId[i]=e,t&&(this.broadcastLocationReport(t,e),t.id===this.followedClientId&&e.focusableId!==this.focusedId&&this.setFocusedEl(e.focusableId))},handleSessionEvent(i){i.type==="cursor_selection_changed"&&this.sendLocationReport({focusableId:i.focusableId,selection:i.selection})},repositionJSViews(){Ti.broadcast("js_views",{type:"reposition"})},broadcastLocationReport(i,e){Ti.broadcast("navigation",{type:"location_report",client:i,report:e})},sendLocationReport(i){Object.keys(this.clientsMap).length>1&&this.pushEvent("location_report",{focusable_id:i.focusableId,selection:this.encodeSelection(i.selection)})},encodeSelection(i){if(i===null)return null;let{tag:e,editorSelection:t}=i;return[e,t.selectionStartLineNumber,t.selectionStartColumn,t.positionLineNumber,t.positionColumn]},decodeSelection(i){if(i===null)return null;let[e,t,n,r,o]=i,s=new yt.Selection(t,n,r,o);return{tag:e,editorSelection:s}},focusedCellType(){return this.focusedId&&this.isCell(this.focusedId)?this.getFocusableEl(this.focusedId).getAttribute("data-type"):null},nearbyFocusableId(i,e){let t=this.getFocusableIds();if(t.length===0)return null;let n=t.indexOf(i);if(n===-1){let r=this.getFocusableEls().find(q9);return r?r.getAttribute("data-focusable-id"):t[0]}else{let r=oL(n+e,0,t.length-1);return t[r]}},ensureVisibleFocusableEl(i){let e=this.getFocusableEl(i),t=Array.from(this.el.querySelectorAll("[data-focusable-id]")),n=t.indexOf(e),r=[...t.slice(n,-1),...t.slice(0,n).reverse()].find(o=>!gh(o));return r&&r.getAttribute("data-focusable-id")},isCell(i){return this.getFocusableEl(i).hasAttribute("data-el-cell")},isSection(i){return this.getFocusableEl(i).hasAttribute("data-el-section-headline")},isNotebook(i){return this.getFocusableEl(i).hasAttribute("data-el-notebook-headline")},getFocusableEl(i){return this.el.querySelector(`[data-focusable-id="${i}"]`)},getFocusableEls(){return Array.from(this.el.querySelectorAll("[data-focusable-id]")).filter(i=>!gh(i))},getFocusableIds(){return this.getFocusableEls().map(i=>i.getAttribute("data-focusable-id"))},getSectionIdByFocusableId(i){let t=this.getFocusableEl(i).closest("[data-el-section]");return t&&t.getAttribute("data-section-id")},getSectionIds(){return this.getSections().map(e=>e.getAttribute("data-section-id"))},getSections(){return Array.from(this.el.querySelectorAll("[data-el-section]"))},getSectionById(i){return this.el.querySelector(`[data-el-section][data-section-id="${i}"]`)},getElement(i){return this.el.querySelector(`[data-el-${i}]`)},isViewCodeZen(){return this.view==="code-zen"},isViewPresentation(){return this.view==="presentation"}},gW=Dse;var Mse={mounted(){this.autosize(),this.el.addEventListener("input",i=>{this.autosize()})},updated(){this.autosize()},autosize(){this.el.style.height="0px",this.el.style.height=`${this.el.scrollHeight+2}px`}},_W=Mse;var Ose=100,Pse={mounted(){this.props=this.getProps(),this.interval=setInterval(()=>this.updateDOM(),Ose)},updated(){this.props=this.getProps(),this.updateDOM()},destroyed(){clearInterval(this.interval)},getProps(){return{start:We(this.el,"data-start")}},updateDOM(){let e=(Date.now()-new Date(this.props.start))/1e3;this.el.innerHTML=`${e.toFixed(1)}s`}},vW=Pse;var bW="lb:user_data";function yW(i){let e=JSON.stringify(i),t=cL(e);Hse(bW,t,15768e4)}function SW(){let i=Fse(bW);if(i){let e=dL(i);return JSON.parse(e)}else return null}function Fse(i){let e=document.cookie.split("; ").find(t=>t.startsWith(`${i}=`));return e?e.replace(`${i}=`,""):null}function Hse(i,e,t){let n=`${i}=${e};max-age=${t};path=/${Fg()}`;document.cookie=n}var Bse={mounted(){this.el.addEventListener("submit",i=>{let e=this.el.user_form_name.value,t=this.el.user_form_hex_color.value;yW({name:e,hex_color:t})})}},CW=Bse;var zse={mounted(){this.props=this.getProps(),this.updateAttrs(),this.el.addEventListener("blur",i=>{let e=this.datetimeLocalToUtc(this.el.value);this.pushEventTo(this.props.phxTarget,"change",{html_value:e})})},updated(){this.props=this.getProps(),this.updateAttrs()},getProps(){return{utcValue:di(this.el,"data-utc-value",null),utcMin:di(this.el,"data-utc-min",null),utcMax:di(this.el,"data-utc-max",null),phxTarget:We(this.el,"data-phx-target")}},updateAttrs(){this.el.value=this.datetimeUtcToLocal(this.props.utcValue),this.el.min=this.datetimeUtcToLocal(this.props.utcMin),this.el.max=this.datetimeUtcToLocal(this.props.utcMax)},datetimeUtcToLocal(i){if(!i)return null;let e=new Date(i+"Z"),t=e.getFullYear().toString(),n=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getDate().toString().padStart(2,"0"),o=e.getHours().toString().padStart(2,"0"),s=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0");return`${t}-${n}-${r}T${o}:${s}:${a}`},datetimeLocalToUtc(i){if(!i)return null;let e=new Date(i),t=e.getUTCFullYear().toString(),n=(e.getUTCMonth()+1).toString().padStart(2,"0"),r=e.getUTCDate().toString().padStart(2,"0"),o=e.getUTCHours().toString().padStart(2,"0"),s=e.getUTCMinutes().toString().padStart(2,"0"),a=e.getUTCSeconds().toString().padStart(2,"0");return`${t}-${n}-${r}T${o}:${s}:${a}`}},wW=zse;var Use={mounted(){this.props=this.getProps(),this.updateAttrs(),this.el.addEventListener("blur",i=>{let e=this.timeLocalToUtc(this.el.value);this.pushEventTo(this.props.phxTarget,"change",{html_value:e})})},updated(){this.props=this.getProps(),this.updateAttrs()},getProps(){return{utcValue:di(this.el,"data-utc-value",null),utcMin:di(this.el,"data-utc-min",null),utcMax:di(this.el,"data-utc-max",null),phxTarget:We(this.el,"data-phx-target")}},updateAttrs(){this.el.value=this.timeUtcToLocal(this.props.utcValue),this.el.min=this.timeUtcToLocal(this.props.utcMin),this.el.max=this.timeUtcToLocal(this.props.utcMax)},timeUtcToLocal(i){if(!i)return null;let e=new Date;e.setUTCHours(...i.split(":"));let t=e.getHours().toString().padStart(2,"0"),n=e.getMinutes().toString().padStart(2,"0"),r=e.getSeconds().toString().padStart(2,"0");return`${t}:${n}:${r}`},timeLocalToUtc(i){if(!i)return null;let e=new Date;e.setHours(...i.split(":"));let t=e.getUTCHours().toString().padStart(2,"0"),n=e.getUTCMinutes().toString().padStart(2,"0"),r=e.getUTCSeconds().toString().padStart(2,"0");return`${t}:${n}:${r}`}},xW=Use;var IW=zi(TW());var Wse={mounted(){this.props=this.getProps(),this.lineHeight=sL(this.el),this.templateEl=_h(this.el,"[data-template]"),this.contentEl=_h(this.el,"[data-content]"),this.capLines();let i=this.hyperListConfig();this.virtualizedList=new IW.default(this.contentEl,i),this.props.follow&&F1(this.contentEl)},updated(){this.props=this.getProps(),this.capLines();let i=this.props.follow&&lL(this.contentEl),e=this.hyperListConfig();this.virtualizedList.refresh(this.contentEl,e),i&&F1(this.contentEl)},getProps(){return{maxHeight:We(this.el,"data-max-height",Zr),follow:di(this.el,"data-follow",!1,ea),maxLines:di(this.el,"data-max-lines",null,Zr),ignoreTrailingEmptyLine:di(this.el,"data-ignore-trailing-empty-line",!1,ea)}},hyperListConfig(){let i=this.getLineElements(),e=i.length,t=Math.min(this.props.maxHeight,this.lineHeight*e);return{height:t,total:e,itemHeight:this.lineHeight,generate:n=>{let r=i[n].cloneNode(!0);return r.removeAttribute("id"),r},afterRender:()=>{this.contentEl.scrollWidth>this.contentEl.clientWidth?this.contentEl.style.height=`${t+12}px`:this.contentEl.style.height=`${t}px`}}},getLineElements(){let i=Array.from(this.templateEl.querySelectorAll("[data-line]"));if(i.length===0)return[];let e=i[i.length-1];return this.props.ignoreTrailingEmptyLine&&e.innerText===""?i.slice(0,-1):i},capLines(){if(this.props.maxLines){let e=Array.from(this.templateEl.querySelectorAll("[data-line]")).slice(0,-this.props.maxLines),[t,...n]=e;n.forEach(r=>r.remove()),t&&(t.innerHTML="...")}}},kW=Wse;var AW={AppAuth:GA,AudioInput:gL,Cell:sU,CellEditor:hU,Dropzone:uU,EditorSettings:mU,EmojiPicker:ZU,FocusOnUpdate:eW,Headline:iW,Highlight:nW,ImageInput:rW,ImageOutput:oW,JSView:hW,KeyboardControl:uW,MarkdownRenderer:mW,ScrollOnUpdate:pW,Session:gW,TextareaAutosize:_W,Timer:vW,UserForm:CW,UtcDateTimeInput:wW,UtcTimeInput:xW,VirtualizedLines:kW};var LW={onBeforeElUpdated(i,e){for(let t of i.attributes)t.name.startsWith("data-js-")&&e.setAttribute(t.name,t.value),t.name==="data-keep-attribute"&&(i.hasAttribute(t.value)?e.setAttribute(t.value,i.getAttribute(t.value)):e.removeAttribute(t.value))},onNodeAdded(i){if(i.nodeType===Node.ELEMENT_NODE&&i.hasAttribute("autofocus")&&(i.focus(),i.setSelectionRange&&i.value)){let e=i.value.length;i.setSelectionRange(e,e)}}};var C2=zi(RW());function DW(){C2.default.config({barColors:{0:"#b2c1ff"},shadowColor:"rgba(0, 0, 0, .3)"});let i=null;window.addEventListener("phx:page-loading-start",()=>{i||(i=setTimeout(()=>C2.default.show(),500))}),window.addEventListener("phx:page-loading-stop",()=>{clearTimeout(i),i=null,C2.default.hide()})}function MW(){window.addEventListener("lb:focus",i=>{requestAnimationFrame(()=>{i.target.focus()})}),window.addEventListener("lb:set_value",i=>{i.target.value=i.detail.value}),window.addEventListener("lb:check",i=>{i.target.checked=!0}),window.addEventListener("lb:uncheck",i=>{i.target.checked=!1}),window.addEventListener("lb:set_text",i=>{i.target.textContent=i.detail.value}),window.addEventListener("lb:clipcopy",i=>{"clipboard"in navigator?i.target.tagName==="INPUT"?navigator.clipboard.writeText(i.target.value):navigator.clipboard.writeText(i.target.textContent):alert(`Sorry, your browser does not support clipboard copy. -This generally requires a secure origin \u2014 either HTTPS or localhost.`)}),window.addEventListener("lb:session_list:on_selection_change",()=>{let i=!!document.querySelector("[name='session_ids[]']:checked"),e=document.querySelector("#edit-sessions [name='disconnect']"),t=document.querySelector("#edit-sessions [name='close_all']");e.disabled=!i,t.disabled=!i}),window.addEventListener("contextmenu",i=>{let e=i.target.closest("[data-contextmenu-trigger-click]");e&&(i.preventDefault(),e.dispatchEvent(new Event("mousedown",{bubbles:!0})),e.dispatchEvent(new Event("click",{bubbles:!0})))}),window.addEventListener("submit",i=>{i.target.hasAttribute("phx-nosubmit")&&(i.preventDefault(),i.stopPropagation())},{capture:!0})}function OW(){let i=/AppleWebKit/.test(navigator.userAgent),e="ontouchstart"in window||navigator.maxTouchPoints>0;if(i&&e){let t=document.querySelector("meta[name='viewport']");t&&(t.content+=", maximum-scale=1.0")}}var qE="confirm-opted-out-ids";function PW(){return _c(qE)||[]}function FW(){window.addEventListener("phx:add_confirm_opt_out_id",i=>{let e=_c(qE)||[],t=i.detail.opt_out_id;e.push(t),fh(qE,e)})}function jse(){let i=document.querySelector("meta[name='csrf-token']").getAttribute("content"),e=new WA(window.LIVEBOOK_BASE_URL_PATH+"/live",ug,{params:t=>({_csrf_token:i,user_data:SW(),app_auth_token:qA(),confirm_opt_out_ids:PW()}),hooks:AW,dom:LW});DW(),MW(),FW(),OW(),Yn.getAndSubscribe(t=>{document.body.setAttribute("data-editor-theme",t.editor_theme)}),e.connect(),window.liveSocket=e}if(Vse())jse();else{let i=document.createElement("div");i.innerHTML=` +This generally requires a secure origin \u2014 either HTTPS or localhost.`)}),window.addEventListener("phx:lb:exec_js",i=>{let e=i.detail.to||"body";document.querySelectorAll(e).forEach(t=>{window.liveSocket.execJS(t,i.detail.js)})}),window.addEventListener("lb:session_list:on_selection_change",()=>{let i=!!document.querySelector("[name='session_ids[]']:checked"),e=document.querySelector("#edit-sessions [name='disconnect']"),t=document.querySelector("#edit-sessions [name='close_all']");e.parentElement.classList.toggle("pointer-events-none",!i),e.parentElement.classList.toggle("opacity-50",!i),t.parentElement.classList.toggle("pointer-events-none",!i),t.parentElement.classList.toggle("opacity-50",!i)}),window.addEventListener("contextmenu",i=>{let e=i.target.closest("[data-contextmenu-trigger-click]");e&&(i.preventDefault(),e.dispatchEvent(new Event("mousedown",{bubbles:!0})),e.dispatchEvent(new Event("click",{bubbles:!0})))}),window.addEventListener("submit",i=>{i.target.hasAttribute("phx-nosubmit")&&(i.preventDefault(),i.stopPropagation())},{capture:!0})}function OW(){let i=/AppleWebKit/.test(navigator.userAgent),e="ontouchstart"in window||navigator.maxTouchPoints>0;if(i&&e){let t=document.querySelector("meta[name='viewport']");t&&(t.content+=", maximum-scale=1.0")}}var qE="confirm-opted-out-ids";function PW(){return _c(qE)||[]}function FW(){window.addEventListener("phx:add_confirm_opt_out_id",i=>{let e=_c(qE)||[],t=i.detail.opt_out_id;e.push(t),fh(qE,e)})}function jse(){let i=document.querySelector("meta[name='csrf-token']").getAttribute("content"),e=new WA(window.LIVEBOOK_BASE_URL_PATH+"/live",ug,{params:t=>({_csrf_token:i,user_data:SW(),app_auth_token:qA(),confirm_opt_out_ids:PW()}),hooks:AW,dom:LW});DW(),MW(),FW(),OW(),Yn.getAndSubscribe(t=>{document.body.setAttribute("data-editor-theme",t.editor_theme)}),e.connect(),window.liveSocket=e}if(Vse())jse();else{let i=document.createElement("div");i.innerHTML=`