zen-gitsync 2.2.2 → 2.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,4 +42,4 @@
42
42
  * @return {boolean} True if the event is supported.
43
43
  * @internal
44
44
  * @license Modernizr 3.0.0pre (Custom Build) | MIT
45
- */const R$=function(e,t){if(e&&e.addEventListener){const n=function(r){const s=$$(r);t&&Reflect.apply(t,this,[r,s])};e.addEventListener("wheel",n,{passive:!0})}},P$={beforeMount(e,t){R$(e,t.value)}};let I$=1;const L$=ee({name:"ElTable",directives:{Mousewheel:P$},components:{TableHeader:u$,TableBody:g$,TableFooter:w$,ElScrollbar:$a,hColgroup:mb},props:E$,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change","scroll"],setup(e){const{t}=It(),n=$e("table"),r=ot();Et(Zn,r);const s=QM(r,e);r.store=s;const o=new t$({store:r.store,table:r,fit:e.fit,showHeader:e.showHeader});r.layout=o;const a=k(()=>(s.states.data.value||[]).length===0),{setCurrentRow:l,getSelectionRows:i,toggleRowSelection:c,clearSelection:d,clearFilter:f,toggleAllSelection:p,toggleRowExpansion:m,clearSort:h,sort:v,updateKeyChildren:y}=_$(s),{isHidden:_,renderExpanded:x,setDragVisible:w,isGroup:g,handleMouseLeave:b,handleHeaderFooterMousewheel:C,tableSize:S,emptyBlockStyle:A,handleFixedMousewheel:E,resizeProxyVisible:F,bodyWidth:M,resizeState:$,doLayout:U,tableBodyStyles:W,tableLayout:B,scrollbarViewStyle:I,scrollbarStyle:V}=C$(e,o,s,r),{scrollBarRef:O,scrollTo:T,setScrollLeft:H,setScrollTop:Y}=k$(),q=Or(U,50),X=`${n.namespace.value}-table_${I$++}`;r.tableId=X,r.state={isGroup:g,resizeState:$,doLayout:U,debouncedUpdateLayout:q};const G=k(()=>{var J;return(J=e.sumText)!=null?J:t("el.table.sumText")}),ie=k(()=>{var J;return(J=e.emptyText)!=null?J:t("el.table.emptyText")}),ge=k(()=>vb(s.states.originColumns.value)[0]);return S$(r),Pt(()=>{q.cancel()}),{ns:n,layout:o,store:s,columns:ge,handleHeaderFooterMousewheel:C,handleMouseLeave:b,tableId:X,tableSize:S,isHidden:_,isEmpty:a,renderExpanded:x,resizeProxyVisible:F,resizeState:$,isGroup:g,bodyWidth:M,tableBodyStyles:W,emptyBlockStyle:A,debouncedUpdateLayout:q,handleFixedMousewheel:E,setCurrentRow:l,getSelectionRows:i,toggleRowSelection:c,clearSelection:d,clearFilter:f,toggleAllSelection:p,toggleRowExpansion:m,clearSort:h,doLayout:U,sort:v,updateKeyChildren:y,t,setDragVisible:w,context:r,computedSumText:G,computedEmptyText:ie,tableLayout:B,scrollbarViewStyle:I,scrollbarStyle:V,scrollBarRef:O,scrollTo:T,setScrollLeft:H,setScrollTop:Y,allowDragLastColumn:e.allowDragLastColumn}}});function B$(e,t,n,r,s,o){const a=St("hColgroup"),l=St("table-header"),i=St("table-body"),c=St("table-footer"),d=St("el-scrollbar"),f=Xc("mousewheel");return R(),K("div",{ref:"tableWrapper",class:P([{[e.ns.m("fit")]:e.fit,[e.ns.m("striped")]:e.stripe,[e.ns.m("border")]:e.border||e.isGroup,[e.ns.m("hidden")]:e.isHidden,[e.ns.m("group")]:e.isGroup,[e.ns.m("fluid-height")]:e.maxHeight,[e.ns.m("scrollable-x")]:e.layout.scrollX.value,[e.ns.m("scrollable-y")]:e.layout.scrollY.value,[e.ns.m("enable-row-hover")]:!e.store.states.isComplex.value,[e.ns.m("enable-row-transition")]:(e.store.states.data.value||[]).length!==0&&(e.store.states.data.value||[]).length<100,"has-footer":e.showSummary},e.ns.m(e.tableSize),e.className,e.ns.b(),e.ns.m(`layout-${e.tableLayout}`)]),style:Ge(e.style),"data-prefix":e.ns.namespace.value,onMouseleave:e.handleMouseLeave},[j("div",{class:P(e.ns.e("inner-wrapper"))},[j("div",{ref:"hiddenColumns",class:"hidden-columns"},[fe(e.$slots,"default")],512),e.showHeader&&e.tableLayout==="fixed"?et((R(),K("div",{key:0,ref:"headerWrapper",class:P(e.ns.e("header-wrapper"))},[j("table",{ref:"tableHeader",class:P(e.ns.e("header")),style:Ge(e.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[re(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),re(l,{ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,"append-filter-panel-to":e.appendFilterPanelTo,"allow-drag-last-column":e.allowDragLastColumn,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","append-filter-panel-to","allow-drag-last-column","onSetDragVisible"])],6)],2)),[[f,e.handleHeaderFooterMousewheel]]):de("v-if",!0),j("div",{ref:"bodyWrapper",class:P(e.ns.e("body-wrapper"))},[re(d,{ref:"scrollBarRef","view-style":e.scrollbarViewStyle,"wrap-style":e.scrollbarStyle,always:e.scrollbarAlwaysOn,tabindex:e.scrollbarTabindex,onScroll:p=>e.$emit("scroll",p)},{default:le(()=>[j("table",{ref:"tableBody",class:P(e.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:Ge({width:e.bodyWidth,tableLayout:e.tableLayout})},[re(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),e.showHeader&&e.tableLayout==="auto"?(R(),be(l,{key:0,ref:"tableHeaderRef",class:P(e.ns.e("body-header")),border:e.border,"default-sort":e.defaultSort,store:e.store,"append-filter-panel-to":e.appendFilterPanelTo,onSetDragVisible:e.setDragVisible},null,8,["class","border","default-sort","store","append-filter-panel-to","onSetDragVisible"])):de("v-if",!0),re(i,{context:e.context,highlight:e.highlightCurrentRow,"row-class-name":e.rowClassName,"tooltip-effect":e.tooltipEffect,"tooltip-options":e.tooltipOptions,"row-style":e.rowStyle,store:e.store,stripe:e.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"]),e.showSummary&&e.tableLayout==="auto"?(R(),be(c,{key:1,class:P(e.ns.e("body-footer")),border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["class","border","default-sort","store","sum-text","summary-method"])):de("v-if",!0)],6),e.isEmpty?(R(),K("div",{key:0,ref:"emptyBlock",style:Ge(e.emptyBlockStyle),class:P(e.ns.e("empty-block"))},[j("span",{class:P(e.ns.e("empty-text"))},[fe(e.$slots,"empty",{},()=>[mt(Me(e.computedEmptyText),1)])],2)],6)):de("v-if",!0),e.$slots.append?(R(),K("div",{key:1,ref:"appendWrapper",class:P(e.ns.e("append-wrapper"))},[fe(e.$slots,"append")],2)):de("v-if",!0)]),_:3},8,["view-style","wrap-style","always","tabindex","onScroll"])],2),e.showSummary&&e.tableLayout==="fixed"?et((R(),K("div",{key:1,ref:"footerWrapper",class:P(e.ns.e("footer-wrapper"))},[j("table",{class:P(e.ns.e("footer")),cellspacing:"0",cellpadding:"0",border:"0",style:Ge(e.tableBodyStyles)},[re(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),re(c,{border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["border","default-sort","store","sum-text","summary-method"])],6)],2)),[[At,!e.isEmpty],[f,e.handleHeaderFooterMousewheel]]):de("v-if",!0),e.border||e.isGroup?(R(),K("div",{key:2,class:P(e.ns.e("border-left-patch"))},null,2)):de("v-if",!0)],2),et(j("div",{ref:"resizeProxy",class:P(e.ns.e("column-resize-proxy"))},null,2),[[At,e.resizeProxyVisible]])],46,["data-prefix","onMouseleave"])}var N$=Fe(L$,[["render",B$],["__file","table.vue"]]);const D$={selection:"table-column--selection",expand:"table__expand-column"},F$={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},V$=e=>D$[e]||"",H$={selection:{renderHeader({store:e,column:t}){function n(){return e.states.data.value&&e.states.data.value.length===0}return Je(co,{disabled:n(),size:e.states.tableSize.value,indeterminate:e.states.selection.value.length>0&&!e.states.isAllSelected.value,"onUpdate:modelValue":e.toggleAllSelection,modelValue:e.states.isAllSelected.value,ariaLabel:t.label})},renderCell({row:e,column:t,store:n,$index:r}){return Je(co,{disabled:t.selectable?!t.selectable.call(null,e,r):!1,size:n.states.tableSize.value,onChange:()=>{n.commit("rowSelectedChanged",e)},onClick:s=>s.stopPropagation(),modelValue:n.isSelected(e),ariaLabel:t.label})},sortable:!1,resizable:!1},index:{renderHeader({column:e}){return e.label||"#"},renderCell({column:e,$index:t}){let n=t+1;const r=e.index;return Ye(r)?n=t+r:Oe(r)&&(n=r(t)),Je("div",{},[n])},sortable:!1},expand:{renderHeader({column:e}){return e.label||""},renderCell({row:e,store:t,expanded:n}){const{ns:r}=t,s=[r.e("expand-icon")];return n&&s.push(r.em("expand-icon","expanded")),Je("div",{class:s,onClick:function(a){a.stopPropagation(),t.toggleRowExpansion(e)}},{default:()=>[Je(ze,null,{default:()=>[Je(Xs)]})]})},sortable:!1,resizable:!1}};function z$({row:e,column:t,$index:n}){var r;const s=t.property,o=s&&qo(e,s).value;return t&&t.formatter?t.formatter(e,t,o,n):((r=o==null?void 0:o.toString)==null?void 0:r.call(o))||""}function j$({row:e,treeNode:t,store:n},r=!1){const{ns:s}=n;if(!t)return r?[Je("span",{class:s.e("placeholder")})]:null;const o=[],a=function(l){l.stopPropagation(),!t.loading&&n.loadOrToggle(e)};if(t.indent&&o.push(Je("span",{class:s.e("indent"),style:{"padding-left":`${t.indent}px`}})),kt(t.expanded)&&!t.noLazyChildren){const l=[s.e("expand-icon"),t.expanded?s.em("expand-icon","expanded"):""];let i=Xs;t.loading&&(i=Os),o.push(Je("div",{class:l,onClick:a},{default:()=>[Je(ze,{class:{[s.is("loading")]:t.loading}},{default:()=>[Je(i)]})]}))}else o.push(Je("span",{class:s.e("placeholder")}));return o}function Yh(e,t){return e.reduce((n,r)=>(n[r]=r,n),t)}function W$(e,t){const n=ot();return{registerComplexWatchers:()=>{const o=["fixed"],a={realWidth:"width",realMinWidth:"minWidth"},l=Yh(o,a);Object.keys(l).forEach(i=>{const c=a[i];rt(t,c)&&ke(()=>t[c],d=>{let f=d;c==="width"&&i==="realWidth"&&(f=Gd(d)),c==="minWidth"&&i==="realMinWidth"&&(f=ub(d)),n.columnConfig.value[c]=f,n.columnConfig.value[i]=f;const p=c==="fixed";e.value.store.scheduleLayout(p)})})},registerNormalWatchers:()=>{const o=["label","filters","filterMultiple","filteredValue","sortable","index","formatter","className","labelClassName","filterClassName","showOverflowTooltip","tooltipFormatter"],a={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},l=Yh(o,a);Object.keys(l).forEach(i=>{const c=a[i];rt(t,c)&&ke(()=>t[c],d=>{n.columnConfig.value[i]=d})})}}}function K$(e,t,n){const r=ot(),s=D(""),o=D(!1),a=D(),l=D(),i=$e("table");Jr(()=>{a.value=e.align?`is-${e.align}`:null,a.value}),Jr(()=>{l.value=e.headerAlign?`is-${e.headerAlign}`:a.value,l.value});const c=k(()=>{let g=r.vnode.vParent||r.parent;for(;g&&!g.tableId&&!g.columnId;)g=g.vnode.vParent||g.parent;return g}),d=k(()=>{const{store:g}=r.parent;if(!g)return!1;const{treeData:b}=g.states,C=b.value;return C&&Object.keys(C).length>0}),f=D(Gd(e.width)),p=D(ub(e.minWidth)),m=g=>(f.value&&(g.width=f.value),p.value&&(g.minWidth=p.value),!f.value&&p.value&&(g.width=void 0),g.minWidth||(g.minWidth=80),g.realWidth=Number(Tt(g.width)?g.minWidth:g.width),g),h=g=>{const b=g.type,C=H$[b]||{};Object.keys(C).forEach(A=>{const E=C[A];A!=="className"&&!Tt(E)&&(g[A]=E)});const S=V$(b);if(S){const A=`${u(i.namespace)}-${S}`;g.className=g.className?`${g.className} ${A}`:A}return g},v=g=>{he(g)?g.forEach(C=>b(C)):b(g);function b(C){var S;((S=C==null?void 0:C.type)==null?void 0:S.name)==="ElTableColumn"&&(C.vParent=r)}};return{columnId:s,realAlign:a,isSubColumn:o,realHeaderAlign:l,columnOrTableParent:c,setColumnWidth:m,setColumnForcedProps:h,setColumnRenders:g=>{e.renderHeader||g.type!=="selection"&&(g.renderHeader=C=>(r.columnConfig.value.label,fe(t,"header",C,()=>[g.label]))),t["filter-icon"]&&(g.renderFilterIcon=C=>fe(t,"filter-icon",C));let b=g.renderCell;return g.type==="expand"?(g.renderCell=C=>Je("div",{class:"cell"},[b(C)]),n.value.renderExpanded=C=>t.default?t.default(C):t.default):(b=b||z$,g.renderCell=C=>{let S=null;if(t.default){const U=t.default(C);S=U.some(W=>W.type!==jt)?U:b(C)}else S=b(C);const{columns:A}=n.value.store.states,E=A.value.findIndex(U=>U.type==="default"),F=d.value&&C.cellIndex===E,M=j$(C,F),$={class:"cell",style:{}};return g.showOverflowTooltip&&($.class=`${$.class} ${u(i.namespace)}-tooltip`,$.style={width:`${(C.column.realWidth||Number(C.column.width))-1}px`}),v(S),Je("div",$,[M,S])}),g},getPropsData:(...g)=>g.reduce((b,C)=>(he(C)&&C.forEach(S=>{b[S]=e[S]}),b),{}),getColumnElIndex:(g,b)=>Array.prototype.indexOf.call(g,b),updateColumnOrder:()=>{n.value.store.commit("updateColumnOrder",r.columnConfig.value)}}}var U$={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},tooltipFormatter:Function,fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},filterClassName:String,index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:e=>e.every(t=>["ascending","descending",null].includes(t))}};let q$=1;var Eb=ee({name:"ElTableColumn",components:{ElCheckbox:co},props:U$,setup(e,{slots:t}){const n=ot(),r=D({}),s=k(()=>{let w=n.parent;for(;w&&!w.tableId;)w=w.parent;return w}),{registerNormalWatchers:o,registerComplexWatchers:a}=W$(s,e),{columnId:l,isSubColumn:i,realHeaderAlign:c,columnOrTableParent:d,setColumnWidth:f,setColumnForcedProps:p,setColumnRenders:m,getPropsData:h,getColumnElIndex:v,realAlign:y,updateColumnOrder:_}=K$(e,t,s),x=d.value;l.value=`${x.tableId||x.columnId}_column_${q$++}`,bi(()=>{i.value=s.value!==x;const w=e.type||"default",g=e.sortable===""?!0:e.sortable,b=w==="selection"?!1:Tt(e.showOverflowTooltip)?x.props.showOverflowTooltip:e.showOverflowTooltip,C=Tt(e.tooltipFormatter)?x.props.tooltipFormatter:e.tooltipFormatter,S={...F$[w],id:l.value,type:w,property:e.prop||e.property,align:y,headerAlign:c,showOverflowTooltip:b,tooltipFormatter:C,filterable:e.filters||e.filterMethod,filteredValue:[],filterPlacement:"",filterClassName:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:g,index:e.index,rawColumnKey:n.vnode.key};let $=h(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement","filterClassName"]);$=HM(S,$),$=jM(m,f,p)($),r.value=$,o(),a()}),ut(()=>{var w;const g=d.value,b=i.value?g.vnode.el.children:(w=g.refs.hiddenColumns)==null?void 0:w.children,C=()=>v(b||[],n.vnode.el);r.value.getColumnIndex=C,C()>-1&&s.value.store.commit("insertColumn",r.value,i.value?g.columnConfig.value:null,_)}),Pt(()=>{const w=r.value.getColumnIndex;(w?w():-1)>-1&&s.value.store.commit("removeColumn",r.value,i.value?x.columnConfig.value:null,_)}),n.columnId=l.value,n.columnConfig=r},render(){var e,t,n;try{const r=(t=(e=this.$slots).default)==null?void 0:t.call(e,{row:{},column:{},$index:-1}),s=[];if(he(r))for(const a of r)((n=a.type)==null?void 0:n.name)==="ElTableColumn"||a.shapeFlag&2?s.push(a):a.type===Ke&&he(a.children)&&a.children.forEach(l=>{(l==null?void 0:l.patchFlag)!==1024&&!Be(l==null?void 0:l.children)&&s.push(l)});return Je("div",s)}catch{return Je("div",[])}}});const bI=wt(N$,{TableColumn:Eb}),yI=Pr(Eb);function Y$(e,t){let n;const r=D(!1),s=Rt({...e,originalPosition:"",originalOverflow:"",visible:!1});function o(m){s.text=m}function a(){const m=s.parent,h=p.ns;if(!m.vLoadingAddClassList){let v=m.getAttribute("loading-number");v=Number.parseInt(v)-1,v?m.setAttribute("loading-number",v.toString()):(fr(m,h.bm("parent","relative")),m.removeAttribute("loading-number")),fr(m,h.bm("parent","hidden"))}l(),f.unmount()}function l(){var m,h;(h=(m=p.$el)==null?void 0:m.parentNode)==null||h.removeChild(p.$el)}function i(){var m;e.beforeClose&&!e.beforeClose()||(r.value=!0,clearTimeout(n),n=setTimeout(c,400),s.visible=!1,(m=e.closed)==null||m.call(e))}function c(){if(!r.value)return;const m=s.parent;r.value=!1,m.vLoadingAddClassList=void 0,a()}const f=Sw(ee({name:"ElLoading",setup(m,{expose:h}){const{ns:v,zIndex:y}=Cd("loading");return h({ns:v,zIndex:y}),()=>{const _=s.spinner||s.svg,x=Je("svg",{class:"circular",viewBox:s.svgViewBox?s.svgViewBox:"0 0 50 50",..._?{innerHTML:_}:{}},[Je("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),w=s.text?Je("p",{class:v.b("text")},[s.text]):void 0;return Je(Yn,{name:v.b("fade"),onAfterLeave:c},{default:le(()=>[et(re("div",{style:{backgroundColor:s.background||""},class:[v.b("mask"),s.customClass,s.fullscreen?"is-fullscreen":""]},[Je("div",{class:v.b("spinner")},[x,w])]),[[At,s.visible]])])})}}}));Object.assign(f._context,t??{});const p=f.mount(document.createElement("div"));return{...cn(s),setText:o,removeElLoadingChild:l,close:i,handleAfterLeave:c,vm:p,get $el(){return p.$el}}}let tl;const Qd=function(e={}){if(!ft)return;const t=G$(e);if(t.fullscreen&&tl)return tl;const n=Y$({...t,closed:()=>{var s;(s=t.closed)==null||s.call(t),t.fullscreen&&(tl=void 0)}},Qd._context);X$(t,t.parent,n),Gh(t,t.parent,n),t.parent.vLoadingAddClassList=()=>Gh(t,t.parent,n);let r=t.parent.getAttribute("loading-number");return r?r=`${Number.parseInt(r)+1}`:r="1",t.parent.setAttribute("loading-number",r),t.parent.appendChild(n.$el),Ve(()=>n.visible.value=t.visible),t.fullscreen&&(tl=n),n},G$=e=>{var t,n,r,s;let o;return Be(e.target)?o=(t=document.querySelector(e.target))!=null?t:document.body:o=e.target||document.body,{parent:o===document.body||e.body?document.body:o,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:o===document.body&&((n=e.fullscreen)!=null?n:!0),lock:(r=e.lock)!=null?r:!1,customClass:e.customClass||"",visible:(s=e.visible)!=null?s:!0,beforeClose:e.beforeClose,closed:e.closed,target:o}},X$=async(e,t,n)=>{const{nextZIndex:r}=n.vm.zIndex||n.vm._.exposed.zIndex,s={};if(e.fullscreen)n.originalPosition.value=cs(document.body,"position"),n.originalOverflow.value=cs(document.body,"overflow"),s.zIndex=r();else if(e.parent===document.body){n.originalPosition.value=cs(document.body,"position"),await Ve();for(const o of["top","left"]){const a=o==="top"?"scrollTop":"scrollLeft";s[o]=`${e.target.getBoundingClientRect()[o]+document.body[a]+document.documentElement[a]-Number.parseInt(cs(document.body,`margin-${o}`),10)}px`}for(const o of["height","width"])s[o]=`${e.target.getBoundingClientRect()[o]}px`}else n.originalPosition.value=cs(t,"position");for(const[o,a]of Object.entries(s))n.$el.style[o]=a},Gh=(e,t,n)=>{const r=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?fr(t,r.bm("parent","relative")):Ss(t,r.bm("parent","relative")),e.fullscreen&&e.lock?Ss(t,r.bm("parent","hidden")):fr(t,r.bm("parent","hidden"))};Qd._context=null;const Ll=Symbol("ElLoading"),Xh=(e,t)=>{var n,r,s,o;const a=t.instance,l=m=>Ue(t.value)?t.value[m]:void 0,i=m=>{const h=Be(m)&&(a==null?void 0:a[m])||m;return h&&D(h)},c=m=>i(l(m)||e.getAttribute(`element-loading-${xr(m)}`)),d=(n=l("fullscreen"))!=null?n:t.modifiers.fullscreen,f={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:d,target:(r=l("target"))!=null?r:d?void 0:e,body:(s=l("body"))!=null?s:t.modifiers.body,lock:(o=l("lock"))!=null?o:t.modifiers.lock},p=Qd(f);p._context=kb._context,e[Ll]={options:f,instance:p}},J$=(e,t)=>{for(const n of Object.keys(t))dt(t[n])&&(t[n].value=e[n])},kb={mounted(e,t){t.value&&Xh(e,t)},updated(e,t){const n=e[Ll];t.oldValue!==t.value&&(t.value&&!t.oldValue?Xh(e,t):t.value&&t.oldValue?Ue(t.value)&&J$(t.value,n.options):n==null||n.instance.close())},unmounted(e){var t;(t=e[Ll])==null||t.instance.close(),e[Ll]=null}};kb._context=null;const Ob=["success","info","warning","error"],Jt=Zg({customClass:"",dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:ft?document.body:void 0}),Z$=De({customClass:{type:String,default:Jt.customClass},dangerouslyUseHTMLString:{type:Boolean,default:Jt.dangerouslyUseHTMLString},duration:{type:Number,default:Jt.duration},icon:{type:On,default:Jt.icon},id:{type:String,default:Jt.id},message:{type:Ce([String,Object,Function]),default:Jt.message},onClose:{type:Ce(Function),default:Jt.onClose},showClose:{type:Boolean,default:Jt.showClose},type:{type:String,values:Ob,default:Jt.type},plain:{type:Boolean,default:Jt.plain},offset:{type:Number,default:Jt.offset},zIndex:{type:Number,default:Jt.zIndex},grouping:{type:Boolean,default:Jt.grouping},repeatNum:{type:Number,default:Jt.repeatNum}}),Q$={destroy:()=>!0},Hn=Wv([]),eR=e=>{const t=Hn.findIndex(s=>s.id===e),n=Hn[t];let r;return t>0&&(r=Hn[t-1]),{current:n,prev:r}},tR=e=>{const{prev:t}=eR(e);return t?t.vm.exposed.bottom.value:0},nR=(e,t)=>Hn.findIndex(r=>r.id===e)>0?16:t,rR=ee({name:"ElMessage"}),sR=ee({...rR,props:Z$,emits:Q$,setup(e,{expose:t,emit:n}){const r=e,{Close:s}=Ed,o=D(!1),{ns:a,zIndex:l}=Cd("message"),{currentZIndex:i,nextZIndex:c}=l,d=D(),f=D(!1),p=D(0);let m;const h=k(()=>r.type?r.type==="error"?"danger":r.type:"info"),v=k(()=>{const E=r.type;return{[a.bm("icon",E)]:E&&so[E]}}),y=k(()=>r.icon||so[r.type]||""),_=k(()=>tR(r.id)),x=k(()=>nR(r.id,r.offset)+_.value),w=k(()=>p.value+x.value),g=k(()=>({top:`${x.value}px`,zIndex:i.value}));function b(){r.duration!==0&&({stop:m}=Gu(()=>{S()},r.duration))}function C(){m==null||m()}function S(){f.value=!1,Ve(()=>{var E;o.value||((E=r.onClose)==null||E.call(r),n("destroy"))})}function A({code:E}){E===it.esc&&S()}return ut(()=>{b(),c(),f.value=!0}),ke(()=>r.repeatNum,()=>{C(),b()}),Gt(document,"keydown",A),mn(d,()=>{p.value=d.value.getBoundingClientRect().height}),t({visible:f,bottom:w,close:S}),(E,F)=>(R(),be(Yn,{name:u(a).b("fade"),onBeforeEnter:M=>o.value=!0,onBeforeLeave:E.onClose,onAfterLeave:M=>E.$emit("destroy"),persisted:""},{default:le(()=>[et(j("div",{id:E.id,ref_key:"messageRef",ref:d,class:P([u(a).b(),{[u(a).m(E.type)]:E.type},u(a).is("closable",E.showClose),u(a).is("plain",E.plain),E.customClass]),style:Ge(u(g)),role:"alert",onMouseenter:C,onMouseleave:b},[E.repeatNum>1?(R(),be(u(NT),{key:0,value:E.repeatNum,type:u(h),class:P(u(a).e("badge"))},null,8,["value","type","class"])):de("v-if",!0),u(y)?(R(),be(u(ze),{key:1,class:P([u(a).e("icon"),u(v)])},{default:le(()=>[(R(),be(ct(u(y))))]),_:1},8,["class"])):de("v-if",!0),fe(E.$slots,"default",{},()=>[E.dangerouslyUseHTMLString?(R(),K(Ke,{key:1},[de(" Caution here, message could've been compromised, never use user's input as message "),j("p",{class:P(u(a).e("content")),innerHTML:E.message},null,10,["innerHTML"])],2112)):(R(),K("p",{key:0,class:P(u(a).e("content"))},Me(E.message),3))]),E.showClose?(R(),be(u(ze),{key:2,class:P(u(a).e("closeBtn")),onClick:Xe(S,["stop"])},{default:le(()=>[re(u(s))]),_:1},8,["class","onClick"])):de("v-if",!0)],46,["id"]),[[At,f.value]])]),_:3},8,["name","onBeforeEnter","onBeforeLeave","onAfterLeave"]))}});var oR=Fe(sR,[["__file","message.vue"]]);let aR=1;const Tb=e=>{const t=!e||Be(e)||Un(e)||Oe(e)?{message:e}:e,n={...Jt,...t};if(!n.appendTo)n.appendTo=document.body;else if(Be(n.appendTo)){let r=document.querySelector(n.appendTo);xn(r)||(r=document.body),n.appendTo=r}return kt(sr.grouping)&&!n.grouping&&(n.grouping=sr.grouping),Ye(sr.duration)&&n.duration===3e3&&(n.duration=sr.duration),Ye(sr.offset)&&n.offset===16&&(n.offset=sr.offset),kt(sr.showClose)&&!n.showClose&&(n.showClose=sr.showClose),n},lR=e=>{const t=Hn.indexOf(e);if(t===-1)return;Hn.splice(t,1);const{handler:n}=e;n.close()},iR=({appendTo:e,...t},n)=>{const r=`message_${aR++}`,s=t.onClose,o=document.createElement("div"),a={...t,id:r,onClose:()=>{s==null||s(),lR(d)},onDestroy:()=>{no(null,o)}},l=re(oR,a,Oe(a.message)||Un(a.message)?{default:Oe(a.message)?a.message:()=>a.message}:null);l.appContext=n||vo._context,no(l,o),e.appendChild(o.firstElementChild);const i=l.component,d={id:r,vnode:l,vm:i,handler:{close:()=>{i.exposed.close()}},props:l.component.props};return d},vo=(e={},t)=>{if(!ft)return{close:()=>{}};const n=Tb(e);if(n.grouping&&Hn.length){const s=Hn.find(({vnode:o})=>{var a;return((a=o.props)==null?void 0:a.message)===n.message});if(s)return s.props.repeatNum+=1,s.props.type=n.type,s.handler}if(Ye(sr.max)&&Hn.length>=sr.max)return{close:()=>{}};const r=iR(n,t);return Hn.push(r),r.handler};Ob.forEach(e=>{vo[e]=(t={},n)=>{const r=Tb(t);return vo({...r,type:e},n)}});function uR(e){const t=[...Hn];for(const n of t)(!e||e===n.props.type)&&n.handler.close()}vo.closeAll=uR;vo._context=null;const wI=x4(vo,"$message"),kc="_trap-focus-children",hs=[],Jh=e=>{if(hs.length===0)return;const t=hs[hs.length-1][kc];if(t.length>0&&e.code===it.tab){if(t.length===1){e.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const n=e.shiftKey,r=e.target===t[0],s=e.target===t[t.length-1];r&&n&&(e.preventDefault(),t[t.length-1].focus()),s&&!n&&(e.preventDefault(),t[0].focus())}},cR={beforeMount(e){e[kc]=qp(e),hs.push(e),hs.length<=1&&document.addEventListener("keydown",Jh)},updated(e){Ve(()=>{e[kc]=qp(e)})},unmounted(){hs.shift(),hs.length===0&&document.removeEventListener("keydown",Jh)}},dR=ee({name:"ElMessageBox",directives:{TrapFocus:cR},components:{ElButton:ha,ElFocusTrap:Bi,ElInput:lr,ElOverlay:qd,ElIcon:ze,...Ed},inheritAttrs:!1,props:{buttonSize:{type:String,validator:ab},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:t}){const{locale:n,zIndex:r,ns:s,size:o}=Cd("message-box",k(()=>e.buttonSize)),{t:a}=n,{nextZIndex:l}=r,i=D(!1),c=Rt({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",closeIcon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:Qs(Os),cancelButtonLoadingIcon:Qs(Os),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:l()}),d=k(()=>{const I=c.type;return{[s.bm("icon",I)]:I&&so[I]}}),f=$n(),p=$n(),m=k(()=>{const I=c.type;return c.icon||I&&so[I]||""}),h=k(()=>!!c.message),v=D(),y=D(),_=D(),x=D(),w=D(),g=k(()=>c.confirmButtonClass);ke(()=>c.inputValue,async I=>{await Ve(),e.boxType==="prompt"&&I&&$()},{immediate:!0}),ke(()=>i.value,I=>{var V,O;I&&(e.boxType!=="prompt"&&(c.autofocus?_.value=(O=(V=w.value)==null?void 0:V.$el)!=null?O:v.value:_.value=v.value),c.zIndex=l()),e.boxType==="prompt"&&(I?Ve().then(()=>{var T;x.value&&x.value.$el&&(c.autofocus?_.value=(T=U())!=null?T:v.value:_.value=v.value)}):(c.editorErrorMessage="",c.validateError=!1))});const b=k(()=>e.draggable),C=k(()=>e.overflow);X0(v,y,b,C),ut(async()=>{await Ve(),e.closeOnHashChange&&window.addEventListener("hashchange",S)}),Pt(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",S)});function S(){i.value&&(i.value=!1,Ve(()=>{c.action&&t("action",c.action)}))}const A=()=>{e.closeOnClickModal&&M(c.distinguishCancelAndClose?"close":"cancel")},E=Ud(A),F=I=>{if(c.inputType!=="textarea")return I.preventDefault(),M("confirm")},M=I=>{var V;e.boxType==="prompt"&&I==="confirm"&&!$()||(c.action=I,c.beforeClose?(V=c.beforeClose)==null||V.call(c,I,c,S):S())},$=()=>{if(e.boxType==="prompt"){const I=c.inputPattern;if(I&&!I.test(c.inputValue||""))return c.editorErrorMessage=c.inputErrorMessage||a("el.messagebox.error"),c.validateError=!0,!1;const V=c.inputValidator;if(Oe(V)){const O=V(c.inputValue);if(O===!1)return c.editorErrorMessage=c.inputErrorMessage||a("el.messagebox.error"),c.validateError=!0,!1;if(Be(O))return c.editorErrorMessage=O,c.validateError=!0,!1}}return c.editorErrorMessage="",c.validateError=!1,!0},U=()=>{var I,V;const O=(I=x.value)==null?void 0:I.$refs;return(V=O==null?void 0:O.input)!=null?V:O==null?void 0:O.textarea},W=()=>{M("close")},B=()=>{e.closeOnPressEscape&&W()};return e.lockScroll&&Q0(i),{...cn(c),ns:s,overlayEvent:E,visible:i,hasMessage:h,typeClass:d,contentId:f,inputId:p,btnSize:o,iconComponent:m,confirmButtonClasses:g,rootRef:v,focusStartRef:_,headerRef:y,inputRef:x,confirmRef:w,doClose:S,handleClose:W,onCloseRequested:B,handleWrapperClick:A,handleInputEnter:F,handleAction:M,t:a}}});function fR(e,t,n,r,s,o){const a=St("el-icon"),l=St("el-input"),i=St("el-button"),c=St("el-focus-trap"),d=St("el-overlay");return R(),be(Yn,{name:"fade-in-linear",onAfterLeave:f=>e.$emit("vanish"),persisted:""},{default:le(()=>[et(re(d,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:le(()=>[j("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:P(`${e.ns.namespace.value}-overlay-message-box`),onClick:e.overlayEvent.onClick,onMousedown:e.overlayEvent.onMousedown,onMouseup:e.overlayEvent.onMouseup},[re(c,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:le(()=>[j("div",{ref:"rootRef",class:P([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),{[e.ns.m("center")]:e.center}]),style:Ge(e.customStyle),tabindex:"-1",onClick:Xe(()=>{},["stop"])},[e.title!==null&&e.title!==void 0?(R(),K("div",{key:0,ref:"headerRef",class:P([e.ns.e("header"),{"show-close":e.showClose}])},[j("div",{class:P(e.ns.e("title"))},[e.iconComponent&&e.center?(R(),be(a,{key:0,class:P([e.ns.e("status"),e.typeClass])},{default:le(()=>[(R(),be(ct(e.iconComponent)))]),_:1},8,["class"])):de("v-if",!0),j("span",null,Me(e.title),1)],2),e.showClose?(R(),K("button",{key:0,type:"button",class:P(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),onKeydown:Ct(Xe(f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[re(a,{class:P(e.ns.e("close"))},{default:le(()=>[(R(),be(ct(e.closeIcon||"close")))]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):de("v-if",!0)],2)):de("v-if",!0),j("div",{id:e.contentId,class:P(e.ns.e("content"))},[j("div",{class:P(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(R(),be(a,{key:0,class:P([e.ns.e("status"),e.typeClass])},{default:le(()=>[(R(),be(ct(e.iconComponent)))]),_:1},8,["class"])):de("v-if",!0),e.hasMessage?(R(),K("div",{key:1,class:P(e.ns.e("message"))},[fe(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(R(),be(ct(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(R(),be(ct(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0},{default:le(()=>[mt(Me(e.dangerouslyUseHTMLString?"":e.message),1)]),_:1},8,["for"]))])],2)):de("v-if",!0)],2),et(j("div",{class:P(e.ns.e("input"))},[re(l,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":f=>e.inputValue=f,type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:P({invalid:e.validateError}),onKeydown:Ct(e.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),j("div",{class:P(e.ns.e("errormsg")),style:Ge({visibility:e.editorErrorMessage?"visible":"hidden"})},Me(e.editorErrorMessage),7)],2),[[At,e.showInput]])],10,["id"]),j("div",{class:P(e.ns.e("btns"))},[e.showCancelButton?(R(),be(i,{key:0,loading:e.cancelButtonLoading,"loading-icon":e.cancelButtonLoadingIcon,class:P([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:f=>e.handleAction("cancel"),onKeydown:Ct(Xe(f=>e.handleAction("cancel"),["prevent"]),["enter"])},{default:le(()=>[mt(Me(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):de("v-if",!0),et(re(i,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,"loading-icon":e.confirmButtonLoadingIcon,class:P([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:f=>e.handleAction("confirm"),onKeydown:Ct(Xe(f=>e.handleAction("confirm"),["prevent"]),["enter"])},{default:le(()=>[mt(Me(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[At,e.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[At,e.visible]])]),_:3},8,["onAfterLeave"])}var pR=Fe(dR,[["render",fR],["__file","index.vue"]]);const ba=new Map,hR=e=>{let t=document.body;return e.appendTo&&(Be(e.appendTo)&&(t=document.querySelector(e.appendTo)),xn(e.appendTo)&&(t=e.appendTo),xn(t)||(t=document.body)),t},vR=(e,t,n=null)=>{const r=re(pR,e,Oe(e.message)||Un(e.message)?{default:Oe(e.message)?e.message:()=>e.message}:null);return r.appContext=n,no(r,t),hR(e).appendChild(t.firstElementChild),r.component},mR=()=>document.createElement("div"),gR=(e,t)=>{const n=mR();e.onVanish=()=>{no(null,n),ba.delete(s)},e.onAction=o=>{const a=ba.get(s);let l;e.showInput?l={value:s.inputValue,action:o}:l=o,e.callback?e.callback(l,r.proxy):o==="cancel"||o==="close"?e.distinguishCancelAndClose&&o!=="cancel"?a.reject("close"):a.reject("cancel"):a.resolve(l)};const r=vR(e,n,t),s=r.proxy;for(const o in e)rt(e,o)&&!rt(s.$props,o)&&(o==="closeIcon"&&Ue(e[o])?s[o]=Qs(e[o]):s[o]=e[o]);return s.visible=!0,s};function So(e,t=null){if(!ft)return Promise.reject();let n;return Be(e)||Un(e)?e={message:e}:n=e.callback,new Promise((r,s)=>{const o=gR(e,t??So._context);ba.set(o,{options:e,callback:n,resolve:r,reject:s})})}const bR=["alert","confirm","prompt"],yR={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};bR.forEach(e=>{So[e]=wR(e)});function wR(e){return(t,n,r,s)=>{let o="";return Ue(n)?(r=n,o=""):Tt(n)?o="":o=n,So(Object.assign({title:o,message:t,type:"",...yR[e]},r,{boxType:e}),s)}}So.close=()=>{ba.forEach((e,t)=>{t.doClose()}),ba.clear()};So._context=null;const zr=So;zr.install=e=>{zr._context=e._context,e.config.globalProperties.$msgbox=zr,e.config.globalProperties.$messageBox=zr,e.config.globalProperties.$alert=zr.alert,e.config.globalProperties.$confirm=zr.confirm,e.config.globalProperties.$prompt=zr.prompt};const _I=zr,hr=Object.create(null);hr.open="0";hr.close="1";hr.ping="2";hr.pong="3";hr.message="4";hr.upgrade="5";hr.noop="6";const Bl=Object.create(null);Object.keys(hr).forEach(e=>{Bl[hr[e]]=e});const Oc={type:"error",data:"parser error"},xb=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ab=typeof ArrayBuffer=="function",Mb=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,ef=({type:e,data:t},n,r)=>xb&&t instanceof Blob?n?r(t):Zh(t,r):Ab&&(t instanceof ArrayBuffer||Mb(t))?n?r(t):Zh(new Blob([t]),r):r(hr[e]+(t||"")),Zh=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Qh(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let wu;function _R(e,t){if(xb&&e.data instanceof Blob)return e.data.arrayBuffer().then(Qh).then(t);if(Ab&&(e.data instanceof ArrayBuffer||Mb(e.data)))return t(Qh(e.data));ef(e,!1,n=>{wu||(wu=new TextEncoder),t(wu.encode(n))})}const ev="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",No=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<ev.length;e++)No[ev.charCodeAt(e)]=e;const CR=e=>{let t=e.length*.75,n=e.length,r,s=0,o,a,l,i;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)o=No[e.charCodeAt(r)],a=No[e.charCodeAt(r+1)],l=No[e.charCodeAt(r+2)],i=No[e.charCodeAt(r+3)],d[s++]=o<<2|a>>4,d[s++]=(a&15)<<4|l>>2,d[s++]=(l&3)<<6|i&63;return c},SR=typeof ArrayBuffer=="function",tf=(e,t)=>{if(typeof e!="string")return{type:"message",data:$b(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:ER(e.substring(1),t)}:Bl[n]?e.length>1?{type:Bl[n],data:e.substring(1)}:{type:Bl[n]}:Oc},ER=(e,t)=>{if(SR){const n=CR(e);return $b(n,t)}else return{base64:!0,data:e}},$b=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Rb="",kR=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,a)=>{ef(o,!1,l=>{r[a]=l,++s===n&&t(r.join(Rb))})})},OR=(e,t)=>{const n=e.split(Rb),r=[];for(let s=0;s<n.length;s++){const o=tf(n[s],t);if(r.push(o),o.type==="error")break}return r};function TR(){return new TransformStream({transform(e,t){_R(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let _u;function nl(e){return e.reduce((t,n)=>t+n.length,0)}function rl(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function xR(e,t){_u||(_u=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(a,l){for(n.push(a);;){if(r===0){if(nl(n)<1)break;const i=rl(n,1);o=(i[0]&128)===128,s=i[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(nl(n)<2)break;const i=rl(n,2);s=new DataView(i.buffer,i.byteOffset,i.length).getUint16(0),r=3}else if(r===2){if(nl(n)<8)break;const i=rl(n,8),c=new DataView(i.buffer,i.byteOffset,i.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){l.enqueue(Oc);break}s=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(nl(n)<s)break;const i=rl(n,s);l.enqueue(tf(o?i:_u.decode(i),t)),r=0}if(s===0||s>e){l.enqueue(Oc);break}}}})}const Pb=4;function Bt(e){if(e)return AR(e)}function AR(e){for(var t in Bt.prototype)e[t]=Bt.prototype[t];return e}Bt.prototype.on=Bt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Bt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Bt.prototype.off=Bt.prototype.removeListener=Bt.prototype.removeAllListeners=Bt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Bt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Bt.prototype.emitReserved=Bt.prototype.emit;Bt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Bt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Hi=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),kn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),MR="arraybuffer";function Ib(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const $R=kn.setTimeout,RR=kn.clearTimeout;function zi(e,t){t.useNativeTimers?(e.setTimeoutFn=$R.bind(kn),e.clearTimeoutFn=RR.bind(kn)):(e.setTimeoutFn=kn.setTimeout.bind(kn),e.clearTimeoutFn=kn.clearTimeout.bind(kn))}const PR=1.33;function IR(e){return typeof e=="string"?LR(e):Math.ceil((e.byteLength||e.size)*PR)}function LR(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Lb(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function BR(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function NR(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class DR extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class nf extends Bt{constructor(t){super(),this.writable=!1,zi(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new DR(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=tf(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=BR(t);return n.length?"?"+n:""}}class FR extends nf{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};OR(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,kR(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Lb()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Bb=!1;try{Bb=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const VR=Bb;function HR(){}class zR extends FR{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class cr extends Bt{constructor(t,n,r){super(),this.createRequest=t,zi(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Ib(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=cr.requestsCount++,cr.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=HR,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete cr.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}cr.requestsCount=0;cr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",tv);else if(typeof addEventListener=="function"){const e="onpagehide"in kn?"pagehide":"unload";addEventListener(e,tv,!1)}}function tv(){for(let e in cr.requests)cr.requests.hasOwnProperty(e)&&cr.requests[e].abort()}const jR=function(){const e=Nb({xdomain:!1});return e&&e.responseType!==null}();class WR extends zR{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=jR&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new cr(Nb,this.uri(),t)}}function Nb(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||VR))return new XMLHttpRequest}catch{}if(!t)try{return new kn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Db=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class KR extends nf{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Db?{}:Ib(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;ef(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}s&&Hi(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Lb()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Cu=kn.WebSocket||kn.MozWebSocket;class UR extends KR{createSocket(t,n,r){return Db?new Cu(t,n,r):n?new Cu(t,n):new Cu(t)}doWrite(t,n){this.ws.send(n)}}class qR extends nf{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=xR(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=TR();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{r.read().then(({done:l,value:i})=>{l||(this.onPacket(i),o())}).catch(l=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&Hi(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const YR={websocket:UR,webtransport:qR,polling:WR},GR=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,XR=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Tc(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=GR.exec(e||""),o={},a=14;for(;a--;)o[XR[a]]=s[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=JR(o,o.path),o.queryKey=ZR(o,o.query),o}function JR(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function ZR(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const xc=typeof addEventListener=="function"&&typeof removeEventListener=="function",Nl=[];xc&&addEventListener("offline",()=>{Nl.forEach(e=>e())},!1);class Zr extends Bt{constructor(t,n){if(super(),this.binaryType=MR,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Tc(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Tc(n.host).host);zi(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=NR(this.opts.query)),xc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Nl.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Pb,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Zr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Zr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=IR(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Hi(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Zr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),xc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Nl.indexOf(this._offlineEventListener);r!==-1&&Nl.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Zr.protocol=Pb;class QR extends Zr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Zr.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Zr.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const a=f=>{const p=new Error("probe error: "+f);p.transport=n.name,o(),this.emitReserved("upgradeError",p)};function l(){a("transport closed")}function i(){a("socket closed")}function c(f){n&&f.name!==n.name&&o()}const d=()=>{n.removeListener("open",s),n.removeListener("error",a),n.removeListener("close",l),this.off("close",i),this.off("upgrading",c)};n.once("open",s),n.once("error",a),n.once("close",l),this.once("close",i),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let eP=class extends QR{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>YR[s]).filter(s=>!!s)),super(t,r)}};function tP(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Tc(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const nP=typeof ArrayBuffer=="function",rP=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Fb=Object.prototype.toString,sP=typeof Blob=="function"||typeof Blob<"u"&&Fb.call(Blob)==="[object BlobConstructor]",oP=typeof File=="function"||typeof File<"u"&&Fb.call(File)==="[object FileConstructor]";function rf(e){return nP&&(e instanceof ArrayBuffer||rP(e))||sP&&e instanceof Blob||oP&&e instanceof File}function Dl(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Dl(e[n]))return!0;return!1}if(rf(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Dl(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Dl(e[n]))return!0;return!1}function aP(e){const t=[],n=e.data,r=e;return r.data=Ac(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Ac(e,t){if(!e)return e;if(rf(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Ac(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Ac(e[r],t));return n}return e}function lP(e,t){return e.data=Mc(e.data,t),delete e.attachments,e}function Mc(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Mc(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Mc(e[n],t));return e}const iP=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],uP=5;var lt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(lt||(lt={}));class cP{constructor(t){this.replacer=t}encode(t){return(t.type===lt.EVENT||t.type===lt.ACK)&&Dl(t)?this.encodeAsBinary({type:t.type===lt.EVENT?lt.BINARY_EVENT:lt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===lt.BINARY_EVENT||t.type===lt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=aP(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}function nv(e){return Object.prototype.toString.call(e)==="[object Object]"}class sf extends Bt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===lt.BINARY_EVENT;r||n.type===lt.BINARY_ACK?(n.type=r?lt.EVENT:lt.ACK,this.reconstructor=new dP(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(rf(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(lt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===lt.BINARY_EVENT||r.type===lt.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(sf.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case lt.CONNECT:return nv(n);case lt.DISCONNECT:return n===void 0;case lt.CONNECT_ERROR:return typeof n=="string"||nv(n);case lt.EVENT:case lt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&iP.indexOf(n[0])===-1);case lt.ACK:case lt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class dP{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=lP(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const fP=Object.freeze(Object.defineProperty({__proto__:null,Decoder:sf,Encoder:cP,get PacketType(){return lt},protocol:uP},Symbol.toStringTag,{value:"Module"}));function Bn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const pP=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Vb extends Bt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Bn(t,"open",this.onopen.bind(this)),Bn(t,"packet",this.onpacket.bind(this)),Bn(t,"error",this.onerror.bind(this)),Bn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,o;if(pP.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const a={type:lt.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,f=n.pop();this._registerAckCallback(d,f),a.id=d}const l=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,i=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!l||(i?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},s),a=(...l)=>{this.io.clearTimeoutFn(o),n.apply(this,l)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,s)=>{const o=(a,l)=>a?s(a):r(l);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:lt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case lt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case lt.EVENT:case lt.BINARY_EVENT:this.onevent(t);break;case lt.ACK:case lt.BINARY_ACK:this.onack(t);break;case lt.DISCONNECT:this.ondisconnect();break;case lt.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:lt.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:lt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Eo(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Eo.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};Eo.prototype.reset=function(){this.attempts=0};Eo.prototype.setMin=function(e){this.ms=e};Eo.prototype.setMax=function(e){this.max=e};Eo.prototype.setJitter=function(e){this.jitter=e};class $c extends Bt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,zi(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Eo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||fP;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new eP(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=Bn(n,"open",function(){r.onopen(),t&&t()}),o=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},a=Bn(n,"error",o);if(this._timeout!==!1){const l=this._timeout,i=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},l);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}return this.subs.push(s),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Bn(t,"ping",this.onping.bind(this)),Bn(t,"data",this.ondata.bind(this)),Bn(t,"error",this.onerror.bind(this)),Bn(t,"close",this.onclose.bind(this)),Bn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Hi(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Vb(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Ro={};function Su(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=tP(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,a=Ro[s]&&o in Ro[s].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let i;return l?i=new $c(r,t):(Ro[s]||(Ro[s]=new $c(r,t)),i=Ro[s]),n.query&&!t.query&&(t.query=n.queryKey),i.socket(n.path,t)}Object.assign(Su,{Manager:$c,Socket:Vb,io:Su,connect:Su});var zt={},sl={},Vs={},Hs={},ol={},al={},Eu={},er={},ku={},rv;function of(){return rv||(rv=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.VerticalReverse="vertical-reverse",t.Horizontal="horizontal",t.HorizontalReverse="horizontal-reverse"}(e.Orientation||(e.Orientation={}))}(ku)),ku}var sv;function ko(){if(sv)return er;sv=1,Object.defineProperty(er,"__esModule",{value:!0});const e=of();function t(c,d){return typeof c=="boolean"?c:d}er.booleanOptionOr=t;function n(c,d){return typeof c=="number"?c:d}er.numberOptionOr=n;function r(c,d){return Object.assign({},d.reduce((f,p)=>Object.assign({},f,{[p]:c[p]}),{}))}er.pick=r;function s(c,d){console.log(JSON.stringify(c.map(f=>r(f,d)),null,2))}er.debug=s;function o(c){return c===void 0}er.isUndefined=o;function a(c={}){return Object.keys(c).reduce((d,f)=>o(c[f])?d:Object.assign({},d,{[f]:c[f]}),{})}er.withoutUndefinedKeys=a;function l(c,d,f){const p=f.style.dot.size,m=c.template.arrow.size,h=p+c.template.arrow.offset,v=Math.PI/7,y=i(c,d,f),_=h*Math.cos(y),x=h*Math.sin(y),w=(h+m)*Math.cos(y-v),g=(h+m)*Math.sin(y-v),b=(h+m/2)*Math.cos(y),C=(h+m/2)*Math.sin(y),S=(h+m)*Math.cos(y+v),A=(h+m)*Math.sin(y+v);return`M${_},${x} L${w},${g} Q${b},${C} ${S},${A} L${S},${A}`}er.arrowSvgPath=l;function i(c,d,f){const p=d.x-f.x,m=d.y-f.y,h=c.template.commit.spacing;let v,y;switch(c.orientation){case e.Orientation.Horizontal:v=m,y=-h;break;case e.Orientation.HorizontalReverse:v=m,y=h;break;case e.Orientation.VerticalReverse:v=-h,y=p;break;default:v=h,y=p;break}return c.isVertical?Math.abs(m)>h&&(y=0):Math.abs(p)>h&&(v=0),c.reverseArrow&&(v*=-1,y*=-1),Math.atan2(v,y)}return er}var ov;function af(){return ov||(ov=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=ko();var n;(function(c){c.Bezier="bezier",c.Straight="straight"})(n||(n={})),e.MergeStyle=n,e.DEFAULT_FONT="normal 12pt Calibri";class r{constructor(d){d.branch=d.branch||{},d.branch.label=d.branch.label||{},d.arrow=d.arrow||{},d.commit=d.commit||{},d.commit.dot=d.commit.dot||{},d.commit.message=d.commit.message||{},this.colors=d.colors||["#000000"],this.branch={color:d.branch.color,lineWidth:d.branch.lineWidth||2,mergeStyle:d.branch.mergeStyle||n.Bezier,spacing:t.numberOptionOr(d.branch.spacing,20),label:{display:t.booleanOptionOr(d.branch.label.display,!0),color:d.branch.label.color||d.commit.color,strokeColor:d.branch.label.strokeColor||d.commit.color,bgColor:d.branch.label.bgColor||"white",font:d.branch.label.font||d.commit.message.font||e.DEFAULT_FONT,borderRadius:t.numberOptionOr(d.branch.label.borderRadius,10)}},this.arrow={size:d.arrow.size||null,color:d.arrow.color||null,offset:d.arrow.offset||2},this.commit={color:d.commit.color,spacing:t.numberOptionOr(d.commit.spacing,25),hasTooltipInCompactMode:t.booleanOptionOr(d.commit.hasTooltipInCompactMode,!0),dot:{color:d.commit.dot.color||d.commit.color,size:d.commit.dot.size||3,strokeWidth:t.numberOptionOr(d.commit.dot.strokeWidth,0),strokeColor:d.commit.dot.strokeColor,font:d.commit.dot.font||d.commit.message.font||"normal 10pt Calibri"},message:{display:t.booleanOptionOr(d.commit.message.display,!0),displayAuthor:t.booleanOptionOr(d.commit.message.displayAuthor,!0),displayHash:t.booleanOptionOr(d.commit.message.displayHash,!0),color:d.commit.message.color||d.commit.color,font:d.commit.message.font||e.DEFAULT_FONT}},this.tag=d.tag||{}}}e.Template=r;const s=new r({colors:["#6963FF","#47E8D4","#6BDB52","#E84BA5","#FFA657"],branch:{color:"#000000",lineWidth:4,spacing:50,mergeStyle:n.Straight},commit:{spacing:60,dot:{size:16,strokeColor:"#000000",strokeWidth:4},message:{color:"black"}},arrow:{size:16,offset:-1.5}});e.blackArrowTemplate=s;const o=new r({colors:["#979797","#008fb5","#f1c109"],branch:{lineWidth:10,spacing:50},commit:{spacing:80,dot:{size:14},message:{font:"normal 14pt Arial"}}});e.metroTemplate=o;var a;(function(c){c.Metro="metro",c.BlackArrow="blackarrow"})(a||(a={})),e.TemplateName=a;function l(c,d){const f=i(c);return d.branch||(d.branch={}),d.commit||(d.commit={}),{colors:d.colors||f.colors,arrow:Object.assign({},f.arrow,d.arrow),branch:Object.assign({},f.branch,d.branch,{label:Object.assign({},f.branch.label,d.branch.label)}),commit:Object.assign({},f.commit,d.commit,{dot:Object.assign({},f.commit.dot,d.commit.dot),message:Object.assign({},f.commit.message,d.commit.message)}),tag:Object.assign({},f.tag,d.tag)}}e.templateExtend=l;function i(c){return c?typeof c=="string"?{[a.BlackArrow]:s,[a.Metro]:o}[c]:c:o}e.getTemplate=i}(Eu)),Eu}var av;function Hb(){if(av)return al;av=1,Object.defineProperty(al,"__esModule",{value:!0});const e=af(),t=ko();class n{constructor(s,o,a,l){this.name=s,this.tagStyle=o,this.commitStyle=l,this.render=a}get style(){return{strokeColor:this.tagStyle.strokeColor||this.commitStyle.color,bgColor:this.tagStyle.bgColor||this.commitStyle.color,color:this.tagStyle.color||"white",font:this.tagStyle.font||this.commitStyle.message.font||e.DEFAULT_FONT,borderRadius:t.numberOptionOr(this.tagStyle.borderRadius,10),pointerWidth:t.numberOptionOr(this.tagStyle.pointerWidth,12)}}}return al.Tag=n,al}var lv;function lf(){if(lv)return ol;lv=1,Object.defineProperty(ol,"__esModule",{value:!0});const e=Hb(),t=()=>(Math.random().toString(16).substring(3)+Math.random().toString(16).substring(3)+Math.random().toString(16).substring(3)+Math.random().toString(16).substring(3)).substring(0,40);class n{constructor(s){this.refs=[],this.x=0,this.y=0;let o,a;try{[,o,a]=s.author.match(/(.*) <(.*)>/)}catch{[o,a]=[s.author,""]}this.author={name:o,email:a,timestamp:Date.now()},this.committer={name:o,email:a,timestamp:Date.now()},this.subject=s.subject,this.body=s.body||"",this.hash=s.hash||t(),this.hashAbbrev=this.hash.substring(0,7),this.parents=s.parents?s.parents:[],this.parentsAbbrev=this.parents.map(l=>l.substring(0,7)),this.style=Object.assign({},s.style,{message:Object.assign({},s.style.message),dot:Object.assign({},s.style.dot)}),this.dotText=s.dotText,this.onClick=()=>s.onClick?s.onClick(this):void 0,this.onMessageClick=()=>s.onMessageClick?s.onMessageClick(this):void 0,this.onMouseOver=()=>s.onMouseOver?s.onMouseOver(this):void 0,this.onMouseOut=()=>s.onMouseOut?s.onMouseOut(this):void 0,this.renderDot=s.renderDot,this.renderMessage=s.renderMessage,this.renderTooltip=s.renderTooltip}get message(){let s="";return this.style.message.displayHash&&(s+=`${this.hashAbbrev} `),s+=this.subject,this.style.message.displayAuthor&&(s+=` - ${this.author.name} <${this.author.email}>`),s}get branchToDisplay(){return this.branches?this.branches[0]:""}setRefs(s){return this.refs=s.getNames(this.hash),this}setTags(s,o,a){return this.tags=s.getNames(this.hash).map(l=>new e.Tag(l,o(l),a(l),this.style)),this}setBranches(s){return this.branches=s,this}setPosition({x:s,y:o}){return this.x=s,this.y=o,this}withDefaultColor(s){const o=Object.assign({},this.style,{dot:Object.assign({},this.style.dot),message:Object.assign({},this.style.message)});o.color||(o.color=s),o.dot.color||(o.dot.color=s),o.message.color||(o.message.color=s);const a=this.cloneCommit();return a.style=o,a}cloneCommit(){const s=new n({author:`${this.author.name} <${this.author.email}>`,subject:this.subject,style:this.style,body:this.body,hash:this.hash,parents:this.parents,dotText:this.dotText,onClick:this.onClick,onMessageClick:this.onMessageClick,onMouseOver:this.onMouseOver,onMouseOut:this.onMouseOut,renderDot:this.renderDot,renderMessage:this.renderMessage,renderTooltip:this.renderTooltip});return s.refs=this.refs,s.branches=this.branches,s.tags=this.tags,s.x=this.x,s.y=this.y,s}}return ol.Commit=n,ol}var iv;function zb(){if(iv)return Hs;iv=1;var e=Hs&&Hs.__rest||function(a,l){var i={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&l.indexOf(c)<0&&(i[c]=a[c]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,c=Object.getOwnPropertySymbols(a);d<c.length;d++)l.indexOf(c[d])<0&&Object.prototype.propertyIsEnumerable.call(a,c[d])&&(i[c[d]]=a[c[d]]);return i};Object.defineProperty(Hs,"__esModule",{value:!0});const t=lf(),n=ji(),r=ko();class s{constructor(l,i,c){this._branch=l,this.name=l.name,this._graph=i,this._onGraphUpdate=c}branch(l){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot branch from the deleted branch "${this.name}"`);const i=typeof l=="string"?{name:l}:l;return i.from=this,this._graph.createBranch(i).getUserApi()}commit(l){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot commit on the deleted branch "${this.name}"`);return typeof l=="string"&&(l={subject:l}),l||(l={}),this._commitWithParents(l,[]),this._onGraphUpdate(),this}delete(){if(this._graph.refs.getCommit("HEAD")===this._graph.refs.getCommit(this.name))throw new Error(`Cannot delete the checked out branch "${this.name}"`);return[...function*(i,c){const d=(p,m)=>p.commits.find(({hash:h})=>h===m);let f=d(i,i.refs.getCommit(c.name));for(;f&&f.hash!==c.parentCommitHash;)yield f,f=d(i,f.parents[0])}(this._graph,this._branch)].forEach(i=>{i.refs=i.refs.filter(c=>c!==this.name)}),this._graph.refs.delete(this.name),this._graph.branches.delete(this.name),this._branch=n.createDeletedBranch(this._graph,this._branch.style,()=>{}),this._onGraphUpdate(),this}merge(...l){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot merge to the deleted branch "${this.name}"`);let i=l[0];o(i)||(i={branch:l[0],fastForward:!1,commitOptions:{subject:l[1]}});const{branch:c,fastForward:d,commitOptions:f}=i,p=typeof c=="string"?c:c.name,m=this._graph.refs.getCommit(p);if(!m)throw new Error(`The branch called "${p}" is unknown`);let h=!1;if(d){const v=this._graph.refs.getCommit(this._branch.name);v&&(h=this._areCommitsConnected(v,m))}return d&&h?this._fastForwardTo(m):this._commitWithParents(Object.assign({},f,{subject:f&&f.subject||`Merge branch ${p}`}),[m]),this._onGraphUpdate(),this}tag(l){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot tag on the deleted branch "${this.name}"`);return typeof l=="string"?this._graph.getUserApi().tag({name:l,ref:this._branch.name}):this._graph.getUserApi().tag(Object.assign({},l,{ref:this._branch.name})),this}checkout(){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot checkout the deleted branch "${this.name}"`);const l=this._branch,i=this._graph.refs.getCommit(l.name);return this._graph.currentBranch=l,i&&this._graph.refs.set("HEAD",i),this}_commitWithParents(l,i){const c=this._graph.refs.getCommit(this._branch.name);c?i.unshift(c):this._branch.parentCommitHash&&i.unshift(this._branch.parentCommitHash);const{tag:d}=l,f=e(l,["tag"]),p=new t.Commit(Object.assign({hash:this._graph.generateCommitHash(),author:this._branch.commitDefaultOptions.author||this._graph.author,subject:this._branch.commitDefaultOptions.subject||this._graph.commitMessage},f,{parents:i,style:this._getCommitStyle(l.style)}));c?this._graph.refs.getNames(c).forEach(h=>this._graph.refs.set(h,p.hash)):this._graph.refs.set(this._branch.name,p.hash),this._graph.commits.push(p),this.checkout(),d&&this.tag(d)}_areCommitsConnected(l,i){const c=this._graph.commits.find(({hash:f})=>i===f);return!c||c.parents.length===0?!1:c.parents.includes(l)?!0:c.parents.some(f=>this._areCommitsConnected(l,f))}_fastForwardTo(l){this._graph.refs.set(this._branch.name,l)}_getCommitStyle(l={}){return Object.assign({},r.withoutUndefinedKeys(this._graph.template.commit),r.withoutUndefinedKeys(this._branch.commitDefaultOptions.style),l,{message:Object.assign({},r.withoutUndefinedKeys(this._graph.template.commit.message),r.withoutUndefinedKeys(this._branch.commitDefaultOptions.style.message),l.message,r.withoutUndefinedKeys({display:this._graph.shouldDisplayCommitMessage&&void 0})),dot:Object.assign({},r.withoutUndefinedKeys(this._graph.template.commit.dot),r.withoutUndefinedKeys(this._branch.commitDefaultOptions.style.dot),l.dot)})}_isReferenced(){return this._graph.branches.has(this.name)||this._graph.refs.hasName(this.name)||this._graph.commits.reduce((l,{refs:i})=>[...l,...i],[]).includes(this.name)}}Hs.BranchUserApi=s;function o(a){return typeof a=="object"&&!(a instanceof s)}return Hs}var uv;function ji(){if(uv)return Vs;uv=1,Object.defineProperty(Vs,"__esModule",{value:!0});const e=zb(),t="";Vs.DELETED_BRANCH_NAME=t;class n{constructor(o){this.gitgraph=o.gitgraph,this.name=o.name,this.style=o.style,this.parentCommitHash=o.parentCommitHash,this.commitDefaultOptions=o.commitDefaultOptions||{style:{}},this.onGraphUpdate=o.onGraphUpdate,this.renderLabel=o.renderLabel}getUserApi(){return new e.BranchUserApi(this,this.gitgraph,this.onGraphUpdate)}isDeleted(){return this.name===t}}Vs.Branch=n;function r(s,o,a){return new n({name:t,gitgraph:s,style:o,onGraphUpdate:a})}return Vs.createDeletedBranch=r,Vs}var Po={},ll={},cv;function uf(){if(cv)return ll;cv=1,Object.defineProperty(ll,"__esModule",{value:!0});var e;return function(t){t.Compact="compact"}(e||(e={})),ll.Mode=e,ll}var il={},ul={},dv;function jb(){if(dv)return ul;dv=1,Object.defineProperty(ul,"__esModule",{value:!0});class e{constructor(r){this.rows=new Map,this.maxRowCache=void 0,this.computeRowsFromCommits(r)}getRowOf(r){return this.rows.get(r)||0}getMaxRow(){return this.maxRowCache===void 0&&(this.maxRowCache=t(Array.from(this.rows.values())).length-1),this.maxRowCache}computeRowsFromCommits(r){r.forEach((s,o)=>{this.rows.set(s.hash,o)}),this.maxRowCache=void 0}}ul.RegularGraphRows=e;function t(n){const r=new Set;return n.forEach(s=>r.add(s)),Array.from(r)}return ul}var fv;function hP(){if(fv)return il;fv=1,Object.defineProperty(il,"__esModule",{value:!0});const e=jb();class t extends e.RegularGraphRows{computeRowsFromCommits(r){r.forEach((s,o)=>{let a=o;if(!(o===0)){const i=this.getRowOf(s.parents[0]),c=r[o-1];if(a=Math.max(i+1,this.getRowOf(c.hash)),s.parents.length>1){const f=this.getRowOf(s.parents[1]);i<f&&a++}}this.rows.set(s.hash,a)})}}return il.CompactGraphRows=t,il}var pv;function vP(){if(pv)return Po;pv=1,Object.defineProperty(Po,"__esModule",{value:!0});const e=uf(),t=hP(),n=jb();Po.GraphRows=n.RegularGraphRows;function r(s,o){return s===e.Mode.Compact?new t.CompactGraphRows(o):new n.RegularGraphRows(o)}return Po.createGraphRows=r,Po}var cl={},hv;function mP(){if(hv)return cl;hv=1,Object.defineProperty(cl,"__esModule",{value:!0});class e{constructor(n,r,s){this.branches=new Set,this.colors=r,n.forEach(o=>this.branches.add(o.branchToDisplay)),s&&(this.branches=new Set(Array.from(this.branches).sort(s)))}get(n){return Array.from(this.branches).findIndex(r=>r===n)}getColorOf(n){return this.colors[this.get(n)%this.colors.length]}}return cl.BranchesOrder=e,cl}var dl={},vv;function cf(){if(vv)return dl;vv=1,Object.defineProperty(dl,"__esModule",{value:!0});class e{constructor(){this.commitPerName=new Map,this.namesPerCommit=new Map}set(n,r){const s=this.commitPerName.get(n);return s&&this.removeNameFrom(s,n),this.addNameTo(r,n),this.addCommitTo(n,r),this}delete(n){return this.hasName(n)&&(this.removeNameFrom(this.getCommit(n),n),this.commitPerName.delete(n)),this}getCommit(n){return this.commitPerName.get(n)}getNames(n){return this.namesPerCommit.get(n)||[]}getAllNames(){return Array.from(this.commitPerName.keys())}hasCommit(n){return this.namesPerCommit.has(n)}hasName(n){return this.commitPerName.has(n)}removeNameFrom(n,r){const s=this.namesPerCommit.get(n)||[];this.namesPerCommit.set(n,s.filter(o=>o!==r))}addNameTo(n,r){const s=this.namesPerCommit.get(n)||[];this.namesPerCommit.set(n,[...s,r])}addCommitTo(n,r){this.commitPerName.set(n,r)}}return dl.Refs=e,dl}var Io={},mv;function Wb(){if(mv)return Io;mv=1,Object.defineProperty(Io,"__esModule",{value:!0});const e=ko();class t{constructor(s,o,a,l,i,c){this.branchesPaths=new Map,this.commits=s,this.branches=o,this.commitSpacing=a,this.isGraphVertical=l,this.isGraphReverse=i,this.createDeletedBranch=c}execute(){return this.fromCommits(),this.withMergeCommits(),this.smoothBranchesPaths()}fromCommits(){this.commits.forEach(s=>{let o=this.branches.get(s.branchToDisplay);o||(o=this.getDeletedBranchInPath()||this.createDeletedBranch());const a=[],l=this.branchesPaths.get(o),i=this.commits.find(({hash:c})=>c===s.parents[0]);l?a.push(...l):i&&a.push({x:i.x,y:i.y}),a.push({x:s.x,y:s.y}),this.branchesPaths.set(o,a)})}withMergeCommits(){this.commits.filter(({parents:o})=>o.length>1).forEach(o=>{const a=this.commits.find(({hash:d})=>d===o.parents[1]);if(!a)return;const l=a.branches?a.branches[0]:"";let i=this.branches.get(l);if(!i&&(i=this.getDeletedBranchInPath(),!i))return;const c=[...this.branchesPaths.get(i)||[]];this.branchesPaths.set(i,[...c,{x:o.x,y:o.y,mergeCommit:!0}])})}getDeletedBranchInPath(){return Array.from(this.branchesPaths.keys()).find(s=>s.isDeleted())}smoothBranchesPaths(){const s=new Map;return this.branchesPaths.forEach((o,a)=>{if(o.length<=1){s.set(a,[o]);return}this.isGraphVertical?o=o.sort((i,c)=>i.y>c.y?-1:1):o=o.sort((i,c)=>i.x>c.x?1:-1),this.isGraphReverse&&(o=o.reverse());const l=o.reduce((i,c,d)=>{if(c.mergeCommit){i[i.length-1].push(e.pick(c,["x","y"]));let f=d-1,p=o[f];for(;f>=0&&p.mergeCommit;)f--,p=o[f];f>=0&&i.push([p])}else i[i.length-1].push(c);return i},[[]]);this.isGraphReverse&&l.forEach(i=>i.reverse()),this.isGraphVertical?l.forEach(i=>{if(i.length<=1)return;const c=i[0],d=i[i.length-1],f=i[1].x,p=Math.round(Math.abs(c.y-d.y)/this.commitSpacing)-1,m=p>0?new Array(p).fill(0).map((v,y)=>({x:f,y:i[0].y-this.commitSpacing*(y+1)})):[],h=s.get(a)||[];s.set(a,[...h,[c,...m,d]])}):l.forEach(i=>{if(i.length<=1)return;const c=i[0],d=i[i.length-1],f=i[1].y,p=Math.round(Math.abs(c.x-d.x)/this.commitSpacing)-1,m=p>0?new Array(p).fill(0).map((v,y)=>({y:f,x:i[0].x+this.commitSpacing*(y+1)})):[],h=s.get(a)||[];s.set(a,[...h,[c,...m,d]])})}),s}}Io.BranchesPathsCalculator=t;function n(r,s,o){return r.map(a=>"M"+a.map(({x:l,y:i},c,d)=>{if(s&&d.length>1&&(c===1||c===d.length-1)){const f=d[c-1];if(o){const p=(f.y+i)/2;return`C ${f.x} ${p} ${l} ${p} ${l} ${i}`}else{const p=(f.x+l)/2;return`C ${p} ${f.y} ${p} ${i} ${l} ${i}`}}return`L ${l} ${i}`}).join(" ").slice(1)).join(" ")}return Io.toSvgPath=n,Io}var fl={},gv;function Kb(){if(gv)return fl;gv=1,Object.defineProperty(fl,"__esModule",{value:!0});const e=lf(),t=ji(),n=cf();class r{constructor(o,a){this._graph=o,this._onGraphUpdate=a}clear(){return this._graph.refs=new n.Refs,this._graph.tags=new n.Refs,this._graph.commits=[],this._graph.branches=new Map,this._graph.currentBranch=this._graph.createBranch("master"),this._onGraphUpdate(),this}commit(o){return this._graph.currentBranch.getUserApi().commit(o),this}branch(o){return this._graph.createBranch(o).getUserApi()}tag(...o){let a,l,i,c;if(typeof o[0]=="string"?(a=o[0],l=o[1]):(a=o[0].name,l=o[0].ref,i=o[0].style,c=o[0].render),!l){const f=this._graph.refs.getCommit("HEAD");if(!f)return this;l=f}let d;if(this._graph.refs.hasCommit(l)&&(d=l),this._graph.refs.hasName(l)&&(d=this._graph.refs.getCommit(l)),!d)throw new Error(`The ref "${l}" does not exist`);return this._graph.tags.set(a,d),this._graph.tagStyles[a]=i,this._graph.tagRenders[a]=c,this._onGraphUpdate(),this}import(o){const a=new Error("Only `git2json` format is supported for imported data.");if(!Array.isArray(o)||!o.every(d=>typeof d=="object"&&typeof d.author=="object"&&Array.isArray(d.refs)))throw a;const i=o.map(d=>Object.assign({},d,{style:Object.assign({},this._graph.template.commit,{message:Object.assign({},this._graph.template.commit.message,{display:this._graph.shouldDisplayCommitMessage})}),author:`${d.author.name} <${d.author.email}>`})).reverse();this.clear(),this._graph.commits=i.map(d=>new e.Commit(d)),i.forEach(({refs:d,hash:f})=>{if(!d||!f)return;const p="tag: ";d.map(h=>h.split(p)).map(([h,v])=>v).filter(h=>typeof h=="string").forEach(h=>this._graph.tags.set(h,f)),d.filter(h=>!h.startsWith(p)).forEach(h=>this._graph.refs.set(h,f))});const c=this._getBranches();return this._graph.commits.map(d=>this._withBranches(c,d)).reduce((d,f)=>(f.branches&&f.branches.forEach(p=>d.add(p)),d),new Set).forEach(d=>this.branch(d)),this._onGraphUpdate(),this}_withBranches(o,a){let l=Array.from((o.get(a.hash)||new Set).values());return l.length===0&&(l=[t.DELETED_BRANCH_NAME]),a.setBranches(l)}_getBranches(){const o=new Map,a=[];return this._graph.refs.getAllNames().filter(i=>i!=="HEAD").forEach(i=>{const c=this._graph.refs.getCommit(i);for(c&&a.push(c);a.length>0;){const d=a.pop(),f=this._graph.commits.find(({hash:m})=>m===d),p=o.get(d)||new Set;p.add(i),o.set(d,p),f&&f.parents&&f.parents.length>0&&a.push(f.parents[0])}}),o}}return fl.GitgraphUserApi=r,fl}var bv;function gP(){if(bv)return sl;bv=1,Object.defineProperty(sl,"__esModule",{value:!0});const e=ji(),t=vP(),n=uf(),r=mP(),s=af(),o=cf(),a=Wb(),l=ko(),i=of(),c=Kb();class d{constructor(p={}){this.refs=new o.Refs,this.tags=new o.Refs,this.tagStyles={},this.tagRenders={},this.commits=[],this.branches=new Map,this.listeners=[],this.nextTimeoutId=null,this.template=s.getTemplate(p.template),this.currentBranch=this.createBranch("master"),this.orientation=p.orientation,this.reverseArrow=l.booleanOptionOr(p.reverseArrow,!1),this.initCommitOffsetX=l.numberOptionOr(p.initCommitOffsetX,0),this.initCommitOffsetY=l.numberOptionOr(p.initCommitOffsetY,0),this.mode=p.mode,this.author=p.author||"Sergio Flores <saxo-guy@epic.com>",this.commitMessage=p.commitMessage||"He doesn't like George Michael! Boooo!",this.generateCommitHash=typeof p.generateCommitHash=="function"?p.generateCommitHash:()=>{},this.branchesOrderFunction=typeof p.compareBranchesOrder=="function"?p.compareBranchesOrder:void 0,this.branchLabelOnEveryCommit=l.booleanOptionOr(p.branchLabelOnEveryCommit,!1)}get isHorizontal(){return this.orientation===i.Orientation.Horizontal||this.orientation===i.Orientation.HorizontalReverse}get isVertical(){return!this.isHorizontal}get isReverse(){return this.orientation===i.Orientation.HorizontalReverse||this.orientation===i.Orientation.VerticalReverse}get shouldDisplayCommitMessage(){return!this.isHorizontal&&this.mode!==n.Mode.Compact}getUserApi(){return new c.GitgraphUserApi(this,()=>this.next())}subscribe(p){this.listeners.push(p);let m=!0;return()=>{if(!m)return;m=!1;const h=this.listeners.indexOf(p);this.listeners.splice(h,1)}}getRenderedData(){const p=this.computeRenderedCommits(),m=this.computeRenderedBranchesPaths(p),h=this.computeCommitMessagesX(m);return this.computeBranchesColor(p,m),{commits:p,branchesPaths:m,commitMessagesX:h}}createBranch(p){const m="HEAD";let h={gitgraph:this,name:"",parentCommitHash:this.refs.getCommit(m),style:this.template.branch,onGraphUpdate:()=>this.next()};if(typeof p=="string")h.name=p,h.parentCommitHash=this.refs.getCommit(m);else{const y=p.from?p.from.name:m,_=this.refs.getCommit(y)||(this.refs.hasCommit(p.from)?p.from:void 0);p.style=p.style||{},h=Object.assign({},h,p,{parentCommitHash:_,style:Object.assign({},h.style,p.style,{label:Object.assign({},h.style.label,p.style.label)})})}const v=new e.Branch(h);return this.branches.set(v.name,v),v}computeRenderedCommits(){const p=this.getBranches(),m=(()=>{const x=new Set(this.commits.reduce((b,{hash:C})=>p.has(C)?b:[...b,C],[])),w=this.commits.reduce((b,C)=>C.parents.length>1?[...b,...C.parents.slice(1).map(S=>this.commits.find(({hash:A})=>S===A))]:b,[]),g=new Set;return w.forEach(b=>{let C=b;for(;C&&x.has(C.hash);)g.add(C.hash),C=C.parents.length>0?this.commits.find(({hash:S})=>C.parents[0]===S):void 0}),g})(),h=this.commits.filter(({hash:x})=>p.has(x)||m.has(x)),v=h.map(x=>this.withBranches(p,x)),y=t.createGraphRows(this.mode,h),_=new r.BranchesOrder(v,this.template.colors,this.branchesOrderFunction);return v.map(x=>x.setRefs(this.refs)).map(x=>this.withPosition(y,_,x)).map(x=>x.withDefaultColor(this.getBranchDefaultColor(_,x.branchToDisplay))).map(x=>x.setTags(this.tags,w=>Object.assign({},this.tagStyles[w],this.template.tag),w=>this.tagRenders[w]))}computeRenderedBranchesPaths(p){return new a.BranchesPathsCalculator(p,this.branches,this.template.commit.spacing,this.isVertical,this.isReverse,()=>e.createDeletedBranch(this,this.template.branch,()=>this.next())).execute()}computeBranchesColor(p,m){const h=new r.BranchesOrder(p,this.template.colors,this.branchesOrderFunction);Array.from(m).forEach(([v])=>{v.computedColor=v.style.color||this.getBranchDefaultColor(h,v.name)})}computeCommitMessagesX(p){return Array.from(p).length*this.template.branch.spacing}withBranches(p,m){let h=Array.from((p.get(m.hash)||new Set).values());return h.length===0&&(h=[e.DELETED_BRANCH_NAME]),m.setBranches(h)}getBranches(){const p=new Map,m=[];return this.refs.getAllNames().filter(v=>v!=="HEAD").forEach(v=>{const y=this.refs.getCommit(v);for(y&&m.push(y);m.length>0;){const _=m.pop(),x=this.commits.find(({hash:g})=>g===_),w=p.get(_)||new Set;w.add(v),p.set(_,w),x&&x.parents&&x.parents.length>0&&m.push(x.parents[0])}}),p}withPosition(p,m,h){const v=p.getRowOf(h.hash),y=p.getMaxRow(),_=m.get(h.branchToDisplay);switch(this.orientation){default:return h.setPosition({x:this.initCommitOffsetX+this.template.branch.spacing*_,y:this.initCommitOffsetY+this.template.commit.spacing*(y-v)});case i.Orientation.VerticalReverse:return h.setPosition({x:this.initCommitOffsetX+this.template.branch.spacing*_,y:this.initCommitOffsetY+this.template.commit.spacing*v});case i.Orientation.Horizontal:return h.setPosition({x:this.initCommitOffsetX+this.template.commit.spacing*v,y:this.initCommitOffsetY+this.template.branch.spacing*_});case i.Orientation.HorizontalReverse:return h.setPosition({x:this.initCommitOffsetX+this.template.commit.spacing*(y-v),y:this.initCommitOffsetY+this.template.branch.spacing*_})}}getBranchDefaultColor(p,m){return p.getColorOf(m)}next(){this.nextTimeoutId&&window.clearTimeout(this.nextTimeoutId),this.nextTimeoutId=window.setTimeout(()=>{this.listeners.forEach(p=>p(this.getRenderedData()))},0)}}return sl.GitgraphCore=d,sl}var yv;function bP(){if(yv)return zt;yv=1,Object.defineProperty(zt,"__esModule",{value:!0});var e=gP();zt.GitgraphCore=e.GitgraphCore;var t=uf();zt.Mode=t.Mode;var n=Kb();zt.GitgraphUserApi=n.GitgraphUserApi;var r=zb();zt.BranchUserApi=r.BranchUserApi;var s=ji();zt.Branch=s.Branch;var o=lf();zt.Commit=o.Commit;var a=Hb();zt.Tag=a.Tag;var l=cf();zt.Refs=l.Refs;var i=af();zt.MergeStyle=i.MergeStyle,zt.TemplateName=i.TemplateName,zt.templateExtend=i.templateExtend;var c=of();zt.Orientation=c.Orientation;var d=Wb();zt.toSvgPath=d.toSvgPath;var f=ko();return zt.arrowSvgPath=f.arrowSvgPath,zt}var zs=bP(),vr="http://www.w3.org/2000/svg";function yP(e){var t=document.createElementNS(vr,"svg");return t}function Kt(e){var t=document.createElementNS(vr,"g");return e.children.forEach(function(n){return n&&t.appendChild(n)}),e.translate&&t.setAttribute("transform","translate("+e.translate.x+", "+e.translate.y+")"),e.fill&&t.setAttribute("fill",e.fill),e.stroke&&t.setAttribute("stroke",e.stroke),e.strokeWidth&&t.setAttribute("stroke-width",e.strokeWidth.toString()),e.onClick&&t.addEventListener("click",e.onClick),e.onMouseOver&&t.addEventListener("mouseover",e.onMouseOver),e.onMouseOut&&t.addEventListener("mouseout",e.onMouseOut),t}function ya(e){var t=document.createElementNS(vr,"text");return t.setAttribute("alignment-baseline","central"),t.setAttribute("dominant-baseline","central"),t.textContent=e.content,e.fill&&t.setAttribute("fill",e.fill),e.font&&t.setAttribute("style","font: "+e.font),e.anchor&&t.setAttribute("text-anchor",e.anchor),e.translate&&(t.setAttribute("x",e.translate.x.toString()),t.setAttribute("y",e.translate.y.toString())),e.onClick&&t.addEventListener("click",e.onClick),t}function wP(e){var t=document.createElementNS(vr,"circle");return t.setAttribute("cx",e.radius.toString()),t.setAttribute("cy",e.radius.toString()),t.setAttribute("r",e.radius.toString()),e.id&&t.setAttribute("id",e.id),e.fill&&t.setAttribute("fill",e.fill),t}function _P(e){var t=document.createElementNS(vr,"rect");return t.setAttribute("width",e.width.toString()),t.setAttribute("height",e.height.toString()),e.borderRadius&&t.setAttribute("rx",e.borderRadius.toString()),e.fill&&t.setAttribute("fill",e.fill||"none"),e.stroke&&t.setAttribute("stroke",e.stroke),t}function ii(e){var t=document.createElementNS(vr,"path");return t.setAttribute("d",e.d),e.fill&&t.setAttribute("fill",e.fill),e.stroke&&t.setAttribute("stroke",e.stroke),e.strokeWidth&&t.setAttribute("stroke-width",e.strokeWidth.toString()),e.translate&&t.setAttribute("transform","translate("+e.translate.x+", "+e.translate.y+")"),t}function wv(e){var t=document.createElementNS(vr,"use");return t.setAttribute("href","#"+e),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+e),t}function CP(){return document.createElementNS(vr,"clipPath")}function SP(e){var t=document.createElementNS(vr,"defs");return e.forEach(function(n){return t.appendChild(n)}),t}function EP(e){var t=document.createElementNS(vr,"foreignObject");t.setAttribute("width",e.width.toString()),e.translate&&(t.setAttribute("x",e.translate.x.toString()),t.setAttribute("y",e.translate.y.toString()));var n=document.createElement("p");return n.textContent=e.content,t.appendChild(n),t}var Zo=10,Ub=5;function kP(e,t){var n=_P({width:0,height:0,borderRadius:e.style.label.borderRadius,stroke:e.style.label.strokeColor||t.style.color,fill:e.style.label.bgColor}),r=ya({content:e.name,translate:{x:Zo,y:0},font:e.style.label.font,fill:e.style.label.color||t.style.color}),s=Kt({children:[n]}),o=new MutationObserver(function(){var a=r.getBBox(),l=a.height,i=a.width,c=i+2*Zo,d=l+2*Ub;n.setAttribute("width",c.toString()),n.setAttribute("height",d.toString()),r.setAttribute("y",(d/2).toString())});return o.observe(s,{attributes:!1,subtree:!1,childList:!0}),s.appendChild(r),s}var Rc=10,OP=5;function TP(e){var t=ii({d:"",fill:e.style.bgColor,stroke:e.style.strokeColor}),n=ya({content:e.name,fill:e.style.color,font:e.style.font,translate:{x:0,y:0}}),r=Kt({children:[t]}),s=e.style.pointerWidth,o=new MutationObserver(function(){var a=n.getBBox(),l=a.height,i=a.width;if(!(l===0||i===0)){var c=e.style.borderRadius,d=s+i+2*Rc,f=l+2*OP,p=["M 0,0","L "+s+","+f/2,"V "+f/2,"Q "+s+","+f/2+" "+(s+c)+","+f/2,"H "+(d-c),"Q "+d+","+f/2+" "+d+","+(f/2-c),"V -"+(f/2-c),"Q "+d+",-"+f/2+" "+(d-c)+",-"+f/2,"H "+(s+c),"Q "+s+",-"+f/2+" "+s+",-"+f/2,"V -"+f/2,"z"].join(" ");t.setAttribute("d",p.toString()),n.setAttribute("x",(s+Rc).toString())}});return o.observe(r,{attributes:!1,subtree:!1,childList:!0}),r.appendChild(n),r}var Qo=10,tr=10;function xP(e){var t=ii({d:"",fill:"#EEE"}),n=ya({translate:{x:tr+Qo,y:0},content:e.hashAbbrev+" - "+e.subject,fill:"#333"}),r=e.style.dot.size*2,s=Kt({translate:{x:r,y:r/2},children:[t]}),o=new MutationObserver(function(){var a=n.getBBox().width,l=5,i=50,c=tr+a+2*Qo,d=["M 0,0","L "+tr+","+tr,"V "+(i/2-l),"Q "+tr+","+i/2+" "+(tr+l)+","+i/2,"H "+(c-l),"Q "+c+","+i/2+" "+c+","+(i/2-l),"V -"+(i/2-l),"Q "+c+",-"+i/2+" "+(c-l)+",-"+i/2,"H "+(tr+l),"Q "+tr+",-"+i/2+" "+tr+",-"+(i/2-l),"V -"+tr,"z"].join(" ");t.setAttribute("d",d.toString())});return o.observe(s,{attributes:!1,subtree:!1,childList:!0}),s.appendChild(n),s}function SI(e,t){var n={},r={},s=!1,o,a,l=0,i=null,c=yP();p(!!(t&&t.responsive)),e.appendChild(c),t&&t.responsive&&e.setAttribute("style","display:inline-block; position: relative; width:100%; padding-bottom:100%; vertical-align:middle; overflow:hidden;");var d=new zs.GitgraphCore(t);return d.subscribe(function(M){s=!0,f(M)}),d.getUserApi();function f(M){n={};var $=M.commits,U=M.branchesPaths;l=M.commitMessagesX,o=M,a=v($),c.innerHTML="",c.appendChild(Kt({translate:{x:Zo,y:Qo},children:[h(U),a]}))}function p(M){var $=new MutationObserver(function(){s?(s=!1,U(),f(o)):(W(),B(M))});$.observe(c,{attributes:!1,subtree:!0,childList:!0});function U(){var I=Array.from(a.children),V=0,O=d.orientation===zs.Orientation.VerticalReverse?I:I.reverse();r=O.reduce(function(T,H){var Y=parseInt(H.getAttribute("transform").split(",")[1].slice(0,-1),10),q=H.getElementsByTagName("foreignObject")[0],X=q&&q.firstElementChild;return T[Y]=Y+V,V+=_v(X),T},{})}function W(){if(!d.isHorizontal){var I=10;Object.keys(n).forEach(function(V){var O=n[V],T=O.branchLabel,H=O.tags,Y=O.message,q=l;if(T){m(T,q);var X=T.getBBox().width+2*Zo;q+=X+I}H.forEach(function(G){m(G,q);var ie=parseFloat(G.getAttribute("data-offset")||"0"),ge=G.getBBox().width+2*Rc+ie;q+=ge+I}),Y&&m(Y,q)})}}function B(I){var V=c.getBBox(),O=V.height,T=V.width,H=50,Y=20,q=d.isHorizontal?H:Zo+Qo,X=d.isHorizontal?H:Ub+Qo+Y;I?(c.setAttribute("preserveAspectRatio","xMinYMin meet"),c.setAttribute("viewBox","0 0 "+(T+q)+" "+(O+X))):(c.setAttribute("width",(T+q).toString()),c.setAttribute("height",(O+X).toString()))}}function m(M,$){var U=M.getAttribute("transform")||"translate(0, 0)";M.setAttribute("transform",U.replace(/translate\(([\d\.]+),/,"translate("+$+","))}function h(M){var $=d.template.commit.dot.size,U=d.template.branch.mergeStyle===zs.MergeStyle.Bezier,W=Array.from(M).map(function(B){var I=B[0],V=B[1];return ii({d:zs.toSvgPath(V.map(function(O){return O.map(C)}),U,d.isVertical),fill:"none",stroke:I.computedColor||"",strokeWidth:I.style.lineWidth,translate:{x:$,y:$}})});return Kt({children:W})}function v(M){return Kt({children:M.map($)});function $(W){var B=C(W),I=B.x,V=B.y;return Kt({translate:{x:I,y:V},children:[g(W)].concat(U(W),[Kt({translate:{x:-I,y:0},children:[y(W)].concat(x(W),w(W))})])})}function U(W){if(!d.template.arrow.size)return[null];var B=W.style.dot.size;return W.parents.map(function(I){var V=M.find(function(H){var Y=H.hash;return Y===I});if(!V)return null;var O=d.reverseArrow?{x:B+(V.x-W.x),y:B+(V.y-W.y)}:{x:B,y:B},T=ii({d:zs.arrowSvgPath(d,V,W),fill:d.template.arrow.color||""});return Kt({translate:O,children:[T]})})}}function y(M){if(!M.style.message.display)return null;var $;if(M.renderMessage)return $=Kt({children:[]}),_($),$.appendChild(M.renderMessage(M)),A(M,$),$;var U=ya({content:M.message,fill:M.style.message.color||"",font:M.style.message.font,onClick:M.onMessageClick});if($=Kt({translate:{x:0,y:M.style.dot.size},children:[U]}),M.body){var W=EP({width:600,translate:{x:10,y:0},content:M.body});_($),$.appendChild(W)}return A(M,$),$}function _(M){var $=new MutationObserver(function(W){W.forEach(function(B){var I=B.target;return U(I)})});$.observe(M,{attributes:!1,subtree:!1,childList:!0});function U(W){if(W.nodeName==="foreignObject"){var B=W.firstChild&&W.firstChild.parentElement;if(!B)return;B.setAttribute("height",_v(B.firstElementChild).toString())}W.childNodes.forEach(U)}}function x(M){var $=Array.from(d.branches.values());return $.map(function(U){if(!U.style.label.display)return null;if(!d.branchLabelOnEveryCommit){var W=d.refs.getCommit(U.name);if(M.hash!==W)return null}if(M.branchToDisplay!==U.name)return null;var B=U.renderLabel?U.renderLabel(U):kP(U,M),I;if(d.isVertical)I=Kt({children:[B]});else{var V=M.style.dot.size*2,O=10;I=Kt({translate:{x:M.x,y:V+O},children:[B]})}return S(M,I),I})}function w(M){return M.tags?d.isHorizontal?[]:M.tags.map(function($){var U=$.render?$.render($.name,$.style):TP($),W=Kt({translate:{x:0,y:M.style.dot.size},children:[U]});return W.setAttribute("data-offset",$.style.pointerWidth.toString()),E(M,W),W}):[]}function g(M){if(M.renderDot)return M.renderDot(M);var $=M.hash,U=wP({id:$,radius:M.style.dot.size,fill:M.style.dot.color||""}),W="clip-"+M.hash,B=CP();B.setAttribute("id",W),B.appendChild(wv($));var I=wv($);I.setAttribute("clip-path","url(#"+W+")"),I.setAttribute("stroke",M.style.dot.strokeColor||"");var V=M.style.dot.strokeWidth?M.style.dot.strokeWidth*2:0;I.setAttribute("stroke-width",V.toString());var O=M.dotText?ya({content:M.dotText,font:M.style.dot.font,anchor:"middle",translate:{x:M.style.dot.size,y:M.style.dot.size}}):null;return Kt({onClick:M.onClick,onMouseOver:function(){b(M),M.onMouseOver()},onMouseOut:function(){i&&i.remove(),M.onMouseOut()},children:[SP([U,B]),I,O]})}function b(M){if(c.firstChild&&!(d.isVertical&&d.mode!==zs.Mode.Compact)&&!(d.isVertical&&!M.style.hasTooltipInCompactMode)){var $=M.renderTooltip?M.renderTooltip(M):xP(M);i=Kt({translate:C(M),children:[$]}),c.firstChild.appendChild(i)}}function C(M){var $=M.x,U=M.y;return{x:$,y:r[U]||U}}function S(M,$){n[M.hashAbbrev]||F(M),n[M.hashAbbrev].branchLabel=$}function A(M,$){n[M.hashAbbrev]||F(M),n[M.hashAbbrev].message=$}function E(M,$){n[M.hashAbbrev]||F(M),n[M.hashAbbrev].tags.push($)}function F(M){n[M.hashAbbrev]={branchLabel:null,tags:[],message:null}}}function _v(e){var t=0;if(e){var n=e.getBoundingClientRect().height,r=window.getComputedStyle(e).marginTop||"0px",s=parseInt(r.replace("px",""),10);t=n+s}return t}export{nI as $,zP as A,qP as B,kb as C,Gx as D,wI as E,Ke as F,mt as G,Sd as H,Me as I,Ri as J,P as K,Ot as L,LP as M,lI as N,Ju as O,Xs as P,qg as Q,iI as R,JP as S,Xe as T,ct as U,UP as V,_I as W,NP as X,jP as Y,Yn as Z,tI as _,go as a,Ge as a0,ZP as a1,KP as a2,hI as a3,pI as a4,lr as a5,IP as a6,GP as a7,uI as a8,cI as a9,FP as aA,v3 as aB,Je as aC,Sw as aD,AP as aE,rI as aa,vI as ab,dI as ac,fI as ad,sI as ae,oI as af,co as ag,bI as ah,yI as ai,Ve as aj,Pt as ak,DP as al,XP as am,HP as an,WP as ao,VP as ap,Os as aq,aI as ar,eI as as,mI as at,QP as au,PP as av,SI as aw,K4 as ax,Uy as ay,YP as az,ee as b,k as c,MP as d,K as e,R as f,j as g,re as h,et as i,be as j,de as k,Su as l,_o as m,le as n,ut as o,gI as p,da as q,D as r,$P as s,ha as t,u,BP as v,ke as w,RP as x,At as y,ze as z};
45
+ */const R$=function(e,t){if(e&&e.addEventListener){const n=function(r){const s=$$(r);t&&Reflect.apply(t,this,[r,s])};e.addEventListener("wheel",n,{passive:!0})}},P$={beforeMount(e,t){R$(e,t.value)}};let I$=1;const L$=ee({name:"ElTable",directives:{Mousewheel:P$},components:{TableHeader:u$,TableBody:g$,TableFooter:w$,ElScrollbar:$a,hColgroup:mb},props:E$,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change","scroll"],setup(e){const{t}=It(),n=$e("table"),r=ot();Et(Zn,r);const s=QM(r,e);r.store=s;const o=new t$({store:r.store,table:r,fit:e.fit,showHeader:e.showHeader});r.layout=o;const a=k(()=>(s.states.data.value||[]).length===0),{setCurrentRow:l,getSelectionRows:i,toggleRowSelection:c,clearSelection:d,clearFilter:f,toggleAllSelection:p,toggleRowExpansion:m,clearSort:h,sort:v,updateKeyChildren:y}=_$(s),{isHidden:_,renderExpanded:x,setDragVisible:w,isGroup:g,handleMouseLeave:b,handleHeaderFooterMousewheel:C,tableSize:S,emptyBlockStyle:A,handleFixedMousewheel:E,resizeProxyVisible:F,bodyWidth:M,resizeState:$,doLayout:U,tableBodyStyles:W,tableLayout:B,scrollbarViewStyle:I,scrollbarStyle:V}=C$(e,o,s,r),{scrollBarRef:O,scrollTo:T,setScrollLeft:H,setScrollTop:Y}=k$(),q=Or(U,50),X=`${n.namespace.value}-table_${I$++}`;r.tableId=X,r.state={isGroup:g,resizeState:$,doLayout:U,debouncedUpdateLayout:q};const G=k(()=>{var J;return(J=e.sumText)!=null?J:t("el.table.sumText")}),ie=k(()=>{var J;return(J=e.emptyText)!=null?J:t("el.table.emptyText")}),ge=k(()=>vb(s.states.originColumns.value)[0]);return S$(r),Pt(()=>{q.cancel()}),{ns:n,layout:o,store:s,columns:ge,handleHeaderFooterMousewheel:C,handleMouseLeave:b,tableId:X,tableSize:S,isHidden:_,isEmpty:a,renderExpanded:x,resizeProxyVisible:F,resizeState:$,isGroup:g,bodyWidth:M,tableBodyStyles:W,emptyBlockStyle:A,debouncedUpdateLayout:q,handleFixedMousewheel:E,setCurrentRow:l,getSelectionRows:i,toggleRowSelection:c,clearSelection:d,clearFilter:f,toggleAllSelection:p,toggleRowExpansion:m,clearSort:h,doLayout:U,sort:v,updateKeyChildren:y,t,setDragVisible:w,context:r,computedSumText:G,computedEmptyText:ie,tableLayout:B,scrollbarViewStyle:I,scrollbarStyle:V,scrollBarRef:O,scrollTo:T,setScrollLeft:H,setScrollTop:Y,allowDragLastColumn:e.allowDragLastColumn}}});function B$(e,t,n,r,s,o){const a=St("hColgroup"),l=St("table-header"),i=St("table-body"),c=St("table-footer"),d=St("el-scrollbar"),f=Xc("mousewheel");return R(),K("div",{ref:"tableWrapper",class:P([{[e.ns.m("fit")]:e.fit,[e.ns.m("striped")]:e.stripe,[e.ns.m("border")]:e.border||e.isGroup,[e.ns.m("hidden")]:e.isHidden,[e.ns.m("group")]:e.isGroup,[e.ns.m("fluid-height")]:e.maxHeight,[e.ns.m("scrollable-x")]:e.layout.scrollX.value,[e.ns.m("scrollable-y")]:e.layout.scrollY.value,[e.ns.m("enable-row-hover")]:!e.store.states.isComplex.value,[e.ns.m("enable-row-transition")]:(e.store.states.data.value||[]).length!==0&&(e.store.states.data.value||[]).length<100,"has-footer":e.showSummary},e.ns.m(e.tableSize),e.className,e.ns.b(),e.ns.m(`layout-${e.tableLayout}`)]),style:Ge(e.style),"data-prefix":e.ns.namespace.value,onMouseleave:e.handleMouseLeave},[j("div",{class:P(e.ns.e("inner-wrapper"))},[j("div",{ref:"hiddenColumns",class:"hidden-columns"},[fe(e.$slots,"default")],512),e.showHeader&&e.tableLayout==="fixed"?et((R(),K("div",{key:0,ref:"headerWrapper",class:P(e.ns.e("header-wrapper"))},[j("table",{ref:"tableHeader",class:P(e.ns.e("header")),style:Ge(e.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[re(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),re(l,{ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,"append-filter-panel-to":e.appendFilterPanelTo,"allow-drag-last-column":e.allowDragLastColumn,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","append-filter-panel-to","allow-drag-last-column","onSetDragVisible"])],6)],2)),[[f,e.handleHeaderFooterMousewheel]]):de("v-if",!0),j("div",{ref:"bodyWrapper",class:P(e.ns.e("body-wrapper"))},[re(d,{ref:"scrollBarRef","view-style":e.scrollbarViewStyle,"wrap-style":e.scrollbarStyle,always:e.scrollbarAlwaysOn,tabindex:e.scrollbarTabindex,onScroll:p=>e.$emit("scroll",p)},{default:le(()=>[j("table",{ref:"tableBody",class:P(e.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:Ge({width:e.bodyWidth,tableLayout:e.tableLayout})},[re(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),e.showHeader&&e.tableLayout==="auto"?(R(),be(l,{key:0,ref:"tableHeaderRef",class:P(e.ns.e("body-header")),border:e.border,"default-sort":e.defaultSort,store:e.store,"append-filter-panel-to":e.appendFilterPanelTo,onSetDragVisible:e.setDragVisible},null,8,["class","border","default-sort","store","append-filter-panel-to","onSetDragVisible"])):de("v-if",!0),re(i,{context:e.context,highlight:e.highlightCurrentRow,"row-class-name":e.rowClassName,"tooltip-effect":e.tooltipEffect,"tooltip-options":e.tooltipOptions,"row-style":e.rowStyle,store:e.store,stripe:e.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"]),e.showSummary&&e.tableLayout==="auto"?(R(),be(c,{key:1,class:P(e.ns.e("body-footer")),border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["class","border","default-sort","store","sum-text","summary-method"])):de("v-if",!0)],6),e.isEmpty?(R(),K("div",{key:0,ref:"emptyBlock",style:Ge(e.emptyBlockStyle),class:P(e.ns.e("empty-block"))},[j("span",{class:P(e.ns.e("empty-text"))},[fe(e.$slots,"empty",{},()=>[mt(Me(e.computedEmptyText),1)])],2)],6)):de("v-if",!0),e.$slots.append?(R(),K("div",{key:1,ref:"appendWrapper",class:P(e.ns.e("append-wrapper"))},[fe(e.$slots,"append")],2)):de("v-if",!0)]),_:3},8,["view-style","wrap-style","always","tabindex","onScroll"])],2),e.showSummary&&e.tableLayout==="fixed"?et((R(),K("div",{key:1,ref:"footerWrapper",class:P(e.ns.e("footer-wrapper"))},[j("table",{class:P(e.ns.e("footer")),cellspacing:"0",cellpadding:"0",border:"0",style:Ge(e.tableBodyStyles)},[re(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),re(c,{border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["border","default-sort","store","sum-text","summary-method"])],6)],2)),[[At,!e.isEmpty],[f,e.handleHeaderFooterMousewheel]]):de("v-if",!0),e.border||e.isGroup?(R(),K("div",{key:2,class:P(e.ns.e("border-left-patch"))},null,2)):de("v-if",!0)],2),et(j("div",{ref:"resizeProxy",class:P(e.ns.e("column-resize-proxy"))},null,2),[[At,e.resizeProxyVisible]])],46,["data-prefix","onMouseleave"])}var N$=Fe(L$,[["render",B$],["__file","table.vue"]]);const D$={selection:"table-column--selection",expand:"table__expand-column"},F$={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},V$=e=>D$[e]||"",H$={selection:{renderHeader({store:e,column:t}){function n(){return e.states.data.value&&e.states.data.value.length===0}return Je(co,{disabled:n(),size:e.states.tableSize.value,indeterminate:e.states.selection.value.length>0&&!e.states.isAllSelected.value,"onUpdate:modelValue":e.toggleAllSelection,modelValue:e.states.isAllSelected.value,ariaLabel:t.label})},renderCell({row:e,column:t,store:n,$index:r}){return Je(co,{disabled:t.selectable?!t.selectable.call(null,e,r):!1,size:n.states.tableSize.value,onChange:()=>{n.commit("rowSelectedChanged",e)},onClick:s=>s.stopPropagation(),modelValue:n.isSelected(e),ariaLabel:t.label})},sortable:!1,resizable:!1},index:{renderHeader({column:e}){return e.label||"#"},renderCell({column:e,$index:t}){let n=t+1;const r=e.index;return Ye(r)?n=t+r:Oe(r)&&(n=r(t)),Je("div",{},[n])},sortable:!1},expand:{renderHeader({column:e}){return e.label||""},renderCell({row:e,store:t,expanded:n}){const{ns:r}=t,s=[r.e("expand-icon")];return n&&s.push(r.em("expand-icon","expanded")),Je("div",{class:s,onClick:function(a){a.stopPropagation(),t.toggleRowExpansion(e)}},{default:()=>[Je(ze,null,{default:()=>[Je(Xs)]})]})},sortable:!1,resizable:!1}};function z$({row:e,column:t,$index:n}){var r;const s=t.property,o=s&&qo(e,s).value;return t&&t.formatter?t.formatter(e,t,o,n):((r=o==null?void 0:o.toString)==null?void 0:r.call(o))||""}function j$({row:e,treeNode:t,store:n},r=!1){const{ns:s}=n;if(!t)return r?[Je("span",{class:s.e("placeholder")})]:null;const o=[],a=function(l){l.stopPropagation(),!t.loading&&n.loadOrToggle(e)};if(t.indent&&o.push(Je("span",{class:s.e("indent"),style:{"padding-left":`${t.indent}px`}})),kt(t.expanded)&&!t.noLazyChildren){const l=[s.e("expand-icon"),t.expanded?s.em("expand-icon","expanded"):""];let i=Xs;t.loading&&(i=Os),o.push(Je("div",{class:l,onClick:a},{default:()=>[Je(ze,{class:{[s.is("loading")]:t.loading}},{default:()=>[Je(i)]})]}))}else o.push(Je("span",{class:s.e("placeholder")}));return o}function Yh(e,t){return e.reduce((n,r)=>(n[r]=r,n),t)}function W$(e,t){const n=ot();return{registerComplexWatchers:()=>{const o=["fixed"],a={realWidth:"width",realMinWidth:"minWidth"},l=Yh(o,a);Object.keys(l).forEach(i=>{const c=a[i];rt(t,c)&&ke(()=>t[c],d=>{let f=d;c==="width"&&i==="realWidth"&&(f=Gd(d)),c==="minWidth"&&i==="realMinWidth"&&(f=ub(d)),n.columnConfig.value[c]=f,n.columnConfig.value[i]=f;const p=c==="fixed";e.value.store.scheduleLayout(p)})})},registerNormalWatchers:()=>{const o=["label","filters","filterMultiple","filteredValue","sortable","index","formatter","className","labelClassName","filterClassName","showOverflowTooltip","tooltipFormatter"],a={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},l=Yh(o,a);Object.keys(l).forEach(i=>{const c=a[i];rt(t,c)&&ke(()=>t[c],d=>{n.columnConfig.value[i]=d})})}}}function K$(e,t,n){const r=ot(),s=D(""),o=D(!1),a=D(),l=D(),i=$e("table");Jr(()=>{a.value=e.align?`is-${e.align}`:null,a.value}),Jr(()=>{l.value=e.headerAlign?`is-${e.headerAlign}`:a.value,l.value});const c=k(()=>{let g=r.vnode.vParent||r.parent;for(;g&&!g.tableId&&!g.columnId;)g=g.vnode.vParent||g.parent;return g}),d=k(()=>{const{store:g}=r.parent;if(!g)return!1;const{treeData:b}=g.states,C=b.value;return C&&Object.keys(C).length>0}),f=D(Gd(e.width)),p=D(ub(e.minWidth)),m=g=>(f.value&&(g.width=f.value),p.value&&(g.minWidth=p.value),!f.value&&p.value&&(g.width=void 0),g.minWidth||(g.minWidth=80),g.realWidth=Number(Tt(g.width)?g.minWidth:g.width),g),h=g=>{const b=g.type,C=H$[b]||{};Object.keys(C).forEach(A=>{const E=C[A];A!=="className"&&!Tt(E)&&(g[A]=E)});const S=V$(b);if(S){const A=`${u(i.namespace)}-${S}`;g.className=g.className?`${g.className} ${A}`:A}return g},v=g=>{he(g)?g.forEach(C=>b(C)):b(g);function b(C){var S;((S=C==null?void 0:C.type)==null?void 0:S.name)==="ElTableColumn"&&(C.vParent=r)}};return{columnId:s,realAlign:a,isSubColumn:o,realHeaderAlign:l,columnOrTableParent:c,setColumnWidth:m,setColumnForcedProps:h,setColumnRenders:g=>{e.renderHeader||g.type!=="selection"&&(g.renderHeader=C=>(r.columnConfig.value.label,fe(t,"header",C,()=>[g.label]))),t["filter-icon"]&&(g.renderFilterIcon=C=>fe(t,"filter-icon",C));let b=g.renderCell;return g.type==="expand"?(g.renderCell=C=>Je("div",{class:"cell"},[b(C)]),n.value.renderExpanded=C=>t.default?t.default(C):t.default):(b=b||z$,g.renderCell=C=>{let S=null;if(t.default){const U=t.default(C);S=U.some(W=>W.type!==jt)?U:b(C)}else S=b(C);const{columns:A}=n.value.store.states,E=A.value.findIndex(U=>U.type==="default"),F=d.value&&C.cellIndex===E,M=j$(C,F),$={class:"cell",style:{}};return g.showOverflowTooltip&&($.class=`${$.class} ${u(i.namespace)}-tooltip`,$.style={width:`${(C.column.realWidth||Number(C.column.width))-1}px`}),v(S),Je("div",$,[M,S])}),g},getPropsData:(...g)=>g.reduce((b,C)=>(he(C)&&C.forEach(S=>{b[S]=e[S]}),b),{}),getColumnElIndex:(g,b)=>Array.prototype.indexOf.call(g,b),updateColumnOrder:()=>{n.value.store.commit("updateColumnOrder",r.columnConfig.value)}}}var U$={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},tooltipFormatter:Function,fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},filterClassName:String,index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:e=>e.every(t=>["ascending","descending",null].includes(t))}};let q$=1;var Eb=ee({name:"ElTableColumn",components:{ElCheckbox:co},props:U$,setup(e,{slots:t}){const n=ot(),r=D({}),s=k(()=>{let w=n.parent;for(;w&&!w.tableId;)w=w.parent;return w}),{registerNormalWatchers:o,registerComplexWatchers:a}=W$(s,e),{columnId:l,isSubColumn:i,realHeaderAlign:c,columnOrTableParent:d,setColumnWidth:f,setColumnForcedProps:p,setColumnRenders:m,getPropsData:h,getColumnElIndex:v,realAlign:y,updateColumnOrder:_}=K$(e,t,s),x=d.value;l.value=`${x.tableId||x.columnId}_column_${q$++}`,bi(()=>{i.value=s.value!==x;const w=e.type||"default",g=e.sortable===""?!0:e.sortable,b=w==="selection"?!1:Tt(e.showOverflowTooltip)?x.props.showOverflowTooltip:e.showOverflowTooltip,C=Tt(e.tooltipFormatter)?x.props.tooltipFormatter:e.tooltipFormatter,S={...F$[w],id:l.value,type:w,property:e.prop||e.property,align:y,headerAlign:c,showOverflowTooltip:b,tooltipFormatter:C,filterable:e.filters||e.filterMethod,filteredValue:[],filterPlacement:"",filterClassName:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:g,index:e.index,rawColumnKey:n.vnode.key};let $=h(["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],["sortMethod","sortBy","sortOrders"],["selectable","reserveSelection"],["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement","filterClassName"]);$=HM(S,$),$=jM(m,f,p)($),r.value=$,o(),a()}),ut(()=>{var w;const g=d.value,b=i.value?g.vnode.el.children:(w=g.refs.hiddenColumns)==null?void 0:w.children,C=()=>v(b||[],n.vnode.el);r.value.getColumnIndex=C,C()>-1&&s.value.store.commit("insertColumn",r.value,i.value?g.columnConfig.value:null,_)}),Pt(()=>{const w=r.value.getColumnIndex;(w?w():-1)>-1&&s.value.store.commit("removeColumn",r.value,i.value?x.columnConfig.value:null,_)}),n.columnId=l.value,n.columnConfig=r},render(){var e,t,n;try{const r=(t=(e=this.$slots).default)==null?void 0:t.call(e,{row:{},column:{},$index:-1}),s=[];if(he(r))for(const a of r)((n=a.type)==null?void 0:n.name)==="ElTableColumn"||a.shapeFlag&2?s.push(a):a.type===Ke&&he(a.children)&&a.children.forEach(l=>{(l==null?void 0:l.patchFlag)!==1024&&!Be(l==null?void 0:l.children)&&s.push(l)});return Je("div",s)}catch{return Je("div",[])}}});const bI=wt(N$,{TableColumn:Eb}),yI=Pr(Eb);function Y$(e,t){let n;const r=D(!1),s=Rt({...e,originalPosition:"",originalOverflow:"",visible:!1});function o(m){s.text=m}function a(){const m=s.parent,h=p.ns;if(!m.vLoadingAddClassList){let v=m.getAttribute("loading-number");v=Number.parseInt(v)-1,v?m.setAttribute("loading-number",v.toString()):(fr(m,h.bm("parent","relative")),m.removeAttribute("loading-number")),fr(m,h.bm("parent","hidden"))}l(),f.unmount()}function l(){var m,h;(h=(m=p.$el)==null?void 0:m.parentNode)==null||h.removeChild(p.$el)}function i(){var m;e.beforeClose&&!e.beforeClose()||(r.value=!0,clearTimeout(n),n=setTimeout(c,400),s.visible=!1,(m=e.closed)==null||m.call(e))}function c(){if(!r.value)return;const m=s.parent;r.value=!1,m.vLoadingAddClassList=void 0,a()}const f=Sw(ee({name:"ElLoading",setup(m,{expose:h}){const{ns:v,zIndex:y}=Cd("loading");return h({ns:v,zIndex:y}),()=>{const _=s.spinner||s.svg,x=Je("svg",{class:"circular",viewBox:s.svgViewBox?s.svgViewBox:"0 0 50 50",..._?{innerHTML:_}:{}},[Je("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),w=s.text?Je("p",{class:v.b("text")},[s.text]):void 0;return Je(Yn,{name:v.b("fade"),onAfterLeave:c},{default:le(()=>[et(re("div",{style:{backgroundColor:s.background||""},class:[v.b("mask"),s.customClass,s.fullscreen?"is-fullscreen":""]},[Je("div",{class:v.b("spinner")},[x,w])]),[[At,s.visible]])])})}}}));Object.assign(f._context,t??{});const p=f.mount(document.createElement("div"));return{...cn(s),setText:o,removeElLoadingChild:l,close:i,handleAfterLeave:c,vm:p,get $el(){return p.$el}}}let tl;const Qd=function(e={}){if(!ft)return;const t=G$(e);if(t.fullscreen&&tl)return tl;const n=Y$({...t,closed:()=>{var s;(s=t.closed)==null||s.call(t),t.fullscreen&&(tl=void 0)}},Qd._context);X$(t,t.parent,n),Gh(t,t.parent,n),t.parent.vLoadingAddClassList=()=>Gh(t,t.parent,n);let r=t.parent.getAttribute("loading-number");return r?r=`${Number.parseInt(r)+1}`:r="1",t.parent.setAttribute("loading-number",r),t.parent.appendChild(n.$el),Ve(()=>n.visible.value=t.visible),t.fullscreen&&(tl=n),n},G$=e=>{var t,n,r,s;let o;return Be(e.target)?o=(t=document.querySelector(e.target))!=null?t:document.body:o=e.target||document.body,{parent:o===document.body||e.body?document.body:o,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:o===document.body&&((n=e.fullscreen)!=null?n:!0),lock:(r=e.lock)!=null?r:!1,customClass:e.customClass||"",visible:(s=e.visible)!=null?s:!0,beforeClose:e.beforeClose,closed:e.closed,target:o}},X$=async(e,t,n)=>{const{nextZIndex:r}=n.vm.zIndex||n.vm._.exposed.zIndex,s={};if(e.fullscreen)n.originalPosition.value=cs(document.body,"position"),n.originalOverflow.value=cs(document.body,"overflow"),s.zIndex=r();else if(e.parent===document.body){n.originalPosition.value=cs(document.body,"position"),await Ve();for(const o of["top","left"]){const a=o==="top"?"scrollTop":"scrollLeft";s[o]=`${e.target.getBoundingClientRect()[o]+document.body[a]+document.documentElement[a]-Number.parseInt(cs(document.body,`margin-${o}`),10)}px`}for(const o of["height","width"])s[o]=`${e.target.getBoundingClientRect()[o]}px`}else n.originalPosition.value=cs(t,"position");for(const[o,a]of Object.entries(s))n.$el.style[o]=a},Gh=(e,t,n)=>{const r=n.vm.ns||n.vm._.exposed.ns;["absolute","fixed","sticky"].includes(n.originalPosition.value)?fr(t,r.bm("parent","relative")):Ss(t,r.bm("parent","relative")),e.fullscreen&&e.lock?Ss(t,r.bm("parent","hidden")):fr(t,r.bm("parent","hidden"))};Qd._context=null;const Ll=Symbol("ElLoading"),Xh=(e,t)=>{var n,r,s,o;const a=t.instance,l=m=>Ue(t.value)?t.value[m]:void 0,i=m=>{const h=Be(m)&&(a==null?void 0:a[m])||m;return h&&D(h)},c=m=>i(l(m)||e.getAttribute(`element-loading-${xr(m)}`)),d=(n=l("fullscreen"))!=null?n:t.modifiers.fullscreen,f={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:d,target:(r=l("target"))!=null?r:d?void 0:e,body:(s=l("body"))!=null?s:t.modifiers.body,lock:(o=l("lock"))!=null?o:t.modifiers.lock},p=Qd(f);p._context=kb._context,e[Ll]={options:f,instance:p}},J$=(e,t)=>{for(const n of Object.keys(t))dt(t[n])&&(t[n].value=e[n])},kb={mounted(e,t){t.value&&Xh(e,t)},updated(e,t){const n=e[Ll];t.oldValue!==t.value&&(t.value&&!t.oldValue?Xh(e,t):t.value&&t.oldValue?Ue(t.value)&&J$(t.value,n.options):n==null||n.instance.close())},unmounted(e){var t;(t=e[Ll])==null||t.instance.close(),e[Ll]=null}};kb._context=null;const Ob=["success","info","warning","error"],Jt=Zg({customClass:"",dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:ft?document.body:void 0}),Z$=De({customClass:{type:String,default:Jt.customClass},dangerouslyUseHTMLString:{type:Boolean,default:Jt.dangerouslyUseHTMLString},duration:{type:Number,default:Jt.duration},icon:{type:On,default:Jt.icon},id:{type:String,default:Jt.id},message:{type:Ce([String,Object,Function]),default:Jt.message},onClose:{type:Ce(Function),default:Jt.onClose},showClose:{type:Boolean,default:Jt.showClose},type:{type:String,values:Ob,default:Jt.type},plain:{type:Boolean,default:Jt.plain},offset:{type:Number,default:Jt.offset},zIndex:{type:Number,default:Jt.zIndex},grouping:{type:Boolean,default:Jt.grouping},repeatNum:{type:Number,default:Jt.repeatNum}}),Q$={destroy:()=>!0},Hn=Wv([]),eR=e=>{const t=Hn.findIndex(s=>s.id===e),n=Hn[t];let r;return t>0&&(r=Hn[t-1]),{current:n,prev:r}},tR=e=>{const{prev:t}=eR(e);return t?t.vm.exposed.bottom.value:0},nR=(e,t)=>Hn.findIndex(r=>r.id===e)>0?16:t,rR=ee({name:"ElMessage"}),sR=ee({...rR,props:Z$,emits:Q$,setup(e,{expose:t,emit:n}){const r=e,{Close:s}=Ed,o=D(!1),{ns:a,zIndex:l}=Cd("message"),{currentZIndex:i,nextZIndex:c}=l,d=D(),f=D(!1),p=D(0);let m;const h=k(()=>r.type?r.type==="error"?"danger":r.type:"info"),v=k(()=>{const E=r.type;return{[a.bm("icon",E)]:E&&so[E]}}),y=k(()=>r.icon||so[r.type]||""),_=k(()=>tR(r.id)),x=k(()=>nR(r.id,r.offset)+_.value),w=k(()=>p.value+x.value),g=k(()=>({top:`${x.value}px`,zIndex:i.value}));function b(){r.duration!==0&&({stop:m}=Gu(()=>{S()},r.duration))}function C(){m==null||m()}function S(){f.value=!1,Ve(()=>{var E;o.value||((E=r.onClose)==null||E.call(r),n("destroy"))})}function A({code:E}){E===it.esc&&S()}return ut(()=>{b(),c(),f.value=!0}),ke(()=>r.repeatNum,()=>{C(),b()}),Gt(document,"keydown",A),mn(d,()=>{p.value=d.value.getBoundingClientRect().height}),t({visible:f,bottom:w,close:S}),(E,F)=>(R(),be(Yn,{name:u(a).b("fade"),onBeforeEnter:M=>o.value=!0,onBeforeLeave:E.onClose,onAfterLeave:M=>E.$emit("destroy"),persisted:""},{default:le(()=>[et(j("div",{id:E.id,ref_key:"messageRef",ref:d,class:P([u(a).b(),{[u(a).m(E.type)]:E.type},u(a).is("closable",E.showClose),u(a).is("plain",E.plain),E.customClass]),style:Ge(u(g)),role:"alert",onMouseenter:C,onMouseleave:b},[E.repeatNum>1?(R(),be(u(NT),{key:0,value:E.repeatNum,type:u(h),class:P(u(a).e("badge"))},null,8,["value","type","class"])):de("v-if",!0),u(y)?(R(),be(u(ze),{key:1,class:P([u(a).e("icon"),u(v)])},{default:le(()=>[(R(),be(ct(u(y))))]),_:1},8,["class"])):de("v-if",!0),fe(E.$slots,"default",{},()=>[E.dangerouslyUseHTMLString?(R(),K(Ke,{key:1},[de(" Caution here, message could've been compromised, never use user's input as message "),j("p",{class:P(u(a).e("content")),innerHTML:E.message},null,10,["innerHTML"])],2112)):(R(),K("p",{key:0,class:P(u(a).e("content"))},Me(E.message),3))]),E.showClose?(R(),be(u(ze),{key:2,class:P(u(a).e("closeBtn")),onClick:Xe(S,["stop"])},{default:le(()=>[re(u(s))]),_:1},8,["class","onClick"])):de("v-if",!0)],46,["id"]),[[At,f.value]])]),_:3},8,["name","onBeforeEnter","onBeforeLeave","onAfterLeave"]))}});var oR=Fe(sR,[["__file","message.vue"]]);let aR=1;const Tb=e=>{const t=!e||Be(e)||Un(e)||Oe(e)?{message:e}:e,n={...Jt,...t};if(!n.appendTo)n.appendTo=document.body;else if(Be(n.appendTo)){let r=document.querySelector(n.appendTo);xn(r)||(r=document.body),n.appendTo=r}return kt(sr.grouping)&&!n.grouping&&(n.grouping=sr.grouping),Ye(sr.duration)&&n.duration===3e3&&(n.duration=sr.duration),Ye(sr.offset)&&n.offset===16&&(n.offset=sr.offset),kt(sr.showClose)&&!n.showClose&&(n.showClose=sr.showClose),n},lR=e=>{const t=Hn.indexOf(e);if(t===-1)return;Hn.splice(t,1);const{handler:n}=e;n.close()},iR=({appendTo:e,...t},n)=>{const r=`message_${aR++}`,s=t.onClose,o=document.createElement("div"),a={...t,id:r,onClose:()=>{s==null||s(),lR(d)},onDestroy:()=>{no(null,o)}},l=re(oR,a,Oe(a.message)||Un(a.message)?{default:Oe(a.message)?a.message:()=>a.message}:null);l.appContext=n||vo._context,no(l,o),e.appendChild(o.firstElementChild);const i=l.component,d={id:r,vnode:l,vm:i,handler:{close:()=>{i.exposed.close()}},props:l.component.props};return d},vo=(e={},t)=>{if(!ft)return{close:()=>{}};const n=Tb(e);if(n.grouping&&Hn.length){const s=Hn.find(({vnode:o})=>{var a;return((a=o.props)==null?void 0:a.message)===n.message});if(s)return s.props.repeatNum+=1,s.props.type=n.type,s.handler}if(Ye(sr.max)&&Hn.length>=sr.max)return{close:()=>{}};const r=iR(n,t);return Hn.push(r),r.handler};Ob.forEach(e=>{vo[e]=(t={},n)=>{const r=Tb(t);return vo({...r,type:e},n)}});function uR(e){const t=[...Hn];for(const n of t)(!e||e===n.props.type)&&n.handler.close()}vo.closeAll=uR;vo._context=null;const wI=x4(vo,"$message"),kc="_trap-focus-children",hs=[],Jh=e=>{if(hs.length===0)return;const t=hs[hs.length-1][kc];if(t.length>0&&e.code===it.tab){if(t.length===1){e.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const n=e.shiftKey,r=e.target===t[0],s=e.target===t[t.length-1];r&&n&&(e.preventDefault(),t[t.length-1].focus()),s&&!n&&(e.preventDefault(),t[0].focus())}},cR={beforeMount(e){e[kc]=qp(e),hs.push(e),hs.length<=1&&document.addEventListener("keydown",Jh)},updated(e){Ve(()=>{e[kc]=qp(e)})},unmounted(){hs.shift(),hs.length===0&&document.removeEventListener("keydown",Jh)}},dR=ee({name:"ElMessageBox",directives:{TrapFocus:cR},components:{ElButton:ha,ElFocusTrap:Bi,ElInput:lr,ElOverlay:qd,ElIcon:ze,...Ed},inheritAttrs:!1,props:{buttonSize:{type:String,validator:ab},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:t}){const{locale:n,zIndex:r,ns:s,size:o}=Cd("message-box",k(()=>e.buttonSize)),{t:a}=n,{nextZIndex:l}=r,i=D(!1),c=Rt({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",closeIcon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:"",inputValidator:void 0,inputErrorMessage:"",message:"",modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:Qs(Os),cancelButtonLoadingIcon:Qs(Os),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:l()}),d=k(()=>{const I=c.type;return{[s.bm("icon",I)]:I&&so[I]}}),f=$n(),p=$n(),m=k(()=>{const I=c.type;return c.icon||I&&so[I]||""}),h=k(()=>!!c.message),v=D(),y=D(),_=D(),x=D(),w=D(),g=k(()=>c.confirmButtonClass);ke(()=>c.inputValue,async I=>{await Ve(),e.boxType==="prompt"&&I&&$()},{immediate:!0}),ke(()=>i.value,I=>{var V,O;I&&(e.boxType!=="prompt"&&(c.autofocus?_.value=(O=(V=w.value)==null?void 0:V.$el)!=null?O:v.value:_.value=v.value),c.zIndex=l()),e.boxType==="prompt"&&(I?Ve().then(()=>{var T;x.value&&x.value.$el&&(c.autofocus?_.value=(T=U())!=null?T:v.value:_.value=v.value)}):(c.editorErrorMessage="",c.validateError=!1))});const b=k(()=>e.draggable),C=k(()=>e.overflow);X0(v,y,b,C),ut(async()=>{await Ve(),e.closeOnHashChange&&window.addEventListener("hashchange",S)}),Pt(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",S)});function S(){i.value&&(i.value=!1,Ve(()=>{c.action&&t("action",c.action)}))}const A=()=>{e.closeOnClickModal&&M(c.distinguishCancelAndClose?"close":"cancel")},E=Ud(A),F=I=>{if(c.inputType!=="textarea")return I.preventDefault(),M("confirm")},M=I=>{var V;e.boxType==="prompt"&&I==="confirm"&&!$()||(c.action=I,c.beforeClose?(V=c.beforeClose)==null||V.call(c,I,c,S):S())},$=()=>{if(e.boxType==="prompt"){const I=c.inputPattern;if(I&&!I.test(c.inputValue||""))return c.editorErrorMessage=c.inputErrorMessage||a("el.messagebox.error"),c.validateError=!0,!1;const V=c.inputValidator;if(Oe(V)){const O=V(c.inputValue);if(O===!1)return c.editorErrorMessage=c.inputErrorMessage||a("el.messagebox.error"),c.validateError=!0,!1;if(Be(O))return c.editorErrorMessage=O,c.validateError=!0,!1}}return c.editorErrorMessage="",c.validateError=!1,!0},U=()=>{var I,V;const O=(I=x.value)==null?void 0:I.$refs;return(V=O==null?void 0:O.input)!=null?V:O==null?void 0:O.textarea},W=()=>{M("close")},B=()=>{e.closeOnPressEscape&&W()};return e.lockScroll&&Q0(i),{...cn(c),ns:s,overlayEvent:E,visible:i,hasMessage:h,typeClass:d,contentId:f,inputId:p,btnSize:o,iconComponent:m,confirmButtonClasses:g,rootRef:v,focusStartRef:_,headerRef:y,inputRef:x,confirmRef:w,doClose:S,handleClose:W,onCloseRequested:B,handleWrapperClick:A,handleInputEnter:F,handleAction:M,t:a}}});function fR(e,t,n,r,s,o){const a=St("el-icon"),l=St("el-input"),i=St("el-button"),c=St("el-focus-trap"),d=St("el-overlay");return R(),be(Yn,{name:"fade-in-linear",onAfterLeave:f=>e.$emit("vanish"),persisted:""},{default:le(()=>[et(re(d,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:le(()=>[j("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:P(`${e.ns.namespace.value}-overlay-message-box`),onClick:e.overlayEvent.onClick,onMousedown:e.overlayEvent.onMousedown,onMouseup:e.overlayEvent.onMouseup},[re(c,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:le(()=>[j("div",{ref:"rootRef",class:P([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),{[e.ns.m("center")]:e.center}]),style:Ge(e.customStyle),tabindex:"-1",onClick:Xe(()=>{},["stop"])},[e.title!==null&&e.title!==void 0?(R(),K("div",{key:0,ref:"headerRef",class:P([e.ns.e("header"),{"show-close":e.showClose}])},[j("div",{class:P(e.ns.e("title"))},[e.iconComponent&&e.center?(R(),be(a,{key:0,class:P([e.ns.e("status"),e.typeClass])},{default:le(()=>[(R(),be(ct(e.iconComponent)))]),_:1},8,["class"])):de("v-if",!0),j("span",null,Me(e.title),1)],2),e.showClose?(R(),K("button",{key:0,type:"button",class:P(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),onKeydown:Ct(Xe(f=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[re(a,{class:P(e.ns.e("close"))},{default:le(()=>[(R(),be(ct(e.closeIcon||"close")))]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):de("v-if",!0)],2)):de("v-if",!0),j("div",{id:e.contentId,class:P(e.ns.e("content"))},[j("div",{class:P(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(R(),be(a,{key:0,class:P([e.ns.e("status"),e.typeClass])},{default:le(()=>[(R(),be(ct(e.iconComponent)))]),_:1},8,["class"])):de("v-if",!0),e.hasMessage?(R(),K("div",{key:1,class:P(e.ns.e("message"))},[fe(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(R(),be(ct(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(R(),be(ct(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0},{default:le(()=>[mt(Me(e.dangerouslyUseHTMLString?"":e.message),1)]),_:1},8,["for"]))])],2)):de("v-if",!0)],2),et(j("div",{class:P(e.ns.e("input"))},[re(l,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":f=>e.inputValue=f,type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:P({invalid:e.validateError}),onKeydown:Ct(e.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),j("div",{class:P(e.ns.e("errormsg")),style:Ge({visibility:e.editorErrorMessage?"visible":"hidden"})},Me(e.editorErrorMessage),7)],2),[[At,e.showInput]])],10,["id"]),j("div",{class:P(e.ns.e("btns"))},[e.showCancelButton?(R(),be(i,{key:0,loading:e.cancelButtonLoading,"loading-icon":e.cancelButtonLoadingIcon,class:P([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:f=>e.handleAction("cancel"),onKeydown:Ct(Xe(f=>e.handleAction("cancel"),["prevent"]),["enter"])},{default:le(()=>[mt(Me(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):de("v-if",!0),et(re(i,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,"loading-icon":e.confirmButtonLoadingIcon,class:P([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:f=>e.handleAction("confirm"),onKeydown:Ct(Xe(f=>e.handleAction("confirm"),["prevent"]),["enter"])},{default:le(()=>[mt(Me(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[At,e.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[At,e.visible]])]),_:3},8,["onAfterLeave"])}var pR=Fe(dR,[["render",fR],["__file","index.vue"]]);const ba=new Map,hR=e=>{let t=document.body;return e.appendTo&&(Be(e.appendTo)&&(t=document.querySelector(e.appendTo)),xn(e.appendTo)&&(t=e.appendTo),xn(t)||(t=document.body)),t},vR=(e,t,n=null)=>{const r=re(pR,e,Oe(e.message)||Un(e.message)?{default:Oe(e.message)?e.message:()=>e.message}:null);return r.appContext=n,no(r,t),hR(e).appendChild(t.firstElementChild),r.component},mR=()=>document.createElement("div"),gR=(e,t)=>{const n=mR();e.onVanish=()=>{no(null,n),ba.delete(s)},e.onAction=o=>{const a=ba.get(s);let l;e.showInput?l={value:s.inputValue,action:o}:l=o,e.callback?e.callback(l,r.proxy):o==="cancel"||o==="close"?e.distinguishCancelAndClose&&o!=="cancel"?a.reject("close"):a.reject("cancel"):a.resolve(l)};const r=vR(e,n,t),s=r.proxy;for(const o in e)rt(e,o)&&!rt(s.$props,o)&&(o==="closeIcon"&&Ue(e[o])?s[o]=Qs(e[o]):s[o]=e[o]);return s.visible=!0,s};function So(e,t=null){if(!ft)return Promise.reject();let n;return Be(e)||Un(e)?e={message:e}:n=e.callback,new Promise((r,s)=>{const o=gR(e,t??So._context);ba.set(o,{options:e,callback:n,resolve:r,reject:s})})}const bR=["alert","confirm","prompt"],yR={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};bR.forEach(e=>{So[e]=wR(e)});function wR(e){return(t,n,r,s)=>{let o="";return Ue(n)?(r=n,o=""):Tt(n)?o="":o=n,So(Object.assign({title:o,message:t,type:"",...yR[e]},r,{boxType:e}),s)}}So.close=()=>{ba.forEach((e,t)=>{t.doClose()}),ba.clear()};So._context=null;const zr=So;zr.install=e=>{zr._context=e._context,e.config.globalProperties.$msgbox=zr,e.config.globalProperties.$messageBox=zr,e.config.globalProperties.$alert=zr.alert,e.config.globalProperties.$confirm=zr.confirm,e.config.globalProperties.$prompt=zr.prompt};const _I=zr,hr=Object.create(null);hr.open="0";hr.close="1";hr.ping="2";hr.pong="3";hr.message="4";hr.upgrade="5";hr.noop="6";const Bl=Object.create(null);Object.keys(hr).forEach(e=>{Bl[hr[e]]=e});const Oc={type:"error",data:"parser error"},xb=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ab=typeof ArrayBuffer=="function",Mb=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,ef=({type:e,data:t},n,r)=>xb&&t instanceof Blob?n?r(t):Zh(t,r):Ab&&(t instanceof ArrayBuffer||Mb(t))?n?r(t):Zh(new Blob([t]),r):r(hr[e]+(t||"")),Zh=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Qh(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let wu;function _R(e,t){if(xb&&e.data instanceof Blob)return e.data.arrayBuffer().then(Qh).then(t);if(Ab&&(e.data instanceof ArrayBuffer||Mb(e.data)))return t(Qh(e.data));ef(e,!1,n=>{wu||(wu=new TextEncoder),t(wu.encode(n))})}const ev="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",No=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<ev.length;e++)No[ev.charCodeAt(e)]=e;const CR=e=>{let t=e.length*.75,n=e.length,r,s=0,o,a,l,i;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)o=No[e.charCodeAt(r)],a=No[e.charCodeAt(r+1)],l=No[e.charCodeAt(r+2)],i=No[e.charCodeAt(r+3)],d[s++]=o<<2|a>>4,d[s++]=(a&15)<<4|l>>2,d[s++]=(l&3)<<6|i&63;return c},SR=typeof ArrayBuffer=="function",tf=(e,t)=>{if(typeof e!="string")return{type:"message",data:$b(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:ER(e.substring(1),t)}:Bl[n]?e.length>1?{type:Bl[n],data:e.substring(1)}:{type:Bl[n]}:Oc},ER=(e,t)=>{if(SR){const n=CR(e);return $b(n,t)}else return{base64:!0,data:e}},$b=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Rb="",kR=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((o,a)=>{ef(o,!1,l=>{r[a]=l,++s===n&&t(r.join(Rb))})})},OR=(e,t)=>{const n=e.split(Rb),r=[];for(let s=0;s<n.length;s++){const o=tf(n[s],t);if(r.push(o),o.type==="error")break}return r};function TR(){return new TransformStream({transform(e,t){_R(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const o=new DataView(s.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{s=new Uint8Array(9);const o=new DataView(s.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let _u;function nl(e){return e.reduce((t,n)=>t+n.length,0)}function rl(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function xR(e,t){_u||(_u=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(a,l){for(n.push(a);;){if(r===0){if(nl(n)<1)break;const i=rl(n,1);o=(i[0]&128)===128,s=i[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(nl(n)<2)break;const i=rl(n,2);s=new DataView(i.buffer,i.byteOffset,i.length).getUint16(0),r=3}else if(r===2){if(nl(n)<8)break;const i=rl(n,8),c=new DataView(i.buffer,i.byteOffset,i.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){l.enqueue(Oc);break}s=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(nl(n)<s)break;const i=rl(n,s);l.enqueue(tf(o?i:_u.decode(i),t)),r=0}if(s===0||s>e){l.enqueue(Oc);break}}}})}const Pb=4;function Bt(e){if(e)return AR(e)}function AR(e){for(var t in Bt.prototype)e[t]=Bt.prototype[t];return e}Bt.prototype.on=Bt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Bt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Bt.prototype.off=Bt.prototype.removeListener=Bt.prototype.removeAllListeners=Bt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Bt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};Bt.prototype.emitReserved=Bt.prototype.emit;Bt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Bt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Hi=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),kn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),MR="arraybuffer";function Ib(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const $R=kn.setTimeout,RR=kn.clearTimeout;function zi(e,t){t.useNativeTimers?(e.setTimeoutFn=$R.bind(kn),e.clearTimeoutFn=RR.bind(kn)):(e.setTimeoutFn=kn.setTimeout.bind(kn),e.clearTimeoutFn=kn.clearTimeout.bind(kn))}const PR=1.33;function IR(e){return typeof e=="string"?LR(e):Math.ceil((e.byteLength||e.size)*PR)}function LR(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Lb(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function BR(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function NR(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class DR extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class nf extends Bt{constructor(t){super(),this.writable=!1,zi(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new DR(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=tf(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=BR(t);return n.length?"?"+n:""}}class FR extends nf{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};OR(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,kR(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=Lb()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let Bb=!1;try{Bb=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const VR=Bb;function HR(){}class zR extends FR{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,o)=>{this.onError("xhr post error",s,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class cr extends Bt{constructor(t,n,r){super(),this.createRequest=t,zi(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=Ib(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=cr.requestsCount++,cr.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=HR,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete cr.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}cr.requestsCount=0;cr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",tv);else if(typeof addEventListener=="function"){const e="onpagehide"in kn?"pagehide":"unload";addEventListener(e,tv,!1)}}function tv(){for(let e in cr.requests)cr.requests.hasOwnProperty(e)&&cr.requests[e].abort()}const jR=function(){const e=Nb({xdomain:!1});return e&&e.responseType!==null}();class WR extends zR{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=jR&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new cr(Nb,this.uri(),t)}}function Nb(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||VR))return new XMLHttpRequest}catch{}if(!t)try{return new kn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Db=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class KR extends nf{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=Db?{}:Ib(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;ef(r,this.supportsBinary,o=>{try{this.doWrite(r,o)}catch{}s&&Hi(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=Lb()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Cu=kn.WebSocket||kn.MozWebSocket;class UR extends KR{createSocket(t,n,r){return Db?new Cu(t,n,r):n?new Cu(t,n):new Cu(t)}doWrite(t,n){this.ws.send(n)}}class qR extends nf{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=xR(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=TR();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const o=()=>{r.read().then(({done:l,value:i})=>{l||(this.onPacket(i),o())}).catch(l=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&Hi(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const YR={websocket:UR,webtransport:qR,polling:WR},GR=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,XR=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Tc(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=GR.exec(e||""),o={},a=14;for(;a--;)o[XR[a]]=s[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=JR(o,o.path),o.queryKey=ZR(o,o.query),o}function JR(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function ZR(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,o){s&&(n[s]=o)}),n}const xc=typeof addEventListener=="function"&&typeof removeEventListener=="function",Nl=[];xc&&addEventListener("offline",()=>{Nl.forEach(e=>e())},!1);class Zr extends Bt{constructor(t,n){if(super(),this.binaryType=MR,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Tc(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Tc(n.host).host);zi(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=NR(this.opts.query)),xc&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Nl.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=Pb,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Zr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Zr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=IR(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Hi(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Zr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),xc&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Nl.indexOf(this._offlineEventListener);r!==-1&&Nl.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Zr.protocol=Pb;class QR extends Zr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Zr.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Zr.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const a=f=>{const p=new Error("probe error: "+f);p.transport=n.name,o(),this.emitReserved("upgradeError",p)};function l(){a("transport closed")}function i(){a("socket closed")}function c(f){n&&f.name!==n.name&&o()}const d=()=>{n.removeListener("open",s),n.removeListener("error",a),n.removeListener("close",l),this.off("close",i),this.off("upgrading",c)};n.once("open",s),n.once("error",a),n.once("close",l),this.once("close",i),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let eP=class extends QR{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>YR[s]).filter(s=>!!s)),super(t,r)}};function tP(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Tc(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const nP=typeof ArrayBuffer=="function",rP=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Fb=Object.prototype.toString,sP=typeof Blob=="function"||typeof Blob<"u"&&Fb.call(Blob)==="[object BlobConstructor]",oP=typeof File=="function"||typeof File<"u"&&Fb.call(File)==="[object FileConstructor]";function rf(e){return nP&&(e instanceof ArrayBuffer||rP(e))||sP&&e instanceof Blob||oP&&e instanceof File}function Dl(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Dl(e[n]))return!0;return!1}if(rf(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Dl(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Dl(e[n]))return!0;return!1}function aP(e){const t=[],n=e.data,r=e;return r.data=Ac(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Ac(e,t){if(!e)return e;if(rf(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Ac(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Ac(e[r],t));return n}return e}function lP(e,t){return e.data=Mc(e.data,t),delete e.attachments,e}function Mc(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Mc(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Mc(e[n],t));return e}const iP=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],uP=5;var lt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(lt||(lt={}));class cP{constructor(t){this.replacer=t}encode(t){return(t.type===lt.EVENT||t.type===lt.ACK)&&Dl(t)?this.encodeAsBinary({type:t.type===lt.EVENT?lt.BINARY_EVENT:lt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===lt.BINARY_EVENT||t.type===lt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=aP(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}function nv(e){return Object.prototype.toString.call(e)==="[object Object]"}class sf extends Bt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===lt.BINARY_EVENT;r||n.type===lt.BINARY_ACK?(n.type=r?lt.EVENT:lt.ACK,this.reconstructor=new dP(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(rf(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(lt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===lt.BINARY_EVENT||r.type===lt.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(sf.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case lt.CONNECT:return nv(n);case lt.DISCONNECT:return n===void 0;case lt.CONNECT_ERROR:return typeof n=="string"||nv(n);case lt.EVENT:case lt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&iP.indexOf(n[0])===-1);case lt.ACK:case lt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class dP{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=lP(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const fP=Object.freeze(Object.defineProperty({__proto__:null,Decoder:sf,Encoder:cP,get PacketType(){return lt},protocol:uP},Symbol.toStringTag,{value:"Module"}));function Bn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const pP=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Vb extends Bt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Bn(t,"open",this.onopen.bind(this)),Bn(t,"packet",this.onpacket.bind(this)),Bn(t,"error",this.onerror.bind(this)),Bn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,o;if(pP.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const a={type:lt.EVENT,data:n};if(a.options={},a.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,f=n.pop();this._registerAckCallback(d,f),a.id=d}const l=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,i=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!l||(i?(this.notifyOutgoingListeners(a),this.packet(a)):this.sendBuffer.push(a)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===t&&this.sendBuffer.splice(l,1);n.call(this,new Error("operation has timed out"))},s),a=(...l)=>{this.io.clearTimeoutFn(o),n.apply(this,l)};a.withError=!0,this.acks[t]=a}emitWithAck(t,...n){return new Promise((r,s)=>{const o=(a,l)=>a?s(a):r(l);o.withError=!0,n.push(o),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...o)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:lt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case lt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case lt.EVENT:case lt.BINARY_EVENT:this.onevent(t);break;case lt.ACK:case lt.BINARY_ACK:this.onack(t);break;case lt.DISCONNECT:this.ondisconnect();break;case lt.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:lt.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:lt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Eo(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Eo.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};Eo.prototype.reset=function(){this.attempts=0};Eo.prototype.setMin=function(e){this.ms=e};Eo.prototype.setMax=function(e){this.max=e};Eo.prototype.setJitter=function(e){this.jitter=e};class $c extends Bt{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,zi(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Eo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||fP;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new eP(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=Bn(n,"open",function(){r.onopen(),t&&t()}),o=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},a=Bn(n,"error",o);if(this._timeout!==!1){const l=this._timeout,i=this.setTimeoutFn(()=>{s(),o(new Error("timeout")),n.close()},l);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}return this.subs.push(s),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Bn(t,"ping",this.onping.bind(this)),Bn(t,"data",this.ondata.bind(this)),Bn(t,"error",this.onerror.bind(this)),Bn(t,"close",this.onclose.bind(this)),Bn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Hi(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Vb(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Ro={};function Su(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=tP(e,t.path||"/socket.io"),r=n.source,s=n.id,o=n.path,a=Ro[s]&&o in Ro[s].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let i;return l?i=new $c(r,t):(Ro[s]||(Ro[s]=new $c(r,t)),i=Ro[s]),n.query&&!t.query&&(t.query=n.queryKey),i.socket(n.path,t)}Object.assign(Su,{Manager:$c,Socket:Vb,io:Su,connect:Su});var zt={},sl={},Vs={},Hs={},ol={},al={},Eu={},er={},ku={},rv;function of(){return rv||(rv=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.VerticalReverse="vertical-reverse",t.Horizontal="horizontal",t.HorizontalReverse="horizontal-reverse"}(e.Orientation||(e.Orientation={}))}(ku)),ku}var sv;function ko(){if(sv)return er;sv=1,Object.defineProperty(er,"__esModule",{value:!0});const e=of();function t(c,d){return typeof c=="boolean"?c:d}er.booleanOptionOr=t;function n(c,d){return typeof c=="number"?c:d}er.numberOptionOr=n;function r(c,d){return Object.assign({},d.reduce((f,p)=>Object.assign({},f,{[p]:c[p]}),{}))}er.pick=r;function s(c,d){console.log(JSON.stringify(c.map(f=>r(f,d)),null,2))}er.debug=s;function o(c){return c===void 0}er.isUndefined=o;function a(c={}){return Object.keys(c).reduce((d,f)=>o(c[f])?d:Object.assign({},d,{[f]:c[f]}),{})}er.withoutUndefinedKeys=a;function l(c,d,f){const p=f.style.dot.size,m=c.template.arrow.size,h=p+c.template.arrow.offset,v=Math.PI/7,y=i(c,d,f),_=h*Math.cos(y),x=h*Math.sin(y),w=(h+m)*Math.cos(y-v),g=(h+m)*Math.sin(y-v),b=(h+m/2)*Math.cos(y),C=(h+m/2)*Math.sin(y),S=(h+m)*Math.cos(y+v),A=(h+m)*Math.sin(y+v);return`M${_},${x} L${w},${g} Q${b},${C} ${S},${A} L${S},${A}`}er.arrowSvgPath=l;function i(c,d,f){const p=d.x-f.x,m=d.y-f.y,h=c.template.commit.spacing;let v,y;switch(c.orientation){case e.Orientation.Horizontal:v=m,y=-h;break;case e.Orientation.HorizontalReverse:v=m,y=h;break;case e.Orientation.VerticalReverse:v=-h,y=p;break;default:v=h,y=p;break}return c.isVertical?Math.abs(m)>h&&(y=0):Math.abs(p)>h&&(v=0),c.reverseArrow&&(v*=-1,y*=-1),Math.atan2(v,y)}return er}var ov;function af(){return ov||(ov=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=ko();var n;(function(c){c.Bezier="bezier",c.Straight="straight"})(n||(n={})),e.MergeStyle=n,e.DEFAULT_FONT="normal 12pt Calibri";class r{constructor(d){d.branch=d.branch||{},d.branch.label=d.branch.label||{},d.arrow=d.arrow||{},d.commit=d.commit||{},d.commit.dot=d.commit.dot||{},d.commit.message=d.commit.message||{},this.colors=d.colors||["#000000"],this.branch={color:d.branch.color,lineWidth:d.branch.lineWidth||2,mergeStyle:d.branch.mergeStyle||n.Bezier,spacing:t.numberOptionOr(d.branch.spacing,20),label:{display:t.booleanOptionOr(d.branch.label.display,!0),color:d.branch.label.color||d.commit.color,strokeColor:d.branch.label.strokeColor||d.commit.color,bgColor:d.branch.label.bgColor||"white",font:d.branch.label.font||d.commit.message.font||e.DEFAULT_FONT,borderRadius:t.numberOptionOr(d.branch.label.borderRadius,10)}},this.arrow={size:d.arrow.size||null,color:d.arrow.color||null,offset:d.arrow.offset||2},this.commit={color:d.commit.color,spacing:t.numberOptionOr(d.commit.spacing,25),hasTooltipInCompactMode:t.booleanOptionOr(d.commit.hasTooltipInCompactMode,!0),dot:{color:d.commit.dot.color||d.commit.color,size:d.commit.dot.size||3,strokeWidth:t.numberOptionOr(d.commit.dot.strokeWidth,0),strokeColor:d.commit.dot.strokeColor,font:d.commit.dot.font||d.commit.message.font||"normal 10pt Calibri"},message:{display:t.booleanOptionOr(d.commit.message.display,!0),displayAuthor:t.booleanOptionOr(d.commit.message.displayAuthor,!0),displayHash:t.booleanOptionOr(d.commit.message.displayHash,!0),color:d.commit.message.color||d.commit.color,font:d.commit.message.font||e.DEFAULT_FONT}},this.tag=d.tag||{}}}e.Template=r;const s=new r({colors:["#6963FF","#47E8D4","#6BDB52","#E84BA5","#FFA657"],branch:{color:"#000000",lineWidth:4,spacing:50,mergeStyle:n.Straight},commit:{spacing:60,dot:{size:16,strokeColor:"#000000",strokeWidth:4},message:{color:"black"}},arrow:{size:16,offset:-1.5}});e.blackArrowTemplate=s;const o=new r({colors:["#979797","#008fb5","#f1c109"],branch:{lineWidth:10,spacing:50},commit:{spacing:80,dot:{size:14},message:{font:"normal 14pt Arial"}}});e.metroTemplate=o;var a;(function(c){c.Metro="metro",c.BlackArrow="blackarrow"})(a||(a={})),e.TemplateName=a;function l(c,d){const f=i(c);return d.branch||(d.branch={}),d.commit||(d.commit={}),{colors:d.colors||f.colors,arrow:Object.assign({},f.arrow,d.arrow),branch:Object.assign({},f.branch,d.branch,{label:Object.assign({},f.branch.label,d.branch.label)}),commit:Object.assign({},f.commit,d.commit,{dot:Object.assign({},f.commit.dot,d.commit.dot),message:Object.assign({},f.commit.message,d.commit.message)}),tag:Object.assign({},f.tag,d.tag)}}e.templateExtend=l;function i(c){return c?typeof c=="string"?{[a.BlackArrow]:s,[a.Metro]:o}[c]:c:o}e.getTemplate=i}(Eu)),Eu}var av;function Hb(){if(av)return al;av=1,Object.defineProperty(al,"__esModule",{value:!0});const e=af(),t=ko();class n{constructor(s,o,a,l){this.name=s,this.tagStyle=o,this.commitStyle=l,this.render=a}get style(){return{strokeColor:this.tagStyle.strokeColor||this.commitStyle.color,bgColor:this.tagStyle.bgColor||this.commitStyle.color,color:this.tagStyle.color||"white",font:this.tagStyle.font||this.commitStyle.message.font||e.DEFAULT_FONT,borderRadius:t.numberOptionOr(this.tagStyle.borderRadius,10),pointerWidth:t.numberOptionOr(this.tagStyle.pointerWidth,12)}}}return al.Tag=n,al}var lv;function lf(){if(lv)return ol;lv=1,Object.defineProperty(ol,"__esModule",{value:!0});const e=Hb(),t=()=>(Math.random().toString(16).substring(3)+Math.random().toString(16).substring(3)+Math.random().toString(16).substring(3)+Math.random().toString(16).substring(3)).substring(0,40);class n{constructor(s){this.refs=[],this.x=0,this.y=0;let o,a;try{[,o,a]=s.author.match(/(.*) <(.*)>/)}catch{[o,a]=[s.author,""]}this.author={name:o,email:a,timestamp:Date.now()},this.committer={name:o,email:a,timestamp:Date.now()},this.subject=s.subject,this.body=s.body||"",this.hash=s.hash||t(),this.hashAbbrev=this.hash.substring(0,7),this.parents=s.parents?s.parents:[],this.parentsAbbrev=this.parents.map(l=>l.substring(0,7)),this.style=Object.assign({},s.style,{message:Object.assign({},s.style.message),dot:Object.assign({},s.style.dot)}),this.dotText=s.dotText,this.onClick=()=>s.onClick?s.onClick(this):void 0,this.onMessageClick=()=>s.onMessageClick?s.onMessageClick(this):void 0,this.onMouseOver=()=>s.onMouseOver?s.onMouseOver(this):void 0,this.onMouseOut=()=>s.onMouseOut?s.onMouseOut(this):void 0,this.renderDot=s.renderDot,this.renderMessage=s.renderMessage,this.renderTooltip=s.renderTooltip}get message(){let s="";return this.style.message.displayHash&&(s+=`${this.hashAbbrev} `),s+=this.subject,this.style.message.displayAuthor&&(s+=` - ${this.author.name} <${this.author.email}>`),s}get branchToDisplay(){return this.branches?this.branches[0]:""}setRefs(s){return this.refs=s.getNames(this.hash),this}setTags(s,o,a){return this.tags=s.getNames(this.hash).map(l=>new e.Tag(l,o(l),a(l),this.style)),this}setBranches(s){return this.branches=s,this}setPosition({x:s,y:o}){return this.x=s,this.y=o,this}withDefaultColor(s){const o=Object.assign({},this.style,{dot:Object.assign({},this.style.dot),message:Object.assign({},this.style.message)});o.color||(o.color=s),o.dot.color||(o.dot.color=s),o.message.color||(o.message.color=s);const a=this.cloneCommit();return a.style=o,a}cloneCommit(){const s=new n({author:`${this.author.name} <${this.author.email}>`,subject:this.subject,style:this.style,body:this.body,hash:this.hash,parents:this.parents,dotText:this.dotText,onClick:this.onClick,onMessageClick:this.onMessageClick,onMouseOver:this.onMouseOver,onMouseOut:this.onMouseOut,renderDot:this.renderDot,renderMessage:this.renderMessage,renderTooltip:this.renderTooltip});return s.refs=this.refs,s.branches=this.branches,s.tags=this.tags,s.x=this.x,s.y=this.y,s}}return ol.Commit=n,ol}var iv;function zb(){if(iv)return Hs;iv=1;var e=Hs&&Hs.__rest||function(a,l){var i={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&l.indexOf(c)<0&&(i[c]=a[c]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,c=Object.getOwnPropertySymbols(a);d<c.length;d++)l.indexOf(c[d])<0&&Object.prototype.propertyIsEnumerable.call(a,c[d])&&(i[c[d]]=a[c[d]]);return i};Object.defineProperty(Hs,"__esModule",{value:!0});const t=lf(),n=ji(),r=ko();class s{constructor(l,i,c){this._branch=l,this.name=l.name,this._graph=i,this._onGraphUpdate=c}branch(l){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot branch from the deleted branch "${this.name}"`);const i=typeof l=="string"?{name:l}:l;return i.from=this,this._graph.createBranch(i).getUserApi()}commit(l){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot commit on the deleted branch "${this.name}"`);return typeof l=="string"&&(l={subject:l}),l||(l={}),this._commitWithParents(l,[]),this._onGraphUpdate(),this}delete(){if(this._graph.refs.getCommit("HEAD")===this._graph.refs.getCommit(this.name))throw new Error(`Cannot delete the checked out branch "${this.name}"`);return[...function*(i,c){const d=(p,m)=>p.commits.find(({hash:h})=>h===m);let f=d(i,i.refs.getCommit(c.name));for(;f&&f.hash!==c.parentCommitHash;)yield f,f=d(i,f.parents[0])}(this._graph,this._branch)].forEach(i=>{i.refs=i.refs.filter(c=>c!==this.name)}),this._graph.refs.delete(this.name),this._graph.branches.delete(this.name),this._branch=n.createDeletedBranch(this._graph,this._branch.style,()=>{}),this._onGraphUpdate(),this}merge(...l){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot merge to the deleted branch "${this.name}"`);let i=l[0];o(i)||(i={branch:l[0],fastForward:!1,commitOptions:{subject:l[1]}});const{branch:c,fastForward:d,commitOptions:f}=i,p=typeof c=="string"?c:c.name,m=this._graph.refs.getCommit(p);if(!m)throw new Error(`The branch called "${p}" is unknown`);let h=!1;if(d){const v=this._graph.refs.getCommit(this._branch.name);v&&(h=this._areCommitsConnected(v,m))}return d&&h?this._fastForwardTo(m):this._commitWithParents(Object.assign({},f,{subject:f&&f.subject||`Merge branch ${p}`}),[m]),this._onGraphUpdate(),this}tag(l){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot tag on the deleted branch "${this.name}"`);return typeof l=="string"?this._graph.getUserApi().tag({name:l,ref:this._branch.name}):this._graph.getUserApi().tag(Object.assign({},l,{ref:this._branch.name})),this}checkout(){if(this._branch.isDeleted()&&!this._isReferenced())throw new Error(`Cannot checkout the deleted branch "${this.name}"`);const l=this._branch,i=this._graph.refs.getCommit(l.name);return this._graph.currentBranch=l,i&&this._graph.refs.set("HEAD",i),this}_commitWithParents(l,i){const c=this._graph.refs.getCommit(this._branch.name);c?i.unshift(c):this._branch.parentCommitHash&&i.unshift(this._branch.parentCommitHash);const{tag:d}=l,f=e(l,["tag"]),p=new t.Commit(Object.assign({hash:this._graph.generateCommitHash(),author:this._branch.commitDefaultOptions.author||this._graph.author,subject:this._branch.commitDefaultOptions.subject||this._graph.commitMessage},f,{parents:i,style:this._getCommitStyle(l.style)}));c?this._graph.refs.getNames(c).forEach(h=>this._graph.refs.set(h,p.hash)):this._graph.refs.set(this._branch.name,p.hash),this._graph.commits.push(p),this.checkout(),d&&this.tag(d)}_areCommitsConnected(l,i){const c=this._graph.commits.find(({hash:f})=>i===f);return!c||c.parents.length===0?!1:c.parents.includes(l)?!0:c.parents.some(f=>this._areCommitsConnected(l,f))}_fastForwardTo(l){this._graph.refs.set(this._branch.name,l)}_getCommitStyle(l={}){return Object.assign({},r.withoutUndefinedKeys(this._graph.template.commit),r.withoutUndefinedKeys(this._branch.commitDefaultOptions.style),l,{message:Object.assign({},r.withoutUndefinedKeys(this._graph.template.commit.message),r.withoutUndefinedKeys(this._branch.commitDefaultOptions.style.message),l.message,r.withoutUndefinedKeys({display:this._graph.shouldDisplayCommitMessage&&void 0})),dot:Object.assign({},r.withoutUndefinedKeys(this._graph.template.commit.dot),r.withoutUndefinedKeys(this._branch.commitDefaultOptions.style.dot),l.dot)})}_isReferenced(){return this._graph.branches.has(this.name)||this._graph.refs.hasName(this.name)||this._graph.commits.reduce((l,{refs:i})=>[...l,...i],[]).includes(this.name)}}Hs.BranchUserApi=s;function o(a){return typeof a=="object"&&!(a instanceof s)}return Hs}var uv;function ji(){if(uv)return Vs;uv=1,Object.defineProperty(Vs,"__esModule",{value:!0});const e=zb(),t="";Vs.DELETED_BRANCH_NAME=t;class n{constructor(o){this.gitgraph=o.gitgraph,this.name=o.name,this.style=o.style,this.parentCommitHash=o.parentCommitHash,this.commitDefaultOptions=o.commitDefaultOptions||{style:{}},this.onGraphUpdate=o.onGraphUpdate,this.renderLabel=o.renderLabel}getUserApi(){return new e.BranchUserApi(this,this.gitgraph,this.onGraphUpdate)}isDeleted(){return this.name===t}}Vs.Branch=n;function r(s,o,a){return new n({name:t,gitgraph:s,style:o,onGraphUpdate:a})}return Vs.createDeletedBranch=r,Vs}var Po={},ll={},cv;function uf(){if(cv)return ll;cv=1,Object.defineProperty(ll,"__esModule",{value:!0});var e;return function(t){t.Compact="compact"}(e||(e={})),ll.Mode=e,ll}var il={},ul={},dv;function jb(){if(dv)return ul;dv=1,Object.defineProperty(ul,"__esModule",{value:!0});class e{constructor(r){this.rows=new Map,this.maxRowCache=void 0,this.computeRowsFromCommits(r)}getRowOf(r){return this.rows.get(r)||0}getMaxRow(){return this.maxRowCache===void 0&&(this.maxRowCache=t(Array.from(this.rows.values())).length-1),this.maxRowCache}computeRowsFromCommits(r){r.forEach((s,o)=>{this.rows.set(s.hash,o)}),this.maxRowCache=void 0}}ul.RegularGraphRows=e;function t(n){const r=new Set;return n.forEach(s=>r.add(s)),Array.from(r)}return ul}var fv;function hP(){if(fv)return il;fv=1,Object.defineProperty(il,"__esModule",{value:!0});const e=jb();class t extends e.RegularGraphRows{computeRowsFromCommits(r){r.forEach((s,o)=>{let a=o;if(!(o===0)){const i=this.getRowOf(s.parents[0]),c=r[o-1];if(a=Math.max(i+1,this.getRowOf(c.hash)),s.parents.length>1){const f=this.getRowOf(s.parents[1]);i<f&&a++}}this.rows.set(s.hash,a)})}}return il.CompactGraphRows=t,il}var pv;function vP(){if(pv)return Po;pv=1,Object.defineProperty(Po,"__esModule",{value:!0});const e=uf(),t=hP(),n=jb();Po.GraphRows=n.RegularGraphRows;function r(s,o){return s===e.Mode.Compact?new t.CompactGraphRows(o):new n.RegularGraphRows(o)}return Po.createGraphRows=r,Po}var cl={},hv;function mP(){if(hv)return cl;hv=1,Object.defineProperty(cl,"__esModule",{value:!0});class e{constructor(n,r,s){this.branches=new Set,this.colors=r,n.forEach(o=>this.branches.add(o.branchToDisplay)),s&&(this.branches=new Set(Array.from(this.branches).sort(s)))}get(n){return Array.from(this.branches).findIndex(r=>r===n)}getColorOf(n){return this.colors[this.get(n)%this.colors.length]}}return cl.BranchesOrder=e,cl}var dl={},vv;function cf(){if(vv)return dl;vv=1,Object.defineProperty(dl,"__esModule",{value:!0});class e{constructor(){this.commitPerName=new Map,this.namesPerCommit=new Map}set(n,r){const s=this.commitPerName.get(n);return s&&this.removeNameFrom(s,n),this.addNameTo(r,n),this.addCommitTo(n,r),this}delete(n){return this.hasName(n)&&(this.removeNameFrom(this.getCommit(n),n),this.commitPerName.delete(n)),this}getCommit(n){return this.commitPerName.get(n)}getNames(n){return this.namesPerCommit.get(n)||[]}getAllNames(){return Array.from(this.commitPerName.keys())}hasCommit(n){return this.namesPerCommit.has(n)}hasName(n){return this.commitPerName.has(n)}removeNameFrom(n,r){const s=this.namesPerCommit.get(n)||[];this.namesPerCommit.set(n,s.filter(o=>o!==r))}addNameTo(n,r){const s=this.namesPerCommit.get(n)||[];this.namesPerCommit.set(n,[...s,r])}addCommitTo(n,r){this.commitPerName.set(n,r)}}return dl.Refs=e,dl}var Io={},mv;function Wb(){if(mv)return Io;mv=1,Object.defineProperty(Io,"__esModule",{value:!0});const e=ko();class t{constructor(s,o,a,l,i,c){this.branchesPaths=new Map,this.commits=s,this.branches=o,this.commitSpacing=a,this.isGraphVertical=l,this.isGraphReverse=i,this.createDeletedBranch=c}execute(){return this.fromCommits(),this.withMergeCommits(),this.smoothBranchesPaths()}fromCommits(){this.commits.forEach(s=>{let o=this.branches.get(s.branchToDisplay);o||(o=this.getDeletedBranchInPath()||this.createDeletedBranch());const a=[],l=this.branchesPaths.get(o),i=this.commits.find(({hash:c})=>c===s.parents[0]);l?a.push(...l):i&&a.push({x:i.x,y:i.y}),a.push({x:s.x,y:s.y}),this.branchesPaths.set(o,a)})}withMergeCommits(){this.commits.filter(({parents:o})=>o.length>1).forEach(o=>{const a=this.commits.find(({hash:d})=>d===o.parents[1]);if(!a)return;const l=a.branches?a.branches[0]:"";let i=this.branches.get(l);if(!i&&(i=this.getDeletedBranchInPath(),!i))return;const c=[...this.branchesPaths.get(i)||[]];this.branchesPaths.set(i,[...c,{x:o.x,y:o.y,mergeCommit:!0}])})}getDeletedBranchInPath(){return Array.from(this.branchesPaths.keys()).find(s=>s.isDeleted())}smoothBranchesPaths(){const s=new Map;return this.branchesPaths.forEach((o,a)=>{if(o.length<=1){s.set(a,[o]);return}this.isGraphVertical?o=o.sort((i,c)=>i.y>c.y?-1:1):o=o.sort((i,c)=>i.x>c.x?1:-1),this.isGraphReverse&&(o=o.reverse());const l=o.reduce((i,c,d)=>{if(c.mergeCommit){i[i.length-1].push(e.pick(c,["x","y"]));let f=d-1,p=o[f];for(;f>=0&&p.mergeCommit;)f--,p=o[f];f>=0&&i.push([p])}else i[i.length-1].push(c);return i},[[]]);this.isGraphReverse&&l.forEach(i=>i.reverse()),this.isGraphVertical?l.forEach(i=>{if(i.length<=1)return;const c=i[0],d=i[i.length-1],f=i[1].x,p=Math.round(Math.abs(c.y-d.y)/this.commitSpacing)-1,m=p>0?new Array(p).fill(0).map((v,y)=>({x:f,y:i[0].y-this.commitSpacing*(y+1)})):[],h=s.get(a)||[];s.set(a,[...h,[c,...m,d]])}):l.forEach(i=>{if(i.length<=1)return;const c=i[0],d=i[i.length-1],f=i[1].y,p=Math.round(Math.abs(c.x-d.x)/this.commitSpacing)-1,m=p>0?new Array(p).fill(0).map((v,y)=>({y:f,x:i[0].x+this.commitSpacing*(y+1)})):[],h=s.get(a)||[];s.set(a,[...h,[c,...m,d]])})}),s}}Io.BranchesPathsCalculator=t;function n(r,s,o){return r.map(a=>"M"+a.map(({x:l,y:i},c,d)=>{if(s&&d.length>1&&(c===1||c===d.length-1)){const f=d[c-1];if(o){const p=(f.y+i)/2;return`C ${f.x} ${p} ${l} ${p} ${l} ${i}`}else{const p=(f.x+l)/2;return`C ${p} ${f.y} ${p} ${i} ${l} ${i}`}}return`L ${l} ${i}`}).join(" ").slice(1)).join(" ")}return Io.toSvgPath=n,Io}var fl={},gv;function Kb(){if(gv)return fl;gv=1,Object.defineProperty(fl,"__esModule",{value:!0});const e=lf(),t=ji(),n=cf();class r{constructor(o,a){this._graph=o,this._onGraphUpdate=a}clear(){return this._graph.refs=new n.Refs,this._graph.tags=new n.Refs,this._graph.commits=[],this._graph.branches=new Map,this._graph.currentBranch=this._graph.createBranch("master"),this._onGraphUpdate(),this}commit(o){return this._graph.currentBranch.getUserApi().commit(o),this}branch(o){return this._graph.createBranch(o).getUserApi()}tag(...o){let a,l,i,c;if(typeof o[0]=="string"?(a=o[0],l=o[1]):(a=o[0].name,l=o[0].ref,i=o[0].style,c=o[0].render),!l){const f=this._graph.refs.getCommit("HEAD");if(!f)return this;l=f}let d;if(this._graph.refs.hasCommit(l)&&(d=l),this._graph.refs.hasName(l)&&(d=this._graph.refs.getCommit(l)),!d)throw new Error(`The ref "${l}" does not exist`);return this._graph.tags.set(a,d),this._graph.tagStyles[a]=i,this._graph.tagRenders[a]=c,this._onGraphUpdate(),this}import(o){const a=new Error("Only `git2json` format is supported for imported data.");if(!Array.isArray(o)||!o.every(d=>typeof d=="object"&&typeof d.author=="object"&&Array.isArray(d.refs)))throw a;const i=o.map(d=>Object.assign({},d,{style:Object.assign({},this._graph.template.commit,{message:Object.assign({},this._graph.template.commit.message,{display:this._graph.shouldDisplayCommitMessage})}),author:`${d.author.name} <${d.author.email}>`})).reverse();this.clear(),this._graph.commits=i.map(d=>new e.Commit(d)),i.forEach(({refs:d,hash:f})=>{if(!d||!f)return;const p="tag: ";d.map(h=>h.split(p)).map(([h,v])=>v).filter(h=>typeof h=="string").forEach(h=>this._graph.tags.set(h,f)),d.filter(h=>!h.startsWith(p)).forEach(h=>this._graph.refs.set(h,f))});const c=this._getBranches();return this._graph.commits.map(d=>this._withBranches(c,d)).reduce((d,f)=>(f.branches&&f.branches.forEach(p=>d.add(p)),d),new Set).forEach(d=>this.branch(d)),this._onGraphUpdate(),this}_withBranches(o,a){let l=Array.from((o.get(a.hash)||new Set).values());return l.length===0&&(l=[t.DELETED_BRANCH_NAME]),a.setBranches(l)}_getBranches(){const o=new Map,a=[];return this._graph.refs.getAllNames().filter(i=>i!=="HEAD").forEach(i=>{const c=this._graph.refs.getCommit(i);for(c&&a.push(c);a.length>0;){const d=a.pop(),f=this._graph.commits.find(({hash:m})=>m===d),p=o.get(d)||new Set;p.add(i),o.set(d,p),f&&f.parents&&f.parents.length>0&&a.push(f.parents[0])}}),o}}return fl.GitgraphUserApi=r,fl}var bv;function gP(){if(bv)return sl;bv=1,Object.defineProperty(sl,"__esModule",{value:!0});const e=ji(),t=vP(),n=uf(),r=mP(),s=af(),o=cf(),a=Wb(),l=ko(),i=of(),c=Kb();class d{constructor(p={}){this.refs=new o.Refs,this.tags=new o.Refs,this.tagStyles={},this.tagRenders={},this.commits=[],this.branches=new Map,this.listeners=[],this.nextTimeoutId=null,this.template=s.getTemplate(p.template),this.currentBranch=this.createBranch("master"),this.orientation=p.orientation,this.reverseArrow=l.booleanOptionOr(p.reverseArrow,!1),this.initCommitOffsetX=l.numberOptionOr(p.initCommitOffsetX,0),this.initCommitOffsetY=l.numberOptionOr(p.initCommitOffsetY,0),this.mode=p.mode,this.author=p.author||"Sergio Flores <saxo-guy@epic.com>",this.commitMessage=p.commitMessage||"He doesn't like George Michael! Boooo!",this.generateCommitHash=typeof p.generateCommitHash=="function"?p.generateCommitHash:()=>{},this.branchesOrderFunction=typeof p.compareBranchesOrder=="function"?p.compareBranchesOrder:void 0,this.branchLabelOnEveryCommit=l.booleanOptionOr(p.branchLabelOnEveryCommit,!1)}get isHorizontal(){return this.orientation===i.Orientation.Horizontal||this.orientation===i.Orientation.HorizontalReverse}get isVertical(){return!this.isHorizontal}get isReverse(){return this.orientation===i.Orientation.HorizontalReverse||this.orientation===i.Orientation.VerticalReverse}get shouldDisplayCommitMessage(){return!this.isHorizontal&&this.mode!==n.Mode.Compact}getUserApi(){return new c.GitgraphUserApi(this,()=>this.next())}subscribe(p){this.listeners.push(p);let m=!0;return()=>{if(!m)return;m=!1;const h=this.listeners.indexOf(p);this.listeners.splice(h,1)}}getRenderedData(){const p=this.computeRenderedCommits(),m=this.computeRenderedBranchesPaths(p),h=this.computeCommitMessagesX(m);return this.computeBranchesColor(p,m),{commits:p,branchesPaths:m,commitMessagesX:h}}createBranch(p){const m="HEAD";let h={gitgraph:this,name:"",parentCommitHash:this.refs.getCommit(m),style:this.template.branch,onGraphUpdate:()=>this.next()};if(typeof p=="string")h.name=p,h.parentCommitHash=this.refs.getCommit(m);else{const y=p.from?p.from.name:m,_=this.refs.getCommit(y)||(this.refs.hasCommit(p.from)?p.from:void 0);p.style=p.style||{},h=Object.assign({},h,p,{parentCommitHash:_,style:Object.assign({},h.style,p.style,{label:Object.assign({},h.style.label,p.style.label)})})}const v=new e.Branch(h);return this.branches.set(v.name,v),v}computeRenderedCommits(){const p=this.getBranches(),m=(()=>{const x=new Set(this.commits.reduce((b,{hash:C})=>p.has(C)?b:[...b,C],[])),w=this.commits.reduce((b,C)=>C.parents.length>1?[...b,...C.parents.slice(1).map(S=>this.commits.find(({hash:A})=>S===A))]:b,[]),g=new Set;return w.forEach(b=>{let C=b;for(;C&&x.has(C.hash);)g.add(C.hash),C=C.parents.length>0?this.commits.find(({hash:S})=>C.parents[0]===S):void 0}),g})(),h=this.commits.filter(({hash:x})=>p.has(x)||m.has(x)),v=h.map(x=>this.withBranches(p,x)),y=t.createGraphRows(this.mode,h),_=new r.BranchesOrder(v,this.template.colors,this.branchesOrderFunction);return v.map(x=>x.setRefs(this.refs)).map(x=>this.withPosition(y,_,x)).map(x=>x.withDefaultColor(this.getBranchDefaultColor(_,x.branchToDisplay))).map(x=>x.setTags(this.tags,w=>Object.assign({},this.tagStyles[w],this.template.tag),w=>this.tagRenders[w]))}computeRenderedBranchesPaths(p){return new a.BranchesPathsCalculator(p,this.branches,this.template.commit.spacing,this.isVertical,this.isReverse,()=>e.createDeletedBranch(this,this.template.branch,()=>this.next())).execute()}computeBranchesColor(p,m){const h=new r.BranchesOrder(p,this.template.colors,this.branchesOrderFunction);Array.from(m).forEach(([v])=>{v.computedColor=v.style.color||this.getBranchDefaultColor(h,v.name)})}computeCommitMessagesX(p){return Array.from(p).length*this.template.branch.spacing}withBranches(p,m){let h=Array.from((p.get(m.hash)||new Set).values());return h.length===0&&(h=[e.DELETED_BRANCH_NAME]),m.setBranches(h)}getBranches(){const p=new Map,m=[];return this.refs.getAllNames().filter(v=>v!=="HEAD").forEach(v=>{const y=this.refs.getCommit(v);for(y&&m.push(y);m.length>0;){const _=m.pop(),x=this.commits.find(({hash:g})=>g===_),w=p.get(_)||new Set;w.add(v),p.set(_,w),x&&x.parents&&x.parents.length>0&&m.push(x.parents[0])}}),p}withPosition(p,m,h){const v=p.getRowOf(h.hash),y=p.getMaxRow(),_=m.get(h.branchToDisplay);switch(this.orientation){default:return h.setPosition({x:this.initCommitOffsetX+this.template.branch.spacing*_,y:this.initCommitOffsetY+this.template.commit.spacing*(y-v)});case i.Orientation.VerticalReverse:return h.setPosition({x:this.initCommitOffsetX+this.template.branch.spacing*_,y:this.initCommitOffsetY+this.template.commit.spacing*v});case i.Orientation.Horizontal:return h.setPosition({x:this.initCommitOffsetX+this.template.commit.spacing*v,y:this.initCommitOffsetY+this.template.branch.spacing*_});case i.Orientation.HorizontalReverse:return h.setPosition({x:this.initCommitOffsetX+this.template.commit.spacing*(y-v),y:this.initCommitOffsetY+this.template.branch.spacing*_})}}getBranchDefaultColor(p,m){return p.getColorOf(m)}next(){this.nextTimeoutId&&window.clearTimeout(this.nextTimeoutId),this.nextTimeoutId=window.setTimeout(()=>{this.listeners.forEach(p=>p(this.getRenderedData()))},0)}}return sl.GitgraphCore=d,sl}var yv;function bP(){if(yv)return zt;yv=1,Object.defineProperty(zt,"__esModule",{value:!0});var e=gP();zt.GitgraphCore=e.GitgraphCore;var t=uf();zt.Mode=t.Mode;var n=Kb();zt.GitgraphUserApi=n.GitgraphUserApi;var r=zb();zt.BranchUserApi=r.BranchUserApi;var s=ji();zt.Branch=s.Branch;var o=lf();zt.Commit=o.Commit;var a=Hb();zt.Tag=a.Tag;var l=cf();zt.Refs=l.Refs;var i=af();zt.MergeStyle=i.MergeStyle,zt.TemplateName=i.TemplateName,zt.templateExtend=i.templateExtend;var c=of();zt.Orientation=c.Orientation;var d=Wb();zt.toSvgPath=d.toSvgPath;var f=ko();return zt.arrowSvgPath=f.arrowSvgPath,zt}var zs=bP(),vr="http://www.w3.org/2000/svg";function yP(e){var t=document.createElementNS(vr,"svg");return t}function Kt(e){var t=document.createElementNS(vr,"g");return e.children.forEach(function(n){return n&&t.appendChild(n)}),e.translate&&t.setAttribute("transform","translate("+e.translate.x+", "+e.translate.y+")"),e.fill&&t.setAttribute("fill",e.fill),e.stroke&&t.setAttribute("stroke",e.stroke),e.strokeWidth&&t.setAttribute("stroke-width",e.strokeWidth.toString()),e.onClick&&t.addEventListener("click",e.onClick),e.onMouseOver&&t.addEventListener("mouseover",e.onMouseOver),e.onMouseOut&&t.addEventListener("mouseout",e.onMouseOut),t}function ya(e){var t=document.createElementNS(vr,"text");return t.setAttribute("alignment-baseline","central"),t.setAttribute("dominant-baseline","central"),t.textContent=e.content,e.fill&&t.setAttribute("fill",e.fill),e.font&&t.setAttribute("style","font: "+e.font),e.anchor&&t.setAttribute("text-anchor",e.anchor),e.translate&&(t.setAttribute("x",e.translate.x.toString()),t.setAttribute("y",e.translate.y.toString())),e.onClick&&t.addEventListener("click",e.onClick),t}function wP(e){var t=document.createElementNS(vr,"circle");return t.setAttribute("cx",e.radius.toString()),t.setAttribute("cy",e.radius.toString()),t.setAttribute("r",e.radius.toString()),e.id&&t.setAttribute("id",e.id),e.fill&&t.setAttribute("fill",e.fill),t}function _P(e){var t=document.createElementNS(vr,"rect");return t.setAttribute("width",e.width.toString()),t.setAttribute("height",e.height.toString()),e.borderRadius&&t.setAttribute("rx",e.borderRadius.toString()),e.fill&&t.setAttribute("fill",e.fill||"none"),e.stroke&&t.setAttribute("stroke",e.stroke),t}function ii(e){var t=document.createElementNS(vr,"path");return t.setAttribute("d",e.d),e.fill&&t.setAttribute("fill",e.fill),e.stroke&&t.setAttribute("stroke",e.stroke),e.strokeWidth&&t.setAttribute("stroke-width",e.strokeWidth.toString()),e.translate&&t.setAttribute("transform","translate("+e.translate.x+", "+e.translate.y+")"),t}function wv(e){var t=document.createElementNS(vr,"use");return t.setAttribute("href","#"+e),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+e),t}function CP(){return document.createElementNS(vr,"clipPath")}function SP(e){var t=document.createElementNS(vr,"defs");return e.forEach(function(n){return t.appendChild(n)}),t}function EP(e){var t=document.createElementNS(vr,"foreignObject");t.setAttribute("width",e.width.toString()),e.translate&&(t.setAttribute("x",e.translate.x.toString()),t.setAttribute("y",e.translate.y.toString()));var n=document.createElement("p");return n.textContent=e.content,t.appendChild(n),t}var Zo=10,Ub=5;function kP(e,t){var n=_P({width:0,height:0,borderRadius:e.style.label.borderRadius,stroke:e.style.label.strokeColor||t.style.color,fill:e.style.label.bgColor}),r=ya({content:e.name,translate:{x:Zo,y:0},font:e.style.label.font,fill:e.style.label.color||t.style.color}),s=Kt({children:[n]}),o=new MutationObserver(function(){var a=r.getBBox(),l=a.height,i=a.width,c=i+2*Zo,d=l+2*Ub;n.setAttribute("width",c.toString()),n.setAttribute("height",d.toString()),r.setAttribute("y",(d/2).toString())});return o.observe(s,{attributes:!1,subtree:!1,childList:!0}),s.appendChild(r),s}var Rc=10,OP=5;function TP(e){var t=ii({d:"",fill:e.style.bgColor,stroke:e.style.strokeColor}),n=ya({content:e.name,fill:e.style.color,font:e.style.font,translate:{x:0,y:0}}),r=Kt({children:[t]}),s=e.style.pointerWidth,o=new MutationObserver(function(){var a=n.getBBox(),l=a.height,i=a.width;if(!(l===0||i===0)){var c=e.style.borderRadius,d=s+i+2*Rc,f=l+2*OP,p=["M 0,0","L "+s+","+f/2,"V "+f/2,"Q "+s+","+f/2+" "+(s+c)+","+f/2,"H "+(d-c),"Q "+d+","+f/2+" "+d+","+(f/2-c),"V -"+(f/2-c),"Q "+d+",-"+f/2+" "+(d-c)+",-"+f/2,"H "+(s+c),"Q "+s+",-"+f/2+" "+s+",-"+f/2,"V -"+f/2,"z"].join(" ");t.setAttribute("d",p.toString()),n.setAttribute("x",(s+Rc).toString())}});return o.observe(r,{attributes:!1,subtree:!1,childList:!0}),r.appendChild(n),r}var Qo=10,tr=10;function xP(e){var t=ii({d:"",fill:"#EEE"}),n=ya({translate:{x:tr+Qo,y:0},content:e.hashAbbrev+" - "+e.subject,fill:"#333"}),r=e.style.dot.size*2,s=Kt({translate:{x:r,y:r/2},children:[t]}),o=new MutationObserver(function(){var a=n.getBBox().width,l=5,i=50,c=tr+a+2*Qo,d=["M 0,0","L "+tr+","+tr,"V "+(i/2-l),"Q "+tr+","+i/2+" "+(tr+l)+","+i/2,"H "+(c-l),"Q "+c+","+i/2+" "+c+","+(i/2-l),"V -"+(i/2-l),"Q "+c+",-"+i/2+" "+(c-l)+",-"+i/2,"H "+(tr+l),"Q "+tr+",-"+i/2+" "+tr+",-"+(i/2-l),"V -"+tr,"z"].join(" ");t.setAttribute("d",d.toString())});return o.observe(s,{attributes:!1,subtree:!1,childList:!0}),s.appendChild(n),s}function SI(e,t){var n={},r={},s=!1,o,a,l=0,i=null,c=yP();p(!!(t&&t.responsive)),e.appendChild(c),t&&t.responsive&&e.setAttribute("style","display:inline-block; position: relative; width:100%; padding-bottom:100%; vertical-align:middle; overflow:hidden;");var d=new zs.GitgraphCore(t);return d.subscribe(function(M){s=!0,f(M)}),d.getUserApi();function f(M){n={};var $=M.commits,U=M.branchesPaths;l=M.commitMessagesX,o=M,a=v($),c.innerHTML="",c.appendChild(Kt({translate:{x:Zo,y:Qo},children:[h(U),a]}))}function p(M){var $=new MutationObserver(function(){s?(s=!1,U(),f(o)):(W(),B(M))});$.observe(c,{attributes:!1,subtree:!0,childList:!0});function U(){var I=Array.from(a.children),V=0,O=d.orientation===zs.Orientation.VerticalReverse?I:I.reverse();r=O.reduce(function(T,H){var Y=parseInt(H.getAttribute("transform").split(",")[1].slice(0,-1),10),q=H.getElementsByTagName("foreignObject")[0],X=q&&q.firstElementChild;return T[Y]=Y+V,V+=_v(X),T},{})}function W(){if(!d.isHorizontal){var I=10;Object.keys(n).forEach(function(V){var O=n[V],T=O.branchLabel,H=O.tags,Y=O.message,q=l;if(T){m(T,q);var X=T.getBBox().width+2*Zo;q+=X+I}H.forEach(function(G){m(G,q);var ie=parseFloat(G.getAttribute("data-offset")||"0"),ge=G.getBBox().width+2*Rc+ie;q+=ge+I}),Y&&m(Y,q)})}}function B(I){var V=c.getBBox(),O=V.height,T=V.width,H=50,Y=20,q=d.isHorizontal?H:Zo+Qo,X=d.isHorizontal?H:Ub+Qo+Y;I?(c.setAttribute("preserveAspectRatio","xMinYMin meet"),c.setAttribute("viewBox","0 0 "+(T+q)+" "+(O+X))):(c.setAttribute("width",(T+q).toString()),c.setAttribute("height",(O+X).toString()))}}function m(M,$){var U=M.getAttribute("transform")||"translate(0, 0)";M.setAttribute("transform",U.replace(/translate\(([\d\.]+),/,"translate("+$+","))}function h(M){var $=d.template.commit.dot.size,U=d.template.branch.mergeStyle===zs.MergeStyle.Bezier,W=Array.from(M).map(function(B){var I=B[0],V=B[1];return ii({d:zs.toSvgPath(V.map(function(O){return O.map(C)}),U,d.isVertical),fill:"none",stroke:I.computedColor||"",strokeWidth:I.style.lineWidth,translate:{x:$,y:$}})});return Kt({children:W})}function v(M){return Kt({children:M.map($)});function $(W){var B=C(W),I=B.x,V=B.y;return Kt({translate:{x:I,y:V},children:[g(W)].concat(U(W),[Kt({translate:{x:-I,y:0},children:[y(W)].concat(x(W),w(W))})])})}function U(W){if(!d.template.arrow.size)return[null];var B=W.style.dot.size;return W.parents.map(function(I){var V=M.find(function(H){var Y=H.hash;return Y===I});if(!V)return null;var O=d.reverseArrow?{x:B+(V.x-W.x),y:B+(V.y-W.y)}:{x:B,y:B},T=ii({d:zs.arrowSvgPath(d,V,W),fill:d.template.arrow.color||""});return Kt({translate:O,children:[T]})})}}function y(M){if(!M.style.message.display)return null;var $;if(M.renderMessage)return $=Kt({children:[]}),_($),$.appendChild(M.renderMessage(M)),A(M,$),$;var U=ya({content:M.message,fill:M.style.message.color||"",font:M.style.message.font,onClick:M.onMessageClick});if($=Kt({translate:{x:0,y:M.style.dot.size},children:[U]}),M.body){var W=EP({width:600,translate:{x:10,y:0},content:M.body});_($),$.appendChild(W)}return A(M,$),$}function _(M){var $=new MutationObserver(function(W){W.forEach(function(B){var I=B.target;return U(I)})});$.observe(M,{attributes:!1,subtree:!1,childList:!0});function U(W){if(W.nodeName==="foreignObject"){var B=W.firstChild&&W.firstChild.parentElement;if(!B)return;B.setAttribute("height",_v(B.firstElementChild).toString())}W.childNodes.forEach(U)}}function x(M){var $=Array.from(d.branches.values());return $.map(function(U){if(!U.style.label.display)return null;if(!d.branchLabelOnEveryCommit){var W=d.refs.getCommit(U.name);if(M.hash!==W)return null}if(M.branchToDisplay!==U.name)return null;var B=U.renderLabel?U.renderLabel(U):kP(U,M),I;if(d.isVertical)I=Kt({children:[B]});else{var V=M.style.dot.size*2,O=10;I=Kt({translate:{x:M.x,y:V+O},children:[B]})}return S(M,I),I})}function w(M){return M.tags?d.isHorizontal?[]:M.tags.map(function($){var U=$.render?$.render($.name,$.style):TP($),W=Kt({translate:{x:0,y:M.style.dot.size},children:[U]});return W.setAttribute("data-offset",$.style.pointerWidth.toString()),E(M,W),W}):[]}function g(M){if(M.renderDot)return M.renderDot(M);var $=M.hash,U=wP({id:$,radius:M.style.dot.size,fill:M.style.dot.color||""}),W="clip-"+M.hash,B=CP();B.setAttribute("id",W),B.appendChild(wv($));var I=wv($);I.setAttribute("clip-path","url(#"+W+")"),I.setAttribute("stroke",M.style.dot.strokeColor||"");var V=M.style.dot.strokeWidth?M.style.dot.strokeWidth*2:0;I.setAttribute("stroke-width",V.toString());var O=M.dotText?ya({content:M.dotText,font:M.style.dot.font,anchor:"middle",translate:{x:M.style.dot.size,y:M.style.dot.size}}):null;return Kt({onClick:M.onClick,onMouseOver:function(){b(M),M.onMouseOver()},onMouseOut:function(){i&&i.remove(),M.onMouseOut()},children:[SP([U,B]),I,O]})}function b(M){if(c.firstChild&&!(d.isVertical&&d.mode!==zs.Mode.Compact)&&!(d.isVertical&&!M.style.hasTooltipInCompactMode)){var $=M.renderTooltip?M.renderTooltip(M):xP(M);i=Kt({translate:C(M),children:[$]}),c.firstChild.appendChild(i)}}function C(M){var $=M.x,U=M.y;return{x:$,y:r[U]||U}}function S(M,$){n[M.hashAbbrev]||F(M),n[M.hashAbbrev].branchLabel=$}function A(M,$){n[M.hashAbbrev]||F(M),n[M.hashAbbrev].message=$}function E(M,$){n[M.hashAbbrev]||F(M),n[M.hashAbbrev].tags.push($)}function F(M){n[M.hashAbbrev]={branchLabel:null,tags:[],message:null}}}function _v(e){var t=0;if(e){var n=e.getBoundingClientRect().height,r=window.getComputedStyle(e).marginTop||"0px",s=parseInt(r.replace("px",""),10);t=n+s}return t}export{tI as $,zP as A,qP as B,kb as C,Gx as D,wI as E,Ke as F,mt as G,Sd as H,Me as I,Ri as J,P as K,Ot as L,LP as M,lI as N,Ju as O,Xs as P,qg as Q,iI as R,JP as S,_I as T,Xe as U,ct as V,UP as W,St as X,NP as Y,jP as Z,Yn as _,go as a,nI as a0,Ge as a1,ZP as a2,KP as a3,hI as a4,pI as a5,lr as a6,IP as a7,GP as a8,uI as a9,Uy as aA,YP as aB,FP as aC,v3 as aD,Je as aE,Sw as aF,AP as aG,cI as aa,rI as ab,vI as ac,dI as ad,fI as ae,sI as af,oI as ag,co as ah,bI as ai,yI as aj,$a as ak,Ve as al,Pt as am,DP as an,XP as ao,HP as ap,WP as aq,VP as ar,Os as as,aI as at,eI as au,mI as av,QP as aw,PP as ax,SI as ay,K4 as az,ee as b,k as c,MP as d,K as e,R as f,j as g,re as h,et as i,be as j,de as k,Su as l,_o as m,le as n,ut as o,gI as p,da as q,D as r,$P as s,ha as t,u,BP as v,ke as w,RP as x,At as y,ze as z};