diff --git a/priv/static/js/app.js b/priv/static/js/app.js index 4bd85e6d9..2341bac01 100644 --- a/priv/static/js/app.js +++ b/priv/static/js/app.js @@ -1,2 +1,2 @@ /*! For license information please see app.js.LICENSE.txt */ -(()=>{var e,t={3355:(e,t,n)=>{"use strict";var i={};n.r(i),n.d(i,{contentInitial:()=>po,disable:()=>yo,document:()=>go,flow:()=>mo,flowInitial:()=>fo,insideSpan:()=>bo,string:()=>_o,text:()=>vo});var o={};n.r(o),n.d(o,{boolean:()=>As,booleanish:()=>Is,commaOrSpaceSeparated:()=>Fs,commaSeparated:()=>Ps,number:()=>Os,overloadedBoolean:()=>Ms,spaceSeparated:()=>Rs});var r={};n.r(r),n.d(r,{aggregate:()=>lb,bin:()=>cb,collect:()=>hb,compare:()=>db,countpattern:()=>pb,cross:()=>fb,density:()=>vb,dotbin:()=>Sb,expression:()=>xb,extent:()=>Eb,facet:()=>Lb,field:()=>Db,filter:()=>Ab,flatten:()=>Ib,fold:()=>Mb,formula:()=>Ob,generate:()=>Rb,impute:()=>Bb,joinaggregate:()=>Hb,kde:()=>zb,key:()=>Wb,load:()=>Ub,lookup:()=>jb,multiextent:()=>qb,multivalues:()=>Gb,params:()=>Qb,pivot:()=>Xb,prefacet:()=>Zb,project:()=>Jb,proxy:()=>ey,quantile:()=>ty,relay:()=>ny,sample:()=>iy,sequence:()=>oy,sieve:()=>ry,subflow:()=>Nb,timeunit:()=>sy,tupleindex:()=>ly,values:()=>cy,window:()=>py});var s={};n.r(s),n.d(s,{interpolate:()=>VC,interpolateArray:()=>OC,interpolateBasis:()=>CC,interpolateBasisClosed:()=>SC,interpolateCubehelix:()=>kx,interpolateCubehelixLong:()=>Ex,interpolateDate:()=>PC,interpolateDiscrete:()=>AS,interpolateHcl:()=>hx,interpolateHclLong:()=>dx,interpolateHsl:()=>US,interpolateHslLong:()=>$S,interpolateHue:()=>IS,interpolateLab:()=>cx,interpolateNumber:()=>FC,interpolateNumberArray:()=>IC,interpolateObject:()=>BC,interpolateRgb:()=>LC,interpolateRgbBasis:()=>TC,interpolateRgbBasisClosed:()=>AC,interpolateRound:()=>UC,interpolateString:()=>WC,interpolateTransformCss:()=>BS,interpolateTransformSvg:()=>HS,interpolateZoom:()=>WS,piecewise:()=>LS,quantize:()=>Nx});var a={};n.r(a),n.d(a,{bound:()=>WT,identifier:()=>$T,mark:()=>jT,overlap:()=>qT,render:()=>JT,viewlayout:()=>yA});var l={};n.r(l),n.d(l,{axisticks:()=>CA,datajoin:()=>SA,encode:()=>kA,legendentries:()=>EA,linkpath:()=>AA,pie:()=>PA,scale:()=>HA,sortitems:()=>UA,stack:()=>GA});var c={};n.r(c),n.d(c,{contour:()=>kR,geojson:()=>LR,geopath:()=>DR,geopoint:()=>TR,geoshape:()=>AR,graticule:()=>IR,heatmap:()=>MR,isocontour:()=>fR,kde2d:()=>CR,projection:()=>RR});var u={};n.r(u),n.d(u,{force:()=>TP});var h={};n.r(h),n.d(h,{nest:()=>TF,pack:()=>PF,partition:()=>BF,stratify:()=>HF,tree:()=>VF,treelinks:()=>UF,treemap:()=>qF});var d={};n.r(d),n.d(d,{label:()=>hB});var g={};n.r(g),n.d(g,{loess:()=>gB,regression:()=>fB});var p={};n.r(p),n.d(p,{voronoi:()=>BB});var f={};n.r(f),n.d(f,{wordcloud:()=>ZB});var m={};n.r(m),n.d(m,{crossfilter:()=>rH,resolvefilter:()=>sH});var _={};n.r(_),n.d(_,{Bounds:()=>HE,CanvasHandler:()=>pD,CanvasRenderer:()=>bD,DATE:()=>dp,DAY:()=>gp,DAYOFYEAR:()=>pp,Dataflow:()=>B_,Debug:()=>Uu,Error:()=>zu,EventStream:()=>x_,Gradient:()=>qk,GroupItem:()=>WE,HOURS:()=>fp,Handler:()=>QL,Info:()=>Vu,Item:()=>zE,MILLISECONDS:()=>vp,MINUTES:()=>mp,MONTH:()=>up,Marks:()=>OL,MultiPulse:()=>O_,None:()=>Hu,Operator:()=>w_,Parameters:()=>v_,Pulse:()=>T_,QUARTER:()=>cp,RenderType:()=>sT,Renderer:()=>ZL,ResourceLoader:()=>VE,SECONDS:()=>_p,SVGHandler:()=>wD,SVGRenderer:()=>jD,SVGStringRenderer:()=>rT,Scenegraph:()=>VL,TIME_UNITS:()=>bp,Transform:()=>z_,View:()=>uU,WEEK:()=>hp,Warn:()=>Wu,YEAR:()=>lp,accessor:()=>Su,accessorFields:()=>ku,accessorName:()=>xu,array:()=>mh,ascending:()=>yh,bandwidthNRD:()=>tv,bin:()=>nv,bootstrapCI:()=>rv,boundClip:()=>pT,boundContext:()=>cN,boundItem:()=>RL,boundMark:()=>FL,boundStroke:()=>jE,changeset:()=>m_,clampRange:()=>_h,codegenExpression:()=>gz,compare:()=>bh,constant:()=>xh,cumulativeLogNormal:()=>yv,cumulativeNormal:()=>pv,cumulativeUniform:()=>Ev,dayofyear:()=>Ep,debounce:()=>kh,defaultLocale:()=>Jm,definition:()=>V_,densityLogNormal:()=>bv,densityNormal:()=>gv,densityUniform:()=>kv,domChild:()=>qL,domClear:()=>KL,domCreate:()=>$L,domFind:()=>jL,dotbin:()=>sv,error:()=>Du,expressionFunction:()=>dV,extend:()=>Eh,extent:()=>Nh,extentIndex:()=>Lh,falsy:()=>Fu,fastmap:()=>Ih,field:()=>Au,flush:()=>Mh,font:()=>LL,fontFamily:()=>NL,fontSize:()=>CL,format:()=>Bd,formatLocale:()=>jm,formats:()=>Hd,hasOwnProperty:()=>Th,id:()=>Iu,identity:()=>Mu,inferType:()=>_d,inferTypes:()=>vd,ingest:()=>u_,inherits:()=>Oh,inrange:()=>Rh,interpolate:()=>_k,interpolateColors:()=>pk,interpolateRange:()=>gk,intersect:()=>cT,intersectBoxLine:()=>yN,intersectPath:()=>mN,intersectPoint:()=>_N,intersectRule:()=>bN,isArray:()=>ju,isBoolean:()=>Ph,isDate:()=>Fh,isFunction:()=>vh,isIterable:()=>Bh,isNumber:()=>Hh,isObject:()=>qu,isRegExp:()=>zh,isString:()=>Wh,isTuple:()=>a_,key:()=>Vh,lerp:()=>Uh,lineHeight:()=>SL,loader:()=>n_,locale:()=>Zm,logger:()=>$u,lruCache:()=>$h,markup:()=>BD,merge:()=>jh,mergeConfig:()=>Gu,multiLineOffset:()=>kL,one:()=>Ru,pad:()=>Kh,panLinear:()=>rh,panLog:()=>sh,panPow:()=>ah,panSymlog:()=>lh,parse:()=>iK,parseExpression:()=>uz,parseSelector:()=>bU,pathCurves:()=>Gk,pathEqual:()=>mT,pathParse:()=>Xk,pathRectangle:()=>wE,pathRender:()=>lE,pathSymbols:()=>dE,pathTrail:()=>CE,peek:()=>Xu,point:()=>YL,projection:()=>iR,quantileLogNormal:()=>wv,quantileNormal:()=>fv,quantileUniform:()=>Nv,quantiles:()=>J_,quantizeInterpolator:()=>fk,quarter:()=>ph,quartiles:()=>ev,random:()=>iv,randomInteger:()=>lv,randomKDE:()=>_v,randomLCG:()=>av,randomLogNormal:()=>Cv,randomMixture:()=>Sv,randomNormal:()=>mv,randomUniform:()=>Lv,read:()=>t_,regressionExp:()=>Rv,regressionLinear:()=>Mv,regressionLoess:()=>zv,regressionLog:()=>Ov,regressionPoly:()=>Bv,regressionPow:()=>Pv,regressionQuad:()=>Fv,renderModule:()=>lT,repeat:()=>qh,resetDefaultLocale:()=>e_,resetSVGClipId:()=>FE,resetSVGDefIds:()=>_T,responseType:()=>zd,runtimeContext:()=>CV,sampleCurve:()=>$v,sampleLogNormal:()=>vv,sampleNormal:()=>dv,sampleUniform:()=>xv,scale:()=>ik,sceneEqual:()=>fT,sceneFromJSON:()=>zL,scenePickVisit:()=>AN,sceneToJSON:()=>HL,sceneVisit:()=>TN,sceneZOrder:()=>DN,scheme:()=>wk,serializeXML:()=>HD,setRandom:()=>ov,span:()=>Gh,splitAccessPath:()=>Tu,stringValue:()=>Yh,textMetrics:()=>mL,timeBin:()=>df,timeFloor:()=>Vp,timeFormatLocale:()=>Qm,timeInterval:()=>Gp,timeOffset:()=>Xp,timeSequence:()=>ef,timeUnitSpecifier:()=>Sp,timeUnits:()=>wp,toBoolean:()=>Qh,toDate:()=>Zh,toNumber:()=>Zu,toSet:()=>ed,toString:()=>Jh,transform:()=>U_,transforms:()=>W_,truncate:()=>td,truthy:()=>Pu,tupleid:()=>l_,typeParsers:()=>pd,utcFloor:()=>jp,utcInterval:()=>Yp,utcOffset:()=>Zp,utcSequence:()=>tf,utcdayofyear:()=>Ip,utcquarter:()=>fh,utcweek:()=>Mp,version:()=>oK,visitArray:()=>nd,week:()=>Np,writeConfig:()=>Yu,zero:()=>Ou,zoomLinear:()=>uh,zoomLog:()=>hh,zoomPow:()=>dh,zoomSymlog:()=>gh});var v={};n.r(v),n.d(v,{JsonPatchError:()=>_K,_areEquals:()=>NK,applyOperation:()=>CK,applyPatch:()=>SK,applyReducer:()=>xK,deepClone:()=>vK,getValueByPointer:()=>wK,validate:()=>EK,validator:()=>kK});var b={};n.r(b),n.d(b,{compare:()=>RK,generate:()=>MK,observe:()=>IK,unobserve:()=>AK});var y={};n.r(y),n.d(y,{accessPathDepth:()=>DG,accessPathWithDatum:()=>SG,compile:()=>r8,contains:()=>iG,deepEqual:()=>QK,deleteNestedProperty:()=>wG,duplicate:()=>XK,entries:()=>_G,every:()=>rG,fieldIntersection:()=>gG,flatAccessWithDatum:()=>xG,getFirstDefined:()=>TG,hasIntersection:()=>hG,hash:()=>tG,internalField:()=>OG,isBoolean:()=>vG,isEmpty:()=>pG,isEqual:()=>cG,isInternalField:()=>RG,isNullOrFalse:()=>nG,isNumeric:()=>FG,keys:()=>fG,logicalExpr:()=>yG,mergeDeep:()=>sG,normalize:()=>Q5,normalizeAngle:()=>PG,omit:()=>JK,pick:()=>ZK,prefixGenerator:()=>dG,removePathFromField:()=>LG,replaceAll:()=>NG,replacePathInField:()=>EG,resetIdCounter:()=>MG,setEqual:()=>uG,some:()=>oG,stringify:()=>eG,titleCase:()=>CG,unique:()=>lG,uniqueId:()=>IG,vals:()=>mG,varName:()=>bG,version:()=>s8});var w={};n.r(w),n.d(w,{dark:()=>c8,excel:()=>h8,fivethirtyeight:()=>m8,ggplot2:()=>v8,googlecharts:()=>H8,latimes:()=>x8,quartz:()=>N8,urbaninstitute:()=>R8,version:()=>z8,vox:()=>D8}),n(6458);var C,S=n(4902),x=n(4173),k=n.n(x),E="consecutive-reloads",N=[1e3,3e3],L=["phx-click-loading","phx-change-loading","phx-submit-loading","phx-keydown-loading","phx-keyup-loading","phx-blur-loading","phx-focus-loading"],D="data-phx-component",T="data-phx-link",A="data-phx-ref",I="track-uploads",M="data-phx-upload-ref",O="data-phx-preflighted-refs",R="drop-target",P="data-phx-active-refs",F="phx:live-file:updated",B="data-phx-skip",H="data-phx-remove",z="page-loading",W="phx-connected",V="phx-disconnected",U="phx-no-feedback",$="phx-error",j="data-phx-parent-id",q="data-phx-main",K="data-phx-root-id",G="feedback-for",Y="phx-has-focused",Q=["text","textarea","number","email","password","search","tel","url","date","time"],X=["checkbox","radio"],Z="phx-has-submitted",J="data-phx-session",ee=`[${J}]`,te="data-phx-static",ne="data-phx-readonly",ie="data-phx-disabled",oe="disable-with",re="data-phx-disable-with-restore",se="hook",ae="update",le="auto-recover",ce="phx:live-socket:debug",ue="phx:live-socket:profiling",he="phx:live-socket:latency-sim",de="debounce-trigger",ge="throttled",pe="debounce-prev-key",fe={debounce:300,throttle:300},me="d",_e="s",ve="e",be="r",ye="t",we=(e,t)=>console.error&&console.error(e,t),Ce=e=>"function"==typeof e?e:function(){return e},Se=e=>JSON.parse(JSON.stringify(e)),xe=(e,t,n)=>{do{if(e.matches(`[${t}]`))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType&&!(n&&n.isSameNode(e)||e.matches(ee)));return null},ke=e=>null!==e&&"object"==typeof e&&!(e instanceof Array),Ee=e=>{for(let t in e)return!1;return!0},Ne=(e,t)=>e&&t(e),Le=function(e,t,n,i){e.forEach((e=>{new class{constructor(e,t,n){this.liveSocket=n,this.entry=e,this.offset=0,this.chunkSize=t,this.chunkTimer=null,this.uploadChannel=n.channel(`lvu:${e.ref}`,{token:e.metadata()})}error(e){clearTimeout(this.chunkTimer),this.uploadChannel.leave(),this.entry.error(e)}upload(){this.uploadChannel.onError((e=>this.error(e))),this.uploadChannel.join().receive("ok",(e=>this.readNextChunk())).receive("error",(e=>this.error(e)))}isDone(){return this.offset>=this.entry.file.size}readNextChunk(){let e=new window.FileReader,t=this.entry.file.slice(this.offset,this.chunkSize+this.offset);e.onload=e=>{if(null!==e.target.error)return we("Read error: "+e.target.error);this.offset+=e.target.result.byteLength,this.pushChunk(e.target.result)},e.readAsArrayBuffer(t)}pushChunk(e){this.uploadChannel.isJoined()&&this.uploadChannel.push("chunk",e).receive("ok",(()=>{this.entry.progress(this.offset/this.entry.file.size*100),this.isDone()||(this.chunkTimer=setTimeout((()=>this.readNextChunk()),this.liveSocket.getLatencySim()||0))}))}}(e,n.config.chunk_size,i).upload()}))},De={canPushState:()=>void 0!==history.pushState,dropLocal(e,t,n){return e.removeItem(this.localKey(t,n))},updateLocal(e,t,n,i,o){let r=this.getLocal(e,t,n),s=this.localKey(t,n),a=null===r?i:o(r);return e.setItem(s,JSON.stringify(a)),a},getLocal(e,t,n){return JSON.parse(e.getItem(this.localKey(t,n)))},updateCurrentState(e){this.canPushState()&&history.replaceState(e(history.state||{}),"",window.location.href)},pushState(e,t,n){if(this.canPushState()){if(n!==window.location.href){if("redirect"==t.type&&t.scroll){let e=history.state||{};e.scroll=t.scroll,history.replaceState(e,"",window.location.href)}delete t.scroll,history[e+"State"](t,"",n||null);let i=this.getHashTargetEl(window.location.hash);i?i.scrollIntoView():"redirect"===t.type&&window.scroll(0,0)}}else this.redirect(n)},setCookie(e,t){document.cookie=`${e}=${t}`},getCookie:e=>document.cookie.replace(new RegExp(`(?:(?:^|.*;s*)${e}s*=s*([^;]*).*$)|^.*$`),"$1"),redirect(e,t){t&&De.setCookie("__phoenix_flash__",t+"; max-age=60000; path=/"),window.location=e},localKey:(e,t)=>`${e}-${t}`,getHashTargetEl(e){let t=e.toString().substring(1);if(""!==t)return document.getElementById(t)||document.querySelector(`a[name="${t}"]`)}},Te=De,Ae={byId:e=>document.getElementById(e)||we(`no id found for ${e}`),removeClass(e,t){e.classList.remove(t),0===e.classList.length&&e.removeAttribute("class")},all(e,t,n){if(!e)return[];let i=Array.from(e.querySelectorAll(t));return n?i.forEach(n):i},childNodeLength(e){let t=document.createElement("template");return t.innerHTML=e,t.content.childElementCount},isUploadInput:e=>"file"===e.type&&null!==e.getAttribute(M),findUploadInputs(e){return this.all(e,`input[type="file"][${M}]`)},findComponentNodeList(e,t){return this.filterWithinSameLiveView(this.all(e,`[${D}="${t}"]`),e)},isPhxDestroyed:e=>!(!e.id||!Ae.private(e,"destroyed")),markPhxChildDestroyed(e){e.setAttribute(J,""),this.putPrivate(e,"destroyed",!0)},findPhxChildrenInFragment(e,t){let n=document.createElement("template");return n.innerHTML=e,this.findPhxChildren(n.content,t)},isIgnored:(e,t)=>"ignore"===(e.getAttribute(t)||e.getAttribute("data-phx-update")),isPhxUpdate:(e,t,n)=>e.getAttribute&&n.indexOf(e.getAttribute(t))>=0,findPhxChildren(e,t){return this.all(e,`${ee}[${j}="${t}"]`)},findParentCIDs(e,t){let n=new Set(t);return t.reduce(((t,n)=>{let i=`[${D}="${n}"] [${D}]`;return this.filterWithinSameLiveView(this.all(e,i),e).map((e=>parseInt(e.getAttribute(D)))).forEach((e=>t.delete(e))),t}),n)},filterWithinSameLiveView(e,t){return t.querySelector(ee)?e.filter((e=>this.withinSameLiveView(e,t))):e},withinSameLiveView(e,t){for(;e=e.parentNode;){if(e.isSameNode(t))return!0;if(null!==e.getAttribute(J))return!1}},private:(e,t)=>e.phxPrivate&&e.phxPrivate[t],deletePrivate(e,t){e.phxPrivate&&delete e.phxPrivate[t]},putPrivate(e,t,n){e.phxPrivate||(e.phxPrivate={}),e.phxPrivate[t]=n},copyPrivates(e,t){t.phxPrivate&&(e.phxPrivate=Se(t.phxPrivate))},putTitle(e){let t=document.querySelector("title"),{prefix:n,suffix:i}=t.dataset;document.title=`${n||""}${e}${i||""}`},debounce(e,t,n,i,o,r,s){let a=e.getAttribute(n),l=e.getAttribute(o);""===a&&(a=i),""===l&&(l=r);let c=a||l;switch(c){case null:return s();case"blur":return void(this.once(e,"debounce-blur")&&e.addEventListener("blur",(()=>s())));default:let n=parseInt(c),i=()=>l?this.deletePrivate(e,ge):s(),o=this.incCycle(e,de,i);if(isNaN(n))return we(`invalid throttle/debounce value: ${c}`);if(l){let i=!1;if("keydown"===t.type){let n=this.private(e,pe);this.putPrivate(e,pe,t.key),i=n!==t.key}if(!i&&this.private(e,ge))return!1;s(),this.putPrivate(e,ge,!0),setTimeout((()=>this.triggerCycle(e,de)),n)}else setTimeout((()=>this.triggerCycle(e,de,o)),n);let r=e.form;r&&this.once(r,"bind-debounce")&&r.addEventListener("submit",(()=>{Array.from(new FormData(r).entries(),(([e])=>{let t=r.querySelector(`[name="${e}"]`);this.incCycle(t,de),this.deletePrivate(t,ge)}))})),this.once(e,"bind-debounce")&&e.addEventListener("blur",(()=>this.triggerCycle(e,de)))}},triggerCycle(e,t,n){let[i,o]=this.private(e,t);n||(n=i),n===i&&(this.incCycle(e,t),o())},once(e,t){return!0!==this.private(e,t)&&(this.putPrivate(e,t,!0),!0)},incCycle(e,t,n=function(){}){let[i]=this.private(e,t)||[0,n];return i++,this.putPrivate(e,t,[i,n]),i},discardError(e,t,n){let i=t.getAttribute&&t.getAttribute(n),o=i&&e.querySelector(`[id="${i}"], [name="${i}"]`);o&&(this.private(o,Y)||this.private(o.form,Z)||t.classList.add(U))},showError(e,t){(e.id||e.name)&&this.all(e.form,`[${t}="${e.id}"], [${t}="${e.name}"]`,(e=>{this.removeClass(e,U)}))},isPhxChild:e=>e.getAttribute&&e.getAttribute(j),dispatchEvent(e,t,n={}){let i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e.dispatchEvent(i)},cloneNode(e,t){if(void 0===t)return e.cloneNode(!0);{let n=e.cloneNode(!1);return n.innerHTML=t,n}},mergeAttrs(e,t,n={}){let i=n.exclude||[],o=n.isIgnored,r=t.attributes;for(let n=r.length-1;n>=0;n--){let o=r[n].name;i.indexOf(o)<0&&e.setAttribute(o,t.getAttribute(o))}let s=e.attributes;for(let n=s.length-1;n>=0;n--){let i=s[n].name;o?i.startsWith("data-")&&!t.hasAttribute(i)&&e.removeAttribute(i):t.hasAttribute(i)||e.removeAttribute(i)}},mergeFocusedInput(e,t){e instanceof HTMLSelectElement||Ae.mergeAttrs(e,t,{except:["value"]}),t.readOnly?e.setAttribute("readonly",!0):e.removeAttribute("readonly")},hasSelectionRange:e=>e.setSelectionRange&&("text"===e.type||"textarea"===e.type),restoreFocus(e,t,n){if(!Ae.isTextualInput(e))return;let i=e.matches(":focus");e.readOnly&&e.blur(),i||e.focus(),this.hasSelectionRange(e)&&e.setSelectionRange(t,n)},isFormInput:e=>/^(?:input|select|textarea)$/i.test(e.tagName)&&"button"!==e.type,syncAttrsToProps(e){e instanceof HTMLInputElement&&X.indexOf(e.type.toLocaleLowerCase())>=0&&(e.checked=null!==e.getAttribute("checked"))},syncPropsToAttrs(e){if(e instanceof HTMLSelectElement){let t=e.options.item(e.selectedIndex);t&&null===t.getAttribute("selected")&&t.setAttribute("selected","")}},isTextualInput:e=>Q.indexOf(e.type)>=0,isNowTriggerFormExternal:(e,t)=>e.getAttribute&&null!==e.getAttribute(t),syncPendingRef(e,t,n){let i=e.getAttribute(A);return null===i||(Ae.isFormInput(e)||null!==e.getAttribute(n)?(Ae.isUploadInput(e)&&Ae.mergeAttrs(e,t,{isIgnored:!0}),Ae.putPrivate(e,A,t),!1):(L.forEach((n=>{e.classList.contains(n)&&t.classList.add(n)})),t.setAttribute(A,i),!0))},cleanChildNodes(e,t){if(Ae.isPhxUpdate(e,t,["append","prepend"])){let t=[];e.childNodes.forEach((e=>{e.id||(e.nodeType===Node.TEXT_NODE&&""===e.nodeValue.trim()||we(`only HTML element tags with an id are allowed inside containers with phx-update.\n\nremoving illegal node: "${(e.outerHTML||e.nodeValue).trim()}"\n\n`),t.push(e))})),t.forEach((e=>e.remove()))}},replaceRootContainer(e,t,n){let i=new Set(["id",J,te,q]);if(e.tagName.toLowerCase()===t.toLowerCase())return Array.from(e.attributes).filter((e=>!i.has(e.name.toLowerCase()))).forEach((t=>e.removeAttribute(t.name))),Object.keys(n).filter((e=>!i.has(e.toLowerCase()))).forEach((t=>e.setAttribute(t,n[t]))),e;{let o=document.createElement(t);return Object.keys(n).forEach((e=>o.setAttribute(e,n[e]))),i.forEach((t=>o.setAttribute(t,e.getAttribute(t)))),o.innerHTML=e.innerHTML,e.replaceWith(o),o}}},Ie=Ae,Me=class{static isActive(e,t){let n=void 0===t._phxRef,i=e.getAttribute(P).split(",").indexOf(Re.genFileRef(t))>=0;return t.size>0&&(n||i)}static isPreflighted(e,t){return e.getAttribute(O).split(",").indexOf(Re.genFileRef(t))>=0&&this.isActive(e,t)}constructor(e,t,n){this.ref=Re.genFileRef(t),this.fileEl=e,this.file=t,this.view=n,this.meta=null,this._isCancelled=!1,this._isDone=!1,this._progress=0,this._lastProgressSent=-1,this._onDone=function(){},this._onElUpdated=this.onElUpdated.bind(this),this.fileEl.addEventListener(F,this._onElUpdated)}metadata(){return this.meta}progress(e){this._progress=Math.floor(e),this._progress>this._lastProgressSent&&(this._progress>=100?(this._progress=100,this._lastProgressSent=100,this._isDone=!0,this.view.pushFileProgress(this.fileEl,this.ref,100,(()=>{Re.untrackFile(this.fileEl,this.file),this._onDone()}))):(this._lastProgressSent=this._progress,this.view.pushFileProgress(this.fileEl,this.ref,this._progress)))}cancel(){this._isCancelled=!0,this._isDone=!0,this._onDone()}isDone(){return this._isDone}error(e="failed"){this.view.pushFileProgress(this.fileEl,this.ref,{error:e}),Re.clearFiles(this.fileEl)}onDone(e){this._onDone=()=>{this.fileEl.removeEventListener(F,this._onElUpdated),e()}}onElUpdated(){-1===this.fileEl.getAttribute(P).split(",").indexOf(this.ref)&&this.cancel()}toPreflightPayload(){return{last_modified:this.file.lastModified,name:this.file.name,size:this.file.size,type:this.file.type,ref:this.ref}}uploader(e){if(this.meta.uploader){let t=e[this.meta.uploader]||we(`no uploader configured for ${this.meta.uploader}`);return{name:this.meta.uploader,callback:t}}return{name:"channel",callback:Le}}zipPostFlight(e){this.meta=e.entries[this.ref],this.meta||we(`no preflight upload response returned with ref ${this.ref}`,{input:this.fileEl,response:e})}},Oe=0,Re=class{static genFileRef(e){let t=e._phxRef;return void 0!==t?t:(e._phxRef=(Oe++).toString(),e._phxRef)}static getEntryDataURL(e,t,n){let i=this.activeFiles(e).find((e=>this.genFileRef(e)===t));n(URL.createObjectURL(i))}static hasUploadsInProgress(e){let t=0;return Ie.findUploadInputs(e).forEach((e=>{e.getAttribute(O)!==e.getAttribute("data-phx-done-refs")&&t++})),t>0}static serializeUploads(e){let t=this.activeFiles(e),n={};return t.forEach((t=>{let i={path:e.name},o=e.getAttribute(M);n[o]=n[o]||[],i.ref=this.genFileRef(t),i.name=t.name||i.ref,i.type=t.type,i.size=t.size,n[o].push(i)})),n}static clearFiles(e){e.value=null,e.removeAttribute(M),Ie.putPrivate(e,"files",[])}static untrackFile(e,t){Ie.putPrivate(e,"files",Ie.private(e,"files").filter((e=>!Object.is(e,t))))}static trackFiles(e,t){if(null!==e.getAttribute("multiple")){let n=t.filter((t=>!this.activeFiles(e).find((e=>Object.is(e,t)))));Ie.putPrivate(e,"files",this.activeFiles(e).concat(n)),e.value=null}else Ie.putPrivate(e,"files",t)}static activeFileInputs(e){let t=Ie.findUploadInputs(e);return Array.from(t).filter((e=>e.files&&this.activeFiles(e).length>0))}static activeFiles(e){return(Ie.private(e,"files")||[]).filter((t=>Me.isActive(e,t)))}static inputsAwaitingPreflight(e){let t=Ie.findUploadInputs(e);return Array.from(t).filter((e=>this.filesAwaitingPreflight(e).length>0))}static filesAwaitingPreflight(e){return this.activeFiles(e).filter((t=>!Me.isPreflighted(e,t)))}constructor(e,t,n){this.view=t,this.onComplete=n,this._entries=Array.from(Re.filesAwaitingPreflight(e)||[]).map((n=>new Me(e,n,t))),this.numEntriesInProgress=this._entries.length}entries(){return this._entries}initAdapterUpload(e,t,n){this._entries=this._entries.map((t=>(t.zipPostFlight(e),t.onDone((()=>{this.numEntriesInProgress--,0===this.numEntriesInProgress&&this.onComplete()})),t)));let i=this._entries.reduce(((e,t)=>{let{name:i,callback:o}=t.uploader(n.uploaders);return e[i]=e[i]||{callback:o,entries:[]},e[i].entries.push(t),e}),{});for(let o in i){let{callback:r,entries:s}=i[o];r(s,t,e,n)}}},Pe={LiveFileUpload:{activeRefs(){return this.el.getAttribute(P)},preflightedRefs(){return this.el.getAttribute(O)},mounted(){this.preflightedWas=this.preflightedRefs()},updated(){let e=this.preflightedRefs();this.preflightedWas!==e&&(this.preflightedWas=e,""===e&&this.__view.cancelSubmit(this.el.form)),""===this.activeRefs()&&(this.el.value=null),this.el.dispatchEvent(new CustomEvent(F))}},LiveImgPreview:{mounted(){this.ref=this.el.getAttribute("data-phx-entry-ref"),this.inputEl=document.getElementById(this.el.getAttribute(M)),Re.getEntryDataURL(this.inputEl,this.ref,(e=>{this.url=e,this.el.src=e}))},destroyed(){URL.revokeObjectURL(this.url)}}},Fe="undefined"==typeof document?void 0:document,Be=!!Fe&&"content"in Fe.createElement("template"),He=!!Fe&&Fe.createRange&&"createContextualFragment"in Fe.createRange();function ze(e,t){var n,i,o=e.nodeName,r=t.nodeName;return o===r||(n=o.charCodeAt(0),i=r.charCodeAt(0),n<=90&&i>=97?o===r.toUpperCase():i<=90&&n>=97&&r===o.toUpperCase())}function We(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var Ve={OPTION:function(e,t){var n=e.parentNode;if(n){var i=n.nodeName.toUpperCase();"OPTGROUP"===i&&(i=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==i||n.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}We(e,t,"selected")},INPUT:function(e,t){We(e,t,"checked"),We(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var i=e.firstChild;if(i){var o=i.nodeValue;if(o==n||!n&&o==e.placeholder)return;i.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n,i,o=-1,r=0,s=e.firstChild;s;)if("OPTGROUP"===(i=s.nodeName&&s.nodeName.toUpperCase()))s=(n=s).firstChild;else{if("OPTION"===i){if(s.hasAttribute("selected")){o=r;break}r++}!(s=s.nextSibling)&&n&&(s=n.nextSibling,n=null)}e.selectedIndex=o}}};function Ue(){}function $e(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}var je,qe=(je=function(e,t){var n,i,o,r,s=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var a=s.length-1;a>=0;a--)i=(n=s[a]).name,o=n.namespaceURI,r=n.value,o?(i=n.localName||i,e.getAttributeNS(o,i)!==r&&("xmlns"===n.prefix&&(i=n.name),e.setAttributeNS(o,i,r))):e.getAttribute(i)!==r&&e.setAttribute(i,r);for(var l=e.attributes,c=l.length-1;c>=0;c--)i=(n=l[c]).name,(o=n.namespaceURI)?(i=n.localName||i,t.hasAttributeNS(o,i)||e.removeAttributeNS(o,i)):t.hasAttribute(i)||e.removeAttribute(i)}},function(e,t,n){if(n||(n={}),"string"==typeof t)if("#document"===e.nodeName||"HTML"===e.nodeName||"BODY"===e.nodeName){var i=t;(t=Fe.createElement("html")).innerHTML=i}else o=(o=t).trim(),t=Be?function(e){var t=Fe.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(o):He?function(e){return C||(C=Fe.createRange()).selectNode(Fe.body),C.createContextualFragment(e).childNodes[0]}(o):function(e){var t=Fe.createElement("body");return t.innerHTML=e,t.childNodes[0]}(o);var o,r=n.getNodeKey||$e,s=n.onBeforeNodeAdded||Ue,a=n.onNodeAdded||Ue,l=n.onBeforeElUpdated||Ue,c=n.onElUpdated||Ue,u=n.onBeforeNodeDiscarded||Ue,h=n.onNodeDiscarded||Ue,d=n.onBeforeElChildrenUpdated||Ue,g=!0===n.childrenOnly,p=Object.create(null),f=[];function m(e){f.push(e)}function _(e,t){if(1===e.nodeType)for(var n=e.firstChild;n;){var i=void 0;t&&(i=r(n))?m(i):(h(n),n.firstChild&&_(n,t)),n=n.nextSibling}}function v(e,t,n){!1!==u(e)&&(t&&t.removeChild(e),h(e),_(e,n))}function b(e){a(e);for(var t=e.firstChild;t;){var n=t.nextSibling,i=r(t);if(i){var o=p[i];o&&ze(t,o)?(t.parentNode.replaceChild(o,t),y(o,t)):b(t)}else b(t);t=n}}function y(e,t,n){var i=r(t);if(i&&delete p[i],!n){if(!1===l(e,t))return;if(je(e,t),c(e),!1===d(e,t))return}"TEXTAREA"!==e.nodeName?function(e,t){var n,i,o,a,l,c=t.firstChild,u=e.firstChild;e:for(;c;){for(a=c.nextSibling,n=r(c);u;){if(o=u.nextSibling,c.isSameNode&&c.isSameNode(u)){c=a,u=o;continue e}i=r(u);var h=u.nodeType,d=void 0;if(h===c.nodeType&&(1===h?(n?n!==i&&((l=p[n])?o===l?d=!1:(e.insertBefore(l,u),i?m(i):v(u,e,!0),u=l):d=!1):i&&(d=!1),(d=!1!==d&&ze(u,c))&&y(u,c)):3!==h&&8!=h||(d=!0,u.nodeValue!==c.nodeValue&&(u.nodeValue=c.nodeValue))),d){c=a,u=o;continue e}i?m(i):v(u,e,!0),u=o}if(n&&(l=p[n])&&ze(l,c))e.appendChild(l),y(l,c);else{var g=s(c);!1!==g&&(g&&(c=g),c.actualize&&(c=c.actualize(e.ownerDocument||Fe)),e.appendChild(c),b(c))}c=a,u=o}!function(e,t,n){for(;t;){var i=t.nextSibling;(n=r(t))?m(n):v(t,e,!0),t=i}}(e,u,i);var f=Ve[e.nodeName];f&&f(e,t)}(e,t):Ve.TEXTAREA(e,t)}!function e(t){if(1===t.nodeType||11===t.nodeType)for(var n=t.firstChild;n;){var i=r(n);i&&(p[i]=n),e(n),n=n.nextSibling}}(e);var w,S,x=e,k=x.nodeType,E=t.nodeType;if(!g)if(1===k)1===E?ze(e,t)||(h(e),x=function(e,t){for(var n=e.firstChild;n;){var i=n.nextSibling;t.appendChild(n),n=i}return t}(e,(w=t.nodeName,(S=t.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==S?Fe.createElementNS(S,w):Fe.createElement(w)))):x=t;else if(3===k||8===k){if(E===k)return x.nodeValue!==t.nodeValue&&(x.nodeValue=t.nodeValue),x;x=t}if(x===t)h(e);else{if(t.isSameNode&&t.isSameNode(x))return;if(y(x,t,g),f)for(var N=0,L=f.length;N{if(n&&n.isSameNode(e)&&Ie.isFormInput(e))return Ie.mergeFocusedInput(e,t),!1}})}constructor(e,t,n,i,o){this.view=e,this.liveSocket=e.liveSocket,this.container=t,this.id=n,this.rootID=e.root.id,this.html=i,this.targetCID=o,this.cidPatch="number"==typeof this.targetCID,this.callbacks={beforeadded:[],beforeupdated:[],beforephxChildAdded:[],afteradded:[],afterupdated:[],afterdiscarded:[],afterphxChildAdded:[]}}before(e,t){this.callbacks[`before${e}`].push(t)}after(e,t){this.callbacks[`after${e}`].push(t)}trackBefore(e,...t){this.callbacks[`before${e}`].forEach((e=>e(...t)))}trackAfter(e,...t){this.callbacks[`after${e}`].forEach((e=>e(...t)))}markPrunableContentForRemoval(){Ie.all(this.container,"[phx-update=append] > *, [phx-update=prepend] > *",(e=>{e.setAttribute(H,"")}))}perform(){let{view:e,liveSocket:t,container:n,html:i}=this,o=this.isCIDPatch()?this.targetCIDContainer(i):n;if(this.isCIDPatch()&&!o)return;let r=t.getActiveElement(),{selectionStart:s,selectionEnd:a}=r&&Ie.hasSelectionRange(r)?r:{},l=t.binding(ae),c=t.binding(G),u=t.binding(oe),h=t.binding("trigger-action"),d=[],g=[],p=[],f=null,m=t.time("premorph container prep",(()=>this.buildDiffHTML(n,i,l,o)));return this.trackBefore("added",n),this.trackBefore("updated",n,n),t.time("morphdom",(()=>{qe(o,m,{childrenOnly:null===o.getAttribute(D),getNodeKey:e=>Ie.isPhxDestroyed(e)?null:e.id,onBeforeNodeAdded:e=>(this.trackBefore("added",e),e),onNodeAdded:t=>{Ie.isNowTriggerFormExternal(t,h)&&(f=t),Ie.discardError(o,t,c),Ie.isPhxChild(t)&&e.ownsElement(t)&&this.trackAfter("phxChildAdded",t),d.push(t)},onNodeDiscarded:e=>{Ie.isPhxChild(e)&&t.destroyViewByEl(e),this.trackAfter("discarded",e)},onBeforeNodeDiscarded:e=>!((!e.getAttribute||null===e.getAttribute(H))&&(null!==e.parentNode&&Ie.isPhxUpdate(e.parentNode,l,["append","prepend"])&&e.id||this.skipCIDSibling(e))),onElUpdated:e=>{Ie.isNowTriggerFormExternal(e,h)&&(f=e),g.push(e)},onBeforeElUpdated:(e,t)=>{if(Ie.cleanChildNodes(t,l),this.skipCIDSibling(t))return!1;if(Ie.isIgnored(e,l))return this.trackBefore("updated",e,t),Ie.mergeAttrs(e,t,{isIgnored:!0}),g.push(e),!1;if("number"===e.type&&e.validity&&e.validity.badInput)return!1;if(!Ie.syncPendingRef(e,t,u))return Ie.isUploadInput(e)&&(this.trackBefore("updated",e,t),g.push(e)),!1;if(Ie.isPhxChild(t)){let n=e.getAttribute(J);return Ie.mergeAttrs(e,t,{exclude:[te]}),""!==n&&e.setAttribute(J,n),e.setAttribute(K,this.rootID),!1}return Ie.copyPrivates(t,e),Ie.discardError(o,t,c),Ie.syncPropsToAttrs(t),r&&e.isSameNode(r)&&Ie.isFormInput(e)&&!this.forceFocusedSelectUpdate(e,t)?(this.trackBefore("updated",e,t),Ie.mergeFocusedInput(e,t),Ie.syncAttrsToProps(e),g.push(e),!1):(Ie.isPhxUpdate(t,l,["append","prepend"])&&p.push(new class{constructor(e,t,n){let i=new Set,o=new Set([...t.children].map((e=>e.id))),r=[];Array.from(e.children).forEach((e=>{if(e.id&&(i.add(e.id),o.has(e.id))){let t=e.previousElementSibling&&e.previousElementSibling.id;r.push({elementId:e.id,previousElementId:t})}})),this.containerId=t.id,this.updateType=n,this.elementsToModify=r,this.elementIdsToAdd=[...o].filter((e=>!i.has(e)))}perform(){let e=Ie.byId(this.containerId);this.elementsToModify.forEach((t=>{t.previousElementId?Ne(document.getElementById(t.previousElementId),(e=>{Ne(document.getElementById(t.elementId),(t=>{t.previousElementSibling&&t.previousElementSibling.id==e.id||e.insertAdjacentElement("afterend",t)}))})):Ne(document.getElementById(t.elementId),(t=>{null==t.previousElementSibling||e.insertAdjacentElement("afterbegin",t)}))})),"prepend"==this.updateType&&this.elementIdsToAdd.reverse().forEach((t=>{Ne(document.getElementById(t),(t=>e.insertAdjacentElement("afterbegin",t)))}))}}(e,t,t.getAttribute(l))),Ie.syncAttrsToProps(t),this.trackBefore("updated",e,t),!0)}})})),t.isDebugEnabled()&&function(){let e=new Set,t=document.querySelectorAll("*[id]");for(let n=0,i=t.length;n0&&t.time("post-morph append/prepend restoration",(()=>{p.forEach((e=>e.perform()))})),t.silenceEvents((()=>Ie.restoreFocus(r,s,a))),Ie.dispatchEvent(document,"phx:update"),d.forEach((e=>this.trackAfter("added",e))),g.forEach((e=>this.trackAfter("updated",e))),f&&(t.disconnect(),f.submit()),!0}forceFocusedSelectUpdate(e,t){let n=["select","select-one","select-multiple"].find((t=>t===e.type));return!0===e.multiple||n&&e.innerHTML!=t.innerHTML}isCIDPatch(){return this.cidPatch}skipCIDSibling(e){return e.nodeType===Node.ELEMENT_NODE&&null!==e.getAttribute(B)}targetCIDContainer(e){if(!this.isCIDPatch())return;let[t,...n]=Ie.findComponentNodeList(this.container,this.targetCID);return 0===n.length&&1===Ie.childNodeLength(e)?t:t&&t.parentNode}buildDiffHTML(e,t,n,i){let o=this.isCIDPatch(),r=o&&i.getAttribute(D)===this.targetCID.toString();if(!o||r)return t;{let e=null,n=document.createElement("template");e=Ie.cloneNode(i);let[o,...r]=Ie.findComponentNodeList(e,this.targetCID);return n.innerHTML=t,r.forEach((e=>e.remove())),Array.from(e.childNodes).forEach((e=>{e.id&&e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(D)!==this.targetCID.toString()&&(e.setAttribute(B,""),e.innerHTML="")})),Array.from(n.content.childNodes).forEach((t=>e.insertBefore(t,o))),o.remove(),e.outerHTML}}},Ge=class{static extract(e){let{[be]:t,[ve]:n,[ye]:i}=e;return delete e[be],delete e[ve],delete e[ye],{diff:e,title:i,reply:t||null,events:n||[]}}constructor(e,t){this.viewId=e,this.rendered={},this.mergeDiff(t)}parentViewId(){return this.viewId}toString(e){return this.recursiveToString(this.rendered,this.rendered.c,e)}recursiveToString(e,t=e.c,n){let i={buffer:"",components:t,onlyCids:n=n?new Set(n):null};return this.toOutputBuffer(e,i),i.buffer}componentCIDs(e){return Object.keys(e.c||{}).map((e=>parseInt(e)))}isComponentOnlyDiff(e){return!!e.c&&1===Object.keys(e).length}getComponent(e,t){return e.c[t]}mergeDiff(e){let t=e.c,n={};if(delete e.c,this.rendered=this.mutableMerge(this.rendered,e),this.rendered.c=this.rendered.c||{},t){let o=this.rendered.c;for(let e in t)t[e]=this.cachedFindComponent(e,t[e],o,t,n);for(var i in t)o[i]=t[i];e.c=t}}cachedFindComponent(e,t,n,i,o){if(o[e])return o[e];{let r,s,a=t[_e];if("number"==typeof a){let e;e=a>0?this.cachedFindComponent(a,i[a],n,i,o):n[-a],s=e[_e],r=this.cloneMerge(e,t),r[_e]=s}else r=void 0!==t[_e]?t:this.cloneMerge(n[e]||{},t);return o[e]=r,r}}mutableMerge(e,t){return void 0!==t[_e]?t:(this.doMutableMerge(e,t),e)}doMutableMerge(e,t){for(let n in t){let i=t[n],o=e[n];ke(i)&&void 0===i[_e]&&ke(o)?this.doMutableMerge(o,i):e[n]=i}}cloneMerge(e,t){let n={...e,...t};for(let i in n){let o=t[i],r=e[i];ke(o)&&void 0===o[_e]&&ke(r)&&(n[i]=this.cloneMerge(r,o))}return n}componentToString(e){return this.recursiveCIDToString(this.rendered.c,e)}pruneCIDs(e){e.forEach((e=>delete this.rendered.c[e]))}get(){return this.rendered}isNewFingerprint(e={}){return!!e[_e]}toOutputBuffer(e,t){if(e[me])return this.comprehensionToBuffer(e,t);let{[_e]:n}=e;t.buffer+=n[0];for(let i=1;ii.nodeType===Node.ELEMENT_NODE?i.getAttribute(D)?[e,!0]:(i.setAttribute(D,t),i.id||(i.id=`${this.parentViewId()}-${t}-${r}`),s&&(i.setAttribute(B,""),i.innerHTML=""),[!0,n]):""!==i.nodeValue.trim()?(we(`only HTML element tags are allowed at the root of components.\n\ngot: "${i.nodeValue.trim()}"\n\nwithin:\n`,o.innerHTML.trim()),i.replaceWith(this.createSpan(i.nodeValue,t)),[!0,n]):(i.remove(),[e,n])),[!1,!1]);return a||l?!a&&l?(we("expected at least one HTML element tag directly inside a component, but only subcomponents were found. A component must render at least one HTML tag directly inside itself.",o.innerHTML.trim()),o.innerHTML):o.innerHTML:(we("expected at least one HTML element tag inside a component, but the component is empty:\n",o.innerHTML.trim()),this.createSpan("",t).outerHTML)}createSpan(e,t){let n=document.createElement("span");return n.innerText=e,n.setAttribute(D,t),n}},Ye=1,Qe=class{static makeID(){return Ye++}static elementID(e){return e.phxHookId}constructor(e,t,n){this.__view=e,this.__liveSocket=e.liveSocket,this.__callbacks=n,this.__listeners=new Set,this.__isDisconnected=!1,this.el=t,this.el.phxHookId=this.constructor.makeID();for(let e in this.__callbacks)this[e]=this.__callbacks[e]}__mounted(){this.mounted&&this.mounted()}__updated(){this.updated&&this.updated()}__beforeUpdate(){this.beforeUpdate&&this.beforeUpdate()}__destroyed(){this.destroyed&&this.destroyed()}__reconnected(){this.__isDisconnected&&(this.__isDisconnected=!1,this.reconnected&&this.reconnected())}__disconnected(){this.__isDisconnected=!0,this.disconnected&&this.disconnected()}pushEvent(e,t={},n=function(){}){return this.__view.pushHookEvent(null,e,t,n)}pushEventTo(e,t,n={},i=function(){}){return this.__view.withinTargets(e,((e,o)=>e.pushHookEvent(o,t,n,i)))}handleEvent(e,t){let n=(n,i)=>i?e:t(n.detail);return window.addEventListener(`phx:hook:${e}`,n),this.__listeners.add(n),n}removeHandleEvent(e){let t=e(null,!0);window.removeEventListener(`phx:hook:${t}`,e),this.__listeners.delete(e)}upload(e,t){return this.__view.dispatchUploads(e,t)}uploadTo(e,t,n){return this.__view.withinTargets(e,(e=>e.dispatchUploads(t,n)))}__cleanup__(){this.__listeners.forEach((e=>this.removeHandleEvent(e)))}},Xe=(e,t={})=>{let n=new FormData(e),i=[];n.forEach(((e,t,n)=>{e instanceof File&&i.push(t)})),i.forEach((e=>n.delete(e)));let o=new URLSearchParams;for(let[e,t]of n.entries())o.append(e,t);for(let e in t)o.append(e,t[e]);return o.toString()},Ze=class{constructor(e,t,n,i){this.liveSocket=t,this.flash=i,this.parent=n,this.root=n?n.root:this,this.el=e,this.id=this.el.id,this.ref=0,this.childJoins=0,this.loaderTimer=null,this.pendingDiffs=[],this.pruningCIDs=[],this.redirect=!1,this.href=null,this.joinCount=this.parent?this.parent.joinCount-1:0,this.joinPending=!0,this.destroyed=!1,this.joinCallback=function(){},this.stopCallback=function(){},this.pendingJoinOps=this.parent?null:[],this.viewHooks={},this.uploaders={},this.formSubmits=[],this.children=this.parent?null:{},this.root.children[this.id]={},this.channel=this.liveSocket.channel(`lv:${this.id}`,(()=>({redirect:this.redirect?this.href:void 0,url:this.redirect?void 0:this.href||void 0,params:this.connectParams(),session:this.getSession(),static:this.getStatic(),flash:this.flash}))),this.showLoader(this.liveSocket.loaderTimeout),this.bindChannel()}setHref(e){this.href=e}setRedirect(e){this.redirect=!0,this.href=e}isMain(){return this.liveSocket.main===this}connectParams(){let e=this.liveSocket.params(this.el),t=Ie.all(document,`[${this.binding("track-static")}]`).map((e=>e.src||e.href)).filter((e=>"string"==typeof e));return t.length>0&&(e._track_static=t),e._mounts=this.joinCount,e}isConnected(){return this.channel.canPush()}getSession(){return this.el.getAttribute(J)}getStatic(){let e=this.el.getAttribute(te);return""===e?null:e}destroy(e=function(){}){this.destroyAllChildren(),this.destroyed=!0,delete this.root.children[this.id],this.parent&&delete this.root.children[this.parent.id][this.id],clearTimeout(this.loaderTimer);let t=()=>{e();for(let e in this.viewHooks)this.destroyHook(this.viewHooks[e])};Ie.markPhxChildDestroyed(this.el),this.log("destroyed",(()=>["the child has been removed from the parent"])),this.channel.leave().receive("ok",t).receive("error",t).receive("timeout",t)}setContainerClasses(...e){this.el.classList.remove(W,V,$),this.el.classList.add(...e)}isLoading(){return this.el.classList.contains(V)}showLoader(e){if(clearTimeout(this.loaderTimer),e)this.loaderTimer=setTimeout((()=>this.showLoader()),e);else{for(let e in this.viewHooks)this.viewHooks[e].__disconnected();this.setContainerClasses(V)}}hideLoader(){clearTimeout(this.loaderTimer),this.setContainerClasses(W)}triggerReconnected(){for(let e in this.viewHooks)this.viewHooks[e].__reconnected()}log(e,t){this.liveSocket.log(this,e,t)}withinTargets(e,t){if(e instanceof HTMLElement)return this.liveSocket.owner(e,(n=>t(n,e)));if(/^(0|[1-9]\d*)$/.test(e)){let n=Ie.findComponentNodeList(this.el,e);0===n.length?we(`no component found matching phx-target of ${e}`):t(this,n[0])}else{let n=Array.from(document.querySelectorAll(e));0===n.length&&we(`nothing found matching the phx-target selector "${e}"`),n.forEach((e=>this.liveSocket.owner(e,(n=>t(n,e)))))}}applyDiff(e,t,n){this.log(e,(()=>["",Se(t)]));let{diff:i,reply:o,events:r,title:s}=Ge.extract(t);return s&&Ie.putTitle(s),n({diff:i,reply:o,events:r}),o}onJoin(e){let{rendered:t,container:n}=e;if(n){let[e,t]=n;this.el=Ie.replaceRootContainer(this.el,e,t)}this.childJoins=0,this.joinPending=!0,this.flash=null,Te.dropLocal(this.liveSocket.localStorage,window.location.pathname,E),this.applyDiff("mount",t,(({diff:t,events:n})=>{this.rendered=new Ge(this.id,t);let i=this.renderContainer(null,"join");this.dropPendingRefs();let o=this.formsForRecovery(i);this.joinCount++,o.length>0?o.forEach(((e,t)=>{this.pushFormRecovery(e,(e=>{t===o.length-1&&this.onJoinComplete(e,i,n)}))})):this.onJoinComplete(e,i,n)}))}dropPendingRefs(){Ie.all(this.el,`[${A}]`,(e=>e.removeAttribute(A)))}onJoinComplete({live_patch:e},t,n){if(this.joinCount>1||this.parent&&!this.parent.isJoinPending())return this.applyJoinPatch(e,t,n);0===Ie.findPhxChildrenInFragment(t,this.id).filter((e=>{let t=e.id&&this.el.querySelector(`[id="${e.id}"]`),n=t&&t.getAttribute(te);return n&&e.setAttribute(te,n),this.joinChild(e)})).length?this.parent?(this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(e,t,n)]),this.parent.ackJoin(this)):(this.onAllChildJoinsComplete(),this.applyJoinPatch(e,t,n)):this.root.pendingJoinOps.push([this,()=>this.applyJoinPatch(e,t,n)])}attachTrueDocEl(){this.el=Ie.byId(this.id),this.el.setAttribute(K,this.root.id)}dispatchEvents(e){e.forEach((([e,t])=>{window.dispatchEvent(new CustomEvent(`phx:hook:${e}`,{detail:t}))}))}applyJoinPatch(e,t,n){this.attachTrueDocEl();let i=new Ke(this,this.el,this.id,t,null);if(i.markPrunableContentForRemoval(),this.performPatch(i,!1),this.joinNewChildren(),Ie.all(this.el,`[${this.binding(se)}], [data-phx-hook]`,(e=>{let t=this.addHook(e);t&&t.__mounted()})),this.joinPending=!1,this.dispatchEvents(n),this.applyPendingUpdates(),e){let{kind:t,to:n}=e;this.liveSocket.historyPatch(n,t)}this.hideLoader(),this.joinCount>1&&this.triggerReconnected(),this.stopCallback()}triggerBeforeUpdateHook(e,t){this.liveSocket.triggerDOM("onBeforeElUpdated",[e,t]);let n=this.getHook(e),i=n&&Ie.isIgnored(e,this.binding(ae));if(n&&!e.isEqualNode(t)&&(!i||(o=e.dataset,r=t.dataset,JSON.stringify(o)!==JSON.stringify(r))))return n.__beforeUpdate(),n;var o,r}performPatch(e,t){let n=[],i=!1,o=new Set;return e.after("added",(e=>{this.liveSocket.triggerDOM("onNodeAdded",[e]);let t=this.addHook(e);t&&t.__mounted()})),e.after("phxChildAdded",(e=>i=!0)),e.before("updated",((e,t)=>{this.triggerBeforeUpdateHook(e,t)&&o.add(e.id)})),e.after("updated",(e=>{o.has(e.id)&&this.getHook(e).__updated()})),e.after("discarded",(e=>{let t=this.componentID(e);"number"==typeof t&&-1===n.indexOf(t)&&n.push(t);let i=this.getHook(e);i&&this.destroyHook(i)})),e.perform(),t&&this.maybePushComponentsDestroyed(n),i}joinNewChildren(){Ie.findPhxChildren(this.el,this.id).forEach((e=>this.joinChild(e)))}getChildById(e){return this.root.children[this.id][e]}getDescendentByEl(e){return e.id===this.id?this:this.children[e.getAttribute(j)][e.id]}destroyDescendent(e){for(let t in this.root.children)for(let n in this.root.children[t])if(n===e)return this.root.children[t][n].destroy()}joinChild(e){if(!this.getChildById(e.id)){let t=new Ze(e,this.liveSocket,this);return this.root.children[this.id][t.id]=t,t.join(),this.childJoins++,!0}}isJoinPending(){return this.joinPending}ackJoin(e){this.childJoins--,0===this.childJoins&&(this.parent?this.parent.ackJoin(this):this.onAllChildJoinsComplete())}onAllChildJoinsComplete(){this.joinCallback(),this.pendingJoinOps.forEach((([e,t])=>{e.isDestroyed()||t()})),this.pendingJoinOps=[]}update(e,t){if(this.isJoinPending()||this.liveSocket.hasPendingLink())return this.pendingDiffs.push({diff:e,events:t});this.rendered.mergeDiff(e);let n=!1;this.rendered.isComponentOnlyDiff(e)?this.liveSocket.time("component patch complete",(()=>{Ie.findParentCIDs(this.el,this.rendered.componentCIDs(e)).forEach((t=>{this.componentPatch(this.rendered.getComponent(e,t),t)&&(n=!0)}))})):Ee(e)||this.liveSocket.time("full patch complete",(()=>{let t=this.renderContainer(e,"update"),i=new Ke(this,this.el,this.id,t,null);n=this.performPatch(i,!0)})),this.dispatchEvents(t),n&&this.joinNewChildren()}renderContainer(e,t){return this.liveSocket.time(`toString diff (${t})`,(()=>{let t=this.el.tagName,n=e?this.rendered.componentCIDs(e).concat(this.pruningCIDs):null;return`<${t}>${this.rendered.toString(n)}`}))}componentPatch(e,t){if(Ee(e))return!1;let n=this.rendered.componentToString(t),i=new Ke(this,this.el,this.id,n,t);return this.performPatch(i,!0)}getHook(e){return this.viewHooks[Qe.elementID(e)]}addHook(e){if(Qe.elementID(e)||!e.getAttribute)return;let t=e.getAttribute("data-phx-hook")||e.getAttribute(this.binding(se));if(t&&!this.ownsElement(e))return;let n=this.liveSocket.getHookCallbacks(t);if(n){e.id||we(`no DOM ID for hook "${t}". Hooks require a unique ID on each element.`,e);let i=new Qe(this,e,n);return this.viewHooks[Qe.elementID(i.el)]=i,i}null!==t&&we(`unknown hook found for "${t}"`,e)}destroyHook(e){e.__destroyed(),e.__cleanup__(),delete this.viewHooks[Qe.elementID(e.el)]}applyPendingUpdates(){this.pendingDiffs.forEach((({diff:e,events:t})=>this.update(e,t))),this.pendingDiffs=[]}onChannel(e,t){this.liveSocket.onChannel(this.channel,e,(e=>{this.isJoinPending()?this.root.pendingJoinOps.push([this,()=>t(e)]):t(e)}))}bindChannel(){this.liveSocket.onChannel(this.channel,"diff",(e=>{this.applyDiff("update",e,(({diff:e,events:t})=>this.update(e,t)))})),this.onChannel("redirect",(({to:e,flash:t})=>this.onRedirect({to:e,flash:t}))),this.onChannel("live_patch",(e=>this.onLivePatch(e))),this.onChannel("live_redirect",(e=>this.onLiveRedirect(e))),this.channel.onError((e=>this.onError(e))),this.channel.onClose((e=>this.onClose(e)))}destroyAllChildren(){for(let e in this.root.children[this.id])this.getChildById(e).destroy()}onLiveRedirect(e){let{to:t,kind:n,flash:i}=e,o=this.expandURL(t);this.liveSocket.historyRedirect(o,n,i)}onLivePatch(e){let{to:t,kind:n}=e;this.href=this.expandURL(t),this.liveSocket.historyPatch(t,n)}expandURL(e){return e.startsWith("/")?`${window.location.protocol}//${window.location.host}${e}`:e}onRedirect({to:e,flash:t}){this.liveSocket.redirect(e,t)}isDestroyed(){return this.destroyed}join(e){this.parent||(this.stopCallback=this.liveSocket.withPageLoading({to:this.href,kind:"initial"})),this.joinCallback=()=>e&&e(this.joinCount),this.liveSocket.wrapPush(this,{timeout:!1},(()=>this.channel.join().receive("ok",(e=>!this.isDestroyed()&&this.onJoin(e))).receive("error",(e=>!this.isDestroyed()&&this.onJoinError(e))).receive("timeout",(()=>!this.isDestroyed()&&this.onJoinError({reason:"timeout"})))))}onJoinError(e){return"unauthorized"===e.reason||"stale"===e.reason?(this.log("error",(()=>["unauthorized live_redirect. Falling back to page request",e])),this.onRedirect({to:this.href})):((e.redirect||e.live_redirect)&&(this.joinPending=!1,this.channel.leave()),e.redirect?this.onRedirect(e.redirect):e.live_redirect?this.onLiveRedirect(e.live_redirect):(this.log("error",(()=>["unable to join",e])),this.liveSocket.reloadWithJitter(this)))}onClose(e){if(!this.isDestroyed()){if(this.isJoinPending()&&"hidden"!==document.visibilityState||this.liveSocket.hasPendingLink()&&"leave"!==e)return this.liveSocket.reloadWithJitter(this);this.destroyAllChildren(),this.liveSocket.dropActiveElement(this),document.activeElement&&document.activeElement.blur(),this.liveSocket.isUnloaded()&&this.showLoader(200)}}onError(e){this.onClose(e),this.log("error",(()=>["view crashed",e])),this.liveSocket.isUnloaded()||this.displayError()}displayError(){this.isMain()&&Ie.dispatchEvent(window,"phx:page-loading-start",{to:this.href,kind:"error"}),this.showLoader(),this.setContainerClasses(V,$)}pushWithReply(e,t,n,i=function(){}){if(!this.isConnected())return;let[o,[r]]=e?e():[null,[]],s=function(){};return r&&null!==r.getAttribute(this.binding(z))&&(s=this.liveSocket.withPageLoading({kind:"element",target:r})),"number"!=typeof n.cid&&delete n.cid,this.liveSocket.wrapPush(this,{timeout:!0},(()=>this.channel.push(t,n,3e4).receive("ok",(e=>{let t=null;null!==o&&this.undoRefs(o),e.diff&&(t=this.applyDiff("update",e.diff,(({diff:e,events:t})=>{this.update(e,t)}))),e.redirect&&this.onRedirect(e.redirect),e.live_patch&&this.onLivePatch(e.live_patch),e.live_redirect&&this.onLiveRedirect(e.live_redirect),s(),i(e,t)}))))}undoRefs(e){Ie.all(this.el,`[${A}="${e}"]`,(e=>{let t=e.getAttribute(ie);e.removeAttribute(A),null!==e.getAttribute(ne)&&(e.readOnly=!1,e.removeAttribute(ne)),null!==t&&(e.disabled="true"===t,e.removeAttribute(ie)),L.forEach((t=>Ie.removeClass(e,t)));let n=e.getAttribute(re);null!==n&&(e.innerText=n,e.removeAttribute(re));let i=Ie.private(e,A);if(i){let t=this.triggerBeforeUpdateHook(e,i);Ke.patchEl(e,i,this.liveSocket.getActiveElement()),t&&t.__updated(),Ie.deletePrivate(e,A)}}))}putRef(e,t){let n=this.ref++,i=this.binding(oe);return e.forEach((e=>{e.classList.add(`phx-${t}-loading`),e.setAttribute(A,n);let o=e.getAttribute(i);null!==o&&(e.getAttribute(re)||e.setAttribute(re,e.innerText),e.innerText=o)})),[n,e]}componentID(e){let t=e.getAttribute&&e.getAttribute(D);return t?parseInt(t):null}targetComponentID(e,t){return e.getAttribute(this.binding("target"))?this.closestComponentID(t):null}closestComponentID(e){return e?Ne(e.closest(`[${D}]`),(e=>this.ownsElement(e)&&this.componentID(e))):null}pushHookEvent(e,t,n,i){if(!this.isConnected())return this.log("hook",(()=>["unable to push hook event. LiveView not connected",t,n])),!1;let[o,r]=this.putRef([],"hook");return this.pushWithReply((()=>[o,r]),"event",{type:"hook",event:t,value:n,cid:this.closestComponentID(e)},((e,t)=>i(t,o))),o}extractMeta(e,t){let n=this.binding("value-");for(let i=0;i=0&&!e.checked&&delete t.value),t}pushEvent(e,t,n,i,o){this.pushWithReply((()=>this.putRef([t],e)),"event",{type:e,event:i,value:this.extractMeta(t,o),cid:this.targetComponentID(t,n)})}pushKey(e,t,n,i,o){this.pushWithReply((()=>this.putRef([e],n)),"event",{type:n,event:i,value:this.extractMeta(e,o),cid:this.targetComponentID(e,t)})}pushFileProgress(e,t,n,i=function(){}){this.liveSocket.withinOwners(e.form,((o,r)=>{o.pushWithReply(null,"progress",{event:e.getAttribute(o.binding("progress")),ref:e.getAttribute(M),entry_ref:t,progress:n,cid:o.targetComponentID(e.form,r)},i)}))}pushInput(e,t,n,i,o){let r,s=this.targetComponentID(e.form,t),a=()=>this.putRef([e,e.form],"change"),l=Xe(e.form,{_target:i.name});e.files&&e.files.length>0&&Re.trackFiles(e,Array.from(e.files)),r=Re.serializeUploads(e);let c={type:"form",event:n,value:l,uploads:r,cid:s};this.pushWithReply(a,"event",c,(n=>{if(Ie.showError(e,this.liveSocket.binding(G)),Ie.isUploadInput(e)&&null!==e.getAttribute("data-phx-auto-upload")){if(Re.filesAwaitingPreflight(e).length>0){let[i,r]=a();this.uploadFiles(e.form,t,i,s,(t=>{o&&o(n),this.triggerAwaitingSubmit(e.form)}))}}else o&&o(n)}))}triggerAwaitingSubmit(e){let t=this.getScheduledSubmit(e);if(t){let[n,i,o]=t;this.cancelSubmit(e),o()}}getScheduledSubmit(e){return this.formSubmits.find((([t,n])=>t.isSameNode(e)))}scheduleSubmit(e,t,n){if(this.getScheduledSubmit(e))return!0;this.formSubmits.push([e,t,n])}cancelSubmit(e){this.formSubmits=this.formSubmits.filter((([t,n,i])=>!t.isSameNode(e)||(this.undoRefs(n),!1)))}pushFormSubmit(e,t,n,i){let o=e=>!(xe(e,`${this.binding(ae)}=ignore`,e.form)||xe(e,"data-phx-update=ignore",e.form)),r=e=>e.hasAttribute(this.binding(oe)),s=e=>"BUTTON"==e.tagName,a=e=>["INPUT","TEXTAREA","SELECT"].includes(e.tagName),l=()=>{let t=Array.from(e.elements),n=t.filter(r),i=t.filter(s).filter(o),l=t.filter(a).filter(o);return i.forEach((e=>{e.setAttribute(ie,e.disabled),e.disabled=!0})),l.forEach((e=>{e.setAttribute(ne,e.readOnly),e.readOnly=!0,e.files&&(e.setAttribute(ie,e.disabled),e.disabled=!0)})),e.setAttribute(this.binding(z),""),this.putRef([e].concat(n).concat(i).concat(l),"submit")},c=this.targetComponentID(e,t);if(Re.hasUploadsInProgress(e)){let[o,r]=l();return this.scheduleSubmit(e,o,(()=>this.pushFormSubmit(e,t,n,i)))}if(Re.inputsAwaitingPreflight(e).length>0){let[o,r]=l(),s=()=>[o,r];this.uploadFiles(e,t,o,c,(t=>{let o=Xe(e,{});this.pushWithReply(s,"event",{type:"form",event:n,value:o,cid:c},i)}))}else{let t=Xe(e);this.pushWithReply(l,"event",{type:"form",event:n,value:t,cid:c},i)}}uploadFiles(e,t,n,i,o){let r=this.joinCount,s=Re.activeFileInputs(e),a=s.length;s.forEach((e=>{let i=new Re(e,this,(()=>{a--,0===a&&o()}));this.uploaders[e]=i;let s=i.entries().map((e=>e.toPreflightPayload())),l={ref:e.getAttribute(M),entries:s,cid:this.targetComponentID(e.form,t)};this.log("upload",(()=>["sending preflight request",l])),this.pushWithReply(null,"allow_upload",l,(e=>{if(this.log("upload",(()=>["got preflight response",e])),e.error){this.undoRefs(n);let[t,i]=e.error;this.log("upload",(()=>[`error for entry ${t}`,i]))}else{let t=e=>{this.channel.onError((()=>{this.joinCount===r&&e()}))};i.initAdapterUpload(e,t,this.liveSocket)}}))}))}dispatchUploads(e,t){let n=Ie.findUploadInputs(this.el).filter((t=>t.name===e));0===n.length?we(`no live file inputs found matching the name "${e}"`):n.length>1?we(`duplicate live file inputs found matching the name "${e}"`):Ie.dispatchEvent(n[0],I,{files:t})}pushFormRecovery(e,t){this.liveSocket.withinOwners(e,((n,i)=>{let o=e.elements[0],r=e.getAttribute(this.binding(le))||e.getAttribute(this.binding("change"));n.pushInput(o,i,r,o,t)}))}pushLinkPatch(e,t,n){let i=this.liveSocket.setPendingLink(e),o=t?()=>this.putRef([t],"click"):null;this.pushWithReply(o,"live_patch",{url:e},(t=>{t.link_redirect?this.liveSocket.replaceMain(e,null,n,i):(this.liveSocket.commitPendingLink(i)&&(this.href=e),this.applyPendingUpdates(),n&&n(i))})).receive("timeout",(()=>this.liveSocket.redirect(window.location.href)))}formsForRecovery(e){if(0===this.joinCount)return[];let t=this.binding("change"),n=document.createElement("template");return n.innerHTML=e,Ie.all(this.el,`form[${t}]`).filter((e=>this.ownsElement(e))).filter((e=>e.elements.length>0)).filter((e=>"ignore"!==e.getAttribute(this.binding(le)))).filter((e=>n.content.querySelector(`form[${t}="${e.getAttribute(t)}"]`)))}maybePushComponentsDestroyed(e){let t=e.filter((e=>0===Ie.findComponentNodeList(this.el,e).length));t.length>0&&(this.pruningCIDs.push(...t),this.pushWithReply(null,"cids_will_destroy",{cids:t},(()=>{this.pruningCIDs=this.pruningCIDs.filter((e=>-1!==t.indexOf(e)));let e=t.filter((e=>0===Ie.findComponentNodeList(this.el,e).length));e.length>0&&this.pushWithReply(null,"cids_destroyed",{cids:e},(e=>{this.rendered.pruneCIDs(e.cids)}))})))}ownsElement(e){return e.getAttribute(j)===this.id||Ne(e.closest(ee),(e=>e.id))===this.id}submitForm(e,t,n){Ie.putPrivate(e,Z,!0),this.liveSocket.blurActiveElement(this),this.pushFormSubmit(e,t,n,(()=>{this.liveSocket.restorePreviouslyActiveFocus()}))}binding(e){return this.liveSocket.binding(e)}};function Je(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.hasAttribute(t))throw new Error("Missing attribute '".concat(t,"' on element <").concat(e.tagName,":").concat(e.id,">"));var i=e.getAttribute(t);return n?n(i):i}function et(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=e.hasAttribute(t)?e.getAttribute(t):n;return i?i(o):o}function tt(e){if("true"===e)return!0;if("false"===e)return!1;throw new Error("Invalid boolean attribute ".concat(e,', should be either "true" or "false"'))}function nt(e){var t=parseInt(e,10);if(Number.isNaN(t))throw new Error("Invalid integer value ".concat(e));return t}function it(e){return{attribute:Je(e.el,"data-update-attribute")}}const ot={mounted:function(){var e=this;this.props=it(this),this.__updateAttribute(),this.el.addEventListener("input",(function(t){e.__updateAttribute()})),this.el.addEventListener("paste",(function(e){e.preventDefault();var t=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,t)})),this.el.addEventListener("keydown",(function(t){"Enter"!==t.key&&"Escape"!==t.key||e.el.blur()})),this.el.addEventListener("focus",(function(t){e.el.setAttribute("phx-update","ignore")})),this.el.addEventListener("blur",(function(t){e.el.removeAttribute("phx-update")}))},updated:function(){this.props=it(this),this.__updateAttribute()},__updateAttribute:function(){var e=this.el.innerText.trim();this.el.setAttribute(this.props.attribute,e)}};var rt=n(158),st=n(4565);function at(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,o,r=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(i=n.next()).done)&&(r.push(i.value),!t||r.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return lt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n|[\w:]+/g)||[]}function ht(e){return e[e.length-1]}function dt(e){return""===e.trim()}const gt={autoFormatTriggerCharacters:["\n"],provideOnTypeFormattingEdits:function(e,t,n,i,o){return"\n"===n?function(e,t){var n=e.getLinesContent(),i=t.lineNumber-1,o=n[i],r=ct(n[i-1]);if(function(e,t){var n=e[t-1],i=ct(n),o=ut(n);if("do"===ht(o)||o.includes("fn")&&"->"===ht(o)){var r=e.slice(t+1).filter((function(e){return!dt(e)})).find((function(e){return ct(e)===i}));if(r){var s=at(ut(r),1)[0];if(["after","else","catch","rescue","end"].includes(s))return!1}return!0}return!1}(n,i)){var s=t.lineNumber$/,"")}))}function mt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _t(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:5e3;mt(this,e),this.client=t,this.reportRevisionTimeoutId=null,this.reportRevisionTimeout=n}return vt(e,[{key:"onClientDelta",value:function(e){return null!==this.reportRevisionTimeoutId&&(clearTimeout(this.reportRevisionTimeoutId),this.reportRevisionTimeoutId=null),this.client.sendDelta(e),new wt(this.client,e)}},{key:"onServerDelta",value:function(e){var t=this;return this.client.applyDelta(e),null===this.reportRevisionTimeoutId&&(this.reportRevisionTimeoutId=setTimeout((function(){t.client.reportCurrentRevision(),t.reportRevisionTimeoutId=null}),this.reportRevisionTimeout)),this}},{key:"onServerAcknowledgement",value:function(){throw new Error("Unexpected server acknowledgement.")}}]),e}(),wt=function(){function e(t,n){mt(this,e),this.client=t,this.awaitedDelta=n}return vt(e,[{key:"onClientDelta",value:function(e){return new Ct(this.client,this.awaitedDelta,e)}},{key:"onServerDelta",value:function(t){var n=this.awaitedDelta.transform(t,"right");this.client.applyDelta(n);var i=t.transform(this.awaitedDelta,"left");return new e(this.client,i)}},{key:"onServerAcknowledgement",value:function(){return new yt(this.client)}}]),e}(),Ct=function(){function e(t,n,i){mt(this,e),this.client=t,this.awaitedDelta=n,this.buffer=i}return vt(e,[{key:"onClientDelta",value:function(t){var n=this.buffer.compose(t);return new e(this.client,this.awaitedDelta,n)}},{key:"onServerDelta",value:function(t){var n=this.awaitedDelta.transform(t,"right"),i=this.buffer.transform(n,"right");this.client.applyDelta(i);var o=t.transform(this.awaitedDelta,"left"),r=n.transform(this.buffer,"left");return new e(this.client,o,r)}},{key:"onServerAcknowledgement",value:function(){return this.client.sendDelta(this.buffer),new wt(this.client,this.buffer)}}]),e}();function St(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xt(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[];St(this,e),this.ops=t}return kt(e,[{key:"retain",value:function(e){return e<=0?this:this.append({retain:e})}},{key:"insert",value:function(e){return""===e?this:this.append({insert:e})}},{key:"delete",value:function(e){return e<=0?this:this.append({delete:e})}},{key:"append",value:function(e){if(0===this.ops.length)return this.ops.push(e),this;var t=this.ops.pop();return Dt(e)&&At(t)?this.append(e).append(t):Dt(e)&&Dt(t)?(this.ops.push({insert:t.insert+e.insert}),this):At(e)&&At(t)?(this.ops.push({delete:t.delete+e.delete}),this):Tt(e)&&Tt(t)?(this.ops.push({retain:t.retain+e.retain}),this):(this.ops.push(t,e),this)}},{key:"compose",value:function(t){for(var n=new Nt(this.ops),i=new Nt(t.ops),o=new e;n.hasNext()||i.hasNext();)if(Dt(i.peek()))o.append(i.next());else if(At(n.peek()))o.append(n.next());else{var r=Math.min(n.peekLength(),i.peekLength()),s=n.next(r),a=i.next(r);Tt(a)?o.append(s):At(a)&&Tt(s)&&o.append(a)}return o.__trim()}},{key:"transform",value:function(t,n){if("left"!==n&&"right"!==n)throw new Error('Invalid priority "'.concat(n,'", should be either "left" or "right"'));for(var i=new Nt(this.ops),o=new Nt(t.ops),r=new e;i.hasNext()||o.hasNext();)if(!Dt(i.peek())||Dt(o.peek())&&"left"!==n)if(Dt(o.peek()))r.append(o.next());else{var s=Math.min(i.peekLength(),o.peekLength()),a=i.next(s),l=o.next(s);if(At(a))continue;At(l)?r.append(l):r.retain(s)}else{var c=Lt(i.next());r.retain(c)}return r.__trim()}},{key:"__trim",value:function(){return this.ops.length>0&&Tt(this.ops[this.ops.length-1])&&this.ops.pop(),this}},{key:"toCompressed",value:function(){return this.ops.map((function(e){if(Dt(e))return e.insert;if(Tt(e))return e.retain;if(At(e))return-e.delete;throw new Error("Invalid operation ".concat(e))}))}},{key:"applyToString",value:function(e){var t="",n=0;return this.ops.forEach((function(i){Tt(i)&&(t+=e.slice(n,n+i.retain),n+=i.retain),Dt(i)&&(t+=i.insert),At(i)&&(n+=i.delete)})),t+=e.slice(n)}}],[{key:"fromCompressed",value:function(e){return e.reduce((function(e,t){if("string"==typeof t)return e.insert(t);if("number"==typeof t&&t>=0)return e.retain(t);if("number"==typeof t&&t<0)return e.delete(-t);throw new Error("Invalid compressed operation ".concat(t))}),new this)}}]),e}(),Nt=function(){function e(t){St(this,e),this.ops=t,this.index=0,this.offset=0}return kt(e,[{key:"hasNext",value:function(){return this.peekLength()<1/0}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1/0,t=this.ops[this.index];if(!t)return{retain:e};var n=this.offset,i=Lt(t);return e>=i-n?(e=i-n,this.index+=1,this.offset=0):this.offset+=e,At(t)?{delete:e}:Tt(t)?{retain:e}:Dt(t)?{insert:t.insert.substr(n,e)}:void 0}},{key:"peek",value:function(){return this.ops[this.index]||{retain:1/0}}},{key:"peekLength",value:function(){return this.ops[this.index]?Lt(this.ops[this.index])-this.offset:1/0}}]),e}();function Lt(e){return Dt(e)?e.insert.length:Tt(e)?e.retain:At(e)?e.delete:void 0}function Dt(e){return"string"==typeof e.insert}function Tt(e){return"number"==typeof e.retain}function At(e){return"number"==typeof e.delete}function It(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n0&&e.editor.layout()}))})).observe(this.container),this.editor.onDidContentSizeChange((function(){var t=e.editor.getContentHeight();e.container.style.height="".concat(t,"px")})),function(e,t,n){var i,o=null!==(i=st.P.getCommand(t))&&void 0!==i?i:{},r=o.handler,s=o.when;r&&e._standaloneKeybindingService.addDynamicKeybinding(t,n,r,s)}(this.editor,"editor.action.showHover",pt.KeyMod.CtrlCmd|pt.KeyCode.KEY_I)}},{key:"__setupIntellisense",value:function(){var e=this;this.handlerByRef={},this.editor.getModel().__getCompletionItems=function(t,n){var i=t.getLineContent(n.lineNumber).slice(0,n.column-1);return e.__asyncIntellisenseRequest("completion",{hint:i}).then((function(e){var t;return{suggestions:(t=e.items,t.map(tn).map((function(e,n){return Zt(Zt({},e),{},{sortText:on(n,t.length)})}))).map((function(e){var t=function(e,t){for(var n=t;!e.endsWith(n);)n=n.slice(0,-1);return n.length}(i,e.insertText),o=new pt.Range(n.lineNumber,n.column-t,n.lineNumber,n.column);return Zt(Zt({},e),{},{range:o})}))}})).catch((function(){return null}))},this.editor.getModel().__getHover=function(t,n){var i=t.getLineContent(n.lineNumber),o=n.column;return e.__asyncIntellisenseRequest("details",{line:i,column:o}).then((function(e){return{contents:e.contents.map((function(e){return{value:e,isTrusted:!0}})),range:new pt.Range(n.lineNumber,e.range.from,n.lineNumber,e.range.to)}})).catch((function(){return null}))},this.editor.getModel().__getDocumentFormattingEdits=function(t){var n=t.getValue();return e.__asyncIntellisenseRequest("format",{code:n}).then((function(e){return[{range:t.getFullModelRange(),text:e.code}]})).catch((function(){return null}))},this.hook.handleEvent("intellisense_response",(function(t){var n=t.ref,i=t.response,o=e.handlerByRef[n];o&&(o(i),delete e.handlerByRef[n])}))}},{key:"__asyncIntellisenseRequest",value:function(e,t){var n=this;return new Promise((function(i,o){n.hook.pushEvent("intellisense_request",Zt({cell_id:n.cellId,type:e},t),(function(e){var t=e.ref;t?n.handlerByRef[t]=function(e){e?i(e):o(null)}:o(null)}))}))}}])&&en(t.prototype,n),e}();var sn,an="undefined"==typeof document?void 0:document,ln=!!an&&"content"in an.createElement("template"),cn=!!an&&an.createRange&&"createContextualFragment"in an.createRange();function un(e,t){var n,i,o=e.nodeName,r=t.nodeName;return o===r||(n=o.charCodeAt(0),i=r.charCodeAt(0),n<=90&&i>=97?o===r.toUpperCase():i<=90&&n>=97&&r===o.toUpperCase())}function hn(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var dn={OPTION:function(e,t){var n=e.parentNode;if(n){var i=n.nodeName.toUpperCase();"OPTGROUP"===i&&(i=(n=n.parentNode)&&n.nodeName.toUpperCase()),"SELECT"!==i||n.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}hn(e,t,"selected")},INPUT:function(e,t){hn(e,t,"checked"),hn(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var i=e.firstChild;if(i){var o=i.nodeValue;if(o==n||!n&&o==e.placeholder)return;i.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n,i,o=-1,r=0,s=e.firstChild;s;)if("OPTGROUP"===(i=s.nodeName&&s.nodeName.toUpperCase()))s=(n=s).firstChild;else{if("OPTION"===i){if(s.hasAttribute("selected")){o=r;break}r++}!(s=s.nextSibling)&&n&&(s=n.nextSibling,n=null)}e.selectedIndex=o}}};function gn(){}function pn(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}const fn=function(e,t,n){if(n||(n={}),"string"==typeof t)if("#document"===e.nodeName||"HTML"===e.nodeName||"BODY"===e.nodeName){var i=t;(t=an.createElement("html")).innerHTML=i}else o=(o=t).trim(),t=ln?function(e){var t=an.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}(o):cn?function(e){return sn||(sn=an.createRange()).selectNode(an.body),sn.createContextualFragment(e).childNodes[0]}(o):function(e){var t=an.createElement("body");return t.innerHTML=e,t.childNodes[0]}(o);var o,r=n.getNodeKey||pn,s=n.onBeforeNodeAdded||gn,a=n.onNodeAdded||gn,l=n.onBeforeElUpdated||gn,c=n.onElUpdated||gn,u=n.onBeforeNodeDiscarded||gn,h=n.onNodeDiscarded||gn,d=n.onBeforeElChildrenUpdated||gn,g=!0===n.childrenOnly,p=Object.create(null),f=[];function m(e){f.push(e)}function _(e,t){if(1===e.nodeType)for(var n=e.firstChild;n;){var i=void 0;t&&(i=r(n))?m(i):(h(n),n.firstChild&&_(n,t)),n=n.nextSibling}}function v(e,t,n){!1!==u(e)&&(t&&t.removeChild(e),h(e),_(e,n))}function b(e){a(e);for(var t=e.firstChild;t;){var n=t.nextSibling,i=r(t);if(i){var o=p[i];o&&un(t,o)?(t.parentNode.replaceChild(o,t),y(o,t)):b(t)}else b(t);t=n}}function y(e,t,n){var i=r(t);if(i&&delete p[i],!n){if(!1===l(e,t))return;if(function(e,t){var n,i,o,r,s=t.attributes;if(11!==t.nodeType&&11!==e.nodeType){for(var a=s.length-1;a>=0;a--)i=(n=s[a]).name,o=n.namespaceURI,r=n.value,o?(i=n.localName||i,e.getAttributeNS(o,i)!==r&&("xmlns"===n.prefix&&(i=n.name),e.setAttributeNS(o,i,r))):e.getAttribute(i)!==r&&e.setAttribute(i,r);for(var l=e.attributes,c=l.length-1;c>=0;c--)i=(n=l[c]).name,(o=n.namespaceURI)?(i=n.localName||i,t.hasAttributeNS(o,i)||e.removeAttributeNS(o,i)):t.hasAttribute(i)||e.removeAttribute(i)}}(e,t),c(e),!1===d(e,t))return}"TEXTAREA"!==e.nodeName?function(e,t){var n,i,o,a,l,c=t.firstChild,u=e.firstChild;e:for(;c;){for(a=c.nextSibling,n=r(c);u;){if(o=u.nextSibling,c.isSameNode&&c.isSameNode(u)){c=a,u=o;continue e}i=r(u);var h=u.nodeType,d=void 0;if(h===c.nodeType&&(1===h?(n?n!==i&&((l=p[n])?o===l?d=!1:(e.insertBefore(l,u),i?m(i):v(u,e,!0),u=l):d=!1):i&&(d=!1),(d=!1!==d&&un(u,c))&&y(u,c)):3!==h&&8!=h||(d=!0,u.nodeValue!==c.nodeValue&&(u.nodeValue=c.nodeValue))),d){c=a,u=o;continue e}i?m(i):v(u,e,!0),u=o}if(n&&(l=p[n])&&un(l,c))e.appendChild(l),y(l,c);else{var g=s(c);!1!==g&&(g&&(c=g),c.actualize&&(c=c.actualize(e.ownerDocument||an)),e.appendChild(c),b(c))}c=a,u=o}!function(e,t,n){for(;t;){var i=t.nextSibling;(n=r(t))?m(n):v(t,e,!0),t=i}}(e,u,i);var f=dn[e.nodeName];f&&f(e,t)}(e,t):dn.TEXTAREA(e,t)}!function e(t){if(1===t.nodeType||11===t.nodeType)for(var n=t.firstChild;n;){var i=r(n);i&&(p[i]=n),e(n),n=n.nextSibling}}(e);var w,C,S=e,x=S.nodeType,k=t.nodeType;if(!g)if(1===x)1===k?un(e,t)||(h(e),S=function(e,t){for(var n=e.firstChild;n;){var i=n.nextSibling;t.appendChild(n),n=i}return t}(e,(w=t.nodeName,(C=t.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==C?an.createElementNS(C,w):an.createElement(w)))):S=t;else if(3===x||8===x){if(k===x)return S.nodeValue!==t.nodeValue&&(S.nodeValue=t.nodeValue),S;S=t}if(S===t)h(e);else{if(t.isSameNode&&t.isSameNode(S))return;if(y(S,t,g),f)for(var E=0,N=f.length;Ee.length){for(;n--;)if(47===e.charCodeAt(n)){if(o){s=n+1;break}}else a<0&&(o=!0,a=n+1);return a<0?"":e.slice(s,a)}if(t===e)return"";for(i=-1,r=t.length-1;n--;)if(47===e.charCodeAt(n)){if(o){s=n+1;break}}else i<0&&(o=!0,i=n+1),r>-1&&(e.charCodeAt(n)===t.charCodeAt(r--)?r<0&&(a=n):(r=-1,a=i));return s===a?a=i:a<0&&(a=e.length),e.slice(s,a)},Cn=function(e){var t,n,i;if(En(e),0===e.length)return".";for(t=-1,i=e.length;--i;)if(47===e.charCodeAt(i)){if(n){t=i;break}}else n||(n=!0);return t<0?47===e.charCodeAt(0)?"/":".":1===t&&47===e.charCodeAt(0)?"//":e.slice(0,t)},Sn=function(e){var t,n,i,o=-1,r=0,s=-1,a=0;for(En(e),i=e.length;i--;)if(47!==(n=e.charCodeAt(i)))s<0&&(t=!0,s=i+1),46===n?o<0?o=i:1!==a&&(a=1):o>-1&&(a=-1);else if(t){r=i+1;break}return o<0||s<0||0===a||1===a&&o===s-1&&o===r+1?"":e.slice(o,s)},xn=function(...e){for(var t,n=-1;++n2){if((i=o.lastIndexOf("/"))!==o.length-1){i<0?(o="",r=0):r=(o=o.slice(0,i)).length-1-o.lastIndexOf("/"),s=l,a=0;continue}}else if(o.length>0){o="",r=0,s=l,a=0;continue}t&&(o=o.length>0?o+"/..":"..",r=2)}else o.length>0?o+="/"+e.slice(s+1,l):o=e.slice(s+1,l),r=l-s-1;s=l,a=0}else 46===n&&a>-1?a++:a=-1}return o}(e,!t)).length||t||(n="."),n.length>0&&47===e.charCodeAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},kn="/";function En(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Nn=function(){return"/"};var Ln={}.hasOwnProperty;function Dn(e){return e&&"object"==typeof e?Ln.call(e,"position")||Ln.call(e,"type")?An(e.position):Ln.call(e,"start")||Ln.call(e,"end")?An(e):Ln.call(e,"line")||Ln.call(e,"column")?Tn(e):"":""}function Tn(e){return In(e&&e.line)+":"+In(e&&e.column)}function An(e){return Tn(e&&e.start)+"-"+Tn(e&&e.end)}function In(e){return e&&"number"==typeof e?e:1}class Mn extends Error{constructor(e,t,n){var i,o=[null,null],r={start:{line:null,column:null},end:{line:null,column:null}};super(),"string"==typeof t&&(n=t,t=null),"string"==typeof n&&(-1===(i=n.indexOf(":"))?o[1]=n:(o[0]=n.slice(0,i),o[1]=n.slice(i+1))),t&&("type"in t||"position"in t?t.position&&(r=t.position):"start"in t||"end"in t?r=t:("line"in t||"column"in t)&&(r.start=t)),this.name=Dn(t)||"1:1",this.message="object"==typeof e?e.message:e,this.stack="object"==typeof e?e.stack:"",this.reason=this.message,this.line=r.start.line,this.column=r.start.column,this.source=o[0],this.ruleId=o[1],this.position=r,this.file,this.fatal,this.url,this.note}}Mn.prototype.file="",Mn.prototype.name="",Mn.prototype.reason="",Mn.prototype.message="",Mn.prototype.stack="",Mn.prototype.fatal=null,Mn.prototype.column=null,Mn.prototype.line=null,Mn.prototype.source=null,Mn.prototype.ruleId=null,Mn.prototype.position=null;var On=["history","path","basename","stem","extname","dirname"];class Rn{constructor(e){var t,n,i=-1;for(t=e?"string"==typeof e||yn(e)?{value:e}:e:{},this.data={},this.messages=[],this.history=[],this.cwd=Nn(),this.value,this.stored,this.result;++it.length;let s;r&&t.push(i);try{s=e(...t)}catch(e){const t=e;if(r&&n)throw t;return i(t)}r||(s instanceof Promise?s.then(o,i):s instanceof Error?i(s):o(s))};function i(e,...i){n||(n=!0,t(e,...i))}function o(e){i(null,e)}}(a,o)(...s):i(null,...s)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}(),n=[];let i,o={},r=-1;return s.data=function(e,t){return"string"==typeof e?2===arguments.length?($n("data",i),o[e]=t,s):zn.call(o,e)&&o[e]||null:e?($n("data",i),o=e,s):o},s.Parser=void 0,s.Compiler=void 0,s.freeze=function(){if(i)return s;for(;++r{if(!e&&t&&n){const i=s.stringify(t,n);null==i||(function(e){return"string"==typeof e||_n(e)}(i)?n.value=i:n.result=i),r(e,n)}else r(e)}))}n(null,t)},s.processSync=function(e){let t;s.freeze(),Vn("processSync",s.Parser),Un("processSync",s.Compiler);const n=Kn(e);return s.process(n,(function(e){t=!0,mn(e)})),qn("processSync","process",t),n},s;function s(){const t=e();let i=-1;for(;++io?0:o+t:t>o?o:t,n=n>0?n:0,i.length<1e4)r=Array.from(i),r.unshift(t,n),[].splice.apply(e,r);else for(n&&[].splice.apply(e,[t,n]);s0?(Qn(e,e.length,0,t),e):t}const Zn={}.hasOwnProperty;function Jn(e){const t={};let n=-1;for(;++nr))return;const n=t.events.length;let o,a,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){a=t.events[l][1].end;break}o=!0}for(_(s),e=n;ei;){const i=n[o];t.containerState=i[1],i[0].exit.call(t,e)}n.length=i}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}},bi={tokenize:function(e,t,n){return mi(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},yi={tokenize:function(e,t,n){return mi(e,(function(e){return null===e||hi(e)?t(e):n(e)}),"linePrefix")},partial:!0};function wi(e){const t={};let n,i,o,r,s,a,l,c=-1;for(;++c=4?t(o):e.interrupt(i.parser.constructs.flow,n,t)(o)}},partial:!0},ki={tokenize:function(e){const t=this,n=e.attempt(yi,(function(i){if(null!==i)return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n;e.consume(i)}),e.attempt(this.parser.constructs.flowInitial,i,mi(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Si,i)),"linePrefix")));return n;function i(i){if(null!==i)return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(i)}}},Ei={resolveAll:Ti()},Ni=Di("string"),Li=Di("text");function Di(e){return{tokenize:function(t){const n=this,i=this.parser.constructs[e],o=t.attempt(i,r,s);return r;function r(e){return l(e)?o(e):s(e)}function s(e){if(null!==e)return t.enter("data"),t.consume(e),a;t.consume(e)}function a(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),a)}function l(e){if(null===e)return!0;const t=i[e];let o=-1;if(t)for(;++o-1&&(s[0]=s[0].slice(i)),r>0&&s.push(e[o].slice(0,r))),s}(s,e)}function p(){return Object.assign({},i)}function f(e){l=void 0,h=e,d=d(e)}function m(e,t){t.restore()}function _(e,t){return function(n,o,r){let s,h,d,g;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){return function(t){const n=null!==t&&e[t],i=null!==t&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(i)?i:i?[i]:[]])(t)}}(n);function f(e){return s=e,h=0,0===e.length?r:m(e[h])}function m(e){return function(n){return g=function(){const e=p(),t=u.previous,n=u.currentConstruct,o=u.events.length,r=Array.from(a);return{restore:function(){i=e,u.previous=t,u.currentConstruct=n,u.events.length=o,a=r,b()},from:o}}(),d=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(t?Object.assign(Object.create(u),t):u,c,_,v)(n)}}function _(t){return l=!0,e(d,g),o}function v(e){return l=!0,g.restore(),++hc?n(o):(e.consume(o),p):41===o?u--?(e.consume(o),p):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(i),t(o)):null===o||ui(o)?u?n(o):(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(i),t(o)):ci(o)?n(o):(e.consume(o),92===o?f:p)}function f(t){return 40===t||41===t||92===t?(e.consume(t),p):p(t)}}function zi(e,t,n,i,o,r){const s=this;let a,l=0;return function(t){return e.enter(i),e.enter(o),e.consume(t),e.exit(o),e.enter(r),c};function c(h){return null===h||91===h||93===h&&!a||94===h&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs||l>999?n(h):93===h?(e.exit(r),e.enter(o),e.consume(h),e.exit(o),e.exit(i),t):hi(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(t){return null===t||91===t||93===t||hi(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),a=a||!di(t),92===t?h:u)}function h(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function Wi(e,t,n,i,o,r){let s;return function(t){return e.enter(i),e.enter(o),e.consume(t),e.exit(o),s=40===t?41:t,a};function a(n){return n===s?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),t):(e.enter(r),l(n))}function l(t){return t===s?(e.exit(r),a(s)):null===t?n(t):hi(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mi(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===s||null===t||hi(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===s||92===t?(e.consume(t),c):c(t)}}function Vi(e,t){let n;return function i(o){return hi(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):di(o)?mi(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}function Ui(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const $i={name:"definition",tokenize:function(e,t,n){const i=this;let o;return function(t){return e.enter("definition"),zi.call(i,e,r,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)};function r(t){return o=Ui(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),Vi(e,Hi(e,e.attempt(ji,mi(e,s,"whitespace"),mi(e,s,"whitespace")),n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString"))):n(t)}function s(r){return null===r||hi(r)?(e.exit("definition"),i.parser.defined.includes(o)||i.parser.defined.push(o),t(r)):n(r)}}},ji={tokenize:function(e,t,n){return function(t){return ui(t)?Vi(e,i)(t):n(t)};function i(t){return 34===t||39===t||40===t?Wi(e,mi(e,o,"whitespace"),n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t):n(t)}function o(e){return null===e||hi(e)?t(e):n(e)}},partial:!0},qi={name:"codeIndented",tokenize:function(e,t,n){const i=this;return function(t){return e.enter("codeIndented"),mi(e,o,"linePrefix",5)(t)};function o(e){const t=i.events[i.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?r(e):n(e)}function r(t){return null===t?a(t):hi(t)?e.attempt(Ki,r,a)(t):(e.enter("codeFlowValue"),s(t))}function s(t){return null===t||hi(t)?(e.exit("codeFlowValue"),r(t)):(e.consume(t),s)}function a(n){return e.exit("codeIndented"),t(n)}}},Ki={tokenize:function(e,t,n){const i=this;return o;function o(t){return i.parser.lazy[i.now().line]?n(t):hi(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):mi(e,r,"linePrefix",5)(t)}function r(e){const r=i.events[i.events.length-1];return r&&"linePrefix"===r[1].type&&r[2].sliceSerialize(r[1],!0).length>=4?t(e):hi(e)?o(e):n(e)}},partial:!0},Gi={name:"setextUnderline",tokenize:function(e,t,n){const i=this;let o,r,s=i.events.length;for(;s--;)if("lineEnding"!==i.events[s][1].type&&"linePrefix"!==i.events[s][1].type&&"content"!==i.events[s][1].type){r="paragraph"===i.events[s][1].type;break}return function(t){return i.parser.lazy[i.now().line]||!i.interrupt&&!r?n(t):(e.enter("setextHeadingLine"),e.enter("setextHeadingLineSequence"),o=t,a(t))};function a(t){return t===o?(e.consume(t),a):(e.exit("setextHeadingLineSequence"),mi(e,l,"lineSuffix")(t))}function l(i){return null===i||hi(i)?(e.exit("setextHeadingLine"),t(i)):n(i)}},resolveTo:function(e,t){let n,i,o,r=e.length;for(;r--;)if("enter"===e[r][0]){if("content"===e[r][1].type){n=r;break}"paragraph"===e[r][1].type&&(i=r)}else"content"===e[r][1].type&&e.splice(r,1),o||"definition"!==e[r][1].type||(o=r);const s={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[o][1].end)):e[n][1]=s,e.push(["exit",s,t]),e}},Yi=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Qi=["pre","script","style","textarea"],Xi={name:"htmlFlow",tokenize:function(e,t,n){const i=this;let o,r,s,a,l;return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c};function c(a){return 33===a?(e.consume(a),u):47===a?(e.consume(a),g):63===a?(e.consume(a),o=3,i.interrupt?t:O):ii(a)?(e.consume(a),s=String.fromCharCode(a),r=!0,p):n(a)}function u(r){return 45===r?(e.consume(r),o=2,h):91===r?(e.consume(r),o=5,s="CDATA[",a=0,d):ii(r)?(e.consume(r),o=4,i.interrupt?t:O):n(r)}function h(o){return 45===o?(e.consume(o),i.interrupt?t:O):n(o)}function d(o){return o===s.charCodeAt(a++)?(e.consume(o),a===s.length?i.interrupt?t:E:d):n(o)}function g(t){return ii(t)?(e.consume(t),s=String.fromCharCode(t),p):n(t)}function p(a){return null===a||47===a||62===a||ui(a)?47!==a&&r&&Qi.includes(s.toLowerCase())?(o=1,i.interrupt?t(a):E(a)):Yi.includes(s.toLowerCase())?(o=6,47===a?(e.consume(a),f):i.interrupt?t(a):E(a)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(a):r?_(a):m(a)):45===a||si(a)?(e.consume(a),s+=String.fromCharCode(a),p):n(a)}function f(o){return 62===o?(e.consume(o),i.interrupt?t:E):n(o)}function m(t){return di(t)?(e.consume(t),m):x(t)}function _(t){return 47===t?(e.consume(t),x):58===t||95===t||ii(t)?(e.consume(t),v):di(t)?(e.consume(t),_):x(t)}function v(t){return 45===t||46===t||58===t||95===t||si(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),y):di(t)?(e.consume(t),b):_(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,w):di(t)?(e.consume(t),y):(l=null,C(t))}function w(t){return null===t||hi(t)?n(t):t===l?(e.consume(t),S):(e.consume(t),w)}function C(t){return null===t||34===t||39===t||60===t||61===t||62===t||96===t||ui(t)?b(t):(e.consume(t),C)}function S(e){return 47===e||62===e||di(e)?_(e):n(e)}function x(t){return 62===t?(e.consume(t),k):n(t)}function k(t){return di(t)?(e.consume(t),k):null===t||hi(t)?E(t):n(t)}function E(t){return 45===t&&2===o?(e.consume(t),T):60===t&&1===o?(e.consume(t),A):62===t&&4===o?(e.consume(t),R):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),M):!hi(t)||6!==o&&7!==o?null===t||hi(t)?N(t):(e.consume(t),E):e.check(Zi,R,N)(t)}function N(t){return e.exit("htmlFlowData"),L(t)}function L(t){return null===t?P(t):hi(t)?e.attempt({tokenize:D,partial:!0},L,P)(t):(e.enter("htmlFlowData"),E(t))}function D(e,t,n){return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return i.parser.lazy[i.now().line]?n(e):t(e)}}function T(t){return 45===t?(e.consume(t),O):E(t)}function A(t){return 47===t?(e.consume(t),s="",I):E(t)}function I(t){return 62===t&&Qi.includes(s.toLowerCase())?(e.consume(t),R):ii(t)&&s.length<8?(e.consume(t),s+=String.fromCharCode(t),I):E(t)}function M(t){return 93===t?(e.consume(t),O):E(t)}function O(t){return 62===t?(e.consume(t),R):E(t)}function R(t){return null===t||hi(t)?(e.exit("htmlFlowData"),P(t)):(e.consume(t),R)}function P(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},concrete:!0},Zi={tokenize:function(e,t,n){return function(i){return e.exit("htmlFlowData"),e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),e.attempt(yi,t,n)}},partial:!0},Ji={name:"codeFenced",tokenize:function(e,t,n){const i=this,o={tokenize:function(e,t,n){let i=0;return mi(e,(function(t){return e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),o(t)}),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function o(t){return t===l?(e.consume(t),i++,o):i1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const h=Object.assign({},e[n][1].end),d=Object.assign({},e[u][1].start);ho(h,-a),ho(d,a),r={type:a>1?"strongSequence":"emphasisSequence",start:h,end:Object.assign({},e[n][1].end)},s={type:a>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[u][1].start),end:d},o={type:a>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[u][1].start)},i={type:a>1?"strong":"emphasis",start:Object.assign({},r.start),end:Object.assign({},s.end)},e[n][1].end=Object.assign({},r.start),e[u][1].start=Object.assign({},s.end),l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=Xn(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=Xn(l,[["enter",i,t],["enter",r,t],["exit",r,t],["enter",o,t]]),l=Xn(l,Ii(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=Xn(l,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=Xn(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,Qn(e,n-1,u-n+3,l),u=n+l.length-c-2;break}for(u=-1;++ur&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(r===o-1||o-4>r&&"whitespace"===e[o-2][1].type)&&(o-=r+1===o?2:4),o>r&&(n={type:"atxHeadingText",start:e[r][1].start,end:e[o][1].end},i={type:"chunkText",start:e[r][1].start,end:e[o][1].end,contentType:"text"},Qn(e,r,o-r+1,[["enter",n,t],["enter",i,t],["exit",i,t],["exit",n,t]])),e}},42:Oi,45:[Gi,Oi],60:Xi,61:Gi,95:Oi,96:Ji,126:Ji},_o={38:no,92:io},vo={[-5]:oo,[-4]:oo,[-3]:oo,33:{name:"labelStartImage",tokenize:function(e,t,n){const i=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),r):n(t)}function r(e){return 94===e&&"_hiddenFootnoteSupport"in i.parser.constructs?n(e):t(e)}},resolveAll:ro.resolveAll},38:no,42:uo,60:[{name:"autolink",tokenize:function(e,t,n){let i=1;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return ii(t)?(e.consume(t),r):li(t)?l(t):n(t)}function r(e){return 43===e||45===e||46===e||si(e)?s(e):l(e)}function s(t){return 58===t?(e.consume(t),a):(43===t||45===t||46===t||si(t))&&i++<32?(e.consume(t),s):l(t)}function a(t){return 62===t?(e.exit("autolinkProtocol"),d(t)):null===t||32===t||60===t||ci(t)?n(t):(e.consume(t),a)}function l(t){return 64===t?(e.consume(t),i=0,c):li(t)?(e.consume(t),l):n(t)}function c(e){return si(e)?u(e):n(e)}function u(t){return 46===t?(e.consume(t),i=0,c):62===t?(e.exit("autolinkProtocol").type="autolinkEmail",d(t)):h(t)}function h(t){return(45===t||si(t))&&i++<63?(e.consume(t),45===t?h:u):n(t)}function d(n){return e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t}}},{name:"htmlText",tokenize:function(e,t,n){const i=this;let o,r,s,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),l};function l(t){return 33===t?(e.consume(t),c):47===t?(e.consume(t),C):63===t?(e.consume(t),y):ii(t)?(e.consume(t),k):n(t)}function c(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),r="CDATA[",s=0,f):ii(t)?(e.consume(t),b):n(t)}function u(t){return 45===t?(e.consume(t),h):n(t)}function h(t){return null===t||62===t?n(t):45===t?(e.consume(t),d):g(t)}function d(e){return null===e||62===e?n(e):g(e)}function g(t){return null===t?n(t):45===t?(e.consume(t),p):hi(t)?(a=g,M(t)):(e.consume(t),g)}function p(t){return 45===t?(e.consume(t),R):g(t)}function f(t){return t===r.charCodeAt(s++)?(e.consume(t),s===r.length?m:f):n(t)}function m(t){return null===t?n(t):93===t?(e.consume(t),_):hi(t)?(a=m,M(t)):(e.consume(t),m)}function _(t){return 93===t?(e.consume(t),v):m(t)}function v(t){return 62===t?R(t):93===t?(e.consume(t),v):m(t)}function b(t){return null===t||62===t?R(t):hi(t)?(a=b,M(t)):(e.consume(t),b)}function y(t){return null===t?n(t):63===t?(e.consume(t),w):hi(t)?(a=y,M(t)):(e.consume(t),y)}function w(e){return 62===e?R(e):y(e)}function C(t){return ii(t)?(e.consume(t),S):n(t)}function S(t){return 45===t||si(t)?(e.consume(t),S):x(t)}function x(t){return hi(t)?(a=x,M(t)):di(t)?(e.consume(t),x):R(t)}function k(t){return 45===t||si(t)?(e.consume(t),k):47===t||62===t||ui(t)?E(t):n(t)}function E(t){return 47===t?(e.consume(t),R):58===t||95===t||ii(t)?(e.consume(t),N):hi(t)?(a=E,M(t)):di(t)?(e.consume(t),E):R(t)}function N(t){return 45===t||46===t||58===t||95===t||si(t)?(e.consume(t),N):L(t)}function L(t){return 61===t?(e.consume(t),D):hi(t)?(a=L,M(t)):di(t)?(e.consume(t),L):E(t)}function D(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,T):hi(t)?(a=D,M(t)):di(t)?(e.consume(t),D):(e.consume(t),o=void 0,I)}function T(t){return t===o?(e.consume(t),A):null===t?n(t):hi(t)?(a=T,M(t)):(e.consume(t),T)}function A(e){return 62===e||47===e||ui(e)?E(e):n(e)}function I(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):62===t||ui(t)?E(t):(e.consume(t),I)}function M(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mi(e,O,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function O(t){return e.enter("htmlTextData"),a(t)}function R(i){return 62===i?(e.consume(i),e.exit("htmlTextData"),e.exit("htmlText"),t):n(i)}}}],91:{name:"labelStartLink",tokenize:function(e,t,n){const i=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in i.parser.constructs?n(e):t(e)}},resolveAll:ro.resolveAll},92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.enter("escapeMarker"),e.consume(t),i};function i(i){return hi(i)?(e.exit("escapeMarker"),e.exit("hardBreakEscape"),t(i)):n(i)}}},io],93:ro,95:uo,96:{name:"codeText",tokenize:function(e,t,n){let i,o,r=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),s(t)};function s(t){return 96===t?(e.consume(t),r++,s):(e.exit("codeTextSequence"),a(t))}function a(t){return null===t?n(t):96===t?(o=e.enter("codeTextSequence"),i=0,c(t)):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):hi(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||hi(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}},resolve:function(e){let t,n,i=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[i][1].type&&"space"!==e[i][1].type))for(t=o;++t13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||65535==(65535&n)||65534==(65535&n)||n>1114111?"�":String.fromCharCode(n)}(t,"characterReferenceMarkerNumeric"===n?10:16),o("characterReferenceType")):i=to(t);const a=this.stack.pop();a.value+=i,a.position.end=s(e.end)},codeFenced:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),o("flowCodeInside")})),codeFencedFence:function(){r("flowCodeInside")||(this.buffer(),o("flowCodeInside",!0))},codeFencedFenceInfo:function(){const e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){const e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:p,codeIndented:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")})),codeText:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),codeTextData:p,data:p,definition:u(),definitionDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){const t=this.resume();this.stack[this.stack.length-1].label=t,this.stack[this.stack.length-1].identifier=Ui(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:u(),hardBreakEscape:u(f),hardBreakTrailing:u(f),htmlFlow:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlFlowData:p,htmlText:u((function(){const e=this.resume();this.stack[this.stack.length-1].value=e})),htmlTextData:p,image:u((function(){const e=this.stack[this.stack.length-1];r("inReference")?(e.type+="Reference",e.referenceType=r("referenceType")||"shortcut",delete e.url,delete e.title):(delete e.identifier,delete e.label,delete e.referenceType),o("referenceType")})),label:function(){const e=this.stack[this.stack.length-1],t=this.resume();this.stack[this.stack.length-1].label=t,o("inReference",!0),"link"===this.stack[this.stack.length-1].type?this.stack[this.stack.length-1].children=e.children:this.stack[this.stack.length-1].alt=t},labelText:function(e){this.stack[this.stack.length-2].identifier=Ui(this.sliceSerialize(e)).toLowerCase()},lineEnding:function(e){const n=this.stack[this.stack.length-1];if(r("atHardBreak"))return n.children[n.children.length-1].position.end=s(e.end),void o("atHardBreak");!r("setextHeadingSlurpLineEnding")&&t.canContainEols.includes(n.type)&&(g.call(this,e),p.call(this,e))},link:u((function(){const e=this.stack[this.stack.length-1];r("inReference")?(e.type+="Reference",e.referenceType=r("referenceType")||"shortcut",delete e.url,delete e.title):(delete e.identifier,delete e.label,delete e.referenceType),o("referenceType")})),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:function(e){const t=this.resume();this.stack[this.stack.length-1].label=t,this.stack[this.stack.length-1].identifier=Ui(this.sliceSerialize(e)).toLowerCase(),o("referenceType","full")},resourceDestinationString:function(){const e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){const e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){o("inReference")},setextHeading:u((function(){o("setextHeadingSlurpLineEnding")})),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).charCodeAt(0)?1:2},setextHeadingText:function(){o("setextHeadingSlurpLineEnding",!0)},strong:u(),thematicBreak:u()}},e.mdastExtensions||[]),n={};return function(e){let n={type:"root",children:[]};const a=[],u=[],g={stack:[n],tokenStack:a,config:t,enter:c,exit:h,buffer:l,resume:d,setData:o,getData:r};let p=-1;for(;++p0)throw new Error("Cannot close document, a token (`"+a[a.length-1].type+"`, "+Dn({start:a[a.length-1].start,end:a[a.length-1].end})+") is still open");for(n.position={start:s(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:s(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p{const n=this.data("settings");return So(t,Object.assign({},n,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})},No={tokenize:function(e,t,n){return function(t){return e.consume(t),i};function i(t){return 87===t||119===t?(e.consume(t),o):n(t)}function o(t){return 87===t||119===t?(e.consume(t),r):n(t)}function r(t){return 46===t?(e.consume(t),s):n(t)}function s(e){return null===e||hi(e)?n(e):t(e)}},partial:!0},Lo={tokenize:function(e,t,n){let i,o;return r;function r(t){return 38===t?e.check(Ao,a,s)(t):46===t||95===t?e.check(To,a,s)(t):null===t||ci(t)||gi(t)||45!==t&&pi(t)?a(t):(e.consume(t),r)}function s(t){return 46===t?(o=i,i=void 0,e.consume(t),r):(95===t&&(i=!0),e.consume(t),r)}function a(e){return o||i?n(e):t(e)}},partial:!0},Do={tokenize:function(e,t){let n=0;return i;function i(s){return 38===s?e.check(Ao,t,o)(s):(40===s&&n++,41===s?e.check(To,r,o)(s):Ho(s)?t(s):Bo(s)?e.check(To,t,o)(s):(e.consume(s),i))}function o(t){return e.consume(t),i}function r(e){return n--,n<0?t(e):o(e)}},partial:!0},To={tokenize:function(e,t,n){return function(t){return e.consume(t),i};function i(o){return Bo(o)?(e.consume(o),i):Ho(o)?t(o):n(o)}},partial:!0},Ao={tokenize:function(e,t,n){return function(t){return e.consume(t),i};function i(t){return ii(t)?(e.consume(t),i):59===t?(e.consume(t),o):n(t)}function o(e){return Ho(e)?t(e):n(e)}},partial:!0},Io={tokenize:function(e,t,n){const i=this;return function(t){return 87!==t&&119!==t||!Wo(i.previous)||$o(i.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(No,e.attempt(Lo,e.attempt(Do,o),n),n)(t))};function o(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:Wo},Mo={tokenize:function(e,t,n){const i=this;return function(t){return 72!==t&&104!==t||!Vo(i.previous)||$o(i.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),e.consume(t),o)};function o(t){return 84===t||116===t?(e.consume(t),r):n(t)}function r(t){return 84===t||116===t?(e.consume(t),s):n(t)}function s(t){return 80===t||112===t?(e.consume(t),a):n(t)}function a(t){return 83===t||115===t?(e.consume(t),l):l(t)}function l(t){return 58===t?(e.consume(t),c):n(t)}function c(t){return 47===t?(e.consume(t),u):n(t)}function u(t){return 47===t?(e.consume(t),h):n(t)}function h(t){return null===t||ci(t)||gi(t)||pi(t)?n(t):e.attempt(Lo,e.attempt(Do,d),n)(t)}function d(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:Vo},Oo={tokenize:function(e,t,n){const i=this;let o,r;return function(t){return zo(t)&&Uo(i.previous)&&!$o(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(t)):n(t)};function s(t){return zo(t)?(e.consume(t),s):64===t?(e.consume(t),a):n(t)}function a(t){return 46===t?e.check(To,h,l)(t):45===t||95===t?e.check(To,n,c)(t):si(t)?(!r&&oi(t)&&(r=!0),e.consume(t),a):h(t)}function l(t){return e.consume(t),o=!0,r=void 0,a}function c(t){return e.consume(t),u}function u(t){return 46===t?e.check(To,n,l)(t):a(t)}function h(i){return o&&!r?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(i)):n(i)}},previous:Uo},Ro={},Po={text:Ro};let Fo=48;for(;Fo<123;)Ro[Fo]=Oo,Fo++,58===Fo?Fo=65:91===Fo&&(Fo=97);function Bo(e){return 33===e||34===e||39===e||41===e||42===e||44===e||46===e||58===e||59===e||60===e||63===e||95===e||126===e}function Ho(e){return null===e||60===e||ui(e)}function zo(e){return 43===e||45===e||46===e||95===e||si(e)}function Wo(e){return null===e||40===e||42===e||95===e||126===e||ui(e)}function Vo(e){return null===e||!ii(e)}function Uo(e){return 47!==e&&Vo(e)}function $o(e){let t=e.length,n=!1;for(;t--;){const i=e[t][1];if(("labelLink"===i.type||"labelImage"===i.type)&&!i._balanced){n=!0;break}if(i._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}Ro[43]=Oo,Ro[45]=Oo,Ro[46]=Oo,Ro[95]=Oo,Ro[72]=[Oo,Mo],Ro[104]=[Oo,Mo],Ro[87]=[Oo,Io],Ro[119]=[Oo,Io];const jo={'"':"quot","&":"amp","<":"lt",">":"gt"};const qo={exit:{literalAutolinkEmail:function(e){Ko.call(this,e,"mailto:")},literalAutolinkHttp:function(e){Ko.call(this,e)},literalAutolinkWww:function(e){Ko.call(this,e,"http://")}}};function Ko(e,t){const n=this.sliceSerialize(e);this.tag(']/g,(function(e){return"&"+jo[e]+";"}))}(function(e){const t=[];let n=-1,i=0,o=0;for(;++n55295&&r<57344){const t=e.charCodeAt(n+1);r<56320&&t>56319&&t<57344?(s=String.fromCharCode(r,t),o=1):s="�"}else s=String.fromCharCode(r);s&&(t.push(e.slice(i,n),encodeURIComponent(s)),i=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(i)}(e||""));if(!t)return n;const i=n.indexOf(":"),o=n.indexOf("?"),r=n.indexOf("#"),s=n.indexOf("/");return i<0||s>-1&&i>s||o>-1&&i>o||r>-1&&i>r||t.test(n.slice(0,i))?n:""}((t||"")+n)+'">'),this.raw(this.encode(n)),this.tag("")}function Go(e={}){let t=e.singleTilde;const n={tokenize:function(e,n,i){const o=this.previous,r=this.events;let s=0;return function(t){return 126!==t||126===o&&"characterEscape"!==r[r.length-1][1].type?i(t):(e.enter("strikethroughSequenceTemporary"),a(t))};function a(r){const l=co(o);if(126===r)return s>1?i(r):(e.consume(r),s++,a);if(s<2&&!t)return i(r);const c=e.exit("strikethroughSequenceTemporary"),u=co(r);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(r)}},resolveAll:function(e,t){let n,i,o,r,s=-1;for(;++s")}},exit:{strikethrough(){this.tag("")}}},Qo={flow:{null:{tokenize:function(e,t,n){const i=this,o=[];let r,s,a=0;return function(t){return e.enter("table")._align=o,e.enter("tableHead"),e.enter("tableRow"),124===t?l(t):(a++,e.enter("temporaryTableCellContent"),h(t))};function l(t){return e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,c}function c(t){return null===t||hi(t)?function(t){return null===t?n(t):(e.exit("tableRow"),e.exit("tableHead"),e.attempt({tokenize:T,partial:!0},g,n)(t))}(t):di(t)?(e.enter("whitespace"),e.consume(t),u):(r&&(r=void 0,a++),124===t?l(t):(e.enter("temporaryTableCellContent"),h(t)))}function u(t){return di(t)?(e.consume(t),u):(e.exit("whitespace"),c(t))}function h(t){return null===t||124===t||ui(t)?(e.exit("temporaryTableCellContent"),c(t)):(e.consume(t),92===t?d:h)}function d(t){return 92===t||124===t?(e.consume(t),h):h(t)}function g(t){return e.check(Xo,n,mi(e,p,"linePrefix",4))(t)}function p(t){return null===t||ui(t)?n(t):(e.enter("tableDelimiterRow"),f(t))}function f(t){return null===t||hi(t)?y(t):di(t)?(e.enter("whitespace"),e.consume(t),m):45===t?(e.enter("tableDelimiterFiller"),e.consume(t),s=!0,o.push(null),_):58===t?(e.enter("tableDelimiterAlignment"),e.consume(t),e.exit("tableDelimiterAlignment"),o.push("left"),v):124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),f):n(t)}function m(t){return di(t)?(e.consume(t),m):(e.exit("whitespace"),f(t))}function _(t){return 45===t?(e.consume(t),_):(e.exit("tableDelimiterFiller"),58===t?(e.enter("tableDelimiterAlignment"),e.consume(t),e.exit("tableDelimiterAlignment"),o[o.length-1]="left"===o[o.length-1]?"center":"right",b):f(t))}function v(t){return 45===t?(e.enter("tableDelimiterFiller"),e.consume(t),s=!0,_):n(t)}function b(t){return null===t||hi(t)?y(t):di(t)?(e.enter("whitespace"),e.consume(t),m):124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),f):n(t)}function y(t){return e.exit("tableDelimiterRow"),s&&a===o.length?null===t?w(t):e.check(Zo,w,e.attempt({tokenize:T,partial:!0},mi(e,C,"linePrefix",4),w))(t):n(t)}function w(n){return e.exit("table"),t(n)}function C(t){return e.enter("tableBody"),S(t)}function S(t){return e.enter("tableRow"),124===t?x(t):(e.enter("temporaryTableCellContent"),N(t))}function x(t){return e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),k}function k(t){return null===t||hi(t)?function(t){return e.exit("tableRow"),null===t?D(t):e.check(Zo,D,e.attempt({tokenize:T,partial:!0},mi(e,S,"linePrefix",4),D))(t)}(t):di(t)?(e.enter("whitespace"),e.consume(t),E):124===t?x(t):(e.enter("temporaryTableCellContent"),N(t))}function E(t){return di(t)?(e.consume(t),E):(e.exit("whitespace"),k(t))}function N(t){return null===t||124===t||ui(t)?(e.exit("temporaryTableCellContent"),k(t)):(e.consume(t),92===t?L:N)}function L(t){return 92===t||124===t?(e.consume(t),N):N(t)}function D(t){return e.exit("tableBody"),w(t)}function T(e,t,n){return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return i.parser.lazy[i.now().line]?n(e):t(e)}}},resolve:function(e,t){let n,i,o,r,s,a,l,c,u,h,d=-1;for(;++d"),this.setData("tableAlign",e._align)},tableBody(){this.setData("slurpOneLineEnding"),this.tag("")},tableData(){const e=Jo[this.getData("tableAlign")[this.getData("tableColumn")]];void 0===e?this.buffer():(this.lineEndingIfNeeded(),this.tag(""))},tableHead(){this.lineEndingIfNeeded(),this.tag("")},tableHeader(){this.lineEndingIfNeeded(),this.tag("")},tableRow(){this.setData("tableColumn",0),this.lineEndingIfNeeded(),this.tag("")}},exit:{codeTextData(e){let t=this.sliceSerialize(e);this.getData("tableAlign")&&(t=t.replace(/\\([\\|])/g,tr)),this.raw(this.encode(t))},table(){this.setData("tableAlign"),this.setData("slurpAllLineEndings"),this.lineEndingIfNeeded(),this.tag("")},tableBody(){this.lineEndingIfNeeded(),this.tag("")},tableData(){const e=this.getData("tableColumn");e in this.getData("tableAlign")?(this.tag(""),this.setData("tableColumn",e+1)):this.resume()},tableHead(){this.lineEndingIfNeeded(),this.tag(""),this.setData("slurpOneLineEnding",!0)},tableHeader(){this.tag(""),this.setData("tableColumn",this.getData("tableColumn")+1)},tableRow(){const e=this.getData("tableAlign");let t=this.getData("tableColumn");for(;t"),t++;this.setData("tableColumn",t),this.lineEndingIfNeeded(),this.tag("")}}};function tr(e,t){return"|"===t?t:e}const nr=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|title|textarea|xmp)(?=[\t\n\f\r />])/gi,ir=new RegExp("^"+nr.source,"i");function or(e,t){let n=this.sliceSerialize(e);this.options.allowDangerousHtml&&(n=n.replace(t,"<$1$2")),this.raw(this.encode(n))}const rr={text:{91:{tokenize:function(e,t,n){const i=this;return function(t){return null===i.previous&&i._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),o):n(t)};function o(t){return di(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),r):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),r):n(t)}function r(i){return 93===i?(e.enter("taskListCheckMarker"),e.consume(i),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),e.check({tokenize:sr},t,n)):n(i)}}}}};function sr(e,t,n){const i=this;return mi(e,(function(e){const o=i.events[i.events.length-1];return o&&"whitespace"===o[1].type&&null!==e&&!ui(e)?t(e):n(e)}),"whitespace")}function ar(e,t){var n,i=String(e),o=0;if("string"!=typeof t)throw new Error("Expected character");for(n=i.indexOf(t);-1!==n;)o++,n=i.indexOf(t,n+t.length);return o}!function(e){const t={};let n=-1;for(;++n')},taskListCheckValueChecked(){this.tag('checked="" ')}}}]);const lr=function(e){if(null==e)return ur;if("string"==typeof e)return t=e,cr((function(e){return e&&e.type===t}));var t;if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n":"")+")"})),h;function h(){var c,u,h,d=[];if((!t||o(s,a,l[l.length-1]||null))&&!1===(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[!0,e]:[e]}(n(s,l)))[0])return d;if(s.children&&"skip"!==d[0])for(u=(i?s.children.length:-1)+r,h=l.concat(s);u>-1&&ue}const fr="phrasing",mr=["autolink","link","image","label"],_r={transforms:[function(e){!function(e,t,n,i){let o,r;"string"==typeof t||t instanceof RegExp?(r=[[t,n]],o=i):(r=t,o=n),o||(o={});const s=lr(o.ignore||[]),a=function(e){const t=[];if("object"!=typeof e)throw new TypeError("Expected array or object as schema");if(Array.isArray(e)){let n=-1;for(;++n0?{type:"text",value:t}:void 0),!1!==t&&(r!==o&&c.push({type:"text",value:e.value.slice(r,o)}),Array.isArray(t)?c.push(...t):t&&c.push(t),r=o+u[0].length),!n.global)break;u=n.exec(e.value)}return void 0===o?(c=[e],s--):(r?\]}]+$/.exec(e);let n,i,o,r;if(t)for(e=e.slice(0,t.index),r=t[0],n=r.indexOf(")"),i=ar(e,"("),o=ar(e,")");-1!==n&&i>o;)e+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),o++;return[e,r]}(n+i);if(!s[0])return!1;const a={type:"link",title:null,url:r+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function wr(e,t,n,i){return!(!Cr(i,!0)||/[_-]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Cr(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||gi(n)||pi(n))&&(!t||47!==n)}function Sr(e,t,n){const i=e.children||[],o=[];let r=-1,s=n.before;for(;++r0&&("\r"===s||"\n"===s)&&"html"===a.type&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),s=" "),o.push(t.handle(a,e,t,{before:s,after:l})),s=o[o.length-1].slice(-1)}return o.join("")}const xr={unsafe:[{character:"~",inConstruct:"phrasing"}],handlers:{delete:kr}};function kr(e,t,n){const i=n.enter("emphasis"),o=Sr(e,n,{before:"~",after:"~"});return i(),"~~"+o+"~~"}function Er(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function Nr(e,t,n){let i=e.value||"",o="`",r=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++rb&&(b=e[s].length);++uc[u])&&(c[u]=g)),h.push(p);a[s]=h,l[s]=d}if(u=-1,"object"==typeof i&&"length"in i)for(;++uc[u]&&(c[u]=g),d[u]=g),h[u]=p;a.splice(1,0,h),l.splice(1,0,d),s=-1;const y=[];for(;++s-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+".");let r=o.length+1;("tab"===i||"mixed"===i&&(t&&"spread"in t&&t.spread||e.spread))&&(r=4*Math.ceil(r/4));const s=n.enter("listItem"),a=function(e,t){const n=[];let i,s=0,a=0;for(;i=Rr.exec(e);)l(e.slice(s,i.index)),n.push(i[0]),s=i.index+i[0].length,a++;return l(e.slice(s)),n.join("");function l(e){n.push(function(e,t,n){return t?(n?"":" ".repeat(r))+e:(n?o:o+" ".repeat(r-o.length))+e}(e,a,!e))}}(function(e,t){const n=e.children||[],i=[];let o=-1;for(;++os&&(s=r):r=1,o=i+1,i=n.indexOf(t,o);return s}(i,"$")+1,2)),r=n.enter("mathFlow");let s=o;if(e.meta){const t=n.enter("mathFlowMeta");s+=function(e,t,n){const i=(n.before||"")+(t||"")+(n.after||""),o=[],r=[],s={};let a=-1;for(;++a=c||e+1-1?n.offset:null}}}const is={}.hasOwnProperty;function os(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return function(e,t,n,i){"function"==typeof t&&"function"!=typeof n&&(i=n,n=t,t=null),function(e,t,n,i){"function"==typeof t&&"function"!=typeof n&&(i=n,n=t,t=null);var o=lr(t),r=i?-1:1;!function e(s,a,l){var c,u="object"==typeof s&&null!==s?s:{};return"string"==typeof u.type&&(c="string"==typeof u.tagName?u.tagName:"string"==typeof u.name?u.name:void 0,Object.defineProperty(h,"name",{value:"node ("+u.type+(c?"<"+c+">":"")+")"})),h;function h(){var c,u,h,d=[];if((!t||o(s,a,l[l.length-1]||null))&&!1===(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[!0,e]:[e]}(n(s,l)))[0])return d;if(s.children&&"skip"!==d[0])for(u=(i?s.children.length:-1)+r,h=l.concat(s);u>-1&&u0&&n.push(Jr("text","\n")),n}function gs(e,t){const n={},i=t.ordered?"ol":"ul",o=us(e,t);let r=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++r1:t}const vs={blockquote:function(e,t){return e(t,"blockquote",ds(us(e,t),!0))},break:function(e,t){return[e(t,"br"),Jr("text","\n")]},code:function(e,t){const n=t.value?t.value+"\n":"",i=t.lang&&t.lang.match(/^[^ \t]+(?=[ \t]|$)/),o={};i&&(o.className=["language-"+i]);const r=e(t,"code",o,[Jr("text",n)]);return t.meta&&(r.data={meta:t.meta}),e(t.position,"pre",[r])},delete:function(e,t){return e(t,"del",us(e,t))},emphasis:function(e,t){return e(t,"em",us(e,t))},footnoteReference:ps,footnote:function(e,t){const n=e.footnoteById,i=e.footnoteOrder;let o=1;for(;o in n;)o++;const r=String(o);return i.push(r),n[r]={type:"footnoteDefinition",identifier:r,children:[{type:"paragraph",children:t.children}],position:t.position},ps(e,{type:"footnoteReference",identifier:r,position:t.position})},heading:function(e,t){return e(t,"h"+t.depth,us(e,t))},html:function(e,t){return e.dangerous?e.augment(t,Jr("raw",t.value)):null},imageReference:function(e,t){const n=e.definition(t.identifier);if(!n)return ms(e,t);const i={src:fs(n.url||""),alt:t.alt};return null!==n.title&&void 0!==n.title&&(i.title=n.title),e(t,"img",i)},image:function(e,t){const n={src:fs(t.url),alt:t.alt};return null!==t.title&&void 0!==t.title&&(n.title=t.title),e(t,"img",n)},inlineCode:function(e,t){return e(t,"code",[Jr("text",t.value.replace(/\r?\n|\r/g," "))])},linkReference:function(e,t){const n=e.definition(t.identifier);if(!n)return ms(e,t);const i={href:fs(n.url||"")};return null!==n.title&&void 0!==n.title&&(i.title=n.title),e(t,"a",i,us(e,t))},link:function(e,t){const n={href:fs(t.url)};return null!==t.title&&void 0!==t.title&&(n.title=t.title),e(t,"a",n,us(e,t))},listItem:function(e,t,n){const i=us(e,t),o=n?function(e){let t=e.spread;const n=e.children;let i=-1;for(;!t&&++i0&&n.children.unshift(Jr("text"," ")),n.children.unshift(e(null,"input",{type:"checkbox",checked:t.checked,disabled:!0})),r.className=["task-list-item"]}let a=-1;for(;++a":"")+")"})),h;function h(){var c,u,h,d=[];if((!t||o(s,a,l[l.length-1]||null))&&!1===(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[!0,e]:[e]}(n(s,l)))[0])return d;if(s.children&&"skip"!==d[0])for(u=(i?s.children.length:-1)+r,h=l.concat(s);u>-1&&u{e.run(Cs(n,t),i,(e=>{o(e)}))}}(e,t):function(e){return t=>Cs(t,e)}(e)};var xs=n(7045);const ks=function(e,t,n,i){"function"==typeof t&&"function"!=typeof n&&(i=n,n=t,t=null),function(e,t,n,i){"function"==typeof t&&"function"!=typeof n&&(i=n,n=t,t=null);const o=lr(t),r=i?-1:1;!function e(s,a,l){const c="object"==typeof s&&null!==s?s:{};let u;return"string"==typeof c.type&&(u="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0,Object.defineProperty(h,"name",{value:"node ("+c.type+(u?"<"+u+">":"")+")"})),h;function h(){let c,u,h,d=[];if((!t||o(s,a,l[l.length-1]||null))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[!0,e]:[e]}(n(s,l)),!1===d[0]))return d;if(s.children&&"skip"!==d[0])for(u=(i?s.children.length:-1)+r,h=l.concat(s);u>-1&&u4&&"data"===n.slice(0,4)&&ea.test(t)&&("-"===t.charAt(4)?i=function(e){var t=e.slice(5).replace(ta,ra);return"data"+t.charAt(0).toUpperCase()+t.slice(1)}(t):t=function(e){var t=e.slice(4);return ta.test(t)?e:("-"!==(t=t.replace(na,oa)).charAt(0)&&(t="-"+t),"data"+t)}(t),o=zs),new o(i,t))}function oa(e){return"-"+e.toLowerCase()}function ra(e){return e.charAt(1).toUpperCase()}var sa=/[#.]/g;function aa(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function la(e){return e.join(" ").trim()}function ca(e){for(var t,n,i=[],o=String(e||""),r=o.indexOf(","),s=0;!t;)-1===r&&(r=o.length,t=!0),!(n=o.slice(s,r).trim())&&t||i.push(n),s=r+1,r=o.indexOf(",",s);return i}function ua(e,t){var n=t||{};return""===e[e.length-1]&&(e=e.concat("")),e.join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}const ha=new Set(["menu","submit","reset","button"]),da={}.hasOwnProperty;function ga(e,t,n){const i=n&&function(e){const t={};let n=-1;for(;++n-1&&ee)return{line:t+1,column:e-(n[t-1]||0)+1,offset:e};return{line:void 0,column:void 0,offset:void 0}},toOffset:function(e){var t,i=e&&e.line,o=e&&e.column;return"number"!=typeof i||"number"!=typeof o||Number.isNaN(i)||Number.isNaN(o)||!(i-1 in n)||(t=(n[i-2]||0)+o-1||0),t>-1&&t0?e.call(t,r,s,a):e.call(t,r,s)}function Fa(e,t,n,i,o){const r=ia(i.schema,t);let s;null==n||"number"==typeof n&&Number.isNaN(n)||!1===n&&(i.vue||i.vdom||i.hyperscript)||!n&&r.boolean&&(i.vue||i.vdom||i.hyperscript)||(Array.isArray(n)&&(n=r.commaSeparated?ua(n):la(n)),r.boolean&&i.hyperscript&&(n=""),"style"===r.property&&"string"==typeof n&&(i.react||i.vue||i.vdom)&&(n=function(e,t){const n={};try{La(e,((e,t)=>{"-ms-"===e.slice(0,4)&&(e="ms-"+e.slice(4)),n[e.replace(/-([a-z])/g,((e,t)=>t.toUpperCase()))]=t}))}catch(e){throw e.message=t+"[style]"+e.message.slice("undefined".length),e}return n}(n,o)),i.vue?"style"!==r.property&&(s="attrs"):r.mustUseProperty||(i.vdom?"style"!==r.property&&(s="attributes"):i.hyperscript&&(s="attrs")),s?e[s]=Object.assign(e[s]||{},{[r.attribute]:n}):r.space&&i.react?e[Ta[r.property]||r.property]=n:e[r.attribute]=n)}function Ba(e){return"context"in e&&"cleanup"in e}var Ha={}.hasOwnProperty;function za(e,t){var n=t||{};function i(t){var n=i.invalid,o=i.handlers;if(t&&Ha.call(t,e)&&(n=Ha.call(o,t[e])?o[t[e]]:i.unknown),n)return n.apply(this,arguments)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}var Wa={}.hasOwnProperty,Va=za("type",{handlers:{root:function(e,t){var n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Ua(e.children,n,t),$a(e,n)},element:function(e,t){var n=t.space;return Ra((function(n,i){var o,r,s,a,l,c=[];for(s in i)Wa.call(i,s)&&!1!==i[s]&&((o=ia(t,s)).boolean&&!i[s]||(r={name:s,value:!0===i[s]?"":String(i[s])},o.space&&"html"!==o.space&&"svg"!==o.space&&((a=s.indexOf(":"))<0?r.prefix="":(r.name=s.slice(a+1),r.prefix=s.slice(0,a)),r.namespace=ba[o.space]),c.push(r)));return"html"===t.space&&"svg"===e.tagName&&(t=Js),(l=$a(e,{nodeName:n,tagName:n,attrs:c,namespaceURI:ba[t.space],childNodes:[],parentNode:void 0})).childNodes=Ua(e.children,l,t),"template"===n&&(l.content=function(e,t){var n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Ua(e.children,n,t),$a(e,n)}(e.content,t)),l}),Object.assign({},e,{children:[]}),{space:n})},text:function(e){return $a(e,{nodeName:"#text",value:e.value,parentNode:void 0})},comment:function(e){return $a(e,{nodeName:"#comment",data:e.value,parentNode:void 0})},doctype:function(e){return $a(e,{nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:void 0})}}});function Ua(e,t,n){var i,o=-1,r=[];if(e)for(;++o{const i=e;if(i.value.stitch&&null!==n&&null!==t)return n.children[t]=i.value.stitch,t})),"root"!==e.type&&"root"===h.type&&1===h.children.length?h.children[0]:h;function d(e){let t=-1;if(e)for(;++tKa(t,n,e)}var Za=n(527),Ja=n(6464);const el=function(e,t,n,i,o){const r=tl(t);if(null!=n&&("number"!=typeof n||n<0||n===Number.POSITIVE_INFINITY))throw new Error("Expected positive finite index for child node");if(!(null==i||i.type&&i.children))throw new Error("Expected parent node");if(!e||!e.type||"string"!=typeof e.type)return!1;if(null==i!=(null==n))throw new Error("Expected both parent and index");return r.call(o,e,n,i)},tl=function(e){if(null==e)return il;if("string"==typeof e)return t=e,function(e){return il(e)&&e.tagName===t};var t;if("object"==typeof e)return function(e){const t=[];let n=-1;for(;++n`",url:!1},abruptClosingOfEmptyComment:{reason:"Unexpected abruptly closed empty comment",description:"Unexpected `>` or `->`. Expected `--\x3e` to close comments"},abruptDoctypePublicIdentifier:{reason:"Unexpected abruptly closed public identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:"Unexpected abruptly closed system identifier",description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:"Unexpected non-digit at start of numeric character reference",description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:"Unexpected CDATA section in HTML",description:"Unexpected `` in ``",description:"Unexpected text character `%c`. Only use text in `