UNPKG

@watone/wt-cli

Version:

watone tools

76 lines 417 kB
import{aP as ka,g as qs,a as J,c as ie,k as js,n as Le,W as Ee,b as wi,t as In,aO as $s,F as ps,s as Mf,h as ko,U as ms,m as Df,aQ as Tf,at as Of,l as Pf,j as Lf,aY as gs,aj as Ef,P as Bf,o as Rf,bj as ut,f as Nf,ae as Ff,b2 as Vf}from"./index-c614ad14.js";var Y={innerWidth(i){if(i){let e=i.offsetWidth,t=getComputedStyle(i);return e+=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),e}return 0},width(i){if(i){let e=i.offsetWidth,t=getComputedStyle(i);return e-=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),e}return 0},getWindowScrollTop(){let i=document.documentElement;return(window.pageYOffset||i.scrollTop)-(i.clientTop||0)},getWindowScrollLeft(){let i=document.documentElement;return(window.pageXOffset||i.scrollLeft)-(i.clientLeft||0)},getOuterWidth(i,e){if(i){let t=i.offsetWidth;if(e){let n=getComputedStyle(i);t+=parseFloat(n.marginLeft)+parseFloat(n.marginRight)}return t}return 0},getOuterHeight(i,e){if(i){let t=i.offsetHeight;if(e){let n=getComputedStyle(i);t+=parseFloat(n.marginTop)+parseFloat(n.marginBottom)}return t}return 0},getClientHeight(i,e){if(i){let t=i.clientHeight;if(e){let n=getComputedStyle(i);t+=parseFloat(n.marginTop)+parseFloat(n.marginBottom)}return t}return 0},getViewport(){let i=window,e=document,t=e.documentElement,n=e.getElementsByTagName("body")[0],s=i.innerWidth||t.clientWidth||n.clientWidth,r=i.innerHeight||t.clientHeight||n.clientHeight;return{width:s,height:r}},getOffset(i){if(i){let e=i.getBoundingClientRect();return{top:e.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:e.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}},index(i){if(i){let e=i.parentNode.childNodes,t=0;for(let n=0;n<e.length;n++){if(e[n]===i)return t;e[n].nodeType===1&&t++}}return-1},addMultipleClasses(i,e){if(i&&e)if(i.classList){let t=e.split(" ");for(let n=0;n<t.length;n++)i.classList.add(t[n])}else{let t=e.split(" ");for(let n=0;n<t.length;n++)i.className+=" "+t[n]}},addClass(i,e){i&&e&&(i.classList?i.classList.add(e):i.className+=" "+e)},removeClass(i,e){i&&e&&(i.classList?i.classList.remove(e):i.className=i.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," "))},hasClass(i,e){return i?i.classList?i.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(i.className):!1},find(i,e){return this.isElement(i)?i.querySelectorAll(e):[]},findSingle(i,e){return this.isElement(i)?i.querySelector(e):null},getHeight(i){if(i){let e=i.offsetHeight,t=getComputedStyle(i);return e-=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)+parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),e}return 0},getWidth(i){if(i){let e=i.offsetWidth,t=getComputedStyle(i);return e-=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)+parseFloat(t.borderLeftWidth)+parseFloat(t.borderRightWidth),e}return 0},absolutePosition(i,e){if(i){let t=i.offsetParent?{width:i.offsetWidth,height:i.offsetHeight}:this.getHiddenElementDimensions(i),n=t.height,s=t.width,r=e.offsetHeight,o=e.offsetWidth,l=e.getBoundingClientRect(),a=this.getWindowScrollTop(),h=this.getWindowScrollLeft(),c=this.getViewport(),f,u;l.top+r+n>c.height?(f=l.top+a-n,i.style.transformOrigin="bottom",f<0&&(f=a)):(f=r+l.top+a,i.style.transformOrigin="top"),l.left+s>c.width?u=Math.max(0,l.left+h+o-s):u=l.left+h,i.style.top=f+"px",i.style.left=u+"px"}},relativePosition(i,e){if(i){let t=i.offsetParent?{width:i.offsetWidth,height:i.offsetHeight}:this.getHiddenElementDimensions(i);const n=e.offsetHeight,s=e.getBoundingClientRect(),r=this.getViewport();let o,l;s.top+n+t.height>r.height?(o=-1*t.height,i.style.transformOrigin="bottom",s.top+o<0&&(o=-1*s.top)):(o=n,i.style.transformOrigin="top"),t.width>r.width?l=s.left*-1:s.left+t.width>r.width?l=(s.left+t.width-r.width)*-1:l=0,i.style.top=o+"px",i.style.left=l+"px"}},getParents(i,e=[]){return i.parentNode===null?e:this.getParents(i.parentNode,e.concat([i.parentNode]))},getScrollableParents(i){let e=[];if(i){let t=this.getParents(i);const n=/(auto|scroll)/,s=r=>{let o=window.getComputedStyle(r,null);return n.test(o.getPropertyValue("overflow"))||n.test(o.getPropertyValue("overflowX"))||n.test(o.getPropertyValue("overflowY"))};for(let r of t){let o=r.nodeType===1&&r.dataset.scrollselectors;if(o){let l=o.split(",");for(let a of l){let h=this.findSingle(r,a);h&&s(h)&&e.push(h)}}r.nodeType!==9&&s(r)&&e.push(r)}}return e},getHiddenElementOuterHeight(i){if(i){i.style.visibility="hidden",i.style.display="block";let e=i.offsetHeight;return i.style.display="none",i.style.visibility="visible",e}return 0},getHiddenElementOuterWidth(i){if(i){i.style.visibility="hidden",i.style.display="block";let e=i.offsetWidth;return i.style.display="none",i.style.visibility="visible",e}return 0},getHiddenElementDimensions(i){if(i){let e={};return i.style.visibility="hidden",i.style.display="block",e.width=i.offsetWidth,e.height=i.offsetHeight,i.style.display="none",i.style.visibility="visible",e}return 0},fadeIn(i,e){if(i){i.style.opacity=0;let t=+new Date,n=0,s=function(){n=+i.style.opacity+(new Date().getTime()-t)/e,i.style.opacity=n,t=+new Date,+n<1&&(window.requestAnimationFrame&&requestAnimationFrame(s)||setTimeout(s,16))};s()}},fadeOut(i,e){if(i){let t=1,n=50,s=e,r=n/s,o=setInterval(()=>{t-=r,t<=0&&(t=0,clearInterval(o)),i.style.opacity=t},n)}},getUserAgent(){return navigator.userAgent},appendChild(i,e){if(this.isElement(e))e.appendChild(i);else if(e.el&&e.elElement)e.elElement.appendChild(i);else throw new Error("Cannot append "+e+" to "+i)},isElement(i){return typeof HTMLElement=="object"?i instanceof HTMLElement:i&&typeof i=="object"&&i!==null&&i.nodeType===1&&typeof i.nodeName=="string"},scrollInView(i,e){let t=getComputedStyle(i).getPropertyValue("borderTopWidth"),n=t?parseFloat(t):0,s=getComputedStyle(i).getPropertyValue("paddingTop"),r=s?parseFloat(s):0,o=i.getBoundingClientRect(),a=e.getBoundingClientRect().top+document.body.scrollTop-(o.top+document.body.scrollTop)-n-r,h=i.scrollTop,c=i.clientHeight,f=this.getOuterHeight(e);a<0?i.scrollTop=h+a:a+f>c&&(i.scrollTop=h+a-c+f)},clearSelection(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch{}},getSelection(){return window.getSelection?window.getSelection().toString():document.getSelection?document.getSelection().toString():document.selection?document.selection.createRange().text:null},calculateScrollbarWidth(){if(this.calculatedScrollbarWidth!=null)return this.calculatedScrollbarWidth;let i=document.createElement("div");i.className="p-scrollbar-measure",document.body.appendChild(i);let e=i.offsetWidth-i.clientWidth;return document.body.removeChild(i),this.calculatedScrollbarWidth=e,e},getBrowser(){if(!this.browser){let i=this.resolveUserAgent();this.browser={},i.browser&&(this.browser[i.browser]=!0,this.browser.version=i.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser},resolveUserAgent(){let i=navigator.userAgent.toLowerCase(),e=/(chrome)[ ]([\w.]+)/.exec(i)||/(webkit)[ ]([\w.]+)/.exec(i)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(i)||/(msie) ([\w.]+)/.exec(i)||i.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(i)||[];return{browser:e[1]||"",version:e[2]||"0"}},isVisible(i){return i&&i.offsetParent!=null},invokeElementMethod(i,e,t){i[e].apply(i,t)},isExist(i){return!!(i!==null&&typeof i<"u"&&i.nodeName&&i.parentNode)},isClient(){return!!(typeof window<"u"&&window.document&&window.document.createElement)},focus(i,e){i&&document.activeElement!==i&&i.focus(e)},isFocusableElement(i,e=""){return this.isElement(i)?i.matches(`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}`):!1},getFocusableElements(i,e=""){let t=this.find(i,`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}`),n=[];for(let s of t)getComputedStyle(s).display!="none"&&getComputedStyle(s).visibility!="hidden"&&n.push(s);return n},getFirstFocusableElement(i,e){const t=this.getFocusableElements(i,e);return t.length>0?t[0]:null},getLastFocusableElement(i,e){const t=this.getFocusableElements(i,e);return t.length>0?t[t.length-1]:null},getNextFocusableElement(i,e,t){const n=this.getFocusableElements(i,t),s=n.length>0?n.findIndex(o=>o===e):-1,r=s>-1&&n.length>=s+1?s+1:-1;return r>-1?n[r]:null},isClickable(i){const e=i.nodeName,t=i.parentElement&&i.parentElement.nodeName;return e=="INPUT"||e=="BUTTON"||e=="A"||t=="INPUT"||t=="BUTTON"||t=="A"||this.hasClass(i,"p-button")||this.hasClass(i.parentElement,"p-button")||this.hasClass(i.parentElement,"p-checkbox")||this.hasClass(i.parentElement,"p-radiobutton")},applyStyle(i,e){if(typeof e=="string")i.style.cssText=e;else for(let t in e)i.style[t]=e[t]},isIOS(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream},isAndroid(){return/(android)/i.test(navigator.userAgent)},isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0},exportCSV(i,e){let t=new Blob([i],{type:"application/csv;charset=utf-8;"});if(window.navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(t,e+".csv");else{let n=document.createElement("a");n.download!==void 0?(n.setAttribute("href",URL.createObjectURL(t)),n.setAttribute("download",e+".csv"),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)):(i="data:text/csv;charset=utf-8,"+i,window.open(encodeURI(i)))}}};class pb{constructor(e,t=()=>{}){this.element=e,this.listener=t}bindScrollListener(){this.scrollableParents=Y.getScrollableParents(this.element);for(let e=0;e<this.scrollableParents.length;e++)this.scrollableParents[e].addEventListener("scroll",this.listener)}unbindScrollListener(){if(this.scrollableParents)for(let e=0;e<this.scrollableParents.length;e++)this.scrollableParents[e].removeEventListener("scroll",this.listener)}destroy(){this.unbindScrollListener(),this.element=null,this.listener=null,this.scrollableParents=null}}function mb(){const i=new Map;return{on(e,t){let n=i.get(e);n?n.push(t):n=[t],i.set(e,n)},off(e,t){let n=i.get(e);n&&n.splice(n.indexOf(t)>>>0,1)},emit(e,t){let n=i.get(e);n&&n.slice().map(s=>{s(t)})}}}var xe={equals(i,e,t){return t?this.resolveFieldData(i,t)===this.resolveFieldData(e,t):this.deepEquals(i,e)},deepEquals(i,e){if(i===e)return!0;if(i&&e&&typeof i=="object"&&typeof e=="object"){var t=Array.isArray(i),n=Array.isArray(e),s,r,o;if(t&&n){if(r=i.length,r!=e.length)return!1;for(s=r;s--!==0;)if(!this.deepEquals(i[s],e[s]))return!1;return!0}if(t!=n)return!1;var l=i instanceof Date,a=e instanceof Date;if(l!=a)return!1;if(l&&a)return i.getTime()==e.getTime();var h=i instanceof RegExp,c=e instanceof RegExp;if(h!=c)return!1;if(h&&c)return i.toString()==e.toString();var f=Object.keys(i);if(r=f.length,r!==Object.keys(e).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(e,f[s]))return!1;for(s=r;s--!==0;)if(o=f[s],!this.deepEquals(i[o],e[o]))return!1;return!0}return i!==i&&e!==e},resolveFieldData(i,e){if(i&&Object.keys(i).length&&e){if(this.isFunction(e))return e(i);if(e.indexOf(".")===-1)return i[e];{let s=e.split("."),r=i;for(var t=0,n=s.length;t<n;++t){if(r==null)return null;r=r[s[t]]}return r}}else return null},isFunction(i){return!!(i&&i.constructor&&i.call&&i.apply)},getItemValue(i,...e){return this.isFunction(i)?i(...e):i},filter(i,e,t){var n=[];if(i){for(let s of i)for(let r of e)if(String(this.resolveFieldData(s,r)).toLowerCase().indexOf(t.toLowerCase())>-1){n.push(s);break}}return n},reorderArray(i,e,t){i&&e!==t&&(t>=i.length&&(t%=i.length,e%=i.length),i.splice(t,0,i.splice(e,1)[0]))},findIndexInList(i,e){let t=-1;if(e){for(let n=0;n<e.length;n++)if(e[n]===i){t=n;break}}return t},contains(i,e){if(i!=null&&e&&e.length){for(let t of e)if(this.equals(i,t))return!0}return!1},insertIntoOrderedArray(i,e,t,n){if(t.length>0){let s=!1;for(let r=0;r<t.length;r++)if(this.findIndexInList(t[r],n)>e){t.splice(r,0,i),s=!0;break}s||t.push(i)}else t.push(i)},removeAccents(i){return i&&i.search(/[\xC0-\xFF]/g)>-1&&(i=i.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),i},getVNodeProp(i,e){let t=i.props;if(t){let n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),s=Object.prototype.hasOwnProperty.call(t,n)?n:e;return i.type.props[e].type===Boolean&&t[s]===""?!0:t[s]}return null},isEmpty(i){return i==null||i===""||Array.isArray(i)&&i.length===0||!(i instanceof Date)&&typeof i=="object"&&Object.keys(i).length===0},isNotEmpty(i){return!this.isEmpty(i)},isPrintableCharacter(i=""){return this.isNotEmpty(i)&&i.length===1&&i.match(/\S| /)},findLast(i,e){let t;if(this.isNotEmpty(i))try{t=i.findLast(e)}catch{t=[...i].reverse().find(e)}return t},findLastIndex(i,e){let t=-1;if(this.isNotEmpty(i))try{t=i.findLastIndex(e)}catch{t=i.lastIndexOf([...i].reverse().find(e))}return t}},So=0;function Co(i="pv_id_"){return So++,`${i}${So}`}function Wf(){let i=[];const e=(o,l,a=999)=>{const h=s(o,l,a),c=h.value+(h.key===o?0:a)+1;return i.push({key:o,value:c}),c},t=o=>{i=i.filter(l=>l.value!==o)},n=(o,l)=>s(o,l).value,s=(o,l,a=0)=>[...i].reverse().find(h=>l?!0:h.key===o)||{key:o,value:a},r=o=>o&&parseInt(o.style.zIndex,10)||0;return{get:r,set:(o,l,a)=>{l&&(l.style.zIndex=String(e(o,!0,a)))},clear:o=>{o&&(t(r(o)),o.style.zIndex="")},getCurrent:o=>n(o,!0)}}var ys=Wf();let Us;function Hf(i){i.addEventListener("mousedown",Sa)}function zf(i){i.removeEventListener("mousedown",Sa)}function Kf(i){let e=document.createElement("span");e.className="p-ink",e.setAttribute("role","presentation"),e.setAttribute("aria-hidden","true"),i.appendChild(e),e.addEventListener("animationend",Ca)}function qf(i){let e=Aa(i);e&&(zf(i),e.removeEventListener("animationend",Ca),e.remove())}function Sa(i){let e=i.currentTarget,t=Aa(e);if(!t||getComputedStyle(t,null).display==="none")return;if(Y.removeClass(t,"p-ink-active"),!Y.getHeight(t)&&!Y.getWidth(t)){let o=Math.max(Y.getOuterWidth(e),Y.getOuterHeight(e));t.style.height=o+"px",t.style.width=o+"px"}let n=Y.getOffset(e),s=i.pageX-n.left+document.body.scrollTop-Y.getWidth(t)/2,r=i.pageY-n.top+document.body.scrollLeft-Y.getHeight(t)/2;t.style.top=r+"px",t.style.left=s+"px",Y.addClass(t,"p-ink-active"),Us=setTimeout(()=>{t&&Y.removeClass(t,"p-ink-active")},401)}function Ca(i){Us&&clearTimeout(Us),Y.removeClass(i.currentTarget,"p-ink-active")}function Aa(i){for(let e=0;e<i.children.length;e++)if(typeof i.children[e].className=="string"&&i.children[e].className.indexOf("p-ink")!==-1)return i.children[e];return null}const Ia={mounted(i,e){e.instance.$primevue&&e.instance.$primevue.config&&e.instance.$primevue.config.ripple&&(Kf(i),Hf(i))},unmounted(i){qf(i)}};var jf={name:"Button",props:{label:{type:String,default:null},icon:{type:String,default:null},iconPos:{type:String,default:"left"},iconClass:{type:String,default:null},badge:{type:String,default:null},badgeClass:{type:String,default:null},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"}},computed:{buttonClass(){return{"p-button p-component":!0,"p-button-icon-only":this.icon&&!this.label,"p-button-vertical":(this.iconPos==="top"||this.iconPos==="bottom")&&this.label,"p-disabled":this.$attrs.disabled||this.loading,"p-button-loading":this.loading,"p-button-loading-label-only":this.loading&&!this.icon&&this.label}},iconStyleClass(){return[this.loading?"p-button-loading-icon "+this.loadingIcon:this.icon,"p-button-icon",this.iconClass,{"p-button-icon-left":this.iconPos==="left"&&this.label,"p-button-icon-right":this.iconPos==="right"&&this.label,"p-button-icon-top":this.iconPos==="top"&&this.label,"p-button-icon-bottom":this.iconPos==="bottom"&&this.label}]},badgeStyleClass(){return["p-badge p-component",this.badgeClass,{"p-badge-no-gutter":this.badge&&String(this.badge).length===1}]},disabled(){return this.$attrs.disabled||this.loading},defaultAriaLabel(){return this.label?this.label+(this.badge?" "+this.badge:""):this.$attrs["aria-label"]}},directives:{ripple:Ia}};const $f=["aria-label","disabled"],Uf={class:"p-button-label"};function Gf(i,e,t,n,s,r){const o=ka("ripple");return qs((J(),ie("button",{class:Le(r.buttonClass),type:"button","aria-label":r.defaultAriaLabel,disabled:r.disabled},[js(i.$slots,"default",{},()=>[t.loading&&!t.icon?(J(),ie("span",{key:0,class:Le(r.iconStyleClass)},null,2)):Ee("",!0),t.icon?(J(),ie("span",{key:1,class:Le(r.iconStyleClass)},null,2)):Ee("",!0),wi("span",Uf,In(t.label||" "),1),t.badge?(J(),ie("span",{key:2,class:Le(r.badgeStyleClass)},In(t.badge),3)):Ee("",!0)])],10,$f)),[[o]])}jf.render=Gf;var Ma={name:"MenubarSub",emits:["item-mouseenter","item-click"],props:{items:{type:Array,default:null},root:{type:Boolean,default:!1},popup:{type:Boolean,default:!1},mobileActive:{type:Boolean,default:!1},template:{type:Function,default:null},exact:{type:Boolean,default:!0},level:{type:Number,default:0},menuId:{type:String,default:null},focusedItemId:{type:String,default:null},activeItemPath:{type:Object,default:null}},list:null,methods:{getItemId(i){return`${this.menuId}_${i.key}`},getItemKey(i){return this.getItemId(i)},getItemProp(i,e,t){return i&&i.item?xe.getItemValue(i.item[e],t):void 0},getItemLabel(i){return this.getItemProp(i,"label")},isItemActive(i){return this.activeItemPath.some(e=>e.key===i.key)},isItemVisible(i){return this.getItemProp(i,"visible")!==!1},isItemDisabled(i){return this.getItemProp(i,"disabled")},isItemFocused(i){return this.focusedItemId===this.getItemId(i)},isItemGroup(i){return xe.isNotEmpty(i.items)},onItemClick(i,e){this.getItemProp(e,"command",{originalEvent:i,item:e.item}),this.$emit("item-click",{originalEvent:i,processedItem:e,isFocus:!0})},onItemMouseEnter(i,e){this.$emit("item-mouseenter",{originalEvent:i,processedItem:e})},onItemActionClick(i,e){e&&e(i)},getAriaSetSize(){return this.items.filter(i=>this.isItemVisible(i)&&!this.getItemProp(i,"separator")).length},getAriaPosInset(i){return i-this.items.slice(0,i).filter(e=>this.isItemVisible(e)&&this.getItemProp(e,"separator")).length+1},getItemClass(i){return["p-menuitem",this.getItemProp(i,"class"),{"p-menuitem-active p-highlight":this.isItemActive(i),"p-focus":this.isItemFocused(i),"p-disabled":this.isItemDisabled(i)}]},getItemActionClass(i,e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},getItemIconClass(i){return["p-menuitem-icon",this.getItemProp(i,"icon")]},getSeparatorItemClass(i){return["p-menuitem-separator",this.getItemProp(i,"class")]},getSubmenuIcon(){return["p-submenu-icon pi",{"pi-angle-right":!this.root,"pi-angle-down":this.root}]}},computed:{containerClass(){return{"p-submenu-list":!this.root,"p-menubar-root-list":this.root}}},directives:{ripple:Ia}};const _f=["id","aria-label","aria-disabled","aria-expanded","aria-haspopup","aria-level","aria-setsize","aria-posinset"],Jf=["onClick","onMouseenter"],Yf=["href","onClick"],Xf={class:"p-menuitem-text"},Qf=["href","target"],Zf={class:"p-menuitem-text"},eu=["id"];function tu(i,e,t,n,s,r){const o=$s("router-link"),l=$s("MenubarSub",!0),a=ka("ripple");return J(),ie("ul",null,[(J(!0),ie(ps,null,Mf(t.items,(h,c)=>(J(),ie(ps,{key:r.getItemKey(h)},[r.isItemVisible(h)&&!r.getItemProp(h,"separator")?(J(),ie("li",{key:0,id:r.getItemId(h),style:ko(r.getItemProp(h,"style")),class:Le(r.getItemClass(h)),role:"menuitem","aria-label":r.getItemLabel(h),"aria-disabled":r.isItemDisabled(h)||void 0,"aria-expanded":r.isItemGroup(h)?r.isItemActive(h):void 0,"aria-haspopup":r.isItemGroup(h)&&!r.getItemProp(h,"to")?"menu":void 0,"aria-level":t.level+1,"aria-setsize":r.getAriaSetSize(),"aria-posinset":r.getAriaPosInset(c)},[wi("div",{class:"p-menuitem-content",onClick:f=>r.onItemClick(f,h),onMouseenter:f=>r.onItemMouseEnter(f,h)},[t.template?(J(),ms(Tf(t.template),{key:1,item:h.item},null,8,["item"])):(J(),ie(ps,{key:0},[r.getItemProp(h,"to")&&!r.isItemDisabled(h)?(J(),ms(o,{key:0,to:r.getItemProp(h,"to"),custom:""},{default:Df(({navigate:f,href:u,isActive:d,isExactActive:p})=>[qs((J(),ie("a",{href:u,class:Le(r.getItemActionClass(h,{isActive:d,isExactActive:p})),tabindex:"-1","aria-hidden":"true",onClick:m=>r.onItemActionClick(m,f)},[r.getItemProp(h,"icon")?(J(),ie("span",{key:0,class:Le(r.getItemIconClass(h))},null,2)):Ee("",!0),wi("span",Xf,In(r.getItemLabel(h)),1)],10,Yf)),[[a]])]),_:2},1032,["to"])):qs((J(),ie("a",{key:1,href:r.getItemProp(h,"url"),class:Le(r.getItemActionClass(h)),target:r.getItemProp(h,"target"),tabindex:"-1","aria-hidden":"true"},[r.getItemProp(h,"icon")?(J(),ie("span",{key:0,class:Le(r.getItemIconClass(h))},null,2)):Ee("",!0),wi("span",Zf,In(r.getItemLabel(h)),1),r.getItemProp(h,"items")?(J(),ie("span",{key:1,class:Le(r.getSubmenuIcon())},null,2)):Ee("",!0)],10,Qf)),[[a]])],64))],40,Jf),r.isItemVisible(h)&&r.isItemGroup(h)?(J(),ms(l,{key:0,menuId:t.menuId,role:"menu",class:"p-submenu-list",focusedItemId:t.focusedItemId,items:h.items,mobileActive:t.mobileActive,activeItemPath:t.activeItemPath,template:t.template,exact:t.exact,level:t.level+1,onItemClick:e[0]||(e[0]=f=>i.$emit("item-click",f)),onItemMouseenter:e[1]||(e[1]=f=>i.$emit("item-mouseenter",f))},null,8,["menuId","focusedItemId","items","mobileActive","activeItemPath","template","exact","level"])):Ee("",!0)],14,_f)):Ee("",!0),r.isItemVisible(h)&&r.getItemProp(h,"separator")?(J(),ie("li",{key:1,id:r.getItemId(h),style:ko(r.getItemProp(h,"style")),class:Le(r.getSeparatorItemClass(h)),role:"separator"},null,14,eu)):Ee("",!0)],64))),128))])}Ma.render=tu;var iu={name:"Menubar",emits:["focus","blur"],props:{model:{type:Array,default:null},exact:{type:Boolean,default:!0},buttonProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data(){return{id:this.$attrs.id,mobileActive:!1,focused:!1,focusedItemInfo:{index:-1,level:0,parentKey:""},activeItemPath:[],dirty:!1}},watch:{"$attrs.id":function(i){this.id=i||Co()},activeItemPath(i){xe.isNotEmpty(i)?(this.bindOutsideClickListener(),this.bindResizeListener()):(this.unbindOutsideClickListener(),this.unbindResizeListener())}},outsideClickListener:null,container:null,menubar:null,mounted(){this.id=this.id||Co()},beforeUnmount(){this.mobileActive=!1,this.unbindOutsideClickListener(),this.unbindResizeListener(),this.container&&ys.clear(this.container),this.container=null},methods:{getItemProp(i,e){return i?xe.getItemValue(i[e]):void 0},getItemLabel(i){return this.getItemProp(i,"label")},isItemDisabled(i){return this.getItemProp(i,"disabled")},isItemGroup(i){return xe.isNotEmpty(this.getItemProp(i,"items"))},isItemSeparator(i){return this.getItemProp(i,"separator")},getProccessedItemLabel(i){return i?this.getItemLabel(i.item):void 0},isProccessedItemGroup(i){return i&&xe.isNotEmpty(i.items)},toggle(i){this.mobileActive?(this.mobileActive=!1,ys.clear(this.menubar),this.hide()):(this.mobileActive=!0,ys.set("menu",this.menubar,this.$primevue.config.zIndex.menu),setTimeout(()=>{this.show()},0)),this.bindOutsideClickListener(),i.preventDefault()},show(){this.focusedItemInfo={index:this.findFirstFocusedItemIndex(),level:0,parentKey:""},Y.focus(this.menubar)},hide(i,e){this.mobileActive&&setTimeout(()=>{Y.focus(this.$refs.menubutton)},0),this.activeItemPath=[],this.focusedItemInfo={index:-1,level:0,parentKey:""},e&&Y.focus(this.menubar),this.dirty=!1},onFocus(i){this.focused=!0,this.focusedItemInfo=this.focusedItemInfo.index!==-1?this.focusedItemInfo:{index:this.findFirstFocusedItemIndex(),level:0,parentKey:""},this.$emit("focus",i)},onBlur(i){this.focused=!1,this.focusedItemInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.dirty=!1,this.$emit("blur",i)},onKeyDown(i){const e=i.metaKey||i.ctrlKey;switch(i.code){case"ArrowDown":this.onArrowDownKey(i);break;case"ArrowUp":this.onArrowUpKey(i);break;case"ArrowLeft":this.onArrowLeftKey(i);break;case"ArrowRight":this.onArrowRightKey(i);break;case"Home":this.onHomeKey(i);break;case"End":this.onEndKey(i);break;case"Space":this.onSpaceKey(i);break;case"Enter":this.onEnterKey(i);break;case"Escape":this.onEscapeKey(i);break;case"Tab":this.onTabKey(i);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!e&&xe.isPrintableCharacter(i.key)&&this.searchItems(i,i.key);break}},onItemChange(i){const{processedItem:e,isFocus:t}=i;if(xe.isEmpty(e))return;const{index:n,key:s,level:r,parentKey:o,items:l}=e,a=xe.isNotEmpty(l),h=this.activeItemPath.filter(c=>c.parentKey!==o&&c.parentKey!==s);a&&h.push(e),this.focusedItemInfo={index:n,level:r,parentKey:o},this.activeItemPath=h,a&&(this.dirty=!0),t&&Y.focus(this.menubar)},onItemClick(i){const{originalEvent:e,processedItem:t}=i,n=this.isProccessedItemGroup(t),s=xe.isEmpty(t.parent);if(this.isSelected(t)){const{index:o,key:l,level:a,parentKey:h}=t;this.activeItemPath=this.activeItemPath.filter(c=>l!==c.key&&l.startsWith(c.key)),this.focusedItemInfo={index:o,level:a,parentKey:h},this.dirty=!s,Y.focus(this.menubar)}else if(n)this.onItemChange(i);else{const o=s?t:this.activeItemPath.find(l=>l.parentKey==="");this.hide(e),this.changeFocusedItemIndex(e,o?o.index:-1),this.mobileActive=!1,Y.focus(this.menubar)}},onItemMouseEnter(i){!this.mobileActive&&this.dirty&&this.onItemChange(i)},menuButtonClick(i){this.toggle(i)},menuButtonKeydown(i){(i.code==="Enter"||i.code==="Space")&&this.menuButtonClick(i)},onArrowDownKey(i){const e=this.visibleItems[this.focusedItemInfo.index];if(e?xe.isEmpty(e.parent):null)this.isProccessedItemGroup(e)&&(this.onItemChange({originalEvent:i,processedItem:e}),this.focusedItemInfo={index:-1,parentKey:e.key},this.onArrowRightKey(i));else{const n=this.focusedItemInfo.index!==-1?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(i,n),i.preventDefault()}},onArrowUpKey(i){const e=this.visibleItems[this.focusedItemInfo.index];if(xe.isEmpty(e.parent)){if(this.isProccessedItemGroup(e)){this.onItemChange({originalEvent:i,processedItem:e}),this.focusedItemInfo={index:-1,parentKey:e.key};const s=this.findLastItemIndex();this.changeFocusedItemIndex(i,s)}}else{const n=this.activeItemPath.find(s=>s.key===e.parentKey);if(this.focusedItemInfo.index===0)this.focusedItemInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowLeftKey(i),this.activeItemPath=this.activeItemPath.filter(s=>s.parentKey!==this.focusedItemInfo.parentKey);else{const s=this.focusedItemInfo.index!==-1?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(i,s)}}i.preventDefault()},onArrowLeftKey(i){const e=this.visibleItems[this.focusedItemInfo.index],t=e?this.activeItemPath.find(n=>n.key===e.parentKey):null;if(t)this.onItemChange({originalEvent:i,processedItem:t}),this.activeItemPath=this.activeItemPath.filter(n=>n.parentKey!==this.focusedItemInfo.parentKey),i.preventDefault();else{const n=this.focusedItemInfo.index!==-1?this.findPrevItemIndex(this.focusedItemInfo.index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(i,n),i.preventDefault()}},onArrowRightKey(i){const e=this.visibleItems[this.focusedItemInfo.index];if(e?this.activeItemPath.find(n=>n.key===e.parentKey):null)this.isProccessedItemGroup(e)&&(this.onItemChange({originalEvent:i,processedItem:e}),this.focusedItemInfo={index:-1,parentKey:e.key},this.onArrowDownKey(i));else{const n=this.focusedItemInfo.index!==-1?this.findNextItemIndex(this.focusedItemInfo.index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(i,n),i.preventDefault()}},onHomeKey(i){this.changeFocusedItemIndex(i,this.findFirstItemIndex()),i.preventDefault()},onEndKey(i){this.changeFocusedItemIndex(i,this.findLastItemIndex()),i.preventDefault()},onEnterKey(i){if(this.focusedItemInfo.index!==-1){const e=Y.findSingle(this.menubar,`li[id="${`${this.focusedItemId}`}"]`),t=e&&Y.findSingle(e,".p-menuitem-link");t?t.click():e&&e.click();const n=this.visibleItems[this.focusedItemInfo.index];!this.isProccessedItemGroup(n)&&(this.focusedItemInfo.index=this.findFirstFocusedItemIndex())}i.preventDefault()},onSpaceKey(i){this.onEnterKey(i)},onEscapeKey(i){this.hide(i,!0),this.focusedItemInfo.index=this.findFirstFocusedItemIndex(),i.preventDefault()},onTabKey(i){if(this.focusedItemInfo.index!==-1){const e=this.visibleItems[this.focusedItemInfo.index];!this.isProccessedItemGroup(e)&&this.onItemChange({originalEvent:i,processedItem:e})}this.hide()},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=i=>{const e=this.menubar!==i.target&&!this.menubar.contains(i.target),t=this.mobileActive&&this.$refs.menubutton!==i.target&&!this.$refs.menubutton.contains(i.target);e&&(t?this.mobileActive=!1:this.hide())},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindResizeListener(){this.resizeListener||(this.resizeListener=i=>{Y.isTouchDevice()||this.hide(i,!0),this.mobileActive=!1},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isItemMatched(i){return this.isValidItem(i)&&this.getProccessedItemLabel(i).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())},isValidItem(i){return!!i&&!this.isItemDisabled(i.item)&&!this.isItemSeparator(i.item)},isValidSelectedItem(i){return this.isValidItem(i)&&this.isSelected(i)},isSelected(i){return this.activeItemPath.some(e=>e.key===i.key)},findFirstItemIndex(){return this.visibleItems.findIndex(i=>this.isValidItem(i))},findLastItemIndex(){return xe.findLastIndex(this.visibleItems,i=>this.isValidItem(i))},findNextItemIndex(i){const e=i<this.visibleItems.length-1?this.visibleItems.slice(i+1).findIndex(t=>this.isValidItem(t)):-1;return e>-1?e+i+1:i},findPrevItemIndex(i){const e=i>0?xe.findLastIndex(this.visibleItems.slice(0,i),t=>this.isValidItem(t)):-1;return e>-1?e:i},findSelectedItemIndex(){return this.visibleItems.findIndex(i=>this.isValidSelectedItem(i))},findFirstFocusedItemIndex(){const i=this.findSelectedItemIndex();return i<0?this.findFirstItemIndex():i},findLastFocusedItemIndex(){const i=this.findSelectedItemIndex();return i<0?this.findLastItemIndex():i},searchItems(i,e){this.searchValue=(this.searchValue||"")+e;let t=-1,n=!1;return this.focusedItemInfo.index!==-1?(t=this.visibleItems.slice(this.focusedItemInfo.index).findIndex(s=>this.isItemMatched(s)),t=t===-1?this.visibleItems.slice(0,this.focusedItemInfo.index).findIndex(s=>this.isItemMatched(s)):t+this.focusedItemInfo.index):t=this.visibleItems.findIndex(s=>this.isItemMatched(s)),t!==-1&&(n=!0),t===-1&&this.focusedItemInfo.index===-1&&(t=this.findFirstFocusedItemIndex()),t!==-1&&this.changeFocusedItemIndex(i,t),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),n},changeFocusedItemIndex(i,e){this.focusedItemInfo.index!==e&&(this.focusedItemInfo.index=e,this.scrollInView())},scrollInView(i=-1){const e=i!==-1?`${this.id}_${i}`:this.focusedItemId,t=Y.findSingle(this.menubar,`li[id="${e}"]`);t&&t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"start"})},createProcessedItems(i,e=0,t={},n=""){const s=[];return i&&i.forEach((r,o)=>{const l=(n!==""?n+"_":"")+o,a={item:r,index:o,level:e,key:l,parent:t,parentKey:n};a.items=this.createProcessedItems(r.items,e+1,a,l),s.push(a)}),s},containerRef(i){this.container=i},menubarRef(i){this.menubar=i?i.$el:void 0}},computed:{containerClass(){return["p-menubar p-component",{"p-menubar-mobile-active":this.mobileActive}]},processedItems(){return this.createProcessedItems(this.model||[])},visibleItems(){const i=this.activeItemPath.find(e=>e.key===this.focusedItemInfo.parentKey);return i?i.items:this.processedItems},focusedItemId(){return this.focusedItemInfo.index!==-1?`${this.id}${xe.isNotEmpty(this.focusedItemInfo.parentKey)?"_"+this.focusedItemInfo.parentKey:""}_${this.focusedItemInfo.index}`:null}},components:{MenubarSub:Ma}};const nu={key:0,class:"p-menubar-start"},su=["aria-haspopup","aria-expanded","aria-controls","aria-label"],ru=wi("i",{class:"pi pi-bars"},null,-1),ou=[ru],lu={key:2,class:"p-menubar-end"};function au(i,e,t,n,s,r){const o=$s("MenubarSub");return J(),ie("div",{ref:r.containerRef,class:Le(r.containerClass)},[i.$slots.start?(J(),ie("div",nu,[js(i.$slots,"start")])):Ee("",!0),t.model&&t.model.length>0?(J(),ie("a",Of({key:1,ref:"menubutton",role:"button",tabindex:"0",class:"p-menubar-button","aria-haspopup":!!(t.model.length&&t.model.length>0),"aria-expanded":s.mobileActive,"aria-controls":s.id,"aria-label":i.$primevue.config.locale.aria.navigation,onClick:e[0]||(e[0]=l=>r.menuButtonClick(l)),onKeydown:e[1]||(e[1]=l=>r.menuButtonKeydown(l))},t.buttonProps),ou,16,su)):Ee("",!0),Pf(o,{ref:r.menubarRef,id:s.id,class:"p-menubar-root-list",role:"menubar",items:r.processedItems,template:i.$slots.item,root:!0,mobileActive:s.mobileActive,tabindex:"0","aria-activedescendant":s.focused?r.focusedItemId:void 0,menuId:s.id,focusedItemId:s.focused?r.focusedItemId:void 0,activeItemPath:s.activeItemPath,exact:t.exact,level:0,"aria-labelledby":i.ariaLabelledby,"aria-label":i.ariaLabel,onFocus:r.onFocus,onBlur:r.onBlur,onKeydown:r.onKeyDown,onItemClick:r.onItemClick,onItemMouseenter:r.onItemMouseEnter},null,8,["id","items","template","mobileActive","aria-activedescendant","menuId","focusedItemId","activeItemPath","exact","aria-labelledby","aria-label","onFocus","onBlur","onKeydown","onItemClick","onItemMouseenter"]),i.$slots.end?(J(),ie("div",lu,[js(i.$slots,"end")])):Ee("",!0)],2)}function hu(i,e){e===void 0&&(e={});var t=e.insertAt;if(!(!i||typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t==="top"&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=i:s.appendChild(document.createTextNode(i))}}var cu=` .p-menubar { display: flex; align-items: center; } .p-menubar ul { margin: 0; padding: 0; list-style: none; } .p-menubar .p-menuitem-link { cursor: pointer; display: flex; align-items: center; text-decoration: none; overflow: hidden; position: relative; } .p-menubar .p-menuitem-text { line-height: 1; } .p-menubar .p-menuitem { position: relative; } .p-menubar-root-list { display: flex; align-items: center; flex-wrap: wrap; } .p-menubar-root-list > li ul { display: none; z-index: 1; } .p-menubar-root-list > .p-menuitem-active > .p-submenu-list { display: block; } .p-menubar .p-submenu-list { display: none; position: absolute; z-index: 1; } .p-menubar .p-submenu-list > .p-menuitem-active > .p-submenu-list { display: block; left: 100%; top: 0; } .p-menubar .p-submenu-list .p-menuitem .p-menuitem-content .p-menuitem-link .p-submenu-icon { margin-left: auto; } .p-menubar .p-menubar-end { margin-left: auto; align-self: center; } .p-menubar-button { display: none; cursor: pointer; align-items: center; justify-content: center; text-decoration: none; } `;hu(cu);iu.render=au;class N{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){let s=[];return this.decompose(0,e,s,2),n.length&&n.decompose(0,n.length,s,3),this.decompose(t,this.length,s,1),Je.from(s,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let n=[];return this.decompose(e,t,n,0),Je.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),s=new vi(this),r=new vi(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=n)return!0}}iter(e=1){return new vi(this,e)}iterRange(e,t=this.length){return new Da(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;n=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Ta(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?N.empty:e.length<=32?new X(e):Je.from(X.split(e,[]))}}class X extends N{constructor(e,t=fu(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?n:l)>=e)return new uu(s,l,n,o);s=l+1,n++}}decompose(e,t,n,s){let r=e<=0&&t>=this.length?this:new X(Ao(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=n.pop(),l=yn(r.text,o.text.slice(),0,r.length);if(l.length<=32)n.push(new X(l,o.length+r.length));else{let a=l.length>>1;n.push(new X(l.slice(0,a)),new X(l.slice(a)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof X))return super.replace(e,t,n);let s=yn(this.text,yn(n.text,Ao(this.text,0,e)),t),r=this.length+n.length-(t-e);return s.length<=32?new X(s,r):Je.from(X.split(s,[]),r)}sliceString(e,t=this.length,n=` `){let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>e&&o&&(s+=n),e<a&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],s=-1;for(let r of e)n.push(r),s+=r.length+1,n.length==32&&(t.push(new X(n,s)),n=[],s=-1);return s>-1&&t.push(new X(n,s)),t}}class Je extends N{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=n+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,n,s);s=l+1,n=a+1}}decompose(e,t,n,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(e<=a&&t>=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?n.push(l):l.decompose(e-o,t-o,n,h)}o=a+1}}replace(e,t,n){if(n.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let a=o.replace(e-r,t-r,n),h=this.lines-o.lines+a.lines;if(a.lines<h>>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[s]=a,new Je(c,this.length-(t-e)+n.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` `){let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],a=o+l.length;o>e&&r&&(s+=n),e<a&&t>o&&(s+=l.sliceString(e-o,t-o,n)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Je))return 0;let n=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return n;let a=this.children[s],h=e.children[r];if(a!=h)return n+a.scanIdentical(h,t);n+=a.length+1}}static from(e,t=e.reduce((n,s)=>n+s.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let p of e)p.flatten(d);return new X(d,t)}let s=Math.max(32,n>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof Je)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof X&&a&&(p=c[c.length-1])instanceof X&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new X(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:Je.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new Je(l,t)}}N.empty=new X([""],0);function fu(i){let e=-1;for(let t of i)e+=t.length+1;return e}function yn(i,e,t=0,n=1e9){for(let s=0,r=0,o=!0;r<i.length&&s<=n;r++){let l=i[r],a=s+l.length;a>=t&&(a>n&&(l=l.slice(0,n-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=a+1}return e}function Ao(i,e,t){return yn(i,[""],e,t)}class vi{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof X?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,s=this.nodes[n],r=this.offsets[n],o=r>>1,l=s instanceof X?s.text.length:s.children.length;if(o==(t>0?l:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(s instanceof X){let a=s.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof X?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Da{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new vi(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=n?s:t<0?s.slice(s.length-n):s.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Ta{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(N.prototype[Symbol.iterator]=function(){return this.iter()},vi.prototype[Symbol.iterator]=Da.prototype[Symbol.iterator]=Ta.prototype[Symbol.iterator]=function(){return this});class uu{constructor(e,t,n,s){this.from=e,this.to=t,this.number=n,this.text=s}get length(){return this.to-this.from}}let Jt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(i=>i?parseInt(i,36):1);for(let i=1;i<Jt.length;i++)Jt[i]+=Jt[i-1];function du(i){for(let e=1;e<Jt.length;e+=2)if(Jt[e]>i)return Jt[e-1]<=i;return!1}function Io(i){return i>=127462&&i<=127487}const Mo=8205;function ve(i,e,t=!0,n=!0){return(t?Oa:pu)(i,e,n)}function Oa(i,e,t){if(e==i.length)return e;e&&Pa(i.charCodeAt(e))&&La(i.charCodeAt(e-1))&&e--;let n=ce(i,e);for(e+=Re(n);e<i.length;){let s=ce(i,e);if(n==Mo||s==Mo||t&&du(s))e+=Re(s),n=s;else if(Io(s)){let r=0,o=e-2;for(;o>=0&&Io(ce(i,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function pu(i,e,t){for(;e>0;){let n=Oa(i,e-2,t);if(n<e)return n;e--}return 0}function Pa(i){return i>=56320&&i<57344}function La(i){return i>=55296&&i<56320}function ce(i,e){let t=i.charCodeAt(e);if(!La(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return Pa(n)?(t-55296<<10)+(n-56320)+65536:t}function Hr(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function Re(i){return i<65536?1:2}const Gs=/\r\n?|\n/;var ue=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(ue||(ue={}));class Ze{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(n,s,r),s+=r):s+=o,n+=r}}iterChangedRanges(e,t=!1){_s(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],s=this.sections[t++];s<0?e.push(n,s):e.push(s,n)}return new Ze(e)}composeDesc(e){return this.empty?e:e.empty?this:Ea(this,e)}mapDesc(e,t=!1){return e.empty?this:Js(this,e,t)}mapPos(e,t=-1,n=ue.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=s+l;if(a<0){if(h>e)return r+(e-s);r+=l}else{if(n!=ue.Simple&&h>=e&&(n==ue.TrackDel&&s<e&&h>e||n==ue.TrackBefore&&s<e||n==ue.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let n=0,s=0;n<this.sections.length&&s<=t;){let r=this.sections[n++],o=this.sections[n++],l=s+r;if(o>=0&&s<=t&&l>=e)return s<e&&l>t?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],s=this.sections[t++];e+=(e?" ":"")+n+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ze(e)}static create(e){return new Ze(e)}}class ne extends Ze{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return _s(this,(t,n,s,r,o)=>e=e.replace(s,s+(n-t),o),!1),e}mapDesc(e,t=!1){return Js(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let s=0,r=0;s<t.length;s+=2){let o=t[s],l=t[s+1];if(l>=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;n.length<a;)n.push(N.empty);n.push(o?e.slice(r,r+o):N.empty)}r+=o}return new ne(t,n)}compose(e){return this.empty?e:e.empty?this:Ea(this,e,!0)}map(e,t=!1){return e.empty?this:Js(this,e,t,!0)}iterChanges(e,t=!1){_s(this,e,t)}get desc(){return Ze.create(this.sections)}filter(e){let t=[],n=[],s=[],r=new Ai(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&r.len==0;){if(r.done)break e;let c=Math.min(r.len,a-l);pe(s,c,-1);let f=r.ins==-1?-1:r.o