pennsieve-dashboard 0.0.2

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.
@@ -0,0 +1,73 @@
1
+ (function(we,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","vue","pinia"],o):(we=typeof globalThis<"u"?globalThis:we||self,o(we["pennsieve-dashboard"]={},we.Vue,we.Pinia))})(this,(function(we,o,St){"use strict";/*! Element Plus Icons Vue v2.3.2 */var _o=o.defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),bo=_o,wo=o.defineComponent({name:"Close",__name:"close",setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Fi=wo,Eo=o.defineComponent({name:"Edit",__name:"edit",setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),o.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),Xn=Eo,xo=o.defineComponent({name:"Lock",__name:"lock",setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"})]))}}),vo=xo,ko=o.defineComponent({name:"Unlock",__name:"unlock",setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[o.createElementVNode("path",{fill:"currentColor",d:"M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"}),o.createElementVNode("path",{fill:"currentColor",d:"M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"})]))}}),To=ko;const dt=St.defineStore("globalVars",()=>{const n=o.ref([]),e=o.ref({}),t="dashboard-globalVarsStore",i=o.ref(null),r=o.ref([]),s=o.ref([]),a=o.ref({}),l=o.reactive({});function d(R,k){l[R]=k}function c(R={}){for(const k of Object.keys(l))delete l[k];Object.assign(l,R)}const u=R=>{delete l[R],S()};function p(){for(const R of Object.keys(l))delete l[R]}function h(){return JSON.parse(JSON.stringify(l))}const y=R=>s.value.find(k=>k.id===R),m=(R,k)=>{r.value.push({name:R,value:k})},g=()=>{r.value=[]},v=R=>{const k=C(R);a.value=k},E=()=>a.value;function C(R){const k={};if(!R||typeof R!="object")return k;for(const[A,M]of Object.entries(R))if(M&&typeof M=="object"&&!(o.isRef(M)||o.isReactive(M))){const U=Object.getPrototypeOf(M)===Object.prototype;k[A]=U?{...M}:o.markRaw(M)}else k[A]=M;return k}const w=R=>{const k=s.value.find(A=>A.id===R);k&&(k.Props=k.Props||{},k.Props.locked=!k.Props.locked)},b=R=>R.map(k=>{const A=e.value[k.componentKey];return A?{...k,component:A}:null}).filter(k=>!!k);function x(R,k={}){const A={...R,...k};return A.componentKey?{id:A.id,componentKey:A.componentKey,Props:A.Props??{},x:A.x,y:A.y,w:A.w,h:A.h}:(console.warn(`save: item ${A.id} missing componentKey; skipping`),null)}function N(){return(i.value?.save?.()??[]).map(k=>{const A=s.value.find(W=>W.id===k.id);if(!A)return null;const{x:M,y:U,w:q,h:oe}=k;return x(A,{x:M,y:U,w:q,h:oe})}).filter(k=>!!k)}const S=()=>{const R={version:1,items:N(),filters:h()};localStorage.setItem(t,JSON.stringify(R))},P=()=>{const R=localStorage.getItem(t);if(!R){s.value=n.value,c({});return}try{const k=JSON.parse(R);s.value=Array.isArray(k.items)?b(k.items):n.value,c(k.filters??{})}catch(k){console.error("Failed to parse globalVarsStore:",k),s.value=n.value,c({})}};return o.watch(l,()=>S(),{deep:!0}),{DASHBOARD_ITEMS:s,DefaultLayout:n,ComponentRegistry:e,optionsData:r,gridInstance:i,Services:a,Filters:l,setFilter:d,clearFilter:u,clearAllFilters:p,resetFilters:c,getDashItem:y,toggleWidgetLock:w,addOptionsDataItems:m,clearOptionsDataItems:g,saveToLocalStorage:S,loadFromLocalStorage:P,setOptionServices:v,getServices:E}}),Co={class:"widget-settings-container"},So={class:"widget-setting"},Ro={class:"dialog-footer"},Ao=o.defineComponent({__name:"TextWidgetSettings",props:{showDialog:{type:Boolean},reactiveSourceValue:{},manualEntryValue:{},hideHeaderValue:{type:Boolean}},emits:["close-dialog","update-text-var"],setup(n,{emit:e}){const t=dt(),{optionsData:i}=St.storeToRefs(t),r=e,s=n,a=o.computed({get:()=>s.showDialog,set:p=>{p||r("close-dialog")}}),l=o.ref(s.reactiveSourceValue??""),d=o.ref(s.manualEntryValue??""),c=o.ref(!!s.hideHeaderValue);o.watch(()=>s.reactiveSourceValue,p=>{l.value=p??""}),o.watch(()=>s.manualEntryValue,p=>{d.value=p??""},{immediate:!0}),o.watch(()=>s.hideHeaderValue,p=>{c.value=!!p});function u(){const p=(l.value||"").trim(),h=p!=="",y=h?null:d.value?.trim()||"";r("update-text-var",{reactiveSource:h?p:null,manualEdit:y,hideHeader:c.value}),a.value=!1}return(p,h)=>{const y=o.resolveComponent("el-option"),m=o.resolveComponent("el-select"),g=o.resolveComponent("el-input"),v=o.resolveComponent("el-checkbox"),E=o.resolveComponent("el-button"),C=o.resolveComponent("el-dialog");return o.openBlock(),o.createBlock(C,{class:"full-dialog-dashboard",modelValue:a.value,"onUpdate:modelValue":h[4]||(h[4]=w=>a.value=w),title:"Text Widget Settings","append-to-body":!0},{footer:o.withCtx(()=>[o.createElementVNode("div",Ro,[o.createVNode(E,{class:"secondary",onClick:h[3]||(h[3]=w=>a.value=!1)},{default:o.withCtx(()=>[...h[8]||(h[8]=[o.createTextVNode("Cancel",-1)])]),_:1}),o.createVNode(E,{onClick:u},{default:o.withCtx(()=>[...h[9]||(h[9]=[o.createTextVNode("Save",-1)])]),_:1})])]),default:o.withCtx(()=>[o.createElementVNode("div",Co,[o.createElementVNode("div",So,[h[5]||(h[5]=o.createElementVNode("h4",null,"Select This Widget's Value",-1)),h[6]||(h[6]=o.createElementVNode("h5",null,"Select From Variables",-1)),o.createVNode(m,{modelValue:l.value,"onUpdate:modelValue":h[0]||(h[0]=w=>l.value=w),class:"text-settings-height"},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(y,{value:"",key:"__manual__",label:"Manual entry"})),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(i),w=>(o.openBlock(),o.createBlock(y,{key:w.name,label:w.name,value:w.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),h[7]||(h[7]=o.createElementVNode("h5",null,"Manual Entry",-1)),o.createVNode(g,{modelValue:d.value,"onUpdate:modelValue":h[1]||(h[1]=w=>d.value=w),class:"text-settings-height"},null,8,["modelValue"]),o.createVNode(v,{modelValue:c.value,"onUpdate:modelValue":h[2]||(h[2]=w=>c.value=w),label:"Hide Header"},null,8,["modelValue"])])])]),_:1},8,["modelValue"])}}}),Je=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},Oo=Je(Ao,[["__scopeId","data-v-cd8e85a7"]]),No={key:0},Do=Je(o.defineComponent({inheritAttrs:!1,__name:"TextWidget",props:{displayText:{},bindedKey:{},widgetID:{},hideHeader:{type:Boolean}},setup(n){const e=dt(),t=n,i=o.ref(t.displayText??"");o.watch(()=>t.displayText,E=>{i.value=E??""},{immediate:!0});const r=o.computed(()=>!!(t.bindedKey&&t.bindedKey.trim()!=="")),s=o.computed(()=>{const E=t.bindedKey?.trim();if(!E)return"—";const w=e.optionsData.find(b=>b?.name===E)?.value;return Array.isArray(w)?w.join(", "):w&&typeof w=="object"?JSON.stringify(w):w??"—"}),a=o.ref("Text Widget"),l=o.shallowRef([{comp:Xn,event:y,tooltip:"open Text settings"}]),d=o.ref(!1),c=o.ref(null);function u(){d.value=!0,c.value?.focus?.()}function p(){d.value=!1}const h=o.ref(!1);function y(){h.value=!0}function m(){h.value=!1,e.saveToLocalStorage()}function g({manualEdit:E,reactiveSource:C,hideHeader:w}){const b=e.getDashItem(t.widgetID);b&&(b.hideHeader=w,C&&C.trim()!==""?(b.Props=b.Props||{},b.Props.bindedKey=C,b.Props.displayText=null,b.componentName=v(C)):(b.Props=b.Props||{},b.Props.bindedKey=null,b.Props.displayText=E??"",b.componentName=E??"Text"),e.saveToLocalStorage())}function v(E){return E?E.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,C=>C.toUpperCase()):""}return(E,C)=>{const w=o.resolveComponent("el-input"),b=o.resolveDirective("click-out");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.renderSlot(E.$slots,"default",{widgetName:a.value,childIcons:l.value},void 0,!0),o.createElementVNode("div",o.mergeProps({class:"text-widget-wrap"},E.$attrs),[r.value?(o.openBlock(),o.createElementBlock("div",No,[o.createElementVNode("h2",null,o.toDisplayString(s.value),1)])):o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:1,onKeyup:o.withKeys(p,["enter"]),class:"tw-flex"},[o.withDirectives(o.createElementVNode("div",null,[o.createVNode(w,{ref_key:"textUserInput",ref:c,modelValue:i.value,"onUpdate:modelValue":C[0]||(C[0]=x=>i.value=x),onFocus:C[1]||(C[1]=x=>x.target?.select?.())},null,8,["modelValue"])],512),[[o.vShow,d.value]]),o.withDirectives(o.createElementVNode("div",{onClick:C[2]||(C[2]=x=>u()),class:"tw-w-full tw-h-full"},[o.createElementVNode("h2",null,o.toDisplayString(i.value),1)],512),[[o.vShow,!d.value]])],32)),[[b,p]])],16),o.createVNode(Oo,{"show-dialog":h.value,"reactive-source-value":t.bindedKey||"","manual-entry-value":i.value,"hide-header-value":t.hideHeader||!1,onCloseDialog:m,onUpdateTextVar:g},null,8,["show-dialog","reactive-source-value","manual-entry-value","hide-header-value"])],64)}}}),[["__scopeId","data-v-3daad922"]]);function Ui(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var et=Ui();function Zn(n){et=n}var Rt={exec:()=>null};function H(n,e=""){let t=typeof n=="string"?n:n.source,i={replace:(r,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(ie.caret,"$1"),t=t.replace(r,a),i},getRegex:()=>new RegExp(t,e)};return i}var ie={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},Po=/^(?:[ \t]*(?:\n|$))+/,Io=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Lo=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,At=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Mo=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vi=/(?:[*+-]|\d{1,9}[.)])/,Qn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Jn=H(Qn).replace(/bull/g,Vi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),zo=H(Qn).replace(/bull/g,Vi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Wi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$o=/^[^\n]+/,Gi=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Bo=H(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Gi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ho=H(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Vi).getRegex(),ri="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ji=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Fo=H("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ji).replace("tag",ri).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),er=H(Wi).replace("hr",At).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ri).getRegex(),Uo=H(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",er).getRegex(),qi={blockquote:Uo,code:Io,def:Bo,fences:Lo,heading:Mo,hr:At,html:Fo,lheading:Jn,list:Ho,newline:Po,paragraph:er,table:Rt,text:$o},tr=H("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",At).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ri).getRegex(),Vo={...qi,lheading:zo,table:tr,paragraph:H(Wi).replace("hr",At).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",tr).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ri).getRegex()},Wo={...qi,html:H(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ji).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:H(Wi).replace("hr",At).replace("heading",` *#{1,6} *[^
2
+ ]`).replace("lheading",Jn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Go=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,jo=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ir=/^( {2,}|\\)\n(?!\s*$)/,qo=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,si=/[\p{P}\p{S}]/u,Ki=/[\s\p{P}\p{S}]/u,nr=/[^\s\p{P}\p{S}]/u,Ko=H(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ki).getRegex(),rr=/(?!~)[\p{P}\p{S}]/u,Yo=/(?!~)[\s\p{P}\p{S}]/u,Xo=/(?:[^\s\p{P}\p{S}]|~)/u,Zo=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,sr=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Qo=H(sr,"u").replace(/punct/g,si).getRegex(),Jo=H(sr,"u").replace(/punct/g,rr).getRegex(),or="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ea=H(or,"gu").replace(/notPunctSpace/g,nr).replace(/punctSpace/g,Ki).replace(/punct/g,si).getRegex(),ta=H(or,"gu").replace(/notPunctSpace/g,Xo).replace(/punctSpace/g,Yo).replace(/punct/g,rr).getRegex(),ia=H("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,nr).replace(/punctSpace/g,Ki).replace(/punct/g,si).getRegex(),na=H(/\\(punct)/,"gu").replace(/punct/g,si).getRegex(),ra=H(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),sa=H(ji).replace("(?:-->|$)","-->").getRegex(),oa=H("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",sa).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),oi=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,aa=H(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",oi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ar=H(/^!?\[(label)\]\[(ref)\]/).replace("label",oi).replace("ref",Gi).getRegex(),lr=H(/^!?\[(ref)\](?:\[\])?/).replace("ref",Gi).getRegex(),la=H("reflink|nolink(?!\\()","g").replace("reflink",ar).replace("nolink",lr).getRegex(),Yi={_backpedal:Rt,anyPunctuation:na,autolink:ra,blockSkip:Zo,br:ir,code:jo,del:Rt,emStrongLDelim:Qo,emStrongRDelimAst:ea,emStrongRDelimUnd:ia,escape:Go,link:aa,nolink:lr,punctuation:Ko,reflink:ar,reflinkSearch:la,tag:oa,text:qo,url:Rt},ca={...Yi,link:H(/^!?\[(label)\]\((.*?)\)/).replace("label",oi).getRegex(),reflink:H(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oi).getRegex()},Xi={...Yi,emStrongRDelimAst:ta,emStrongLDelim:Jo,url:H(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},da={...Xi,br:H(ir).replace("{2,}","*").getRegex(),text:H(Xi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ai={normal:qi,gfm:Vo,pedantic:Wo},Ot={normal:Yi,gfm:Xi,breaks:da,pedantic:ca},ua={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},cr=n=>ua[n];function Ee(n,e){if(e){if(ie.escapeTest.test(n))return n.replace(ie.escapeReplace,cr)}else if(ie.escapeTestNoEncode.test(n))return n.replace(ie.escapeReplaceNoEncode,cr);return n}function dr(n){try{n=encodeURI(n).replace(ie.percentDecode,"%")}catch{return null}return n}function ur(n,e){let t=n.replace(ie.findPipe,(s,a,l)=>{let d=!1,c=a;for(;--c>=0&&l[c]==="\\";)d=!d;return d?"|":" |"}),i=t.split(ie.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(ie.slashPipe,"|");return i}function Nt(n,e,t){let i=n.length;if(i===0)return"";let r=0;for(;r<i&&n.charAt(i-r-1)===e;)r++;return n.slice(0,i-r)}function pa(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let i=0;i<n.length;i++)if(n[i]==="\\")i++;else if(n[i]===e[0])t++;else if(n[i]===e[1]&&(t--,t<0))return i;return t>0?-2:-1}function pr(n,e,t,i,r){let s=e.href,a=e.title||null,l=n[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:s,title:a,text:l,tokens:i.inlineTokens(l)};return i.state.inLink=!1,d}function ha(n,e,t){let i=n.match(t.other.indentCodeCompensation);if(i===null)return e;let r=i[1];return e.split(`
3
+ `).map(s=>{let a=s.match(t.other.beginningSpace);if(a===null)return s;let[l]=a;return l.length>=r.length?s.slice(r.length):s}).join(`
4
+ `)}var li=class{options;rules;lexer;constructor(n){this.options=n||et}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Nt(t,`
5
+ `)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],i=ha(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let i=Nt(t,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(t=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:Nt(e[0],`
6
+ `)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=Nt(e[0],`
7
+ `).split(`
8
+ `),i="",r="",s=[];for(;t.length>0;){let a=!1,l=[],d;for(d=0;d<t.length;d++)if(this.rules.other.blockquoteStart.test(t[d]))l.push(t[d]),a=!0;else if(!a)l.push(t[d]);else break;t=t.slice(d);let c=l.join(`
9
+ `),u=c.replace(this.rules.other.blockquoteSetextReplace,`
10
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
11
+ ${c}`:c,r=r?`${r}
12
+ ${u}`:u;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,s,!0),this.lexer.state.top=p,t.length===0)break;let h=s.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let y=h,m=y.raw+`
13
+ `+t.join(`
14
+ `),g=this.blockquote(m);s[s.length-1]=g,i=i.substring(0,i.length-y.raw.length)+g.raw,r=r.substring(0,r.length-y.text.length)+g.text;break}else if(h?.type==="list"){let y=h,m=y.raw+`
15
+ `+t.join(`
16
+ `),g=this.list(m);s[s.length-1]=g,i=i.substring(0,i.length-h.raw.length)+g.raw,r=r.substring(0,r.length-y.raw.length)+g.raw,t=m.substring(s.at(-1).raw.length).split(`
17
+ `);continue}}return{type:"blockquote",raw:i,tokens:s,text:r}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim(),i=t.length>1,r={type:"list",raw:"",ordered:i,start:i?+t.slice(0,-1):"",loose:!1,items:[]};t=i?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=i?t:"[*+-]");let s=this.rules.other.listItemRegex(t),a=!1;for(;n;){let d=!1,c="",u="";if(!(e=s.exec(n))||this.rules.block.hr.test(n))break;c=e[0],n=n.substring(c.length);let p=e[2].split(`
18
+ `,1)[0].replace(this.rules.other.listReplaceTabs,E=>" ".repeat(3*E.length)),h=n.split(`
19
+ `,1)[0],y=!p.trim(),m=0;if(this.options.pedantic?(m=2,u=p.trimStart()):y?m=e[1].length+1:(m=e[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,u=p.slice(m),m+=e[1].length),y&&this.rules.other.blankLine.test(h)&&(c+=h+`
20
+ `,n=n.substring(h.length+1),d=!0),!d){let E=this.rules.other.nextBulletRegex(m),C=this.rules.other.hrRegex(m),w=this.rules.other.fencesBeginRegex(m),b=this.rules.other.headingBeginRegex(m),x=this.rules.other.htmlBeginRegex(m);for(;n;){let N=n.split(`
21
+ `,1)[0],S;if(h=N,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),S=h):S=h.replace(this.rules.other.tabCharGlobal," "),w.test(h)||b.test(h)||x.test(h)||E.test(h)||C.test(h))break;if(S.search(this.rules.other.nonSpaceChar)>=m||!h.trim())u+=`
22
+ `+S.slice(m);else{if(y||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(p)||b.test(p)||C.test(p))break;u+=`
23
+ `+h}!y&&!h.trim()&&(y=!0),c+=N+`
24
+ `,n=n.substring(N.length+1),p=S.slice(m)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0));let g=null,v;this.options.gfm&&(g=this.rules.other.listIsTask.exec(u),g&&(v=g[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:c,task:!!g,checked:v,loose:!1,text:u,tokens:[]}),r.raw+=c}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let d=0;d<r.items.length;d++)if(this.lexer.state.top=!1,r.items[d].tokens=this.lexer.blockTokens(r.items[d].text,[]),!r.loose){let c=r.items[d].tokens.filter(p=>p.type==="space"),u=c.length>0&&c.some(p=>this.rules.other.anyLine.test(p.raw));r.loose=u}if(r.loose)for(let d=0;d<r.items.length;d++)r.items[d].loose=!0;return r}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:i,title:r}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=ur(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
+ `):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===i.length){for(let a of i)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<t.length;a++)s.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:s.align[a]});for(let a of r)s.rows.push(ur(a,s.header.length).map((l,d)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[d]})));return s}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===`
26
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let s=Nt(t.slice(0,-1),"\\");if((t.length-s.length)%2===0)return}else{let s=pa(e[2],"()");if(s===-2)return;if(s>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?i=i.slice(1):i=i.slice(1,-1)),pr(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let i=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[i.toLowerCase()];if(!r){let s=t[0].charAt(0);return{type:"text",raw:s,text:s}}return pr(t,r,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let i=this.rules.inline.emStrongLDelim.exec(n);if(!(!i||i[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!t||this.rules.inline.punctuation.exec(t))){let r=[...i[0]].length-1,s,a,l=r,d=0,c=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*n.length+r);(i=c.exec(e))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(a=[...s].length,i[3]||i[4]){l+=a;continue}else if((i[5]||i[6])&&r%3&&!((r+a)%3)){d+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+d);let u=[...i[0]][0].length,p=n.slice(0,r+i.index+u+a);if(Math.min(r,a)%2){let y=p.slice(1,-1);return{type:"em",raw:p,text:y,tokens:this.lexer.inlineTokens(y)}}let h=p.slice(2,-2);return{type:"strong",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return i&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){let e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,i;return e[2]==="@"?(t=e[1],i="mailto:"+t):(t=e[1],i=t),{type:"link",raw:e[0],text:t,href:i,tokens:[{type:"text",raw:t,text:t}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let t,i;if(e[2]==="@")t=e[0],i="mailto:"+t;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);t=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:t,href:i,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},De=class Kn{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||et,this.options.tokenizer=this.options.tokenizer||new li,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:ie,block:ai.normal,inline:Ot.normal};this.options.pedantic?(t.block=ai.pedantic,t.inline=Ot.pedantic):this.options.gfm&&(t.block=ai.gfm,this.options.breaks?t.inline=Ot.breaks:t.inline=Ot.gfm),this.tokenizer.rules=t}static get rules(){return{block:ai,inline:Ot}}static lex(e,t){return new Kn(t).lex(e)}static lexInline(e,t){return new Kn(t).inlineTokens(e)}lex(e){e=e.replace(ie.carriageReturn,`
27
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let i=this.inlineQueue[t];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],i=!1){for(this.options.pedantic&&(e=e.replace(ie.tabCharGlobal," ").replace(ie.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(a=>(r=a.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let a=t.at(-1);r.raw.length===1&&a!==void 0?a.raw+=`
28
+ `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
29
+ `)?"":`
30
+ `)+r.raw,a.text+=`
31
+ `+r.text,this.inlineQueue.at(-1).src=a.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
32
+ `)?"":`
33
+ `)+r.raw,a.text+=`
34
+ `+r.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let s=e;if(this.options.extensions?.startBlock){let a=1/0,l=e.slice(1),d;this.options.extensions.startBlock.forEach(c=>{d=c.call({lexer:this},l),typeof d=="number"&&d>=0&&(a=Math.min(a,d))}),a<1/0&&a>=0&&(s=e.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let a=t.at(-1);i&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
35
+ `)?"":`
36
+ `)+r.raw,a.text+=`
37
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),i=s.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let a=t.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
38
+ `)?"":`
39
+ `)+r.raw,a.text+=`
40
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let i=e,r=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,a="";for(;e;){s||(a=""),s=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=t.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):t.push(l);continue}if(l=this.tokenizer.emStrong(e,i,a)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),t.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),t.push(l);continue}let d=e;if(this.options.extensions?.startInline){let c=1/0,u=e.slice(1),p;this.options.extensions.startInline.forEach(h=>{p=h.call({lexer:this},u),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(d=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(d)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),s=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):t.push(l);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},ci=class{options;parser;constructor(e){this.options=e||et}space(e){return""}code({text:e,lang:t,escaped:i}){let r=(t||"").match(ie.notSpaceStart)?.[0],s=e.replace(ie.endingNewline,"")+`
41
+ `;return r?'<pre><code class="language-'+Ee(r)+'">'+(i?s:Ee(s,!0))+`</code></pre>
42
+ `:"<pre><code>"+(i?s:Ee(s,!0))+`</code></pre>
43
+ `}blockquote({tokens:e}){return`<blockquote>
44
+ ${this.parser.parse(e)}</blockquote>
45
+ `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
46
+ `}hr(e){return`<hr>
47
+ `}list(e){let t=e.ordered,i=e.start,r="";for(let l=0;l<e.items.length;l++){let d=e.items[l];r+=this.listitem(d)}let s=t?"ol":"ul",a=t&&i!==1?' start="'+i+'"':"";return"<"+s+a+`>
48
+ `+r+"</"+s+`>
49
+ `}listitem(e){let t="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+Ee(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):t+=i+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
50
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
51
+ `}table(e){let t="",i="";for(let s=0;s<e.header.length;s++)i+=this.tablecell(e.header[s]);t+=this.tablerow({text:i});let r="";for(let s=0;s<e.rows.length;s++){let a=e.rows[s];i="";for(let l=0;l<a.length;l++)i+=this.tablecell(a[l]);r+=this.tablerow({text:i})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
52
+ <thead>
53
+ `+t+`</thead>
54
+ `+r+`</table>
55
+ `}tablerow({text:e}){return`<tr>
56
+ ${e}</tr>
57
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>
58
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ee(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:i}){let r=this.parser.parseInline(i),s=dr(e);if(s===null)return r;e=s;let a='<a href="'+e+'"';return t&&(a+=' title="'+Ee(t)+'"'),a+=">"+r+"</a>",a}image({href:e,title:t,text:i,tokens:r}){r&&(i=this.parser.parseInline(r,this.parser.textRenderer));let s=dr(e);if(s===null)return Ee(i);e=s;let a=`<img src="${e}" alt="${i}"`;return t&&(a+=` title="${Ee(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ee(e.text)}},Zi=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},Pe=class Yn{options;renderer;textRenderer;constructor(e){this.options=e||et,this.options.renderer=this.options.renderer||new ci,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Zi}static parse(e,t){return new Yn(t).parse(e)}static parseInline(e,t){return new Yn(t).parseInline(e)}parse(e,t=!0){let i="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let l=s,d=this.options.extensions.renderers[l.type].call({parser:this},l);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){i+=d||"";continue}}let a=s;switch(a.type){case"space":{i+=this.renderer.space(a);continue}case"hr":{i+=this.renderer.hr(a);continue}case"heading":{i+=this.renderer.heading(a);continue}case"code":{i+=this.renderer.code(a);continue}case"table":{i+=this.renderer.table(a);continue}case"blockquote":{i+=this.renderer.blockquote(a);continue}case"list":{i+=this.renderer.list(a);continue}case"html":{i+=this.renderer.html(a);continue}case"def":{i+=this.renderer.def(a);continue}case"paragraph":{i+=this.renderer.paragraph(a);continue}case"text":{let l=a,d=this.renderer.text(l);for(;r+1<e.length&&e[r+1].type==="text";)l=e[++r],d+=`
59
+ `+this.renderer.text(l);t?i+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):i+=d;continue}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}parseInline(e,t=this.renderer){let i="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=l||"";continue}}let a=s;switch(a.type){case"escape":{i+=t.text(a);break}case"html":{i+=t.html(a);break}case"link":{i+=t.link(a);break}case"image":{i+=t.image(a);break}case"strong":{i+=t.strong(a);break}case"em":{i+=t.em(a);break}case"codespan":{i+=t.codespan(a);break}case"br":{i+=t.br(a);break}case"del":{i+=t.del(a);break}case"text":{i+=t.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},di=class{options;block;constructor(n){this.options=n||et}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?De.lex:De.lexInline}provideParser(){return this.block?Pe.parse:Pe.parseInline}},fa=class{defaults=Ui();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Pe;Renderer=ci;TextRenderer=Zi;Lexer=De;Tokenizer=li;Hooks=di;constructor(...e){this.use(...e)}walkTokens(e,t){let i=[];for(let r of e)switch(i=i.concat(t.call(this,r)),r.type){case"table":{let s=r;for(let a of s.header)i=i.concat(this.walkTokens(a.tokens,t));for(let a of s.rows)for(let l of a)i=i.concat(this.walkTokens(l.tokens,t));break}case"list":{let s=r;i=i.concat(this.walkTokens(s.items,t));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let l=s[a].flat(1/0);i=i.concat(this.walkTokens(l,t))}):s.tokens&&(i=i.concat(this.walkTokens(s.tokens,t)))}}return i}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{let r={...i};if(r.async=this.defaults.async||r.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let a=t.renderers[s.name];a?t.renderers[s.name]=function(...l){let d=s.renderer.apply(this,l);return d===!1&&(d=a.apply(this,l)),d}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=t[s.level];a?a.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),i.renderer){let s=this.defaults.renderer||new ci(this.defaults);for(let a in i.renderer){if(!(a in s))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let l=a,d=i.renderer[l],c=s[l];s[l]=(...u)=>{let p=d.apply(s,u);return p===!1&&(p=c.apply(s,u)),p||""}}r.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new li(this.defaults);for(let a in i.tokenizer){if(!(a in s))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let l=a,d=i.tokenizer[l],c=s[l];s[l]=(...u)=>{let p=d.apply(s,u);return p===!1&&(p=c.apply(s,u)),p}}r.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new di;for(let a in i.hooks){if(!(a in s))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let l=a,d=i.hooks[l],c=s[l];di.passThroughHooks.has(a)?s[l]=u=>{if(this.defaults.async)return Promise.resolve(d.call(s,u)).then(h=>c.call(s,h));let p=d.call(s,u);return c.call(s,p)}:s[l]=(...u)=>{let p=d.apply(s,u);return p===!1&&(p=c.apply(s,u)),p}}r.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,a=i.walkTokens;r.walkTokens=function(l){let d=[];return d.push(a.call(this,l)),s&&(d=d.concat(s.call(this,l))),d}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return De.lex(e,t??this.defaults)}parser(e,t){return Pe.parse(e,t??this.defaults)}parseMarkdown(e){return(t,i)=>{let r={...i},s={...this.defaults,...r},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=e);let l=s.hooks?s.hooks.provideLexer():e?De.lex:De.lexInline,d=s.hooks?s.hooks.provideParser():e?Pe.parse:Pe.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(t):t).then(c=>l(c,s)).then(c=>s.hooks?s.hooks.processAllTokens(c):c).then(c=>s.walkTokens?Promise.all(this.walkTokens(c,s.walkTokens)).then(()=>c):c).then(c=>d(c,s)).then(c=>s.hooks?s.hooks.postprocess(c):c).catch(a);try{s.hooks&&(t=s.hooks.preprocess(t));let c=l(t,s);s.hooks&&(c=s.hooks.processAllTokens(c)),s.walkTokens&&this.walkTokens(c,s.walkTokens);let u=d(c,s);return s.hooks&&(u=s.hooks.postprocess(u)),u}catch(c){return a(c)}}}onError(e,t){return i=>{if(i.message+=`
60
+ Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+Ee(i.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(i);throw i}}},tt=new fa;function F(n,e){return tt.parse(n,e)}F.options=F.setOptions=function(n){return tt.setOptions(n),F.defaults=tt.defaults,Zn(F.defaults),F},F.getDefaults=Ui,F.defaults=et,F.use=function(...n){return tt.use(...n),F.defaults=tt.defaults,Zn(F.defaults),F},F.walkTokens=function(n,e){return tt.walkTokens(n,e)},F.parseInline=tt.parseInline,F.Parser=Pe,F.parser=Pe.parse,F.Renderer=ci,F.TextRenderer=Zi,F.Lexer=De,F.lexer=De.lex,F.Tokenizer=li,F.Hooks=di,F.parse=F,F.options,F.setOptions,F.use,F.walkTokens,F.parseInline,Pe.parse,De.lex;/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:hr,setPrototypeOf:fr,isFrozen:ga,getPrototypeOf:ma,getOwnPropertyDescriptor:ya}=Object;let{freeze:ne,seal:pe,create:gr}=Object,{apply:Qi,construct:Ji}=typeof Reflect<"u"&&Reflect;ne||(ne=function(e){return e}),pe||(pe=function(e){return e}),Qi||(Qi=function(e,t,i){return e.apply(t,i)}),Ji||(Ji=function(e,t){return new e(...t)});const ui=se(Array.prototype.forEach),_a=se(Array.prototype.lastIndexOf),mr=se(Array.prototype.pop),Dt=se(Array.prototype.push),ba=se(Array.prototype.splice),pi=se(String.prototype.toLowerCase),en=se(String.prototype.toString),yr=se(String.prototype.match),Pt=se(String.prototype.replace),wa=se(String.prototype.indexOf),Ea=se(String.prototype.trim),me=se(Object.prototype.hasOwnProperty),re=se(RegExp.prototype.test),It=xa(TypeError);function se(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return Qi(n,e,i)}}function xa(n){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return Ji(n,t)}}function $(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pi;fr&&fr(n,null);let i=e.length;for(;i--;){let r=e[i];if(typeof r=="string"){const s=t(r);s!==r&&(ga(e)||(e[i]=s),r=s)}n[r]=!0}return n}function va(n){for(let e=0;e<n.length;e++)me(n,e)||(n[e]=null);return n}function Ie(n){const e=gr(null);for(const[t,i]of hr(n))me(n,t)&&(Array.isArray(i)?e[t]=va(i):i&&typeof i=="object"&&i.constructor===Object?e[t]=Ie(i):e[t]=i);return e}function Lt(n,e){for(;n!==null;){const i=ya(n,e);if(i){if(i.get)return se(i.get);if(typeof i.value=="function")return se(i.value)}n=ma(n)}function t(){return null}return t}const _r=ne(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),tn=ne(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),nn=ne(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ka=ne(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),rn=ne(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ta=ne(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),br=ne(["#text"]),wr=ne(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),sn=ne(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Er=ne(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),hi=ne(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ca=pe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Sa=pe(/<%[\w\W]*|[\w\W]*%>/gm),Ra=pe(/\$\{[\w\W]*/gm),Aa=pe(/^data-[\-\w.\u00B7-\uFFFF]+$/),Oa=pe(/^aria-[\-\w]+$/),xr=pe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Na=pe(/^(?:\w+script|data):/i),Da=pe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),vr=pe(/^html$/i),Pa=pe(/^[a-z][.\w]*(-[.\w]+)+$/i);var kr=Object.freeze({__proto__:null,ARIA_ATTR:Oa,ATTR_WHITESPACE:Da,CUSTOM_ELEMENT:Pa,DATA_ATTR:Aa,DOCTYPE_NAME:vr,ERB_EXPR:Sa,IS_ALLOWED_URI:xr,IS_SCRIPT_OR_DATA:Na,MUSTACHE_EXPR:Ca,TMPLIT_EXPR:Ra});const Mt={element:1,text:3,progressingInstruction:7,comment:8,document:9},Ia=function(){return typeof window>"u"?null:window},La=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(i=t.getAttribute(r));const s="dompurify"+(i?"#"+i:"");try{return e.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Tr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Cr(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ia();const e=D=>Cr(D);if(e.version="3.2.6",e.removed=[],!n||!n.document||n.document.nodeType!==Mt.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const i=t,r=i.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:l,Element:d,NodeFilter:c,NamedNodeMap:u=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:p,DOMParser:h,trustedTypes:y}=n,m=d.prototype,g=Lt(m,"cloneNode"),v=Lt(m,"remove"),E=Lt(m,"nextSibling"),C=Lt(m,"childNodes"),w=Lt(m,"parentNode");if(typeof a=="function"){const D=t.createElement("template");D.content&&D.content.ownerDocument&&(t=D.content.ownerDocument)}let b,x="";const{implementation:N,createNodeIterator:S,createDocumentFragment:P,getElementsByTagName:R}=t,{importNode:k}=i;let A=Tr();e.isSupported=typeof hr=="function"&&typeof w=="function"&&N&&N.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:M,ERB_EXPR:U,TMPLIT_EXPR:q,DATA_ATTR:oe,ARIA_ATTR:W,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:I,CUSTOM_ELEMENT:Y}=kr;let{IS_ALLOWED_URI:Se}=kr,G=null;const Ze=$({},[..._r,...tn,...nn,...rn,...br]);let K=null;const Re=$({},[...wr,...sn,...Er,...hi]);let B=Object.seal(gr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ae=null,$e=null,Be=!0,Qt=!0,Li=!1,bt=!0,Qe=!1,lt=!0,He=!1,Jt=!1,wt=!1,Fe=!1,Et=!1,xt=!1,Oe=!0,ct=!1;const Mi="user-content-";let vt=!0,Ue=!1,Ve={},We=null;const ei=$({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ti=null;const no=$({},["audio","video","img","source","image","track"]);let Un=null;const ro=$({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),zi="http://www.w3.org/1998/Math/MathML",$i="http://www.w3.org/2000/svg",Ge="http://www.w3.org/1999/xhtml";let kt=Ge,Vn=!1,Wn=null;const uh=$({},[zi,$i,Ge],en);let Bi=$({},["mi","mo","mn","ms","mtext"]),Hi=$({},["annotation-xml"]);const ph=$({},["title","style","font","a","script"]);let ii=null;const hh=["application/xhtml+xml","text/html"],fh="text/html";let Q=null,Tt=null;const gh=t.createElement("form"),so=function(f){return f instanceof RegExp||f instanceof Function},Gn=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Tt&&Tt===f)){if((!f||typeof f!="object")&&(f={}),f=Ie(f),ii=hh.indexOf(f.PARSER_MEDIA_TYPE)===-1?fh:f.PARSER_MEDIA_TYPE,Q=ii==="application/xhtml+xml"?en:pi,G=me(f,"ALLOWED_TAGS")?$({},f.ALLOWED_TAGS,Q):Ze,K=me(f,"ALLOWED_ATTR")?$({},f.ALLOWED_ATTR,Q):Re,Wn=me(f,"ALLOWED_NAMESPACES")?$({},f.ALLOWED_NAMESPACES,en):uh,Un=me(f,"ADD_URI_SAFE_ATTR")?$(Ie(ro),f.ADD_URI_SAFE_ATTR,Q):ro,ti=me(f,"ADD_DATA_URI_TAGS")?$(Ie(no),f.ADD_DATA_URI_TAGS,Q):no,We=me(f,"FORBID_CONTENTS")?$({},f.FORBID_CONTENTS,Q):ei,Ae=me(f,"FORBID_TAGS")?$({},f.FORBID_TAGS,Q):Ie({}),$e=me(f,"FORBID_ATTR")?$({},f.FORBID_ATTR,Q):Ie({}),Ve=me(f,"USE_PROFILES")?f.USE_PROFILES:!1,Be=f.ALLOW_ARIA_ATTR!==!1,Qt=f.ALLOW_DATA_ATTR!==!1,Li=f.ALLOW_UNKNOWN_PROTOCOLS||!1,bt=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Qe=f.SAFE_FOR_TEMPLATES||!1,lt=f.SAFE_FOR_XML!==!1,He=f.WHOLE_DOCUMENT||!1,Fe=f.RETURN_DOM||!1,Et=f.RETURN_DOM_FRAGMENT||!1,xt=f.RETURN_TRUSTED_TYPE||!1,wt=f.FORCE_BODY||!1,Oe=f.SANITIZE_DOM!==!1,ct=f.SANITIZE_NAMED_PROPS||!1,vt=f.KEEP_CONTENT!==!1,Ue=f.IN_PLACE||!1,Se=f.ALLOWED_URI_REGEXP||xr,kt=f.NAMESPACE||Ge,Bi=f.MATHML_TEXT_INTEGRATION_POINTS||Bi,Hi=f.HTML_INTEGRATION_POINTS||Hi,B=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&so(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(B.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&so(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(B.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(B.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Qe&&(Qt=!1),Et&&(Fe=!0),Ve&&(G=$({},br),K=[],Ve.html===!0&&($(G,_r),$(K,wr)),Ve.svg===!0&&($(G,tn),$(K,sn),$(K,hi)),Ve.svgFilters===!0&&($(G,nn),$(K,sn),$(K,hi)),Ve.mathMl===!0&&($(G,rn),$(K,Er),$(K,hi))),f.ADD_TAGS&&(G===Ze&&(G=Ie(G)),$(G,f.ADD_TAGS,Q)),f.ADD_ATTR&&(K===Re&&(K=Ie(K)),$(K,f.ADD_ATTR,Q)),f.ADD_URI_SAFE_ATTR&&$(Un,f.ADD_URI_SAFE_ATTR,Q),f.FORBID_CONTENTS&&(We===ei&&(We=Ie(We)),$(We,f.FORBID_CONTENTS,Q)),vt&&(G["#text"]=!0),He&&$(G,["html","head","body"]),G.table&&($(G,["tbody"]),delete Ae.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw It('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw It('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');b=f.TRUSTED_TYPES_POLICY,x=b.createHTML("")}else b===void 0&&(b=La(y,r)),b!==null&&typeof x=="string"&&(x=b.createHTML(""));ne&&ne(f),Tt=f}},oo=$({},[...tn,...nn,...ka]),ao=$({},[...rn,...Ta]),mh=function(f){let T=w(f);(!T||!T.tagName)&&(T={namespaceURI:kt,tagName:"template"});const O=pi(f.tagName),j=pi(T.tagName);return Wn[f.namespaceURI]?f.namespaceURI===$i?T.namespaceURI===Ge?O==="svg":T.namespaceURI===zi?O==="svg"&&(j==="annotation-xml"||Bi[j]):!!oo[O]:f.namespaceURI===zi?T.namespaceURI===Ge?O==="math":T.namespaceURI===$i?O==="math"&&Hi[j]:!!ao[O]:f.namespaceURI===Ge?T.namespaceURI===$i&&!Hi[j]||T.namespaceURI===zi&&!Bi[j]?!1:!ao[O]&&(ph[O]||!oo[O]):!!(ii==="application/xhtml+xml"&&Wn[f.namespaceURI]):!1},Ne=function(f){Dt(e.removed,{element:f});try{w(f).removeChild(f)}catch{v(f)}},Ct=function(f,T){try{Dt(e.removed,{attribute:T.getAttributeNode(f),from:T})}catch{Dt(e.removed,{attribute:null,from:T})}if(T.removeAttribute(f),f==="is")if(Fe||Et)try{Ne(T)}catch{}else try{T.setAttribute(f,"")}catch{}},lo=function(f){let T=null,O=null;if(wt)f="<remove></remove>"+f;else{const Z=yr(f,/^[\r\n\t ]+/);O=Z&&Z[0]}ii==="application/xhtml+xml"&&kt===Ge&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const j=b?b.createHTML(f):f;if(kt===Ge)try{T=new h().parseFromString(j,ii)}catch{}if(!T||!T.documentElement){T=N.createDocument(kt,"template",null);try{T.documentElement.innerHTML=Vn?x:j}catch{}}const ee=T.body||T.documentElement;return f&&O&&ee.insertBefore(t.createTextNode(O),ee.childNodes[0]||null),kt===Ge?R.call(T,He?"html":"body")[0]:He?T.documentElement:ee},co=function(f){return S.call(f.ownerDocument||f,f,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},jn=function(f){return f instanceof p&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof u)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},uo=function(f){return typeof l=="function"&&f instanceof l};function je(D,f,T){ui(D,O=>{O.call(e,f,T,Tt)})}const po=function(f){let T=null;if(je(A.beforeSanitizeElements,f,null),jn(f))return Ne(f),!0;const O=Q(f.nodeName);if(je(A.uponSanitizeElement,f,{tagName:O,allowedTags:G}),lt&&f.hasChildNodes()&&!uo(f.firstElementChild)&&re(/<[/\w!]/g,f.innerHTML)&&re(/<[/\w!]/g,f.textContent)||f.nodeType===Mt.progressingInstruction||lt&&f.nodeType===Mt.comment&&re(/<[/\w]/g,f.data))return Ne(f),!0;if(!G[O]||Ae[O]){if(!Ae[O]&&fo(O)&&(B.tagNameCheck instanceof RegExp&&re(B.tagNameCheck,O)||B.tagNameCheck instanceof Function&&B.tagNameCheck(O)))return!1;if(vt&&!We[O]){const j=w(f)||f.parentNode,ee=C(f)||f.childNodes;if(ee&&j){const Z=ee.length;for(let ce=Z-1;ce>=0;--ce){const qe=g(ee[ce],!0);qe.__removalCount=(f.__removalCount||0)+1,j.insertBefore(qe,E(f))}}}return Ne(f),!0}return f instanceof d&&!mh(f)||(O==="noscript"||O==="noembed"||O==="noframes")&&re(/<\/no(script|embed|frames)/i,f.innerHTML)?(Ne(f),!0):(Qe&&f.nodeType===Mt.text&&(T=f.textContent,ui([M,U,q],j=>{T=Pt(T,j," ")}),f.textContent!==T&&(Dt(e.removed,{element:f.cloneNode()}),f.textContent=T)),je(A.afterSanitizeElements,f,null),!1)},ho=function(f,T,O){if(Oe&&(T==="id"||T==="name")&&(O in t||O in gh))return!1;if(!(Qt&&!$e[T]&&re(oe,T))){if(!(Be&&re(W,T))){if(!K[T]||$e[T]){if(!(fo(f)&&(B.tagNameCheck instanceof RegExp&&re(B.tagNameCheck,f)||B.tagNameCheck instanceof Function&&B.tagNameCheck(f))&&(B.attributeNameCheck instanceof RegExp&&re(B.attributeNameCheck,T)||B.attributeNameCheck instanceof Function&&B.attributeNameCheck(T))||T==="is"&&B.allowCustomizedBuiltInElements&&(B.tagNameCheck instanceof RegExp&&re(B.tagNameCheck,O)||B.tagNameCheck instanceof Function&&B.tagNameCheck(O))))return!1}else if(!Un[T]){if(!re(Se,Pt(O,I,""))){if(!((T==="src"||T==="xlink:href"||T==="href")&&f!=="script"&&wa(O,"data:")===0&&ti[f])){if(!(Li&&!re(X,Pt(O,I,"")))){if(O)return!1}}}}}}return!0},fo=function(f){return f!=="annotation-xml"&&yr(f,Y)},go=function(f){je(A.beforeSanitizeAttributes,f,null);const{attributes:T}=f;if(!T||jn(f))return;const O={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:K,forceKeepAttr:void 0};let j=T.length;for(;j--;){const ee=T[j],{name:Z,namespaceURI:ce,value:qe}=ee,ni=Q(Z),qn=qe;let te=Z==="value"?qn:Ea(qn);if(O.attrName=ni,O.attrValue=te,O.keepAttr=!0,O.forceKeepAttr=void 0,je(A.uponSanitizeAttribute,f,O),te=O.attrValue,ct&&(ni==="id"||ni==="name")&&(Ct(Z,f),te=Mi+te),lt&&re(/((--!?|])>)|<\/(style|title)/i,te)){Ct(Z,f);continue}if(O.forceKeepAttr)continue;if(!O.keepAttr){Ct(Z,f);continue}if(!bt&&re(/\/>/i,te)){Ct(Z,f);continue}Qe&&ui([M,U,q],yo=>{te=Pt(te,yo," ")});const mo=Q(f.nodeName);if(!ho(mo,ni,te)){Ct(Z,f);continue}if(b&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!ce)switch(y.getAttributeType(mo,ni)){case"TrustedHTML":{te=b.createHTML(te);break}case"TrustedScriptURL":{te=b.createScriptURL(te);break}}if(te!==qn)try{ce?f.setAttributeNS(ce,Z,te):f.setAttribute(Z,te),jn(f)?Ne(f):mr(e.removed)}catch{Ct(Z,f)}}je(A.afterSanitizeAttributes,f,null)},yh=function D(f){let T=null;const O=co(f);for(je(A.beforeSanitizeShadowDOM,f,null);T=O.nextNode();)je(A.uponSanitizeShadowNode,T,null),po(T),go(T),T.content instanceof s&&D(T.content);je(A.afterSanitizeShadowDOM,f,null)};return e.sanitize=function(D){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T=null,O=null,j=null,ee=null;if(Vn=!D,Vn&&(D="<!-->"),typeof D!="string"&&!uo(D))if(typeof D.toString=="function"){if(D=D.toString(),typeof D!="string")throw It("dirty is not a string, aborting")}else throw It("toString is not a function");if(!e.isSupported)return D;if(Jt||Gn(f),e.removed=[],typeof D=="string"&&(Ue=!1),Ue){if(D.nodeName){const qe=Q(D.nodeName);if(!G[qe]||Ae[qe])throw It("root node is forbidden and cannot be sanitized in-place")}}else if(D instanceof l)T=lo("<!---->"),O=T.ownerDocument.importNode(D,!0),O.nodeType===Mt.element&&O.nodeName==="BODY"||O.nodeName==="HTML"?T=O:T.appendChild(O);else{if(!Fe&&!Qe&&!He&&D.indexOf("<")===-1)return b&&xt?b.createHTML(D):D;if(T=lo(D),!T)return Fe?null:xt?x:""}T&&wt&&Ne(T.firstChild);const Z=co(Ue?D:T);for(;j=Z.nextNode();)po(j),go(j),j.content instanceof s&&yh(j.content);if(Ue)return D;if(Fe){if(Et)for(ee=P.call(T.ownerDocument);T.firstChild;)ee.appendChild(T.firstChild);else ee=T;return(K.shadowroot||K.shadowrootmode)&&(ee=k.call(i,ee,!0)),ee}let ce=He?T.outerHTML:T.innerHTML;return He&&G["!doctype"]&&T.ownerDocument&&T.ownerDocument.doctype&&T.ownerDocument.doctype.name&&re(vr,T.ownerDocument.doctype.name)&&(ce="<!DOCTYPE "+T.ownerDocument.doctype.name+`>
61
+ `+ce),Qe&&ui([M,U,q],qe=>{ce=Pt(ce,qe," ")}),b&&xt?b.createHTML(ce):ce},e.setConfig=function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Gn(D),Jt=!0},e.clearConfig=function(){Tt=null,Jt=!1},e.isValidAttribute=function(D,f,T){Tt||Gn({});const O=Q(D),j=Q(f);return ho(O,j,T)},e.addHook=function(D,f){typeof f=="function"&&Dt(A[D],f)},e.removeHook=function(D,f){if(f!==void 0){const T=_a(A[D],f);return T===-1?void 0:ba(A[D],T,1)[0]}return mr(A[D])},e.removeHooks=function(D){A[D]=[]},e.removeAllHooks=function(){A=Tr()},e}var Ma=Cr();const za=["innerHTML"],$a="Markdown",Ba=Je(o.defineComponent({inheritAttrs:!1,__name:"Markdown",props:{markdownText:{},mode:{},sanitize:{type:Boolean},inputFormat:{}},emits:["update:markdownText","changeMode"],setup(n,{emit:e}){const t=n,i=e,r=o.shallowRef([{comp:Xn,event:c,tooltip:"Edit Markdown"}]);F.setOptions({gfm:!0,breaks:!0});const s=o.ref(t.markdownText??"");o.watch(()=>t.markdownText,u=>{u!==void 0&&u!==s.value&&(s.value=u)});const a=o.ref(t.mode?t.mode==="edit":!1);o.watch(()=>t.mode,u=>{u&&(a.value=u==="edit")});const l=o.computed(()=>{const u=t.inputFormat==="html"?s.value??"":F.parse(s.value??"");return t.sanitize===!1?u:Ma.sanitize(u)});function d(){i("update:markdownText",s.value)}function c(){a.value=!a.value,i("changeMode",a.value?"edit":"preview")}return(u,p)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.renderSlot(u.$slots,"default",{widgetName:$a,childIcons:r.value},void 0,!0),o.createElementVNode("div",o.mergeProps({class:"markdown-widget-wrap"},u.$attrs),[a.value?o.withDirectives((o.openBlock(),o.createElementBlock("textarea",{key:0,"onUpdate:modelValue":p[0]||(p[0]=h=>s.value=h),onInput:d,class:"markdown-input",placeholder:"Write markdown here…"},null,544)),[[o.vModelText,s.value]]):(o.openBlock(),o.createElementBlock("div",{key:1,class:"markdown-output",innerHTML:l.value},null,8,za))],16)],64))}}),[["__scopeId","data-v-b2d32c29"]]);function Ha(n,e,t,i,r){let s=(...a)=>(console.warn("gridstack.js: Function `"+t+"` is deprecated in "+r+" and has been replaced with `"+i+"`. It will be **removed** in a future release"),e.apply(n,a));return s.prototype=e.prototype,s}class _{static getElements(e,t=document){if(typeof e=="string"){const i="getElementById"in t?t:void 0;if(i&&!isNaN(+e[0])){const s=i.getElementById(e);return s?[s]:[]}let r=t.querySelectorAll(e);return!r.length&&e[0]!=="."&&e[0]!=="#"&&(r=t.querySelectorAll("."+e),r.length||(r=t.querySelectorAll("#"+e))),Array.from(r)}return[e]}static getElement(e,t=document){if(typeof e=="string"){const i="getElementById"in t?t:void 0;if(!e.length)return null;if(i&&e[0]==="#")return i.getElementById(e.substring(1));if(e[0]==="#"||e[0]==="."||e[0]==="[")return t.querySelector(e);if(i&&!isNaN(+e[0]))return i.getElementById(e);let r=t.querySelector(e);return i&&!r&&(r=i.getElementById(e)),r||(r=t.querySelector("."+e)),r}return e}static shouldSizeToContent(e){return e?.grid&&(!!e.sizeToContent||e.grid.opts.sizeToContent&&e.sizeToContent!==!1)}static isIntercepted(e,t){return!(e.y>=t.y+t.h||e.y+e.h<=t.y||e.x+e.w<=t.x||e.x>=t.x+t.w)}static isTouching(e,t){return _.isIntercepted(e,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(e,t){let i=e.x>t.x?e.x:t.x,r=e.x+e.w<t.x+t.w?e.x+e.w:t.x+t.w;if(r<=i)return 0;let s=e.y>t.y?e.y:t.y,a=e.y+e.h<t.y+t.h?e.y+e.h:t.y+t.h;return a<=s?0:(r-i)*(a-s)}static area(e){return e.w*e.h}static sort(e,t=1,i){return i=i||e.reduce((r,s)=>Math.max(s.x+s.w,r),0)||12,t===-1?e.sort((r,s)=>(s.x??1e3)+(s.y??1e3)*i-((r.x??1e3)+(r.y??1e3)*i)):e.sort((r,s)=>(r.x??1e3)+(r.y??1e3)*i-((s.x??1e3)+(s.y??1e3)*i))}static find(e,t){return t?e.find(i=>i.id===t):void 0}static createStylesheet(e,t,i){let r=document.createElement("style");const s=i?.nonce;return s&&(r.nonce=s),r.setAttribute("type","text/css"),r.setAttribute("gs-style-id",e),r.styleSheet?r.styleSheet.cssText="":r.appendChild(document.createTextNode("")),t?t.insertBefore(r,t.firstChild):(t=document.getElementsByTagName("head")[0],t.appendChild(r)),r.sheet}static removeStylesheet(e){let t=document.querySelector("STYLE[gs-style-id="+e+"]");t&&t.parentNode&&t.remove()}static addCSSRule(e,t,i){typeof e.addRule=="function"?e.addRule(t,i):typeof e.insertRule=="function"&&e.insertRule(`${t}{${i}}`)}static toBool(e){return typeof e=="boolean"?e:typeof e=="string"?(e=e.toLowerCase(),!(e===""||e==="no"||e==="false"||e==="0")):!!e}static toNumber(e){return e===null||e.length===0?void 0:Number(e)}static parseHeight(e){let t,i="px";if(typeof e=="string")if(e==="auto"||e==="")t=0;else{let r=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!r)throw new Error(`Invalid height val = ${e}`);i=r[2]||"px",t=parseFloat(r[1])}else t=e;return{h:t,unit:i}}static defaults(e,...t){return t.forEach(i=>{for(const r in i){if(!i.hasOwnProperty(r))return;e[r]===null||e[r]===void 0?e[r]=i[r]:typeof i[r]=="object"&&typeof e[r]=="object"&&this.defaults(e[r],i[r])}}),e}static same(e,t){if(typeof e!="object")return e==t;if(typeof e!=typeof t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(e[i]!==t[i])return!1;return!0}static copyPos(e,t,i=!1){return t.x!==void 0&&(e.x=t.x),t.y!==void 0&&(e.y=t.y),t.w!==void 0&&(e.w=t.w),t.h!==void 0&&(e.h=t.h),i&&(t.minW&&(e.minW=t.minW),t.minH&&(e.minH=t.minH),t.maxW&&(e.maxW=t.maxW),t.maxH&&(e.maxH=t.maxH)),e}static samePos(e,t){return e&&t&&e.x===t.x&&e.y===t.y&&(e.w||1)===(t.w||1)&&(e.h||1)===(t.h||1)}static sanitizeMinMax(e){e.minW||delete e.minW,e.minH||delete e.minH,e.maxW||delete e.maxW,e.maxH||delete e.maxH}static removeInternalAndSame(e,t){if(!(typeof e!="object"||typeof t!="object"))for(let i in e){let r=e[i];if(i[0]==="_"||r===t[i])delete e[i];else if(r&&typeof r=="object"&&t[i]!==void 0){for(let s in r)(r[s]===t[i][s]||s[0]==="_")&&delete r[s];Object.keys(r).length||delete e[i]}}}static removeInternalForSave(e,t=!0){for(let i in e)(i[0]==="_"||e[i]===null||e[i]===void 0)&&delete e[i];delete e.grid,t&&delete e.el,e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,e.locked||delete e.locked,(e.w===1||e.w===e.minW)&&delete e.w,(e.h===1||e.h===e.minH)&&delete e.h}static throttle(e,t){let i=!1;return(...r)=>{i||(i=!0,setTimeout(()=>{e(...r),i=!1},t))}}static removePositioningStyles(e){let t=e.style;t.position&&t.removeProperty("position"),t.left&&t.removeProperty("left"),t.top&&t.removeProperty("top"),t.width&&t.removeProperty("width"),t.height&&t.removeProperty("height")}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;const t=getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowY)?e:this.getScrollElement(e.parentElement)}static updateScrollPosition(e,t,i){let r=e.getBoundingClientRect(),s=window.innerHeight||document.documentElement.clientHeight;if(r.top<0||r.bottom>s){let a=r.bottom-s,l=r.top,d=this.getScrollElement(e);if(d!==null){let c=d.scrollTop;r.top<0&&i<0?e.offsetHeight>s?d.scrollTop+=i:d.scrollTop+=Math.abs(l)>Math.abs(i)?i:l:i>0&&(e.offsetHeight>s?d.scrollTop+=i:d.scrollTop+=a>i?i:a),t.top+=d.scrollTop-c}}}static updateScrollResize(e,t,i){const r=this.getScrollElement(t),s=r.clientHeight,a=r===this.getScrollElement()?0:r.getBoundingClientRect().top,l=e.clientY-a,d=l<i,c=l>s-i;d?r.scrollBy({behavior:"smooth",top:l-i}):c&&r.scrollBy({behavior:"smooth",top:i-(s-l)})}static clone(e){return e==null||typeof e!="object"?e:e instanceof Array?[...e]:{...e}}static cloneDeep(e){const t=["parentGrid","el","grid","subGrid","engine"],i=_.clone(e);for(const r in i)i.hasOwnProperty(r)&&typeof i[r]=="object"&&r.substring(0,2)!=="__"&&!t.find(s=>s===r)&&(i[r]=_.cloneDeep(e[r]));return i}static cloneNode(e){const t=e.cloneNode(!0);return t.removeAttribute("id"),t}static appendTo(e,t){let i;typeof t=="string"?i=_.getElement(t):i=t,i&&i.appendChild(e)}static addElStyles(e,t){if(t instanceof Object)for(const i in t)t.hasOwnProperty(i)&&(Array.isArray(t[i])?t[i].forEach(r=>{e.style[i]=r}):e.style[i]=t[i])}static initEvent(e,t){const i={type:t.type},r={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:t.target?t.target:e.target};return e.dataTransfer&&(i.dataTransfer=e.dataTransfer),["altKey","ctrlKey","metaKey","shiftKey"].forEach(s=>i[s]=e[s]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(s=>i[s]=e[s]),{...i,...r}}static simulateMouseEvent(e,t,i){const r=document.createEvent("MouseEvents");r.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,0,e.target),(i||e.target).dispatchEvent(r)}}class xe{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.column=e.column||12,this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,t=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,t&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,t){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||t.y<=e.y)}_fixCollisions(e,t=e,i,r={}){if(this.sortNodes(-1),i=i||this.collide(e,t),!i)return!1;if(e._moving&&!r.nested&&!this.float&&this.swap(e,i))return!0;let s=t;this._useEntireRowArea(e,t)&&(s={x:0,w:this.column,y:t.y,h:t.h},i=this.collide(e,s,r.skip));let a=!1,l={nested:!0,pack:!1};for(;i=i||this.collide(e,s,r.skip);){let d;if(i.locked||e._moving&&!e._skipDown&&t.y>e.y&&!this.float&&(!this.collide(i,{...i,y:e.y},e)||!this.collide(i,{...i,y:t.y-i.h},e))?(e._skipDown=e._skipDown||t.y>e.y,d=this.moveNode(e,{...t,y:i.y+i.h,...l}),i.locked&&d?_.copyPos(t,e):!i.locked&&d&&r.pack&&(this._packNodes(),t.y=i.y+i.h,_.copyPos(e,t)),a=a||d):d=this.moveNode(i,{...i,y:t.y+t.h,skip:e,...l}),!d)return a;i=void 0}return a}collide(e,t=e,i){const r=e._id,s=i?._id;return this.nodes.find(a=>a._id!==r&&a._id!==s&&_.isIntercepted(a,t))}collideAll(e,t=e,i){const r=e._id,s=i?._id;return this.nodes.filter(a=>a._id!==r&&a._id!==s&&_.isIntercepted(a,t))}directionCollideCoverage(e,t,i){if(!t.rect||!e._rect)return;let r=e._rect,s={...t.rect};s.y>r.y?(s.h+=s.y-r.y,s.y=r.y):s.h+=r.y-s.y,s.x>r.x?(s.w+=s.x-r.x,s.x=r.x):s.w+=r.x-s.x;let a,l=.5;return i.forEach(d=>{if(d.locked||!d._rect)return;let c=d._rect,u=Number.MAX_VALUE,p=Number.MAX_VALUE;r.y<c.y?u=(s.y+s.h-c.y)/c.h:r.y+r.h>c.y+c.h&&(u=(c.y+c.h-s.y)/c.h),r.x<c.x?p=(s.x+s.w-c.x)/c.w:r.x+r.w>c.x+c.w&&(p=(c.x+c.w-s.x)/c.w);let h=Math.min(p,u);h>l&&(l=h,a=d)}),t.collide=a,a}cacheRects(e,t,i,r,s,a){return this.nodes.forEach(l=>l._rect={y:l.y*t+i,x:l.x*e+a,w:l.w*e-a-r,h:l.h*t-i-s}),this}swap(e,t){if(!t||t.locked||!e||e.locked)return!1;function i(){let s=t.x,a=t.y;return t.x=e.x,t.y=e.y,e.h!=t.h?(e.x=s,e.y=t.y+t.h):e.w!=t.w?(e.x=t.x+t.w,e.y=a):(e.x=s,e.y=a),e._dirty=t._dirty=!0,!0}let r;if(e.w===t.w&&e.h===t.h&&(e.x===t.x||e.y===t.y)&&(r=_.isTouching(e,t)))return i();if(r!==!1){if(e.w===t.w&&e.x===t.x&&(r||(r=_.isTouching(e,t)))){if(t.y<e.y){let s=e;e=t,t=s}return i()}if(r!==!1){if(e.h===t.h&&e.y===t.y&&(r||(r=_.isTouching(e,t)))){if(t.x<e.x){let s=e;e=t,t=s}return i()}return!1}}}isAreaEmpty(e,t,i,r){let s={x:e||0,y:t||0,w:i||1,h:r||1};return!this.collide(s)}compact(e="compact",t=!0){if(this.nodes.length===0)return this;t&&this.sortNodes();const i=this.batchMode;i||this.batchUpdate();const r=this._inColumnResize;r||(this._inColumnResize=!0);let s=this.nodes;return this.nodes=[],s.forEach((a,l,d)=>{let c;a.locked||(a.autoPosition=!0,e==="list"&&l&&(c=d[l-1])),this.addNode(a,!1,c)}),r||delete this._inColumnResize,i||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1,t=this.column){return this.nodes=_.sort(this.nodes,e,t),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let t=e.y;for(;t>e._orig.y;)--t,this.collide(e,{x:e.x,y:t,w:e.w,h:e.h})||(e._dirty=!0,e.y=t)}):this.nodes.forEach((e,t)=>{if(!e.locked)for(;e.y>0;){let i=t===0?0:e.y-1;if(!(t===0||!this.collide(e,{x:e.x,y:i,w:e.w,h:e.h})))break;e._dirty=e.y!==i,e.y=i}}),this)}prepareNode(e,t){e._id=e._id??xe._idSeq++,(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);let i={x:0,y:0,w:1,h:1};return _.defaults(e,i),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,_.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=i.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=i.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=i.w),isNaN(e.h)&&(e.h=i.h),this.nodeBoundFix(e,t),e}nodeBoundFix(e,t){let i=e._orig||_.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w,e.maxW)),e.maxH&&(e.h=Math.min(e.h,e.maxH)),e.minW&&e.minW<=this.column&&(e.w=Math.max(e.w,e.minW)),e.minH&&(e.h=Math.max(e.h,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.column<12&&!this._inColumnResize&&e._id&&this.findCacheLayout(e,12)===-1){let s={...e};s.autoPosition||s.x===void 0?(delete s.x,delete s.y):s.x=Math.min(11,s.x),s.w=Math.min(12,s.w||1),this.cacheOneLayout(s,12)}return e.w>this.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(t?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(t?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),_.samePos(e,i)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(t=>t._dirty&&!_.samePos(t,t._orig)):this.nodes.filter(t=>t._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;let t=(e||[]).concat(this.getDirtyNodes());return this.onChange(t),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=_.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{_.samePos(e,e._orig)||(_.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,t=this.nodes,i=this.column,r){let s=r?r.y*i+(r.x+r.w):0,a=!1;for(let l=s;!a;++l){let d=l%i,c=Math.floor(l/i);if(d+e.w>i)continue;let u={x:d,y:c,w:e.w,h:e.h};t.find(p=>_.isIntercepted(u,p))||((e.x!==d||e.y!==c)&&(e._dirty=!0),e.x=d,e.y=c,delete e.autoPosition,a=!0)}return a}addNode(e,t=!1,i){let r=this.nodes.find(a=>a._id===e._id);if(r)return r;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let s;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,i)&&(delete e.autoPosition,s=!0),this.nodes.push(e),t&&this.addedNodes.push(e),s||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,t=!0,i=!1){return this.nodes.find(r=>r._id===e._id)?(i&&this.removedNodes.push(e),t&&(e._removeDOM=!0),this.nodes=this.nodes.filter(r=>r._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0){return delete this._layouts,this.nodes.length?(e&&this.nodes.forEach(t=>t._removeDOM=!0),this.removedNodes=this.nodes,this.nodes=[],this._notify(this.removedNodes)):this}moveNodeCheck(e,t){if(!this.changedPosConstrain(e,t))return!1;if(t.pack=!0,!this.maxRow)return this.moveNode(e,t);let i,r=new xe({column:this.column,float:this.float,nodes:this.nodes.map(a=>a._id===e._id?(i={...a},i):{...a})});if(!i)return!1;let s=r.moveNode(i,t)&&r.getRow()<=Math.max(this.getRow(),this.maxRow);if(!s&&!t.resizing&&t.collide){let a=t.collide.el.gridstackNode;if(this.swap(e,a))return this._notify(),!0}return s?(r.nodes.filter(a=>a._dirty).forEach(a=>{let l=this.nodes.find(d=>d._id===a._id);l&&(_.copyPos(l,a),l._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;let t=new xe({column:this.column,float:this.float,nodes:this.nodes.map(r=>({...r}))}),i={...e};return this.cleanupNode(i),delete i.el,delete i._id,delete i.content,delete i.grid,t.addNode(i),t.getRow()<=this.maxRow?(e._willFitPos=_.copyPos({},i),!0):!1}changedPosConstrain(e,t){return t.w=t.w||e.w,t.h=t.h||e.h,e.x!==t.x||e.y!==t.y?!0:(e.maxW&&(t.w=Math.min(t.w,e.maxW)),e.maxH&&(t.h=Math.min(t.h,e.maxH)),e.minW&&(t.w=Math.max(t.w,e.minW)),e.minH&&(t.h=Math.max(t.h,e.minH)),e.w!==t.w||e.h!==t.h)}moveNode(e,t){if(!e||!t)return!1;let i;t.pack===void 0&&!this.batchMode&&(i=t.pack=!0),typeof t.x!="number"&&(t.x=e.x),typeof t.y!="number"&&(t.y=e.y),typeof t.w!="number"&&(t.w=e.w),typeof t.h!="number"&&(t.h=e.h);let r=e.w!==t.w||e.h!==t.h,s=_.copyPos({},e,!0);if(_.copyPos(s,t),this.nodeBoundFix(s,r),_.copyPos(t,s),!t.forceCollide&&_.samePos(e,t))return!1;let a=_.copyPos({},e),l=this.collideAll(e,s,t.skip),d=!0;if(l.length){let c=e._moving&&!t.nested,u=c?this.directionCollideCoverage(e,t,l):l[0];if(c&&u&&e.grid?.opts?.subGridDynamic&&!e.grid._isTemp){let p=_.areaIntercept(t.rect,u._rect),h=_.area(t.rect),y=_.area(u._rect);p/(h<y?h:y)>.8&&(u.grid.makeSubGrid(u.el,void 0,e),u=void 0)}u?d=!this._fixCollisions(e,s,u,t):(d=!1,i&&delete t.pack)}return d&&(e._dirty=!0,_.copyPos(e,s)),t.pack&&this._packNodes()._notify(),!_.samePos(e,a)}getRow(){return this.nodes.reduce((e,t)=>Math.max(e,t.y+t.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let e=this.nodes.find(t=>t._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,t){let i=this._layouts?.length,r=i&&this.column!==i-1?this._layouts[i-1]:null,s=[];return this.sortNodes(),this.nodes.forEach(a=>{let l=r?.find(c=>c._id===a._id),d={...a,...l||{}};_.removeInternalForSave(d,!e),t&&t(a,d),s.push(d)}),s}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((t,i)=>{if(!t||i===this.column)return this;if(i<this.column)this._layouts[i]=void 0;else{let r=i/this.column;e.forEach(s=>{if(!s._orig)return;let a=t.find(l=>l._id===s._id);a&&(a.y>=0&&s.y!==s._orig.y&&(a.y+=s.y-s._orig.y),s.x!==s._orig.x&&(a.x=Math.round(s.x*r)),s.w!==s._orig.w&&(a.w=Math.round(s.w*r)))})}}),this)}columnChanged(e,t,i,r="moveScale"){if(!this.nodes.length||!t||e===t)return this;const s=r==="compact"||r==="list";s&&this.sortNodes(1,e),t<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let a=[],l=!1;if(t===1&&i?.length){l=!0;let d=0;i.forEach(c=>{c.x=0,c.w=1,c.y=Math.max(c.y,d),d=c.y+c.h}),a=i,i=[]}else i=s?this.nodes:_.sort(this.nodes,-1,e);if(t>e&&this._layouts){const d=this._layouts[t]||[];let c=this._layouts.length-1;!d.length&&e!==c&&this._layouts[c]?.length&&(e=c,this._layouts[c].forEach(u=>{let p=i.find(h=>h._id===u._id);p&&(!s&&!u.autoPosition&&(p.x=u.x??p.x,p.y=u.y??p.y),p.w=u.w??p.w,(u.x==null||u.y===void 0)&&(p.autoPosition=!0))})),d.forEach(u=>{let p=i.findIndex(h=>h._id===u._id);if(p!==-1){const h=i[p];if(s){h.w=u.w;return}(u.autoPosition||isNaN(u.x)||isNaN(u.y))&&this.findEmptyPosition(u,a),u.autoPosition||(h.x=u.x??h.x,h.y=u.y??h.y,h.w=u.w??h.w,a.push(h)),i.splice(p,1)}})}if(s)this.compact(r,!1);else{if(i.length){if(typeof r=="function")r(t,e,a,i);else if(!l){let d=s||r==="none"?1:t/e,c=r==="move"||r==="moveScale",u=r==="scale"||r==="moveScale";i.forEach(p=>{p.x=t===1?0:c?Math.round(p.x*d):Math.min(p.x,t-1),p.w=t===1||e===1?1:u?Math.round(p.w*d)||1:Math.min(p.w,t),a.push(p)}),i=[]}}l||(a=_.sort(a,-1,t)),this._inColumnResize=!0,this.nodes=[],a.forEach(d=>{this.addNode(d,!1),delete d._orig})}return this.nodes.forEach(d=>delete d._orig),this.batchUpdate(!1,!s),delete this._inColumnResize,this}cacheLayout(e,t,i=!1){let r=[];return e.forEach((s,a)=>{if(s._id===void 0){const l=s.id?this.nodes.find(d=>d.id===s.id):void 0;s._id=l?._id??xe._idSeq++}r[a]={x:s.x,y:s.y,w:s.w,_id:s._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[t]=r,this}cacheOneLayout(e,t){e._id=e._id??xe._idSeq++;let i={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete i.x,delete i.y,e.autoPosition&&(i.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[t]=this._layouts[t]||[];let r=this.findCacheLayout(e,t);return r===-1?this._layouts[t].push(i):this._layouts[t][r]=i,this}findCacheLayout(e,t){return this._layouts?.[t]?.findIndex(i=>i._id===e._id)??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let t=0;t<this._layouts.length;t++){let i=this.findCacheLayout(e,t);i!==-1&&this._layouts[t].splice(i,1)}}cleanupNode(e){for(let t in e)t[0]==="_"&&t!=="_id"&&delete e[t];return this}}xe._idSeq=0;const de={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,oneColumnSize:768,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"},Fa={handle:".grid-stack-item-content",appendTo:"body"};class L{}const ye=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class ve{}function fi(n,e){if(n.touches.length>1)return;n.cancelable&&n.preventDefault();const t=n.changedTouches[0],i=document.createEvent("MouseEvents");i.initMouseEvent(e,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(i)}function Sr(n,e){n.cancelable&&n.preventDefault();const t=document.createEvent("MouseEvents");t.initMouseEvent(e,!0,!0,window,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(t)}function gi(n){ve.touchHandled||(ve.touchHandled=!0,fi(n,"mousedown"))}function mi(n){ve.touchHandled&&fi(n,"mousemove")}function yi(n){if(!ve.touchHandled)return;ve.pointerLeaveTimeout&&(window.clearTimeout(ve.pointerLeaveTimeout),delete ve.pointerLeaveTimeout);const e=!!L.dragElement;fi(n,"mouseup"),e||fi(n,"click"),ve.touchHandled=!1}function _i(n){n.pointerType!=="mouse"&&n.target.releasePointerCapture(n.pointerId)}function Rr(n){L.dragElement&&n.pointerType!=="mouse"&&Sr(n,"mouseenter")}function Ar(n){L.dragElement&&n.pointerType!=="mouse"&&(ve.pointerLeaveTimeout=window.setTimeout(()=>{delete ve.pointerLeaveTimeout,Sr(n,"mouseleave")},10))}class bi{constructor(e,t,i){this.moving=!1,this.host=e,this.dir=t,this.option=i,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._init()}_init(){const e=document.createElement("div");return e.classList.add("ui-resizable-handle"),e.classList.add(`${bi.prefix}${this.dir}`),e.style.zIndex="100",e.style.userSelect="none",this.el=e,this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),ye&&(this.el.addEventListener("touchstart",gi),this.el.addEventListener("pointerdown",_i)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),ye&&(this.el.removeEventListener("touchstart",gi),this.el.removeEventListener("pointerdown",_i)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,!0),document.addEventListener("mouseup",this._mouseUp,!0),ye&&(this.el.addEventListener("touchmove",mi),this.el.addEventListener("touchend",yi)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){let t=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e)),e.stopPropagation(),e.preventDefault()}_mouseUp(e){this.moving&&this._triggerEvent("stop",e),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),ye&&(this.el.removeEventListener("touchmove",mi),this.el.removeEventListener("touchend",yi)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_triggerEvent(e,t){return this.option[e]&&this.option[e](t),this}}bi.prefix="ui-resizable-";class on{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(e,t){this._eventRegister[e]=t}off(e){delete this._eventRegister[e]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(e,t){if(!this.disabled&&this._eventRegister&&this._eventRegister[e])return this._eventRegister[e](t)}}class zt extends on{constructor(e,t={}){super(),this.rectScale={x:1,y:1},this._ui=()=>{const r=this.el.parentElement.getBoundingClientRect(),s={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},a=this.temporalRect||s;return{position:{left:(a.left-r.left)*this.rectScale.x,top:(a.top-r.top)*this.rectScale.y},size:{width:a.width*this.rectScale.x,height:a.height*this.rectScale.y}}},this.el=e,this.option=t,this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(e){let t=e.handles&&e.handles!==this.option.handles,i=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(r=>this.option[r]=e[r]),t&&(this._removeHandlers(),this._setupHandlers()),i&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),L.overResizeElement===this&&delete L.overResizeElement),this}_mouseOver(e){L.overResizeElement||L.dragElement||(L.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){L.overResizeElement===this&&(delete L.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){let e=this.option.handles||"e,s,se";return e==="all"&&(e="n,e,s,w,se,sw,ne,nw"),this.handlers=e.split(",").map(t=>t.trim()).map(t=>new bi(this.el,t,{start:i=>{this._resizeStart(i)},stop:i=>{this._resizeStop(i)},move:i=>{this._resizing(i,t)}})),this}_resizeStart(e){this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=_.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const t=_.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(t,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",t),this}_resizing(e,t){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,t),this._applyChange();const i=_.initEvent(e,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this}_resizeStop(e){const t=_.initEvent(e,{type:"resizestop",target:this.el});return this.option.stop&&this.option.stop(t),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",t),this._cleanHelper(),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=zt._originStyleProp.map(r=>this.el.style[r]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,t=document.createElement("div");_.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),e.appendChild(t);const i=t.getBoundingClientRect();return e.removeChild(t),this.rectScale={x:1/i.width,y:1/i.height},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return zt._originStyleProp.forEach((e,t)=>{this.el.style[e]=this.elOriginStyleVal[t]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,t){const i=this.startEvent,r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},s=e.clientX-i.clientX,a=e.clientY-i.clientY;t.indexOf("e")>-1?r.width+=s:t.indexOf("w")>-1&&(r.width-=s,r.left+=s),t.indexOf("s")>-1?r.height+=a:t.indexOf("n")>-1&&(r.height-=a,r.top+=a);const l=this._constrainSize(r.width,r.height);return Math.round(r.width)!==Math.round(l.width)&&(t.indexOf("w")>-1&&(r.left+=r.width-l.width),r.width=l.width),Math.round(r.height)!==Math.round(l.height)&&(t.indexOf("n")>-1&&(r.top+=r.height-l.height),r.height=l.height),r}_constrainSize(e,t){const i=this.option.maxWidth||Number.MAX_SAFE_INTEGER,r=this.option.minWidth/this.rectScale.x||e,s=this.option.maxHeight||Number.MAX_SAFE_INTEGER,a=this.option.minHeight/this.rectScale.y||t,l=Math.min(i,Math.max(r,e)),d=Math.min(s,Math.max(a,t));return{width:l,height:d}}_applyChange(){let e={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const t=this.el.parentElement,{left:i,top:r}=t.getBoundingClientRect();e={left:i,top:r,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(t=>{const i=this.temporalRect[t],r=t==="width"||t==="left"?this.rectScale.x:t==="height"||t==="top"?this.rectScale.y:1;this.el.style[t]=(i-e[t])*r+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}}zt._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const Ua='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class $t extends on{constructor(e,t={}){super(),this.dragScale={x:1,y:1},this.el=e,this.option=t;let i=t.handle.substring(1);this.dragEl=e.classList.contains(i)?e:e.querySelector(t.handle)||e,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this.enable()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEl.addEventListener("mousedown",this._mouseDown),ye&&(this.dragEl.addEventListener("touchstart",gi),this.dragEl.addEventListener("pointerdown",_i)),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEl.removeEventListener("mousedown",this._mouseDown),ye&&(this.dragEl.removeEventListener("touchstart",gi),this.dragEl.removeEventListener("pointerdown",_i)),e||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this}_mouseDown(e){if(!L.mouseHandled)return e.button!==0||e.target.closest(Ua)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete L.dragElement,delete L.dropElement,document.addEventListener("mousemove",this._mouseMove,!0),document.addEventListener("mouseup",this._mouseUp,!0),ye&&(this.dragEl.addEventListener("touchmove",mi),this.dragEl.addEventListener("touchend",yi)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),L.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const t=_.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(e){let t=this.mouseDownEvent;if(this.dragging)if(this._dragFollow(e),L.pauseDrag){const i=Number.isInteger(L.pauseDrag)?L.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),i)}else this._callDrag(e);else if(Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>3){this.dragging=!0,L.dragElement=this;let i=this.el.gridstackNode?.grid;i?L.dropElement=i.el.ddElement.ddDroppable:delete L.dropElement,this.helper=this._createHelper(e),this._setupHelperContainmentStyle(),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment);const r=_.initEvent(e,{target:this.el,type:"dragstart"});this._setupHelperStyle(e),this.option.start&&this.option.start(r,this.ui()),this.triggerEvent("dragstart",r)}return e.preventDefault(),!0}_mouseUp(e){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),ye&&(this.dragEl.removeEventListener("touchmove",mi,!0),this.dragEl.removeEventListener("touchend",yi,!0)),this.dragging){delete this.dragging,L.dropElement?.el===this.el.parentElement&&delete L.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper===this.el?this._removeHelperStyle():this.helper.remove();const t=_.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(t),this.triggerEvent("dragstop",t),L.dropElement&&L.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete L.dragElement,delete L.dropElement,delete L.mouseHandled,e.preventDefault()}_createHelper(e){let t=this.el;return typeof this.option.helper=="function"?t=this.option.helper(e):this.option.helper==="clone"&&(t=_.cloneNode(this.el)),document.body.contains(t)||_.appendTo(t,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),t===this.el&&(this.dragElementOriginStyle=$t.originStyleProp.map(i=>this.el.style[i])),t}_setupHelperStyle(e){this.helper.classList.add("ui-draggable-dragging");const t=this.helper.style;return t.pointerEvents="none",t.width=this.dragOffset.width+"px",t.height=this.dragOffset.height+"px",t.willChange="left, top",t.position="fixed",this._dragFollow(e),t.transition="none",setTimeout(()=>{this.helper&&(t.transition=null)},0),this}_removeHelperStyle(){if(this.helper.classList.remove("ui-draggable-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){let t=this.helper,i=this.dragElementOriginStyle.transition||null;t.style.transition=this.dragElementOriginStyle.transition="none",$t.originStyleProp.forEach(r=>t.style[r]=this.dragElementOriginStyle[r]||null),setTimeout(()=>t.style.transition=i,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){let t={left:0,top:0};const i=this.helper.style,r=this.dragOffset;i.left=(e.clientX+r.offsetLeft-t.left)*this.dragScale.x+"px",i.top=(e.clientY+r.offsetTop-t.top)*this.dragScale.y+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(e,t,i){let r=0,s=0;if(i){const l=document.createElement("div");_.addElStyles(l,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),i.appendChild(l);const d=l.getBoundingClientRect();i.removeChild(l),r=d.left,s=d.top,this.dragScale={x:1/d.width,y:1/d.height}}const a=t.getBoundingClientRect();return{left:a.left,top:a.top,offsetLeft:-e.clientX+a.left-r,offsetTop:-e.clientY+a.top-s,width:a.width*this.dragScale.x,height:a.height*this.dragScale.y}}ui(){const t=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-t.top)*this.dragScale.y,left:(i.left-t.left)*this.dragScale.x}}}}$t.originStyleProp=["transition","pointerEvents","position","left","top","minWidth","willChange"];class Va extends on{constructor(e,t={}){super(),this.el=e,this.option=t,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),ye&&(this.el.addEventListener("pointerenter",Rr),this.el.addEventListener("pointerleave",Ar)))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),e||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),ye&&(this.el.removeEventListener("pointerenter",Rr),this.el.removeEventListener("pointerleave",Ar)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this._setupAccept(),this}_mouseEnter(e){if(!L.dragElement||!this._canDrop(L.dragElement.el))return;e.preventDefault(),e.stopPropagation(),L.dropElement&&L.dropElement!==this&&L.dropElement._mouseLeave(e),L.dropElement=this;const t=_.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(L.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(e){if(!L.dragElement||L.dropElement!==this)return;e.preventDefault(),e.stopPropagation();const t=_.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(t,this._ui(L.dragElement)),this.triggerEvent("dropout",t),L.dropElement===this){delete L.dropElement;let i,r=this.el.parentElement;for(;!i&&r;)i=r.ddElement?.ddDroppable,r=r.parentElement;i&&i._mouseEnter(e)}}drop(e){e.preventDefault();const t=_.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(L.dragElement)),this.triggerEvent("drop",t)}_canDrop(e){return e&&(!this.accept||this.accept(e))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=e=>e.classList.contains(this.option.accept)||e.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(e){return{draggable:e.el,...e.ui()}}}class an{static init(e){return e.ddElement||(e.ddElement=new an(e)),e.ddElement}constructor(e){this.el=e}on(e,t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.on(e,t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.on(e,t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.on(e,t),this}off(e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.off(e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.off(e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.off(e),this}setupDraggable(e){return this.ddDraggable?this.ddDraggable.updateOption(e):this.ddDraggable=new $t(this.el,e),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(e){return this.ddResizable?this.ddResizable.updateOption(e):this.ddResizable=new zt(this.el,e),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(e){return this.ddDroppable?this.ddDroppable.updateOption(e):this.ddDroppable=new Va(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class Wa{resizable(e,t,i,r){return this._getDDElements(e).forEach(s=>{if(t==="disable"||t==="enable")s.ddResizable&&s.ddResizable[t]();else if(t==="destroy")s.ddResizable&&s.cleanResizable();else if(t==="option")s.setupResizable({[i]:r});else{const a=s.el.gridstackNode.grid;let l=s.el.getAttribute("gs-resize-handles")?s.el.getAttribute("gs-resize-handles"):a.opts.resizable.handles,d=!a.opts.alwaysShowResizeHandle;s.setupResizable({...a.opts.resizable,handles:l,autoHide:d,start:t.start,stop:t.stop,resize:t.resize})}}),this}draggable(e,t,i,r){return this._getDDElements(e).forEach(s=>{if(t==="disable"||t==="enable")s.ddDraggable&&s.ddDraggable[t]();else if(t==="destroy")s.ddDraggable&&s.cleanDraggable();else if(t==="option")s.setupDraggable({[i]:r});else{const a=s.el.gridstackNode.grid;s.setupDraggable({...a.opts.draggable,start:t.start,stop:t.stop,drag:t.drag})}}),this}dragIn(e,t){return this._getDDElements(e).forEach(i=>i.setupDraggable(t)),this}droppable(e,t,i,r){return typeof t.accept=="function"&&!t._accept&&(t._accept=t.accept,t.accept=s=>t._accept(s)),this._getDDElements(e).forEach(s=>{t==="disable"||t==="enable"?s.ddDroppable&&s.ddDroppable[t]():t==="destroy"?s.ddDroppable&&s.cleanDroppable():t==="option"?s.setupDroppable({[i]:r}):s.setupDroppable(t)}),this}isDroppable(e){return!!(e&&e.ddElement&&e.ddElement.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){return!!(e&&e.ddElement&&e.ddElement.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){return!!(e&&e.ddElement&&e.ddElement.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,t,i){return this._getDDElements(e).forEach(r=>r.on(t,s=>{i(s,L.dragElement?L.dragElement.el:s.target,L.dragElement?L.dragElement.helper:null)})),this}off(e,t){return this._getDDElements(e).forEach(i=>i.off(t)),this}_getDDElements(e,t=!0){let i=_.getElements(e);if(!i.length)return[];let r=i.map(s=>s.ddElement||(t?an.init(s):null));return t||r.filter(s=>s),r}}/*!
62
+ * GridStack 9.5.1
63
+ * https://gridstackjs.com/
64
+ *
65
+ * Copyright (c) 2021-2022 Alain Dumesny
66
+ * see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
67
+ */const J=new Wa;class z{static init(e={},t=".grid-stack"){let i=z.getGridElement(t);return i?(i.gridstack||(i.gridstack=new z(i,_.cloneDeep(e))),i.gridstack):(console.error(typeof t=="string"?'GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
68
+ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(e={},t=".grid-stack"){let i=[];return z.getGridElements(t).forEach(r=>{r.gridstack||(r.gridstack=new z(r,_.cloneDeep(e))),i.push(r.gridstack)}),i.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
69
+ Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`),i}static addGrid(e,t={}){if(!e)return null;let i=e;if(i.gridstack){const a=i.gridstack;return t&&(a.opts={...a.opts,...t}),t.children!==void 0&&a.load(t.children),a}if(!e.classList.contains("grid-stack")||z.addRemoveCB)if(z.addRemoveCB)i=z.addRemoveCB(e,t,!0,!0);else{let a=document.implementation.createHTMLDocument("");a.body.innerHTML=`<div class="grid-stack ${t.class||""}"></div>`,i=a.body.children[0],e.appendChild(i)}return z.init(t,i)}static registerEngine(e){z.engineClass=e}get placeholder(){if(!this._placeholder){let e=document.createElement("div");e.className="placeholder-content",this.opts.placeholderText&&(e.innerHTML=this.opts.placeholderText),this._placeholder=document.createElement("div"),this._placeholder.classList.add(this.opts.placeholderClass,de.itemClass,this.opts.itemClass),this.placeholder.appendChild(e)}return this._placeholder}constructor(e,t={}){this._gsEventHandler={},this._extraDragRow=0,this.el=e,t=t||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),t.row&&(t.minRow=t.maxRow=t.row,delete t.row);let i=_.toNumber(e.getAttribute("gs-row"));t.column==="auto"&&delete t.column,t.alwaysShowResizeHandle!==void 0&&(t._alwaysShowResizeHandle=t.alwaysShowResizeHandle);let r={..._.cloneDeep(de),column:_.toNumber(e.getAttribute("gs-column"))||de.column,minRow:i||_.toNumber(e.getAttribute("gs-min-row"))||de.minRow,maxRow:i||_.toNumber(e.getAttribute("gs-max-row"))||de.maxRow,staticGrid:_.toBool(e.getAttribute("gs-static"))||de.staticGrid,draggable:{handle:(t.handleClass?"."+t.handleClass:t.handle?t.handle:"")||de.draggable.handle},removableOptions:{accept:t.itemClass||de.removableOptions.accept,decline:de.removableOptions.decline}};e.getAttribute("gs-animate")&&(r.animate=_.toBool(e.getAttribute("gs-animate"))),this.opts=_.defaults(t,r),t=null,this._initMargin(),this.opts.column!==1&&!this.opts.disableOneColumnMode&&this._widthOrContainer()<=this.opts.oneColumnSize&&(this._prevColumn=this.getColumn(),this.opts.column=1),this.opts.rtl==="auto"&&(this.opts.rtl=e.style.direction==="rtl"),this.opts.rtl&&this.el.classList.add("grid-stack-rtl");const s=this.el.parentElement?.parentElement;let a=s?.classList.contains(de.itemClass)?s.gridstackNode:void 0;a&&(a.subGrid=this,this.parentGridItem=a,this.el.classList.add("grid-stack-nested"),a.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=this.opts.cellHeight==="auto",this._isAutoCellHeight||this.opts.cellHeight==="initial"?this.cellHeight(void 0,!1):(typeof this.opts.cellHeight=="number"&&this.opts.cellHeightUnit&&this.opts.cellHeightUnit!==de.cellHeightUnit&&(this.opts.cellHeight=this.opts.cellHeight+this.opts.cellHeightUnit,delete this.opts.cellHeightUnit),this.cellHeight(this.opts.cellHeight,!1)),this.opts.alwaysShowResizeHandle==="mobile"&&(this.opts.alwaysShowResizeHandle=ye),this._styleSheetClass="gs-id-"+xe._idSeq++,this.el.classList.add(this._styleSheetClass),this._setStaticClass();let l=this.opts.engineClass||z.engineClass||xe;if(this.engine=new l({column:this.getColumn(),float:this.opts.float,maxRow:this.opts.maxRow,onChange:d=>{let c=0;this.engine.nodes.forEach(u=>{c=Math.max(c,u.y+u.h)}),d.forEach(u=>{let p=u.el;p&&(u._removeDOM?(p&&p.remove(),delete u._removeDOM):this._writePosAttr(p,u))}),this._updateStyles(!1,c)}}),this.opts.auto&&(this.batchUpdate(),this.getGridItems().forEach(d=>this._prepareElement(d)),this.batchUpdate(!1)),this.opts.children){let d=this.opts.children;delete this.opts.children,d.length&&this.load(d)}this.setAnimation(this.opts.animate),this._updateStyles(),this.el.classList.add("gs-"+this.opts.column),this.opts.subGridDynamic&&!L.pauseDrag&&(L.pauseDrag=!0),this.opts.draggable?.pause!==void 0&&(L.pauseDrag=this.opts.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}addWidget(e,t){function i(l){return l.el!==void 0||l.x!==void 0||l.y!==void 0||l.w!==void 0||l.h!==void 0||l.content!==void 0}let r,s;if(typeof e=="string"){let l=document.implementation.createHTMLDocument("");l.body.innerHTML=e,r=l.body.children[0]}else if(arguments.length===0||arguments.length===1&&i(e))if(s=t=e,s?.el)r=s.el;else if(z.addRemoveCB)r=z.addRemoveCB(this.el,t,!0,!1);else{let l=t?.content||"",d=document.implementation.createHTMLDocument("");d.body.innerHTML=`<div class="grid-stack-item ${this.opts.itemClass||""}"><div class="grid-stack-item-content">${l}</div></div>`,r=d.body.children[0]}else r=e;if(!r)return;if(s=r.gridstackNode,s&&r.parentElement===this.el&&this.engine.nodes.find(l=>l._id===s._id))return r;let a=this._readAttr(r);return t=_.cloneDeep(t)||{},_.defaults(t,a),s=this.engine.prepareNode(t),this._writeAttr(r,t),this._insertNotAppend?this.el.prepend(r):this.el.appendChild(r),this.makeWidget(r,t),r}makeSubGrid(e,t,i,r=!0){let s=e.gridstackNode;if(s||(s=this.makeWidget(e).gridstackNode),s.subGrid?.el)return s.subGrid;let a,l=this;for(;l&&!a;)a=l.opts?.subGridOpts,l=l.parentGridItem?.grid;t=_.cloneDeep({...a||{},children:void 0,...t||s.subGridOpts}),s.subGridOpts=t;let d;t.column==="auto"&&(d=!0,t.column=Math.max(s.w||1,i?.w||1),t.disableOneColumnMode=!0);let c=s.el.querySelector(".grid-stack-item-content"),u,p;if(r){if(this._removeDD(s.el),p={...s,x:0,y:0},_.removeInternalForSave(p),delete p.subGridOpts,s.content&&(p.content=s.content,delete s.content),z.addRemoveCB)u=z.addRemoveCB(this.el,p,!0,!1);else{let y=document.implementation.createHTMLDocument("");y.body.innerHTML='<div class="grid-stack-item"></div>',u=y.body.children[0],u.appendChild(c),y.body.innerHTML='<div class="grid-stack-item-content"></div>',c=y.body.children[0],s.el.appendChild(c)}this._prepareDragDropByNode(s)}if(i){let y=d?t.column:s.w,m=s.h+i.h,g=s.el.style;g.transition="none",this.update(s.el,{w:y,h:m}),setTimeout(()=>g.transition=null)}let h=s.subGrid=z.addGrid(c,t);return i?._moving&&(h._isTemp=!0),d&&(h._autoColumn=!0),r&&h.addWidget(u,p),i&&(i._moving?window.setTimeout(()=>_.simulateMouseEvent(i._event,"mouseenter",h.el),0):h.addWidget(s.el,s)),h}removeAsSubGrid(e){let t=this.parentGridItem?.grid;t&&(t.batchUpdate(),t.removeWidget(this.parentGridItem.el,!0,!0),this.engine.nodes.forEach(i=>{i.x+=this.parentGridItem.x,i.y+=this.parentGridItem.y,t.addWidget(i.el,i)}),t.batchUpdate(!1),this.parentGridItem&&delete this.parentGridItem.subGrid,delete this.parentGridItem,e&&window.setTimeout(()=>_.simulateMouseEvent(e._event,"mouseenter",t.el),0))}save(e=!0,t=!1,i=z.saveCB){let r=this.engine.save(e,i);if(r.forEach(s=>{if(e&&s.el&&!s.subGrid&&!i){let a=s.el.querySelector(".grid-stack-item-content");s.content=a?a.innerHTML:void 0,s.content||delete s.content}else if(!e&&!i&&delete s.content,s.subGrid?.el){const a=s.subGrid.save(e,t,i);s.subGridOpts=t?a:{children:a},delete s.subGrid}delete s.el}),t){let s=_.cloneDeep(this.opts);s.marginBottom===s.marginTop&&s.marginRight===s.marginLeft&&s.marginTop===s.marginRight&&(s.margin=s.marginTop,delete s.marginTop,delete s.marginRight,delete s.marginBottom,delete s.marginLeft),s.rtl===(this.el.style.direction==="rtl")&&(s.rtl="auto"),this._isAutoCellHeight&&(s.cellHeight="auto"),this._autoColumn&&(s.column="auto",delete s.disableOneColumnMode);const a=s._alwaysShowResizeHandle;return delete s._alwaysShowResizeHandle,a!==void 0?s.alwaysShowResizeHandle=a:delete s.alwaysShowResizeHandle,_.removeInternalAndSame(s,de),s.children=r,s}return r}load(e,t=z.addRemoveCB||!0){e=_.cloneDeep(e);const i=e.some(c=>c.x!==void 0||c.y!==void 0);i&&(e=_.sort(e,-1,this._prevColumn||this.getColumn())),this._insertNotAppend=i;const r=this.opts.column;this._prevColumn&&this._prevColumn!==r&&e.some(c=>(c.x||0)+c.w>r)&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(e,this._prevColumn,!0));const s=z.addRemoveCB;typeof t=="function"&&(z.addRemoveCB=t);let a=[];this.batchUpdate(),t&&[...this.engine.nodes].forEach(u=>{if(!u.id)return;_.find(e,u.id)||(z.addRemoveCB&&z.addRemoveCB(this.el,u,!1,!1),a.push(u),this.removeWidget(u.el,!0,!1))});let l=[];this.engine.nodes=this.engine.nodes.filter(c=>_.find(e,c.id)?(l.push(c),!1):!0);let d=!1;return e.forEach(c=>{let u=_.find(l,c.id);if(u){if(_.shouldSizeToContent(u)&&(c.h=u.h),this.engine.nodeBoundFix(c),(c.autoPosition||c.x===void 0||c.y===void 0)&&(c.w=c.w||u.w,c.h=c.h||u.h,this.engine.findEmptyPosition(c)),d=d||c.w!==void 0&&c.w!==u.w,this.engine.nodes.push(u),_.samePos(u,c)&&this.moveNode(u,{...c,forceCollide:!0}),this.update(u.el,c),c.subGridOpts?.children){let p=u.el.querySelector(".grid-stack");p&&p.gridstack&&(p.gridstack.load(c.subGridOpts.children),this._insertNotAppend=!0)}}else t&&this.addWidget(c)}),this.engine.removedNodes=a,this.doContentResize(d,!0),this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this._insertNotAppend,s?z.addRemoveCB=s:delete z.addRemoveCB,this}batchUpdate(e=!0){return this.engine.batchUpdate(e),e||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(e=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!e||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;let t=this.el.querySelector("."+this.opts.itemClass);if(t){let r=_.toNumber(t.getAttribute("gs-h"))||1;return Math.round(t.offsetHeight/r)}let i=parseInt(this.el.getAttribute("gs-current-row"));return i?Math.round(this.el.getBoundingClientRect().height/i):this.opts.cellHeight}cellHeight(e,t=!0){if(t&&e!==void 0&&this._isAutoCellHeight!==(e==="auto")&&(this._isAutoCellHeight=e==="auto",this._updateResizeEvent()),(e==="initial"||e==="auto")&&(e=void 0),e===void 0){let r=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+r}let i=_.parseHeight(e);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,this.doContentResize(!1,!0),t&&this._updateStyles(!0),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(){return this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}compact(e="compact",t=!0){return this.engine.compact(e,t),this._triggerChangeEvent(),this}column(e,t="moveScale"){if(!e||e<1||this.opts.column===e)return this;let i=this.getColumn();e===1&&!this.opts.disableOneColumnMode?this._prevColumn=i:delete this._prevColumn,this.el.classList.remove("gs-"+i),this.el.classList.add("gs-"+e),this.opts.column=this.engine.column=e;let r;return e===1&&this.opts.oneColumnModeDomSort&&(r=[],this.getGridItems().forEach(s=>{s.gridstackNode&&r.push(s.gridstackNode)}),r.length||(r=void 0)),this.engine.columnChanged(i,e,r,t),this._isAutoCellHeight&&this.cellHeight(),this.doContentResize(),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(e=>e.matches("."+this.opts.itemClass)&&!e.matches("."+this.opts.placeholderClass))}destroy(e=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),e?this.el.parentNode.removeChild(this.el):(this.removeAll(e),this.el.classList.remove(this._styleSheetClass),this.el.removeAttribute("gs-current-row")),this._removeStylesheet(),this.parentGridItem&&delete this.parentGridItem.subGrid,delete this.parentGridItem,delete this.opts,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(e){return this.opts.float!==e&&(this.opts.float=this.engine.float=e,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(e,t=!1){let i=this.el.getBoundingClientRect(),r;t?r={top:i.top+document.documentElement.scrollTop,left:i.left}:r={top:this.el.offsetTop,left:this.el.offsetLeft};let s=e.left-r.left,a=e.top-r.top,l=i.width/this.getColumn(),d=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(s/l),y:Math.floor(a/d)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(e,t,i,r){return this.engine.isAreaEmpty(e,t,i,r)}makeWidget(e,t){let i=z.getElement(e);this._prepareElement(i,!0,t);const r=i.gridstackNode;return this._updateContainerHeight(),this.doContentResize(!1,!1,r),r.subGridOpts&&this.makeSubGrid(i,r.subGridOpts,void 0,!1),this._prevColumn&&this.opts.column===1&&(this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,i}on(e,t){return e.indexOf(" ")!==-1?(e.split(" ").forEach(r=>this.on(r,t)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=r=>t(r):this._gsEventHandler[e]=r=>t(r,r.detail),this.el.addEventListener(e,this._gsEventHandler[e])):e==="drag"||e==="dragstart"||e==="dragstop"||e==="resizestart"||e==="resize"||e==="resizestop"||e==="dropped"||e==="resizecontent"?this._gsEventHandler[e]=t:console.log("GridStack.on("+e+') event not supported, but you can still use $(".grid-stack").on(...) while jquery-ui is still used internally.'),this)}off(e){return e.indexOf(" ")!==-1?(e.split(" ").forEach(i=>this.off(i)),this):((e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable")&&this._gsEventHandler[e]&&this.el.removeEventListener(e,this._gsEventHandler[e]),delete this._gsEventHandler[e],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(e=>this.off(e)),this}removeWidget(e,t=!0,i=!0){return z.getElements(e).forEach(r=>{if(r.parentElement&&r.parentElement!==this.el)return;let s=r.gridstackNode;s||(s=this.engine.nodes.find(a=>r===a.el)),s&&(z.addRemoveCB&&z.addRemoveCB(this.el,s,!1,!1),delete r.gridstackNode,this._removeDD(r),this.engine.removeNode(s,t,i),t&&r.parentElement&&r.remove())}),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this}removeAll(e=!0){return this.engine.nodes.forEach(t=>{delete t.el.gridstackNode,this._removeDD(t.el)}),this.engine.removeAll(e),this._triggerRemoveEvent(),this}setAnimation(e){return e?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this}setStatic(e,t=!0,i=!0){return!!this.opts.staticGrid===e?this:(e?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(r=>{this._prepareDragDropByNode(r),r.subGrid&&i&&r.subGrid.setStatic(e,t,i)}),t&&this._setStaticClass(),this)}update(e,t){if(arguments.length>2){console.warn("gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update(el, {x, w, content, ...})`. It will be removed soon");let i=arguments,r=1;return t={x:i[r++],y:i[r++],w:i[r++],h:i[r++]},this.update(e,t)}return z.getElements(e).forEach(i=>{let r=i?.gridstackNode;if(!r)return;let s=_.cloneDeep(t);this.engine.nodeBoundFix(s),delete s.autoPosition,delete s.id;let a=["x","y","w","h"],l;if(a.some(u=>s[u]!==void 0&&s[u]!==r[u])&&(l={},a.forEach(u=>{l[u]=s[u]!==void 0?s[u]:r[u],delete s[u]})),!l&&(s.minW||s.minH||s.maxW||s.maxH)&&(l={}),s.content!==void 0){const u=i.querySelector(".grid-stack-item-content");u&&u.innerHTML!==s.content&&(u.innerHTML=s.content,r.subGrid?.el&&(u.appendChild(r.subGrid.el),r.subGrid.opts.styleInHead||r.subGrid._updateStyles(!0))),delete s.content}let d=!1,c=!1;for(const u in s)u[0]!=="_"&&r[u]!==s[u]&&(r[u]=s[u],d=!0,c=c||!this.opts.staticGrid&&(u==="noResize"||u==="noMove"||u==="locked"));_.sanitizeMinMax(r),l&&this.moveNode(r,l),(l||d)&&this._writeAttr(i,r),c&&this._prepareDragDropByNode(r)}),this}moveNode(e,t){this.engine.cleanNodes().beginUpdate(e).moveNode(e,t),this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate()}resizeToContent(e,t=!1){if(!e||(e.classList.remove("size-to-content-max"),!e.clientHeight))return;let i=e.gridstackNode;if(!i)return;const r=i.grid;if(!r||e.parentElement!==r.el)return;const s=r.getCellHeight();if(!s)return;let a=t&&i.h?i.h*s:e.clientHeight,l;if(i.resizeToContentParent&&(l=e.querySelector(i.resizeToContentParent)),l||(l=e.querySelector(z.resizeToContentParent)),!l)return;const d=e.clientHeight-l.clientHeight,c=t&&i.h?i.h*s-d:l.clientHeight;let u;if(i.subGrid)u=i.subGrid.getRow()*i.subGrid.getCellHeight();else{const y=l.firstElementChild;if(!y){console.log(`Error: resizeToContent() '${z.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}u=y.getBoundingClientRect().height||c}if(c===u)return;a+=u-c;let p=Math.ceil(a/s);const h=Number.isInteger(i.sizeToContent)?i.sizeToContent:0;h&&p>h&&(p=h,e.classList.add("size-to-content-max")),i.minH&&p<i.minH?p=i.minH:i.maxH&&p>i.maxH&&(p=i.maxH),p!==i.h&&(r._ignoreLayoutsNodeChange=!0,r.moveNode(i,{h:p}),delete r._ignoreLayoutsNodeChange)}resizeToContentCheck(e,t=!1){z.resizeToContentCB?z.resizeToContentCB(e,t):this.resizeToContent(e,t)}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){let i=_.parseHeight(e);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}return this.opts.margin=e,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this._updateStyles(!0),this}getMargin(){return this.opts.margin}willItFit(e){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");let t=arguments,i=0,r={x:t[i++],y:t[i++],w:t[i++],h:t[i++],autoPosition:t[i++]};return this.willItFit(r)}return this.engine.willItFit(e)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),this.engine.saveInitial(),this}_triggerAddEvent(){return this.engine.batchMode?this:(this.engine.addedNodes?.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(e=>{delete e._dirty}),this._triggerEvent("added",this.engine.addedNodes),this.engine.addedNodes=[]),this)}_triggerRemoveEvent(){return this.engine.batchMode?this:(this.engine.removedNodes?.length&&(this._triggerEvent("removed",this.engine.removedNodes),this.engine.removedNodes=[]),this)}_triggerEvent(e,t){let i=t?new CustomEvent(e,{bubbles:!1,detail:t}):new Event(e);return this.el.dispatchEvent(i),this}_removeStylesheet(){return this._styles&&(_.removeStylesheet(this._styleSheetClass),delete this._styles),this}_updateStyles(e=!1,t){if(e&&this._removeStylesheet(),t||(t=this.getRow()),this._updateContainerHeight(),this.opts.cellHeight===0)return this;let i=this.opts.cellHeight,r=this.opts.cellHeightUnit,s=`.${this._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){let a=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=_.createStylesheet(this._styleSheetClass,a,{nonce:this.opts.nonce}),!this._styles)return this;this._styles._max=0,_.addCSSRule(this._styles,s,`height: ${i}${r}`);let l=this.opts.marginTop+this.opts.marginUnit,d=this.opts.marginBottom+this.opts.marginUnit,c=this.opts.marginRight+this.opts.marginUnit,u=this.opts.marginLeft+this.opts.marginUnit,p=`${s} > .grid-stack-item-content`,h=`.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;_.addCSSRule(this._styles,p,`top: ${l}; right: ${c}; bottom: ${d}; left: ${u};`),_.addCSSRule(this._styles,h,`top: ${l}; right: ${c}; bottom: ${d}; left: ${u};`),_.addCSSRule(this._styles,`${s} > .ui-resizable-ne`,`right: ${c}`),_.addCSSRule(this._styles,`${s} > .ui-resizable-e`,`right: ${c}`),_.addCSSRule(this._styles,`${s} > .ui-resizable-se`,`right: ${c}; bottom: ${d}`),_.addCSSRule(this._styles,`${s} > .ui-resizable-nw`,`left: ${u}`),_.addCSSRule(this._styles,`${s} > .ui-resizable-w`,`left: ${u}`),_.addCSSRule(this._styles,`${s} > .ui-resizable-sw`,`left: ${u}; bottom: ${d}`)}if(t=t||this._styles._max,t>this._styles._max){let a=l=>i*l+r;for(let l=this._styles._max+1;l<=t;l++)_.addCSSRule(this._styles,`${s}[gs-y="${l}"]`,`top: ${a(l)}`),_.addCSSRule(this._styles,`${s}[gs-h="${l+1}"]`,`height: ${a(l+1)}`);this._styles._max=t}return this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const e=this.parentGridItem;let t=this.getRow()+this._extraDragRow;const i=this.opts.cellHeight,r=this.opts.cellHeightUnit;if(!i)return this;if(!e){const s=_.parseHeight(getComputedStyle(this.el).minHeight);if(s.h>0&&s.unit===r){const a=Math.floor(s.h/i);t<a&&(t=a)}}return this.el.setAttribute("gs-current-row",String(t)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),t&&(this.el.style[e?"minHeight":"height"]=t*i+r),e&&!e.grid.engine.batchMode&&_.shouldSizeToContent(e)&&e.grid.resizeToContentCheck(e.el),this}_prepareElement(e,t=!1,i){e.classList.add(this.opts.itemClass),i=i||this._readAttr(e),e.gridstackNode=i,i.el=e,i.grid=this;let r={...i};return i=this.engine.addNode(i,t),_.same(i,r)||this._writeAttr(e,i),_.shouldSizeToContent(i)&&e.classList.add("size-to-content"),this._prepareDragDropByNode(i),this}_writePosAttr(e,t){return t.x!==void 0&&t.x!==null&&e.setAttribute("gs-x",String(t.x)),t.y!==void 0&&t.y!==null&&e.setAttribute("gs-y",String(t.y)),t.w>1?e.setAttribute("gs-w",String(t.w)):e.removeAttribute("gs-w"),t.h>1?e.setAttribute("gs-h",String(t.h)):e.removeAttribute("gs-h"),this}_writeAttr(e,t){if(!t)return this;this._writePosAttr(e,t);let i={autoPosition:"gs-auto-position",noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id"};for(const r in i)t[r]?e.setAttribute(i[r],String(t[r])):e.removeAttribute(i[r]);return this}_readAttr(e,t=!0){let i={};i.x=_.toNumber(e.getAttribute("gs-x")),i.y=_.toNumber(e.getAttribute("gs-y")),i.w=_.toNumber(e.getAttribute("gs-w")),i.h=_.toNumber(e.getAttribute("gs-h")),i.autoPosition=_.toBool(e.getAttribute("gs-auto-position")),i.noResize=_.toBool(e.getAttribute("gs-no-resize")),i.noMove=_.toBool(e.getAttribute("gs-no-move")),i.locked=_.toBool(e.getAttribute("gs-locked")),i.id=e.getAttribute("gs-id"),i.maxW=_.toNumber(e.getAttribute("gs-max-w")),i.minW=_.toNumber(e.getAttribute("gs-min-w")),i.maxH=_.toNumber(e.getAttribute("gs-max-h")),i.minH=_.toNumber(e.getAttribute("gs-min-h")),t&&(i.w===1&&e.removeAttribute("gs-w"),i.h===1&&e.removeAttribute("gs-h"),i.maxW&&e.removeAttribute("gs-max-w"),i.minW&&e.removeAttribute("gs-min-w"),i.maxH&&e.removeAttribute("gs-max-h"),i.minH&&e.removeAttribute("gs-min-h"));for(const r in i){if(!i.hasOwnProperty(r))return;!i[r]&&i[r]!==0&&delete i[r]}return i}_setStaticClass(){let e=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...e),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...e),this.el.removeAttribute("gs-static")),this}onResize(){if(!this.el?.clientWidth||this.prevWidth===this.el.clientWidth)return;this.prevWidth=this.el.clientWidth,this.batchUpdate();let e=!1;if(this._autoColumn&&this.parentGridItem)this.opts.column!==this.parentGridItem.w&&(this.column(this.parentGridItem.w,"none"),e=!0);else{let t=!this.opts.disableOneColumnMode&&this.el.clientWidth<=this.opts.oneColumnSize||this.opts.column===1&&!this._prevColumn;this.opts.column===1!==t&&(this.column(t?1:this._prevColumn),e=!0)}return this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(t=>{t.subGrid&&t.subGrid.onResize()}),this._skipInitialResize||this.doContentResize(e),delete this._skipInitialResize,this.batchUpdate(!1),this}doContentResize(e=!0,t=!1,i=void 0){setTimeout(()=>{if(this.engine){if(i)_.shouldSizeToContent(i)&&this.resizeToContentCheck(i.el,t);else if(this.engine.nodes.some(r=>_.shouldSizeToContent(r))){const r=[...this.engine.nodes];this.batchUpdate(),r.forEach(s=>{_.shouldSizeToContent(s)&&this.resizeToContentCheck(s.el,t)}),this.batchUpdate(!1)}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,i?[i]:this.engine.nodes)}},e?310:0)}_updateResizeEvent(e=!1){const t=!this.parentGridItem&&(this._isAutoCellHeight||this.opts.sizeToContent||!this.opts.disableOneColumnMode||this.engine.nodes.find(i=>i.sizeToContent));return!e&&t&&!this.resizeObserver?(this._sizeThrottle=_.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(e||!t)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(e=".grid-stack-item"){return _.getElement(e)}static getElements(e=".grid-stack-item"){return _.getElements(e)}static getGridElement(e){return z.getElement(e)}static getGridElements(e){return _.getElements(e)}_initMargin(){let e,t=0,i=[];return typeof this.opts.margin=="string"&&(i=this.opts.margin.split(" ")),i.length===2?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):i.length===4?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(e=_.parseHeight(this.opts.margin),this.opts.marginUnit=e.unit,t=this.opts.margin=e.h),this.opts.marginTop===void 0?this.opts.marginTop=t:(e=_.parseHeight(this.opts.marginTop),this.opts.marginTop=e.h,delete this.opts.margin),this.opts.marginBottom===void 0?this.opts.marginBottom=t:(e=_.parseHeight(this.opts.marginBottom),this.opts.marginBottom=e.h,delete this.opts.margin),this.opts.marginRight===void 0?this.opts.marginRight=t:(e=_.parseHeight(this.opts.marginRight),this.opts.marginRight=e.h,delete this.opts.margin),this.opts.marginLeft===void 0?this.opts.marginLeft=t:(e=_.parseHeight(this.opts.marginLeft),this.opts.marginLeft=e.h,delete this.opts.margin),this.opts.marginUnit=e.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop),this}static getDD(){return J}static setupDragIn(e,t,i=document){t?.pause!==void 0&&(L.pauseDrag=t.pause),t={...Fa,...t||{}};let r=typeof e=="string"?_.getElements(e,i):e;r.length&&r?.forEach(s=>{J.isDraggable(s)||J.dragIn(s,t)})}movable(e,t){return this.opts.staticGrid?this:(z.getElements(e).forEach(i=>{let r=i.gridstackNode;r&&(t?delete r.noMove:r.noMove=!0,this._prepareDragDropByNode(r))}),this)}resizable(e,t){return this.opts.staticGrid?this:(z.getElements(e).forEach(i=>{let r=i.gridstackNode;r&&(t?delete r.noResize:r.noResize=!0,this._prepareDragDropByNode(r))}),this)}disable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!1,e),this.enableResize(!1,e),this._triggerEvent("disable"),this}enable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!0,e),this.enableResize(!0,e),this._triggerEvent("enable"),this}enableMove(e,t=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(i=>{this._prepareDragDropByNode(i),i.subGrid&&t&&i.subGrid.enableMove(e,t)}),this)}enableResize(e,t=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(i=>{this._prepareDragDropByNode(i),i.subGrid&&t&&i.subGrid.enableResize(e,t)}),this)}_removeDD(e){return J.draggable(e,"destroy").resizable(e,"destroy"),e.gridstackNode&&delete e.gridstackNode._initDD,delete e.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return J.droppable(this.el,"destroy"),this;let e,t,i=(r,s,a)=>{let l=s.gridstackNode;if(!l)return;a=a||s;let d=this.el.getBoundingClientRect(),{top:c,left:u}=a.getBoundingClientRect();u-=d.left,c-=d.top;let p={position:{top:c,left:u}};if(l._temporaryRemoved){if(l.x=Math.max(0,Math.round(u/t)),l.y=Math.max(0,Math.round(c/e)),delete l.autoPosition,this.engine.nodeBoundFix(l),!this.engine.willItFit(l)){if(l.autoPosition=!0,!this.engine.willItFit(l)){J.off(s,"drag");return}l._willFitPos&&(_.copyPos(l,l._willFitPos),delete l._willFitPos)}this._onStartMoving(a,r,p,l,t,e)}else this._dragOrResize(a,r,p,l,t,e)};return J.droppable(this.el,{accept:r=>{let s=r.gridstackNode;if(s?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let a=!0;if(typeof this.opts.acceptWidgets=="function")a=this.opts.acceptWidgets(r);else{let l=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;a=r.matches(l)}if(a&&s&&this.opts.maxRow){let l={w:s.w,h:s.h,minW:s.minW,minH:s.minH};a=this.engine.willItFit(l)}return a}}).on(this.el,"dropover",(r,s,a)=>{let l=s.gridstackNode;if(l?.grid===this&&!l._temporaryRemoved)return!1;l?.grid&&l.grid!==this&&!l._temporaryRemoved&&l.grid._leave(s,a),t=this.cellWidth(),e=this.getCellHeight(!0),l||(l=this._readAttr(s,!1)),l.grid||(l._isExternal=!0,s.gridstackNode=l),a=a||s;let d=l.w||Math.round(a.offsetWidth/t)||1,c=l.h||Math.round(a.offsetHeight/e)||1;return l.grid&&l.grid!==this?(s._gridstackNodeOrig||(s._gridstackNodeOrig=l),s.gridstackNode=l={...l,w:d,h:c,grid:this},delete l.x,delete l.y,this.engine.cleanupNode(l).nodeBoundFix(l),l._initDD=l._isExternal=l._temporaryRemoved=!0):(l.w=d,l.h=c,l._temporaryRemoved=!0),this._itemRemoving(l.el,!1),J.on(s,"drag",i),i(r,s,a),!1}).on(this.el,"dropout",(r,s,a)=>{let l=s.gridstackNode;return l&&(!l.grid||l.grid===this)&&(this._leave(s,a),this._isTemp&&this.removeAsSubGrid(l)),!1}).on(this.el,"drop",(r,s,a)=>{let l=s.gridstackNode;if(l?.grid===this&&!l._isExternal)return!1;let d=!!this.placeholder.parentElement;this.placeholder.remove();let c=s._gridstackNodeOrig;if(delete s._gridstackNodeOrig,d&&c?.grid&&c.grid!==this){let p=c.grid;p.engine.removeNodeFromLayoutCache(c),p.engine.removedNodes.push(c),p._triggerRemoveEvent()._triggerChangeEvent(),p.parentGridItem&&!p.engine.nodes.length&&p.opts.subGridDynamic&&p.removeAsSubGrid()}if(!l||(d&&(this.engine.cleanupNode(l),l.grid=this),delete l.grid._isTemp,J.off(s,"drag"),a!==s?(a.remove(),s.gridstackNode=c,d&&(s=s.cloneNode(!0))):(s.remove(),this._removeDD(s)),!d))return!1;s.gridstackNode=l,l.el=s;let u=l.subGrid?.el?.gridstack;return _.copyPos(l,this._readAttr(this.placeholder)),_.removePositioningStyles(s),this._writeAttr(s,l),s.classList.add(de.itemClass,this.opts.itemClass),this.el.appendChild(s),u&&(u.parentGridItem=l,u.opts.styleInHead||u._updateStyles(!0)),this._prepareDragDropByNode(l),this._updateContainerHeight(),this.engine.addedNodes.push(l),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...r,type:"dropped"},c&&c.grid?c:void 0,l),!1}),this}_itemRemoving(e,t){let i=e?e.gridstackNode:void 0;!i||!i.grid||e.classList.contains(this.opts.removableOptions.decline)||(t?i._isAboutToRemove=!0:delete i._isAboutToRemove,t?e.classList.add("grid-stack-item-removing"):e.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(!this.opts.staticGrid&&typeof this.opts.removable=="string"){let e=document.querySelector(this.opts.removable);if(!e)return this;J.isDroppable(e)||J.droppable(e,this.opts.removableOptions).on(e,"dropover",(t,i)=>this._itemRemoving(i,!0)).on(e,"dropout",(t,i)=>this._itemRemoving(i,!1))}return this}_prepareDragDropByNode(e){let t=e.el;const i=e.noMove||this.opts.disableDrag,r=e.noResize||this.opts.disableResize;if(this.opts.staticGrid||i&&r)return e._initDD&&(this._removeDD(t),delete e._initDD),t.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!e._initDD){let s,a,l=(u,p)=>{this._gsEventHandler[u.type]&&this._gsEventHandler[u.type](u,u.target),s=this.cellWidth(),a=this.getCellHeight(!0),this._onStartMoving(t,u,p,e,s,a)},d=(u,p)=>{this._dragOrResize(t,u,p,e,s,a)},c=u=>{this.placeholder.remove(),delete e._moving,delete e._event,delete e._lastTried;let p=u.target;if(!(!p.gridstackNode||p.gridstackNode.grid!==this)){if(e.el=p,e._isAboutToRemove){let h=t.gridstackNode.grid;h._gsEventHandler[u.type]&&h._gsEventHandler[u.type](u,p),h.engine.nodes.push(e),h.removeWidget(t,!0,!0)}else _.removePositioningStyles(p),e._temporaryRemoved?(_.copyPos(e,e._orig),this._writePosAttr(p,e),this.engine.addNode(e)):this._writePosAttr(p,e),this._gsEventHandler[u.type]&&this._gsEventHandler[u.type](u,p);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),u.type==="resizestop"&&(Number.isInteger(e.sizeToContent)&&(e.sizeToContent=e.h),this.doContentResize(!1,!0,e))}};J.draggable(t,{start:l,stop:c,drag:d}).resizable(t,{start:l,stop:c,resize:d}),e._initDD=!0}return J.draggable(t,i?"disable":"enable").resizable(t,r?"disable":"enable"),this}_onStartMoving(e,t,i,r,s,a){this.engine.cleanNodes().beginUpdate(r),this._writePosAttr(this.placeholder,r),this.el.appendChild(this.placeholder),r.el=this.placeholder,r._lastUiPosition=i.position,r._prevYPix=i.position.top,r._moving=t.type==="dragstart",delete r._lastTried,t.type==="dropover"&&r._temporaryRemoved&&(this.engine.addNode(r),r._moving=!0),this.engine.cacheRects(s,a,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),t.type==="resizestart"&&(J.resizable(e,"option","minWidth",s*(r.minW||1)).resizable(e,"option","minHeight",a*(r.minH||1)),r.maxW&&J.resizable(e,"option","maxWidth",s*r.maxW),r.maxH&&J.resizable(e,"option","maxHeight",a*r.maxH))}_dragOrResize(e,t,i,r,s,a){let l={...r._orig},d,c=this.opts.marginLeft,u=this.opts.marginRight,p=this.opts.marginTop,h=this.opts.marginBottom,y=Math.round(a*.1),m=Math.round(s*.1);if(c=Math.min(c,m),u=Math.min(u,m),p=Math.min(p,y),h=Math.min(h,y),t.type==="drag"){if(r._temporaryRemoved)return;let v=i.position.top-r._prevYPix;r._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&_.updateScrollPosition(e,i.position,v);let E=i.position.left+(i.position.left>r._lastUiPosition.left?-u:c),C=i.position.top+(i.position.top>r._lastUiPosition.top?-h:p);l.x=Math.round(E/s),l.y=Math.round(C/a);let w=this._extraDragRow;if(this.engine.collide(r,l)){let b=this.getRow(),x=Math.max(0,l.y+r.h-b);this.opts.maxRow&&b+x>this.opts.maxRow&&(x=Math.max(0,this.opts.maxRow-b)),this._extraDragRow=x}else this._extraDragRow=0;if(this._extraDragRow!==w&&this._updateContainerHeight(),r.x===l.x&&r.y===l.y)return}else if(t.type==="resize"){if(l.x<0||(_.updateScrollResize(t,e,a),l.w=Math.round((i.size.width-c)/s),l.h=Math.round((i.size.height-p)/a),r.w===l.w&&r.h===l.h)||r._lastTried&&r._lastTried.w===l.w&&r._lastTried.h===l.h)return;let v=i.position.left+c,E=i.position.top+p;l.x=Math.round(v/s),l.y=Math.round(E/a),d=!0}r._event=t,r._lastTried=l;let g={x:i.position.left+c,y:i.position.top+p,w:(i.size?i.size.width:r.w*s)-c-u,h:(i.size?i.size.height:r.h*a)-p-h};if(this.engine.moveNodeCheck(r,{...l,cellWidth:s,cellHeight:a,rect:g,resizing:d})){r._lastUiPosition=i.position,this.engine.cacheRects(s,a,p,u,h,c),delete r._skipDown,d&&r.subGrid&&r.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let v=t.target;this._writePosAttr(v,r),this._gsEventHandler[t.type]&&this._gsEventHandler[t.type](t,v)}}_leave(e,t){let i=e.gridstackNode;i&&(J.off(e,"drag"),!i._temporaryRemoved&&(i._temporaryRemoved=!0,this.engine.removeNode(i),i.el=i._isExternal&&t?t:e,this.opts.removable===!0&&this._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):i._isExternal&&(delete i.el,delete e.gridstackNode,this.engine.restoreInitial())))}commit(){return Ha(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}z.resizeToContentParent=".grid-stack-item-content",z.Utils=_,z.Engine=xe,z.GDRev="9.5.1";const ln="el",Ga="is-",it=(n,e,t,i,r)=>{let s=`${n}-${e}`;return t&&(s+=`-${t}`),i&&(s+=`__${i}`),r&&(s+=`--${r}`),s},ja=Symbol("namespaceContextKey"),cn=n=>{const e=o.getCurrentInstance()?o.inject(ja,o.ref(ln)):o.ref(ln);return o.computed(()=>o.unref(e)||ln)},Ke=(n,e)=>{const t=cn();return{namespace:t,b:(g="")=>it(t.value,n,g,"",""),e:g=>g?it(t.value,n,"",g,""):"",m:g=>g?it(t.value,n,"","",g):"",be:(g,v)=>g&&v?it(t.value,n,g,v,""):"",em:(g,v)=>g&&v?it(t.value,n,"",g,v):"",bm:(g,v)=>g&&v?it(t.value,n,g,"",v):"",bem:(g,v,E)=>g&&v&&E?it(t.value,n,g,v,E):"",is:(g,...v)=>{const E=v.length>=1?v[0]:!0;return g&&E?`${Ga}${g}`:""},cssVar:g=>{const v={};for(const E in g)g[E]&&(v[`--${t.value}-${E}`]=g[E]);return v},cssVarName:g=>`--${t.value}-${g}`,cssVarBlock:g=>{const v={};for(const E in g)g[E]&&(v[`--${t.value}-${n}-${E}`]=g[E]);return v},cssVarBlockName:g=>`--${t.value}-${n}-${g}`}};/**
70
+ * @vue/shared v3.5.19
71
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
72
+ * @license MIT
73
+ **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const dn=()=>{},qa=Object.prototype.hasOwnProperty,Or=(n,e)=>qa.call(n,e),Ka=Array.isArray,wi=n=>typeof n=="function",un=n=>typeof n=="string",pn=n=>n!==null&&typeof n=="object";var Ya=typeof global=="object"&&global&&global.Object===Object&&global,Xa=typeof self=="object"&&self&&self.Object===Object&&self,hn=Ya||Xa||Function("return this")(),Ye=hn.Symbol,Nr=Object.prototype,Za=Nr.hasOwnProperty,Qa=Nr.toString,Bt=Ye?Ye.toStringTag:void 0;function Ja(n){var e=Za.call(n,Bt),t=n[Bt];try{n[Bt]=void 0;var i=!0}catch{}var r=Qa.call(n);return i&&(e?n[Bt]=t:delete n[Bt]),r}var el=Object.prototype,tl=el.toString;function il(n){return tl.call(n)}var nl="[object Null]",rl="[object Undefined]",Dr=Ye?Ye.toStringTag:void 0;function fn(n){return n==null?n===void 0?rl:nl:Dr&&Dr in Object(n)?Ja(n):il(n)}function gn(n){return n!=null&&typeof n=="object"}var sl="[object Symbol]";function mn(n){return typeof n=="symbol"||gn(n)&&fn(n)==sl}function ol(n,e){for(var t=-1,i=n==null?0:n.length,r=Array(i);++t<i;)r[t]=e(n[t],t,n);return r}var Ht=Array.isArray,Pr=Ye?Ye.prototype:void 0,Ir=Pr?Pr.toString:void 0;function Lr(n){if(typeof n=="string")return n;if(Ht(n))return ol(n,Lr)+"";if(mn(n))return Ir?Ir.call(n):"";var e=n+"";return e=="0"&&1/n==-1/0?"-0":e}function Ei(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function al(n){return n}var ll="[object AsyncFunction]",cl="[object Function]",dl="[object GeneratorFunction]",ul="[object Proxy]";function pl(n){if(!Ei(n))return!1;var e=fn(n);return e==cl||e==dl||e==ll||e==ul}var yn=hn["__core-js_shared__"],Mr=(function(){var n=/[^.]+$/.exec(yn&&yn.keys&&yn.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function hl(n){return!!Mr&&Mr in n}var fl=Function.prototype,gl=fl.toString;function ml(n){if(n!=null){try{return gl.call(n)}catch{}try{return n+""}catch{}}return""}var yl=/[\\^$.*+?()[\]{}|]/g,_l=/^\[object .+?Constructor\]$/,bl=Function.prototype,wl=Object.prototype,El=bl.toString,xl=wl.hasOwnProperty,vl=RegExp("^"+El.call(xl).replace(yl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kl(n){if(!Ei(n)||hl(n))return!1;var e=pl(n)?vl:_l;return e.test(ml(n))}function Tl(n,e){return n?.[e]}function _n(n,e){var t=Tl(n,e);return kl(t)?t:void 0}function Cl(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}var Sl=800,Rl=16,Al=Date.now;function Ol(n){var e=0,t=0;return function(){var i=Al(),r=Rl-(i-t);if(t=i,r>0){if(++e>=Sl)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function Nl(n){return function(){return n}}var xi=(function(){try{var n=_n(Object,"defineProperty");return n({},"",{}),n}catch{}})(),Dl=xi?function(n,e){return xi(n,"toString",{configurable:!0,enumerable:!1,value:Nl(e),writable:!0})}:al,Pl=Ol(Dl),Il=9007199254740991,Ll=/^(?:0|[1-9]\d*)$/;function zr(n,e){var t=typeof n;return e=e??Il,!!e&&(t=="number"||t!="symbol"&&Ll.test(n))&&n>-1&&n%1==0&&n<e}function Ml(n,e,t){e=="__proto__"&&xi?xi(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function $r(n,e){return n===e||n!==n&&e!==e}var zl=Object.prototype,$l=zl.hasOwnProperty;function Bl(n,e,t){var i=n[e];(!($l.call(n,e)&&$r(i,t))||t===void 0&&!(e in n))&&Ml(n,e,t)}var Br=Math.max;function Hl(n,e,t){return e=Br(e===void 0?n.length-1:e,0),function(){for(var i=arguments,r=-1,s=Br(i.length-e,0),a=Array(s);++r<s;)a[r]=i[e+r];r=-1;for(var l=Array(e+1);++r<e;)l[r]=i[r];return l[e]=t(a),Cl(n,this,l)}}var Fl=9007199254740991;function Ul(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Fl}var Vl="[object Arguments]";function Hr(n){return gn(n)&&fn(n)==Vl}var Fr=Object.prototype,Wl=Fr.hasOwnProperty,Gl=Fr.propertyIsEnumerable,Ur=Hr((function(){return arguments})())?Hr:function(n){return gn(n)&&Wl.call(n,"callee")&&!Gl.call(n,"callee")},jl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ql=/^\w*$/;function Kl(n,e){if(Ht(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||mn(n)?!0:ql.test(n)||!jl.test(n)||e!=null&&n in Object(e)}var Ft=_n(Object,"create");function Yl(){this.__data__=Ft?Ft(null):{},this.size=0}function Xl(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var Zl="__lodash_hash_undefined__",Ql=Object.prototype,Jl=Ql.hasOwnProperty;function ec(n){var e=this.__data__;if(Ft){var t=e[n];return t===Zl?void 0:t}return Jl.call(e,n)?e[n]:void 0}var tc=Object.prototype,ic=tc.hasOwnProperty;function nc(n){var e=this.__data__;return Ft?e[n]!==void 0:ic.call(e,n)}var rc="__lodash_hash_undefined__";function sc(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Ft&&e===void 0?rc:e,this}function nt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}nt.prototype.clear=Yl,nt.prototype.delete=Xl,nt.prototype.get=ec,nt.prototype.has=nc,nt.prototype.set=sc;function oc(){this.__data__=[],this.size=0}function vi(n,e){for(var t=n.length;t--;)if($r(n[t][0],e))return t;return-1}var ac=Array.prototype,lc=ac.splice;function cc(n){var e=this.__data__,t=vi(e,n);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():lc.call(e,t,1),--this.size,!0}function dc(n){var e=this.__data__,t=vi(e,n);return t<0?void 0:e[t][1]}function uc(n){return vi(this.__data__,n)>-1}function pc(n,e){var t=this.__data__,i=vi(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}function ut(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}ut.prototype.clear=oc,ut.prototype.delete=cc,ut.prototype.get=dc,ut.prototype.has=uc,ut.prototype.set=pc;var hc=_n(hn,"Map");function fc(){this.size=0,this.__data__={hash:new nt,map:new(hc||ut),string:new nt}}function gc(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function ki(n,e){var t=n.__data__;return gc(e)?t[typeof e=="string"?"string":"hash"]:t.map}function mc(n){var e=ki(this,n).delete(n);return this.size-=e?1:0,e}function yc(n){return ki(this,n).get(n)}function _c(n){return ki(this,n).has(n)}function bc(n,e){var t=ki(this,n),i=t.size;return t.set(n,e),this.size+=t.size==i?0:1,this}function rt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}rt.prototype.clear=fc,rt.prototype.delete=mc,rt.prototype.get=yc,rt.prototype.has=_c,rt.prototype.set=bc;var wc="Expected a function";function bn(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(wc);var t=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=t.cache;if(s.has(r))return s.get(r);var a=n.apply(this,i);return t.cache=s.set(r,a)||s,a};return t.cache=new(bn.Cache||rt),t}bn.Cache=rt;var Ec=500;function xc(n){var e=bn(n,function(i){return t.size===Ec&&t.clear(),i}),t=e.cache;return e}var vc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kc=/\\(\\)?/g,Tc=xc(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(vc,function(t,i,r,s){e.push(r?s.replace(kc,"$1"):i||t)}),e});function Cc(n){return n==null?"":Lr(n)}function Ti(n,e){return Ht(n)?n:Kl(n,e)?[n]:Tc(Cc(n))}function wn(n){if(typeof n=="string"||mn(n))return n;var e=n+"";return e=="0"&&1/n==-1/0?"-0":e}function Sc(n,e){e=Ti(e,n);for(var t=0,i=e.length;n!=null&&t<i;)n=n[wn(e[t++])];return t&&t==i?n:void 0}function Rc(n,e){for(var t=-1,i=e.length,r=n.length;++t<i;)n[r+t]=e[t];return n}var Vr=Ye?Ye.isConcatSpreadable:void 0;function Ac(n){return Ht(n)||Ur(n)||!!(Vr&&n&&n[Vr])}function Oc(n,e,t,i,r){var s=-1,a=n.length;for(t||(t=Ac),r||(r=[]);++s<a;){var l=n[s];t(l)?Rc(r,l):r[r.length]=l}return r}function Nc(n){var e=n==null?0:n.length;return e?Oc(n):[]}function Dc(n){return Pl(Hl(n,void 0,Nc),n+"")}function Pc(n,e){return n!=null&&e in Object(n)}function Ic(n,e,t){e=Ti(e,n);for(var i=-1,r=e.length,s=!1;++i<r;){var a=wn(e[i]);if(!(s=n!=null&&t(n,a)))break;n=n[a]}return s||++i!=r?s:(r=n==null?0:n.length,!!r&&Ul(r)&&zr(a,r)&&(Ht(n)||Ur(n)))}function Lc(n,e){return n!=null&&Ic(n,e,Pc)}function En(n){for(var e=-1,t=n==null?0:n.length,i={};++e<t;){var r=n[e];i[r[0]]=r[1]}return i}function xn(n){return n==null}function Mc(n){return n===void 0}function zc(n,e,t,i){if(!Ei(n))return n;e=Ti(e,n);for(var r=-1,s=e.length,a=s-1,l=n;l!=null&&++r<s;){var d=wn(e[r]),c=t;if(d==="__proto__"||d==="constructor"||d==="prototype")return n;if(r!=a){var u=l[d];c=void 0,c===void 0&&(c=Ei(u)?u:zr(e[r+1])?[]:{})}Bl(l,d,c),l=l[d]}return n}function $c(n,e,t){for(var i=-1,r=e.length,s={};++i<r;){var a=e[i],l=Sc(n,a);t(l,a)&&zc(s,Ti(a,n),l)}return s}function Bc(n,e){return $c(n,e,function(t,i){return Lc(n,i)})}var Hc=Dc(function(n,e){return n==null?{}:Bc(n,e)});const Fc=n=>n===void 0,Wr=n=>typeof n=="boolean",Ut=n=>typeof n=="number",st=n=>typeof Element>"u"?!1:n instanceof Element,Uc=n=>un(n)?!Number.isNaN(Number(n)):!1;var Vc=Object.defineProperty,Wc=Object.defineProperties,Gc=Object.getOwnPropertyDescriptors,Gr=Object.getOwnPropertySymbols,jc=Object.prototype.hasOwnProperty,qc=Object.prototype.propertyIsEnumerable,jr=(n,e,t)=>e in n?Vc(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Kc=(n,e)=>{for(var t in e||(e={}))jc.call(e,t)&&jr(n,t,e[t]);if(Gr)for(var t of Gr(e))qc.call(e,t)&&jr(n,t,e[t]);return n},Yc=(n,e)=>Wc(n,Gc(e));function qr(n,e){var t;const i=o.shallowRef();return o.watchEffect(()=>{i.value=n()},Yc(Kc({},e),{flush:(t=void 0)!=null?t:"sync"})),o.readonly(i)}var Kr;const ke=typeof window<"u",Xc=n=>typeof n=="string",Yr=()=>{},Zc=ke&&((Kr=window?.navigator)==null?void 0:Kr.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Xr(n){return typeof n=="function"?n():o.unref(n)}function Qc(n){return n}function Zr(n){return o.getCurrentScope()?(o.onScopeDispose(n),!0):!1}function ot(n){var e;const t=Xr(n);return(e=t?.$el)!=null?e:t}const Qr=ke?window:void 0;function vn(...n){let e,t,i,r;if(Xc(n[0])||Array.isArray(n[0])?([t,i,r]=n,e=Qr):[e,t,i,r]=n,!e)return Yr;Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);const s=[],a=()=>{s.forEach(u=>u()),s.length=0},l=(u,p,h,y)=>(u.addEventListener(p,h,y),()=>u.removeEventListener(p,h,y)),d=o.watch(()=>[ot(e),Xr(r)],([u,p])=>{a(),u&&s.push(...t.flatMap(h=>i.map(y=>l(u,h,y,p))))},{immediate:!0,flush:"post"}),c=()=>{d(),a()};return Zr(c),c}let Jr=!1;function Jc(n,e,t={}){const{window:i=Qr,ignore:r=[],capture:s=!0,detectIframe:a=!1}=t;if(!i)return;Zc&&!Jr&&(Jr=!0,Array.from(i.document.body.children).forEach(h=>h.addEventListener("click",Yr)));let l=!0;const d=h=>r.some(y=>{if(typeof y=="string")return Array.from(i.document.querySelectorAll(y)).some(m=>m===h.target||h.composedPath().includes(m));{const m=ot(y);return m&&(h.target===m||h.composedPath().includes(m))}}),u=[vn(i,"click",h=>{const y=ot(n);if(!(!y||y===h.target||h.composedPath().includes(y))){if(h.detail===0&&(l=!d(h)),!l){l=!0;return}e(h)}},{passive:!0,capture:s}),vn(i,"pointerdown",h=>{const y=ot(n);y&&(l=!h.composedPath().includes(y)&&!d(h))},{passive:!0}),a&&vn(i,"blur",h=>{var y;const m=ot(n);((y=i.document.activeElement)==null?void 0:y.tagName)==="IFRAME"&&!m?.contains(i.document.activeElement)&&e(h)})].filter(Boolean);return()=>u.forEach(h=>h())}const es=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ts="__vueuse_ssr_handlers__";es[ts]=es[ts]||{};var is;(function(n){n.UP="UP",n.RIGHT="RIGHT",n.DOWN="DOWN",n.LEFT="LEFT",n.NONE="NONE"})(is||(is={}));var ed=Object.defineProperty,ns=Object.getOwnPropertySymbols,td=Object.prototype.hasOwnProperty,id=Object.prototype.propertyIsEnumerable,rs=(n,e,t)=>e in n?ed(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,nd=(n,e)=>{for(var t in e||(e={}))td.call(e,t)&&rs(n,t,e[t]);if(ns)for(var t of ns(e))id.call(e,t)&&rs(n,t,e[t]);return n};nd({linear:Qc},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const ss={current:0},os=o.ref(0),rd=2e3,as=Symbol("elZIndexContextKey"),sd=Symbol("zIndexContextKey"),od=n=>{const e=o.getCurrentInstance()?o.inject(as,ss):ss,t=o.getCurrentInstance()?o.inject(sd,void 0):void 0,i=o.computed(()=>{const a=o.unref(t);return Ut(a)?a:rd}),r=o.computed(()=>i.value+os.value),s=()=>(e.current++,os.value=e.current,r.value);return!ke&&o.inject(as),{initialZIndex:i,currentZIndex:r,nextZIndex:s}},ls="__epPropKey",V=n=>n,ad=n=>pn(n)&&!!n[ls],Ci=(n,e)=>{if(!pn(n)||ad(n))return n;const{values:t,required:i,default:r,type:s,validator:a}=n,d={type:s,required:!!i,validator:t||a?c=>{let u=!1,p=[];if(t&&(p=Array.from(t),Or(n,"default")&&p.push(r),u||(u=p.includes(c))),a&&(u||(u=a(c))),!u&&p.length>0){const h=[...new Set(p)].map(y=>JSON.stringify(y)).join(", ");o.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${h}], got value ${JSON.stringify(c)}.`)}return u}:void 0,[ls]:!0};return Or(n,"default")&&(d.default=r),d},ue=n=>En(Object.entries(n).map(([e,t])=>[e,Ci(t,e)])),cs=["","default","small","large"];Ci({type:String,values:cs,required:!1});const ld=Symbol("size"),cd=()=>{const n=o.inject(ld,{});return o.computed(()=>o.unref(n.size)||"")};var _e=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t};function dd(n,e="px"){if(!n)return"";if(Ut(n)||Uc(n))return`${n}${e}`;if(un(n))return n}const Vt=(n,e)=>(n.install=t=>{for(const i of[n,...Object.values({})])t.component(i.name,i)},n),ud=ue({size:{type:V([Number,String])},color:{type:String}}),pd=o.defineComponent({name:"ElIcon",inheritAttrs:!1}),hd=o.defineComponent({...pd,props:ud,setup(n){const e=n,t=Ke("icon"),i=o.computed(()=>{const{size:r,color:s}=e;return!r&&!s?{}:{fontSize:Fc(r)?void 0:dd(r),"--color":s}});return(r,s)=>(o.openBlock(),o.createElementBlock("i",o.mergeProps({class:o.unref(t).b(),style:o.unref(i)},r.$attrs),[o.renderSlot(r.$slots,"default")],16))}});var fd=_e(hd,[["__file","icon.vue"]]);const ds=Vt(fd);function us(){let n;const e=(i,r)=>{t(),n=window.setTimeout(i,r)},t=()=>window.clearTimeout(n);return Zr(()=>t()),{registerTimeout:e,cancelTimeout:t}}const gd=ue({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),md=({showAfter:n,hideAfter:e,autoClose:t,open:i,close:r})=>{const{registerTimeout:s}=us(),{registerTimeout:a,cancelTimeout:l}=us();return{onOpen:u=>{s(()=>{i(u);const p=o.unref(t);Ut(p)&&p>0&&a(()=>{r(u)},p)},o.unref(n))},onClose:u=>{l(),s(()=>{r(u)},o.unref(e))}}},yd=ue({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),ps=n=>Hc(yd,n),hs={prefix:Math.floor(Math.random()*1e4),current:0},_d=Symbol("elIdInjection"),fs=()=>o.getCurrentInstance()?o.inject(_d,hs):hs,bd=n=>{const e=fs(),t=cn();return qr(()=>o.unref(n)||`${t.value}-id-${e.prefix}-${e.current++}`)},wd=Symbol("formContextKey"),kn=Symbol("formItemContextKey"),Ed=n=>{const e=o.getCurrentInstance();return o.computed(()=>{var t,i;return(i=(t=e?.proxy)==null?void 0:t.$props)==null?void 0:i[n]})},xd=(n,e={})=>{const t=o.ref(void 0),i=e.prop?t:Ed("size"),r=e.global?t:cd(),s=e.form?{size:void 0}:o.inject(wd,void 0),a=e.formItem?{size:void 0}:o.inject(kn,void 0);return o.computed(()=>i.value||o.unref(n)||a?.size||s?.size||r.value||"")},Tn=n=>{if(n.tabIndex>0||n.tabIndex===0&&n.getAttribute("tabIndex")!==null)return!0;if(n.tabIndex<0||n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true")return!1;switch(n.nodeName){case"A":return!!n.href&&n.rel!=="ignore";case"INPUT":return!(n.type==="hidden"||n.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},Cn=Symbol("popper"),gs=Symbol("popperContent"),ms=ue({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),vd=o.defineComponent({name:"ElPopper",inheritAttrs:!1}),kd=o.defineComponent({...vd,props:ms,setup(n,{expose:e}){const t=n,i=o.ref(),r=o.ref(),s=o.ref(),a=o.ref(),l=o.computed(()=>t.role),d={triggerRef:i,popperInstanceRef:r,contentRef:s,referenceRef:a,role:l};return e(d),o.provide(Cn,d),(c,u)=>o.renderSlot(c.$slots,"default")}});var Td=_e(kd,[["__file","popper.vue"]]);const Cd=o.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),Sd=o.defineComponent({...Cd,setup(n,{expose:e}){const t=Ke("popper"),{arrowRef:i,arrowStyle:r}=o.inject(gs,void 0);return o.onBeforeUnmount(()=>{i.value=void 0}),e({arrowRef:i}),(s,a)=>(o.openBlock(),o.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:o.normalizeClass(o.unref(t).e("arrow")),style:o.normalizeStyle(o.unref(r)),"data-popper-arrow":""},null,6))}});var Rd=_e(Sd,[["__file","arrow.vue"]]);const ys=ue({virtualRef:{type:V(Object)},virtualTriggering:Boolean,onMouseenter:{type:V(Function)},onMouseleave:{type:V(Function)},onClick:{type:V(Function)},onKeydown:{type:V(Function)},onFocus:{type:V(Function)},onBlur:{type:V(Function)},onContextmenu:{type:V(Function)},id:String,open:Boolean}),_s=Symbol("elForwardRef"),Ad=n=>{const e=t=>{n.value=t};o.provide(_s,{setForwardRef:e})},Od=n=>({mounted(e){n(e)},updated(e){n(e)},unmounted(){n(null)}}),Nd=o.defineComponent({name:"ElOnlyChild",setup(n,{slots:e,attrs:t}){var i;const r=o.inject(_s),s=Od((i=r?.setForwardRef)!=null?i:dn);return()=>{var a;const l=(a=e.default)==null?void 0:a.call(e,t);if(!l||l.length>1)return null;const d=bs(l);return d?o.withDirectives(o.cloneVNode(d,t),[[s]]):null}}});function bs(n){if(!n)return null;const e=n;for(const t of e){if(pn(t))switch(t.type){case o.Comment:continue;case o.Text:case"svg":return ws(t);case o.Fragment:return bs(t.children);default:return t}return ws(t)}return null}function ws(n){const e=Ke("only-child");return o.createVNode("span",{class:e.e("content")},[n])}const Dd=o.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),Pd=o.defineComponent({...Dd,props:ys,setup(n,{expose:e}){const t=n,{role:i,triggerRef:r}=o.inject(Cn,void 0);Ad(r);const s=o.computed(()=>l.value?t.id:void 0),a=o.computed(()=>{if(i&&i.value==="tooltip")return t.open&&t.id?t.id:void 0}),l=o.computed(()=>{if(i&&i.value!=="tooltip")return i.value}),d=o.computed(()=>l.value?`${t.open}`:void 0);let c;const u=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return o.onMounted(()=>{o.watch(()=>t.virtualRef,p=>{p&&(r.value=ot(p))},{immediate:!0}),o.watch(r,(p,h)=>{c?.(),c=void 0,st(p)&&(u.forEach(y=>{var m;const g=t[y];g&&(p.addEventListener(y.slice(2).toLowerCase(),g),(m=h?.removeEventListener)==null||m.call(h,y.slice(2).toLowerCase(),g))}),Tn(p)&&(c=o.watch([s,a,l,d],y=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((m,g)=>{xn(y[g])?p.removeAttribute(m):p.setAttribute(m,y[g])})},{immediate:!0}))),st(h)&&Tn(h)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(y=>h.removeAttribute(y))},{immediate:!0})}),o.onBeforeUnmount(()=>{if(c?.(),c=void 0,r.value&&st(r.value)){const p=r.value;u.forEach(h=>{const y=t[h];y&&p.removeEventListener(h.slice(2).toLowerCase(),y)}),r.value=void 0}}),e({triggerRef:r}),(p,h)=>p.virtualTriggering?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createBlock(o.unref(Nd),o.mergeProps({key:0},p.$attrs,{"aria-controls":o.unref(s),"aria-describedby":o.unref(a),"aria-expanded":o.unref(d),"aria-haspopup":o.unref(l)}),{default:o.withCtx(()=>[o.renderSlot(p.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var Id=_e(Pd,[["__file","trigger.vue"]]);const Sn="focus-trap.focus-after-trapped",Rn="focus-trap.focus-after-released",Ld="focus-trap.focusout-prevented",Es={cancelable:!0,bubbles:!1},Md={cancelable:!0,bubbles:!1},xs="focusAfterTrapped",vs="focusAfterReleased",zd=Symbol("elFocusTrap"),An=o.ref(),Si=o.ref(0),On=o.ref(0);let Ri=0;const ks=n=>{const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0||i===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},Ts=(n,e)=>{for(const t of n)if(!$d(t,e))return t},$d=(n,e)=>{if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},Bd=n=>{const e=ks(n),t=Ts(e,n),i=Ts(e.reverse(),n);return[t,i]},Hd=n=>n instanceof HTMLInputElement&&"select"in n,Le=(n,e)=>{if(n&&n.focus){const t=document.activeElement;let i=!1;st(n)&&!Tn(n)&&!n.getAttribute("tabindex")&&(n.setAttribute("tabindex","-1"),i=!0),n.focus({preventScroll:!0}),On.value=window.performance.now(),n!==t&&Hd(n)&&e&&n.select(),st(n)&&i&&n.removeAttribute("tabindex")}};function Cs(n,e){const t=[...n],i=n.indexOf(e);return i!==-1&&t.splice(i,1),t}const Fd=()=>{let n=[];return{push:i=>{const r=n[0];r&&i!==r&&r.pause(),n=Cs(n,i),n.unshift(i)},remove:i=>{var r,s;n=Cs(n,i),(s=(r=n[0])==null?void 0:r.resume)==null||s.call(r)}}},Ud=(n,e=!1)=>{const t=document.activeElement;for(const i of n)if(Le(i,e),document.activeElement!==t)return},Ss=Fd(),Vd=()=>Si.value>On.value,Ai=()=>{An.value="pointer",Si.value=window.performance.now()},Rs=()=>{An.value="keyboard",Si.value=window.performance.now()},Wd=()=>(o.onMounted(()=>{Ri===0&&(document.addEventListener("mousedown",Ai),document.addEventListener("touchstart",Ai),document.addEventListener("keydown",Rs)),Ri++}),o.onBeforeUnmount(()=>{Ri--,Ri<=0&&(document.removeEventListener("mousedown",Ai),document.removeEventListener("touchstart",Ai),document.removeEventListener("keydown",Rs))}),{focusReason:An,lastUserFocusTimestamp:Si,lastAutomatedFocusTimestamp:On}),Oi=n=>new CustomEvent(Ld,{...Md,detail:n}),Wt={tab:"Tab",enter:"Enter",space:"Space",esc:"Escape",numpadEnter:"NumpadEnter"};let pt=[];const As=n=>{n.code===Wt.esc&&pt.forEach(e=>e(n))},Gd=n=>{o.onMounted(()=>{pt.length===0&&document.addEventListener("keydown",As),ke&&pt.push(n)}),o.onBeforeUnmount(()=>{pt=pt.filter(e=>e!==n),pt.length===0&&ke&&document.removeEventListener("keydown",As)})},jd=o.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[xs,vs,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=o.ref();let i,r;const{focusReason:s}=Wd();Gd(m=>{n.trapped&&!a.paused&&e("release-requested",m)});const a={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=m=>{if(!n.loop&&!n.trapped||a.paused)return;const{code:g,altKey:v,ctrlKey:E,metaKey:C,currentTarget:w,shiftKey:b}=m,{loop:x}=n,N=g===Wt.tab&&!v&&!E&&!C,S=document.activeElement;if(N&&S){const P=w,[R,k]=Bd(P);if(R&&k){if(!b&&S===k){const M=Oi({focusReason:s.value});e("focusout-prevented",M),M.defaultPrevented||(m.preventDefault(),x&&Le(R,!0))}else if(b&&[R,P].includes(S)){const M=Oi({focusReason:s.value});e("focusout-prevented",M),M.defaultPrevented||(m.preventDefault(),x&&Le(k,!0))}}else if(S===P){const M=Oi({focusReason:s.value});e("focusout-prevented",M),M.defaultPrevented||m.preventDefault()}}};o.provide(zd,{focusTrapRef:t,onKeydown:l}),o.watch(()=>n.focusTrapEl,m=>{m&&(t.value=m)},{immediate:!0}),o.watch([t],([m],[g])=>{m&&(m.addEventListener("keydown",l),m.addEventListener("focusin",u),m.addEventListener("focusout",p)),g&&(g.removeEventListener("keydown",l),g.removeEventListener("focusin",u),g.removeEventListener("focusout",p))});const d=m=>{e(xs,m)},c=m=>e(vs,m),u=m=>{const g=o.unref(t);if(!g)return;const v=m.target,E=m.relatedTarget,C=v&&g.contains(v);n.trapped||E&&g.contains(E)||(i=E),C&&e("focusin",m),!a.paused&&n.trapped&&(C?r=v:Le(r,!0))},p=m=>{const g=o.unref(t);if(!(a.paused||!g))if(n.trapped){const v=m.relatedTarget;!xn(v)&&!g.contains(v)&&setTimeout(()=>{if(!a.paused&&n.trapped){const E=Oi({focusReason:s.value});e("focusout-prevented",E),E.defaultPrevented||Le(r,!0)}},0)}else{const v=m.target;v&&g.contains(v)||e("focusout",m)}};async function h(){await o.nextTick();const m=o.unref(t);if(m){Ss.push(a);const g=m.contains(document.activeElement)?i:document.activeElement;if(i=g,!m.contains(g)){const E=new Event(Sn,Es);m.addEventListener(Sn,d),m.dispatchEvent(E),E.defaultPrevented||o.nextTick(()=>{let C=n.focusStartEl;un(C)||(Le(C),document.activeElement!==C&&(C="first")),C==="first"&&Ud(ks(m),!0),(document.activeElement===g||C==="container")&&Le(m)})}}}function y(){const m=o.unref(t);if(m){m.removeEventListener(Sn,d);const g=new CustomEvent(Rn,{...Es,detail:{focusReason:s.value}});m.addEventListener(Rn,c),m.dispatchEvent(g),!g.defaultPrevented&&(s.value=="keyboard"||!Vd()||m.contains(document.activeElement))&&Le(i??document.body),m.removeEventListener(Rn,c),Ss.remove(a)}}return o.onMounted(()=>{n.trapped&&h(),o.watch(()=>n.trapped,m=>{m?h():y()})}),o.onBeforeUnmount(()=>{n.trapped&&y(),t.value&&(t.value.removeEventListener("keydown",l),t.value.removeEventListener("focusin",u),t.value.removeEventListener("focusout",p),t.value=void 0)}),{onKeydown:l}}});function qd(n,e,t,i,r,s){return o.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var Kd=_e(jd,[["render",qd],["__file","focus-trap.vue"]]),ae="top",he="bottom",fe="right",le="left",Nn="auto",Gt=[ae,he,fe,le],ht="start",jt="end",Yd="clippingParents",Os="viewport",qt="popper",Xd="reference",Ns=Gt.reduce(function(n,e){return n.concat([e+"-"+ht,e+"-"+jt])},[]),Dn=[].concat(Gt,[Nn]).reduce(function(n,e){return n.concat([e,e+"-"+ht,e+"-"+jt])},[]),Zd="beforeRead",Qd="read",Jd="afterRead",eu="beforeMain",tu="main",iu="afterMain",nu="beforeWrite",ru="write",su="afterWrite",ou=[Zd,Qd,Jd,eu,tu,iu,nu,ru,su];function Te(n){return n?(n.nodeName||"").toLowerCase():null}function be(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function ft(n){var e=be(n).Element;return n instanceof e||n instanceof Element}function ge(n){var e=be(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Pn(n){if(typeof ShadowRoot>"u")return!1;var e=be(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function au(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},s=e.elements[t];!ge(s)||!Te(s)||(Object.assign(s.style,i),Object.keys(r).forEach(function(a){var l=r[a];l===!1?s.removeAttribute(a):s.setAttribute(a,l===!0?"":l)}))})}function lu(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],s=e.attributes[i]||{},a=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),l=a.reduce(function(d,c){return d[c]="",d},{});!ge(r)||!Te(r)||(Object.assign(r.style,l),Object.keys(s).forEach(function(d){r.removeAttribute(d)}))})}}var Ds={name:"applyStyles",enabled:!0,phase:"write",fn:au,effect:lu,requires:["computeStyles"]};function Ce(n){return n.split("-")[0]}var at=Math.max,Ni=Math.min,gt=Math.round;function mt(n,e){e===void 0&&(e=!1);var t=n.getBoundingClientRect(),i=1,r=1;if(ge(n)&&e){var s=n.offsetHeight,a=n.offsetWidth;a>0&&(i=gt(t.width)/a||1),s>0&&(r=gt(t.height)/s||1)}return{width:t.width/i,height:t.height/r,top:t.top/r,right:t.right/i,bottom:t.bottom/r,left:t.left/i,x:t.left/i,y:t.top/r}}function In(n){var e=mt(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function Ps(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Pn(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Me(n){return be(n).getComputedStyle(n)}function cu(n){return["table","td","th"].indexOf(Te(n))>=0}function Xe(n){return((ft(n)?n.ownerDocument:n.document)||window.document).documentElement}function Di(n){return Te(n)==="html"?n:n.assignedSlot||n.parentNode||(Pn(n)?n.host:null)||Xe(n)}function Is(n){return!ge(n)||Me(n).position==="fixed"?null:n.offsetParent}function du(n){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&ge(n)){var i=Me(n);if(i.position==="fixed")return null}var r=Di(n);for(Pn(r)&&(r=r.host);ge(r)&&["html","body"].indexOf(Te(r))<0;){var s=Me(r);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return r;r=r.parentNode}return null}function Kt(n){for(var e=be(n),t=Is(n);t&&cu(t)&&Me(t).position==="static";)t=Is(t);return t&&(Te(t)==="html"||Te(t)==="body"&&Me(t).position==="static")?e:t||du(n)||e}function Ln(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Yt(n,e,t){return at(n,Ni(e,t))}function uu(n,e,t){var i=Yt(n,e,t);return i>t?t:i}function Ls(){return{top:0,right:0,bottom:0,left:0}}function Ms(n){return Object.assign({},Ls(),n)}function zs(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var pu=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,Ms(typeof n!="number"?n:zs(n,Gt))};function hu(n){var e,t=n.state,i=n.name,r=n.options,s=t.elements.arrow,a=t.modifiersData.popperOffsets,l=Ce(t.placement),d=Ln(l),c=[le,fe].indexOf(l)>=0,u=c?"height":"width";if(!(!s||!a)){var p=pu(r.padding,t),h=In(s),y=d==="y"?ae:le,m=d==="y"?he:fe,g=t.rects.reference[u]+t.rects.reference[d]-a[d]-t.rects.popper[u],v=a[d]-t.rects.reference[d],E=Kt(s),C=E?d==="y"?E.clientHeight||0:E.clientWidth||0:0,w=g/2-v/2,b=p[y],x=C-h[u]-p[m],N=C/2-h[u]/2+w,S=Yt(b,N,x),P=d;t.modifiersData[i]=(e={},e[P]=S,e.centerOffset=S-N,e)}}function fu(n){var e=n.state,t=n.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||!Ps(e.elements.popper,r)||(e.elements.arrow=r))}var gu={name:"arrow",enabled:!0,phase:"main",fn:hu,effect:fu,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function yt(n){return n.split("-")[1]}var mu={top:"auto",right:"auto",bottom:"auto",left:"auto"};function yu(n){var e=n.x,t=n.y,i=window,r=i.devicePixelRatio||1;return{x:gt(e*r)/r||0,y:gt(t*r)/r||0}}function $s(n){var e,t=n.popper,i=n.popperRect,r=n.placement,s=n.variation,a=n.offsets,l=n.position,d=n.gpuAcceleration,c=n.adaptive,u=n.roundOffsets,p=n.isFixed,h=a.x,y=h===void 0?0:h,m=a.y,g=m===void 0?0:m,v=typeof u=="function"?u({x:y,y:g}):{x:y,y:g};y=v.x,g=v.y;var E=a.hasOwnProperty("x"),C=a.hasOwnProperty("y"),w=le,b=ae,x=window;if(c){var N=Kt(t),S="clientHeight",P="clientWidth";if(N===be(t)&&(N=Xe(t),Me(N).position!=="static"&&l==="absolute"&&(S="scrollHeight",P="scrollWidth")),N=N,r===ae||(r===le||r===fe)&&s===jt){b=he;var R=p&&N===x&&x.visualViewport?x.visualViewport.height:N[S];g-=R-i.height,g*=d?1:-1}if(r===le||(r===ae||r===he)&&s===jt){w=fe;var k=p&&N===x&&x.visualViewport?x.visualViewport.width:N[P];y-=k-i.width,y*=d?1:-1}}var A=Object.assign({position:l},c&&mu),M=u===!0?yu({x:y,y:g}):{x:y,y:g};if(y=M.x,g=M.y,d){var U;return Object.assign({},A,(U={},U[b]=C?"0":"",U[w]=E?"0":"",U.transform=(x.devicePixelRatio||1)<=1?"translate("+y+"px, "+g+"px)":"translate3d("+y+"px, "+g+"px, 0)",U))}return Object.assign({},A,(e={},e[b]=C?g+"px":"",e[w]=E?y+"px":"",e.transform="",e))}function _u(n){var e=n.state,t=n.options,i=t.gpuAcceleration,r=i===void 0?!0:i,s=t.adaptive,a=s===void 0?!0:s,l=t.roundOffsets,d=l===void 0?!0:l,c={placement:Ce(e.placement),variation:yt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,$s(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:d})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,$s(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Bs={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:_u,data:{}},Pi={passive:!0};function bu(n){var e=n.state,t=n.instance,i=n.options,r=i.scroll,s=r===void 0?!0:r,a=i.resize,l=a===void 0?!0:a,d=be(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(u){u.addEventListener("scroll",t.update,Pi)}),l&&d.addEventListener("resize",t.update,Pi),function(){s&&c.forEach(function(u){u.removeEventListener("scroll",t.update,Pi)}),l&&d.removeEventListener("resize",t.update,Pi)}}var Hs={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:bu,data:{}},wu={left:"right",right:"left",bottom:"top",top:"bottom"};function Ii(n){return n.replace(/left|right|bottom|top/g,function(e){return wu[e]})}var Eu={start:"end",end:"start"};function Fs(n){return n.replace(/start|end/g,function(e){return Eu[e]})}function Mn(n){var e=be(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function zn(n){return mt(Xe(n)).left+Mn(n).scrollLeft}function xu(n){var e=be(n),t=Xe(n),i=e.visualViewport,r=t.clientWidth,s=t.clientHeight,a=0,l=0;return i&&(r=i.width,s=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=i.offsetLeft,l=i.offsetTop)),{width:r,height:s,x:a+zn(n),y:l}}function vu(n){var e,t=Xe(n),i=Mn(n),r=(e=n.ownerDocument)==null?void 0:e.body,s=at(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=at(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-i.scrollLeft+zn(n),d=-i.scrollTop;return Me(r||t).direction==="rtl"&&(l+=at(t.clientWidth,r?r.clientWidth:0)-s),{width:s,height:a,x:l,y:d}}function $n(n){var e=Me(n),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function Us(n){return["html","body","#document"].indexOf(Te(n))>=0?n.ownerDocument.body:ge(n)&&$n(n)?n:Us(Di(n))}function Xt(n,e){var t;e===void 0&&(e=[]);var i=Us(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),s=be(i),a=r?[s].concat(s.visualViewport||[],$n(i)?i:[]):i,l=e.concat(a);return r?l:l.concat(Xt(Di(a)))}function Bn(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function ku(n){var e=mt(n);return e.top=e.top+n.clientTop,e.left=e.left+n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top,e}function Vs(n,e){return e===Os?Bn(xu(n)):ft(e)?ku(e):Bn(vu(Xe(n)))}function Tu(n){var e=Xt(Di(n)),t=["absolute","fixed"].indexOf(Me(n).position)>=0,i=t&&ge(n)?Kt(n):n;return ft(i)?e.filter(function(r){return ft(r)&&Ps(r,i)&&Te(r)!=="body"}):[]}function Cu(n,e,t){var i=e==="clippingParents"?Tu(n):[].concat(e),r=[].concat(i,[t]),s=r[0],a=r.reduce(function(l,d){var c=Vs(n,d);return l.top=at(c.top,l.top),l.right=Ni(c.right,l.right),l.bottom=Ni(c.bottom,l.bottom),l.left=at(c.left,l.left),l},Vs(n,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ws(n){var e=n.reference,t=n.element,i=n.placement,r=i?Ce(i):null,s=i?yt(i):null,a=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,d;switch(r){case ae:d={x:a,y:e.y-t.height};break;case he:d={x:a,y:e.y+e.height};break;case fe:d={x:e.x+e.width,y:l};break;case le:d={x:e.x-t.width,y:l};break;default:d={x:e.x,y:e.y}}var c=r?Ln(r):null;if(c!=null){var u=c==="y"?"height":"width";switch(s){case ht:d[c]=d[c]-(e[u]/2-t[u]/2);break;case jt:d[c]=d[c]+(e[u]/2-t[u]/2);break}}return d}function Zt(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?n.placement:i,s=t.boundary,a=s===void 0?Yd:s,l=t.rootBoundary,d=l===void 0?Os:l,c=t.elementContext,u=c===void 0?qt:c,p=t.altBoundary,h=p===void 0?!1:p,y=t.padding,m=y===void 0?0:y,g=Ms(typeof m!="number"?m:zs(m,Gt)),v=u===qt?Xd:qt,E=n.rects.popper,C=n.elements[h?v:u],w=Cu(ft(C)?C:C.contextElement||Xe(n.elements.popper),a,d),b=mt(n.elements.reference),x=Ws({reference:b,element:E,placement:r}),N=Bn(Object.assign({},E,x)),S=u===qt?N:b,P={top:w.top-S.top+g.top,bottom:S.bottom-w.bottom+g.bottom,left:w.left-S.left+g.left,right:S.right-w.right+g.right},R=n.modifiersData.offset;if(u===qt&&R){var k=R[r];Object.keys(P).forEach(function(A){var M=[fe,he].indexOf(A)>=0?1:-1,U=[ae,he].indexOf(A)>=0?"y":"x";P[A]+=k[U]*M})}return P}function Su(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,s=t.rootBoundary,a=t.padding,l=t.flipVariations,d=t.allowedAutoPlacements,c=d===void 0?Dn:d,u=yt(i),p=u?l?Ns:Ns.filter(function(m){return yt(m)===u}):Gt,h=p.filter(function(m){return c.indexOf(m)>=0});h.length===0&&(h=p);var y=h.reduce(function(m,g){return m[g]=Zt(n,{placement:g,boundary:r,rootBoundary:s,padding:a})[Ce(g)],m},{});return Object.keys(y).sort(function(m,g){return y[m]-y[g]})}function Ru(n){if(Ce(n)===Nn)return[];var e=Ii(n);return[Fs(n),e,Fs(e)]}function Au(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,s=r===void 0?!0:r,a=t.altAxis,l=a===void 0?!0:a,d=t.fallbackPlacements,c=t.padding,u=t.boundary,p=t.rootBoundary,h=t.altBoundary,y=t.flipVariations,m=y===void 0?!0:y,g=t.allowedAutoPlacements,v=e.options.placement,E=Ce(v),C=E===v,w=d||(C||!m?[Ii(v)]:Ru(v)),b=[v].concat(w).reduce(function(Re,B){return Re.concat(Ce(B)===Nn?Su(e,{placement:B,boundary:u,rootBoundary:p,padding:c,flipVariations:m,allowedAutoPlacements:g}):B)},[]),x=e.rects.reference,N=e.rects.popper,S=new Map,P=!0,R=b[0],k=0;k<b.length;k++){var A=b[k],M=Ce(A),U=yt(A)===ht,q=[ae,he].indexOf(M)>=0,oe=q?"width":"height",W=Zt(e,{placement:A,boundary:u,rootBoundary:p,altBoundary:h,padding:c}),X=q?U?fe:le:U?he:ae;x[oe]>N[oe]&&(X=Ii(X));var I=Ii(X),Y=[];if(s&&Y.push(W[M]<=0),l&&Y.push(W[X]<=0,W[I]<=0),Y.every(function(Re){return Re})){R=A,P=!1;break}S.set(A,Y)}if(P)for(var Se=m?3:1,G=function(Re){var B=b.find(function(Ae){var $e=S.get(Ae);if($e)return $e.slice(0,Re).every(function(Be){return Be})});if(B)return R=B,"break"},Ze=Se;Ze>0;Ze--){var K=G(Ze);if(K==="break")break}e.placement!==R&&(e.modifiersData[i]._skip=!0,e.placement=R,e.reset=!0)}}var Ou={name:"flip",enabled:!0,phase:"main",fn:Au,requiresIfExists:["offset"],data:{_skip:!1}};function Gs(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function js(n){return[ae,fe,he,le].some(function(e){return n[e]>=0})}function Nu(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,a=Zt(e,{elementContext:"reference"}),l=Zt(e,{altBoundary:!0}),d=Gs(a,i),c=Gs(l,r,s),u=js(d),p=js(c);e.modifiersData[t]={referenceClippingOffsets:d,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}var Du={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Nu};function Pu(n,e,t){var i=Ce(n),r=[le,ae].indexOf(i)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,a=s[0],l=s[1];return a=a||0,l=(l||0)*r,[le,fe].indexOf(i)>=0?{x:l,y:a}:{x:a,y:l}}function Iu(n){var e=n.state,t=n.options,i=n.name,r=t.offset,s=r===void 0?[0,0]:r,a=Dn.reduce(function(u,p){return u[p]=Pu(p,e.rects,s),u},{}),l=a[e.placement],d=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=a}var Lu={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Iu};function Mu(n){var e=n.state,t=n.name;e.modifiersData[t]=Ws({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}var qs={name:"popperOffsets",enabled:!0,phase:"read",fn:Mu,data:{}};function zu(n){return n==="x"?"y":"x"}function $u(n){var e=n.state,t=n.options,i=n.name,r=t.mainAxis,s=r===void 0?!0:r,a=t.altAxis,l=a===void 0?!1:a,d=t.boundary,c=t.rootBoundary,u=t.altBoundary,p=t.padding,h=t.tether,y=h===void 0?!0:h,m=t.tetherOffset,g=m===void 0?0:m,v=Zt(e,{boundary:d,rootBoundary:c,padding:p,altBoundary:u}),E=Ce(e.placement),C=yt(e.placement),w=!C,b=Ln(E),x=zu(b),N=e.modifiersData.popperOffsets,S=e.rects.reference,P=e.rects.popper,R=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,k=typeof R=="number"?{mainAxis:R,altAxis:R}:Object.assign({mainAxis:0,altAxis:0},R),A=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(N){if(s){var U,q=b==="y"?ae:le,oe=b==="y"?he:fe,W=b==="y"?"height":"width",X=N[b],I=X+v[q],Y=X-v[oe],Se=y?-P[W]/2:0,G=C===ht?S[W]:P[W],Ze=C===ht?-P[W]:-S[W],K=e.elements.arrow,Re=y&&K?In(K):{width:0,height:0},B=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Ls(),Ae=B[q],$e=B[oe],Be=Yt(0,S[W],Re[W]),Qt=w?S[W]/2-Se-Be-Ae-k.mainAxis:G-Be-Ae-k.mainAxis,Li=w?-S[W]/2+Se+Be+$e+k.mainAxis:Ze+Be+$e+k.mainAxis,bt=e.elements.arrow&&Kt(e.elements.arrow),Qe=bt?b==="y"?bt.clientTop||0:bt.clientLeft||0:0,lt=(U=A?.[b])!=null?U:0,He=X+Qt-lt-Qe,Jt=X+Li-lt,wt=Yt(y?Ni(I,He):I,X,y?at(Y,Jt):Y);N[b]=wt,M[b]=wt-X}if(l){var Fe,Et=b==="x"?ae:le,xt=b==="x"?he:fe,Oe=N[x],ct=x==="y"?"height":"width",Mi=Oe+v[Et],vt=Oe-v[xt],Ue=[ae,le].indexOf(E)!==-1,Ve=(Fe=A?.[x])!=null?Fe:0,We=Ue?Mi:Oe-S[ct]-P[ct]-Ve+k.altAxis,ei=Ue?Oe+S[ct]+P[ct]-Ve-k.altAxis:vt,ti=y&&Ue?uu(We,Oe,ei):Yt(y?We:Mi,Oe,y?ei:vt);N[x]=ti,M[x]=ti-Oe}e.modifiersData[i]=M}}var Bu={name:"preventOverflow",enabled:!0,phase:"main",fn:$u,requiresIfExists:["offset"]};function Hu(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function Fu(n){return n===be(n)||!ge(n)?Mn(n):Hu(n)}function Uu(n){var e=n.getBoundingClientRect(),t=gt(e.width)/n.offsetWidth||1,i=gt(e.height)/n.offsetHeight||1;return t!==1||i!==1}function Vu(n,e,t){t===void 0&&(t=!1);var i=ge(e),r=ge(e)&&Uu(e),s=Xe(e),a=mt(n,r),l={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(i||!i&&!t)&&((Te(e)!=="body"||$n(s))&&(l=Fu(e)),ge(e)?(d=mt(e,!0),d.x+=e.clientLeft,d.y+=e.clientTop):s&&(d.x=zn(s))),{x:a.left+l.scrollLeft-d.x,y:a.top+l.scrollTop-d.y,width:a.width,height:a.height}}function Wu(n){var e=new Map,t=new Set,i=[];n.forEach(function(s){e.set(s.name,s)});function r(s){t.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(l){if(!t.has(l)){var d=e.get(l);d&&r(d)}}),i.push(s)}return n.forEach(function(s){t.has(s.name)||r(s)}),i}function Gu(n){var e=Wu(n);return ou.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function ju(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function qu(n){var e=n.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var Ks={placement:"bottom",modifiers:[],strategy:"absolute"};function Ys(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Hn(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,s=r===void 0?Ks:r;return function(a,l,d){d===void 0&&(d=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ks,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},u=[],p=!1,h={state:c,setOptions:function(g){var v=typeof g=="function"?g(c.options):g;m(),c.options=Object.assign({},s,c.options,v),c.scrollParents={reference:ft(a)?Xt(a):a.contextElement?Xt(a.contextElement):[],popper:Xt(l)};var E=Gu(qu([].concat(i,c.options.modifiers)));return c.orderedModifiers=E.filter(function(C){return C.enabled}),y(),h.update()},forceUpdate:function(){if(!p){var g=c.elements,v=g.reference,E=g.popper;if(Ys(v,E)){c.rects={reference:Vu(v,Kt(E),c.options.strategy==="fixed"),popper:In(E)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(P){return c.modifiersData[P.name]=Object.assign({},P.data)});for(var C=0;C<c.orderedModifiers.length;C++){if(c.reset===!0){c.reset=!1,C=-1;continue}var w=c.orderedModifiers[C],b=w.fn,x=w.options,N=x===void 0?{}:x,S=w.name;typeof b=="function"&&(c=b({state:c,options:N,name:S,instance:h})||c)}}}},update:ju(function(){return new Promise(function(g){h.forceUpdate(),g(c)})}),destroy:function(){m(),p=!0}};if(!Ys(a,l))return h;h.setOptions(d).then(function(g){!p&&d.onFirstUpdate&&d.onFirstUpdate(g)});function y(){c.orderedModifiers.forEach(function(g){var v=g.name,E=g.options,C=E===void 0?{}:E,w=g.effect;if(typeof w=="function"){var b=w({state:c,name:v,instance:h,options:C}),x=function(){};u.push(b||x)}})}function m(){u.forEach(function(g){return g()}),u=[]}return h}}Hn();var Ku=[Hs,qs,Bs,Ds];Hn({defaultModifiers:Ku});var Yu=[Hs,qs,Bs,Ds,Lu,Ou,Bu,gu,Du],Xu=Hn({defaultModifiers:Yu});const Xs=ue({arrowOffset:{type:Number,default:5}}),Zu=["fixed","absolute"],Qu=ue({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:V(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:Dn,default:"bottom"},popperOptions:{type:V(Object),default:()=>({})},strategy:{type:String,values:Zu,default:"absolute"}}),Zs=ue({...Qu,...Xs,id:String,style:{type:V([String,Array,Object])},className:{type:V([String,Array,Object])},effect:{type:V(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:Boolean,trapping:Boolean,popperClass:{type:V([String,Array,Object])},popperStyle:{type:V([String,Array,Object])},referenceEl:{type:V(Object)},triggerTargetEl:{type:V(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...ps(["ariaLabel"])}),Ju={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},ep=(n,e)=>{const t=o.ref(!1),i=o.ref();return{focusStartRef:i,trapped:t,onFocusAfterReleased:c=>{var u;((u=c.detail)==null?void 0:u.focusReason)!=="pointer"&&(i.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:c=>{n.visible&&!t.value&&(c.target&&(i.value=c.target),t.value=!0)},onFocusoutPrevented:c=>{n.trapping||(c.detail.focusReason==="pointer"&&c.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},tp=(n,e=[])=>{const{placement:t,strategy:i,popperOptions:r}=n,s={placement:t,strategy:i,...r,modifiers:[...np(n),...e]};return rp(s,r?.modifiers),s},ip=n=>{if(ke)return ot(n)};function np(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:i}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function rp(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const sp=(n,e,t={})=>{const i={name:"updateState",enabled:!0,phase:"write",fn:({state:d})=>{const c=op(d);Object.assign(a.value,c)},requires:["computeStyles"]},r=o.computed(()=>{const{onFirstUpdate:d,placement:c,strategy:u,modifiers:p}=o.unref(t);return{onFirstUpdate:d,placement:c||"bottom",strategy:u||"absolute",modifiers:[...p||[],i,{name:"applyStyles",enabled:!1}]}}),s=o.shallowRef(),a=o.ref({styles:{popper:{position:o.unref(r).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{s.value&&(s.value.destroy(),s.value=void 0)};return o.watch(r,d=>{const c=o.unref(s);c&&c.setOptions(d)},{deep:!0}),o.watch([n,e],([d,c])=>{l(),!(!d||!c)&&(s.value=Xu(d,c,o.unref(r)))}),o.onBeforeUnmount(()=>{l()}),{state:o.computed(()=>{var d;return{...((d=o.unref(s))==null?void 0:d.state)||{}}}),styles:o.computed(()=>o.unref(a).styles),attributes:o.computed(()=>o.unref(a).attributes),update:()=>{var d;return(d=o.unref(s))==null?void 0:d.update()},forceUpdate:()=>{var d;return(d=o.unref(s))==null?void 0:d.forceUpdate()},instanceRef:o.computed(()=>o.unref(s))}};function op(n){const e=Object.keys(n.elements),t=En(e.map(r=>[r,n.styles[r]||{}])),i=En(e.map(r=>[r,n.attributes[r]]));return{styles:t,attributes:i}}const ap=0,lp=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:i,role:r}=o.inject(Cn,void 0),s=o.ref(),a=o.computed(()=>n.arrowOffset),l=o.computed(()=>({name:"eventListeners",enabled:!!n.visible})),d=o.computed(()=>{var E;const C=o.unref(s),w=(E=o.unref(a))!=null?E:ap;return{name:"arrow",enabled:!Mc(C),options:{element:C,padding:w}}}),c=o.computed(()=>({onFirstUpdate:()=>{m()},...tp(n,[o.unref(d),o.unref(l)])})),u=o.computed(()=>ip(n.referenceEl)||o.unref(i)),{attributes:p,state:h,styles:y,update:m,forceUpdate:g,instanceRef:v}=sp(u,t,c);return o.watch(v,E=>e.value=E,{flush:"sync"}),o.onMounted(()=>{o.watch(()=>{var E;return(E=o.unref(u))==null?void 0:E.getBoundingClientRect()},()=>{m()})}),{attributes:p,arrowRef:s,contentRef:t,instanceRef:v,state:h,styles:y,role:r,forceUpdate:g,update:m}},cp=(n,{attributes:e,styles:t,role:i})=>{const{nextZIndex:r}=od(),s=Ke("popper"),a=o.computed(()=>o.unref(e).popper),l=o.ref(Ut(n.zIndex)?n.zIndex:r()),d=o.computed(()=>[s.b(),s.is("pure",n.pure),s.is(n.effect),n.popperClass]),c=o.computed(()=>[{zIndex:o.unref(l)},o.unref(t).popper,n.popperStyle||{}]),u=o.computed(()=>i.value==="dialog"?"false":void 0),p=o.computed(()=>o.unref(t).arrow||{});return{ariaModal:u,arrowStyle:p,contentAttrs:a,contentClass:d,contentStyle:c,contentZIndex:l,updateZIndex:()=>{l.value=Ut(n.zIndex)?n.zIndex:r()}}},dp=o.defineComponent({name:"ElPopperContent"}),up=o.defineComponent({...dp,props:Zs,emits:Ju,setup(n,{expose:e,emit:t}){const i=n,{focusStartRef:r,trapped:s,onFocusAfterReleased:a,onFocusAfterTrapped:l,onFocusInTrap:d,onFocusoutPrevented:c,onReleaseRequested:u}=ep(i,t),{attributes:p,arrowRef:h,contentRef:y,styles:m,instanceRef:g,role:v,update:E}=lp(i),{ariaModal:C,arrowStyle:w,contentAttrs:b,contentClass:x,contentStyle:N,updateZIndex:S}=cp(i,{styles:m,attributes:p,role:v}),P=o.inject(kn,void 0);o.provide(gs,{arrowStyle:w,arrowRef:h}),P&&o.provide(kn,{...P,addInputId:dn,removeInputId:dn});let R;const k=(M=!0)=>{E(),M&&S()},A=()=>{k(!1),i.visible&&i.focusOnShow?s.value=!0:i.visible===!1&&(s.value=!1)};return o.onMounted(()=>{o.watch(()=>i.triggerTargetEl,(M,U)=>{R?.(),R=void 0;const q=o.unref(M||y.value),oe=o.unref(U||y.value);st(q)&&(R=o.watch([v,()=>i.ariaLabel,C,()=>i.id],W=>{["role","aria-label","aria-modal","id"].forEach((X,I)=>{xn(W[I])?q.removeAttribute(X):q.setAttribute(X,W[I])})},{immediate:!0})),oe!==q&&st(oe)&&["role","aria-label","aria-modal","id"].forEach(W=>{oe.removeAttribute(W)})},{immediate:!0}),o.watch(()=>i.visible,A,{immediate:!0})}),o.onBeforeUnmount(()=>{R?.(),R=void 0}),e({popperContentRef:y,popperInstanceRef:g,updatePopper:k,contentStyle:N}),(M,U)=>(o.openBlock(),o.createElementBlock("div",o.mergeProps({ref_key:"contentRef",ref:y},o.unref(b),{style:o.unref(N),class:o.unref(x),tabindex:"-1",onMouseenter:q=>M.$emit("mouseenter",q),onMouseleave:q=>M.$emit("mouseleave",q)}),[o.createVNode(o.unref(Kd),{trapped:o.unref(s),"trap-on-focus-in":!0,"focus-trap-el":o.unref(y),"focus-start-el":o.unref(r),onFocusAfterTrapped:o.unref(l),onFocusAfterReleased:o.unref(a),onFocusin:o.unref(d),onFocusoutPrevented:o.unref(c),onReleaseRequested:o.unref(u)},{default:o.withCtx(()=>[o.renderSlot(M.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var pp=_e(up,[["__file","content.vue"]]);const hp=Vt(Td),Fn=Symbol("elTooltip"),Qs=ue({to:{type:V([String,Object]),required:!0},disabled:Boolean}),Js=ue({...gd,...Zs,appendTo:{type:Qs.to.type},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:V(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...ps(["ariaLabel"])}),eo=ue({...ys,disabled:Boolean,trigger:{type:V([String,Array]),default:"hover"},triggerKeys:{type:V(Array),default:()=>[Wt.enter,Wt.numpadEnter,Wt.space]}}),fp=Ci({type:V(Boolean),default:null}),gp=Ci({type:V(Function)}),mp=n=>{const e=`update:${n}`,t=`onUpdate:${n}`,i=[e],r={[n]:fp,[t]:gp};return{useModelToggle:({indicator:a,toggleReason:l,shouldHideWhenRouteChanges:d,shouldProceed:c,onShow:u,onHide:p})=>{const h=o.getCurrentInstance(),{emit:y}=h,m=h.props,g=o.computed(()=>wi(m[t])),v=o.computed(()=>m[n]===null),E=S=>{a.value!==!0&&(a.value=!0,l&&(l.value=S),wi(u)&&u(S))},C=S=>{a.value!==!1&&(a.value=!1,l&&(l.value=S),wi(p)&&p(S))},w=S=>{if(m.disabled===!0||wi(c)&&!c())return;const P=g.value&&ke;P&&y(e,!0),(v.value||!P)&&E(S)},b=S=>{if(m.disabled===!0||!ke)return;const P=g.value&&ke;P&&y(e,!1),(v.value||!P)&&C(S)},x=S=>{Wr(S)&&(m.disabled&&S?g.value&&y(e,!1):a.value!==S&&(S?E():C()))},N=()=>{a.value?b():w()};return o.watch(()=>m[n],x),d&&h.appContext.config.globalProperties.$route!==void 0&&o.watch(()=>({...h.proxy.$route}),()=>{d.value&&a.value&&b()}),o.onMounted(()=>{x(m[n])}),{hide:b,show:w,toggle:N,hasUpdateHandler:g}},useModelToggleProps:r,useModelToggleEmits:i}},{useModelToggleProps:yp,useModelToggleEmits:_p,useModelToggle:bp}=mp("visible"),wp=ue({...ms,...yp,...Js,...eo,...Xs,showArrow:{type:Boolean,default:!0}}),Ep=[..._p,"before-show","before-hide","show","hide","open","close"],xp=(n,e)=>Ka(n)?n.includes(e):n===e,_t=(n,e,t)=>i=>{xp(o.unref(n),e)&&t(i)},ze=(n,e,{checkForDefaultPrevented:t=!0}={})=>r=>{const s=n?.(r);if(t===!1||!s)return e?.(r)},vp=o.defineComponent({name:"ElTooltipTrigger"}),kp=o.defineComponent({...vp,props:eo,setup(n,{expose:e}){const t=n,i=Ke("tooltip"),{controlled:r,id:s,open:a,onOpen:l,onClose:d,onToggle:c}=o.inject(Fn,void 0),u=o.ref(null),p=()=>{if(o.unref(r)||t.disabled)return!0},h=o.toRef(t,"trigger"),y=ze(p,_t(h,"hover",l)),m=ze(p,_t(h,"hover",d)),g=ze(p,_t(h,"click",b=>{b.button===0&&c(b)})),v=ze(p,_t(h,"focus",l)),E=ze(p,_t(h,"focus",d)),C=ze(p,_t(h,"contextmenu",b=>{b.preventDefault(),c(b)})),w=ze(p,b=>{const{code:x}=b;t.triggerKeys.includes(x)&&(b.preventDefault(),c(b))});return e({triggerRef:u}),(b,x)=>(o.openBlock(),o.createBlock(o.unref(Id),{id:o.unref(s),"virtual-ref":b.virtualRef,open:o.unref(a),"virtual-triggering":b.virtualTriggering,class:o.normalizeClass(o.unref(i).e("trigger")),onBlur:o.unref(E),onClick:o.unref(g),onContextmenu:o.unref(C),onFocus:o.unref(v),onMouseenter:o.unref(y),onMouseleave:o.unref(m),onKeydown:o.unref(w)},{default:o.withCtx(()=>[o.renderSlot(b.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var Tp=_e(kp,[["__file","trigger.vue"]]),Cp=_e(o.defineComponent({__name:"teleport",props:Qs,setup(n){return(e,t)=>e.disabled?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createBlock(o.Teleport,{key:1,to:e.to},[o.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const Sp=Vt(Cp),to=()=>{const n=cn(),e=fs(),t=o.computed(()=>`${n.value}-popper-container-${e.prefix}`),i=o.computed(()=>`#${t.value}`);return{id:t,selector:i}},Rp=n=>{const e=document.createElement("div");return e.id=n,document.body.appendChild(e),e},Ap=()=>{const{id:n,selector:e}=to();return o.onBeforeMount(()=>{ke&&(document.body.querySelector(e.value)||Rp(n.value))}),{id:n,selector:e}},Op=o.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),Np=o.defineComponent({...Op,props:Js,setup(n,{expose:e}){const t=n,{selector:i}=to(),r=Ke("tooltip"),s=o.ref(),a=qr(()=>{var I;return(I=s.value)==null?void 0:I.popperContentRef});let l;const{controlled:d,id:c,open:u,trigger:p,onClose:h,onOpen:y,onShow:m,onHide:g,onBeforeShow:v,onBeforeHide:E}=o.inject(Fn,void 0),C=o.computed(()=>t.transition||`${r.namespace.value}-fade-in-linear`),w=o.computed(()=>t.persistent);o.onBeforeUnmount(()=>{l?.()});const b=o.computed(()=>o.unref(w)?!0:o.unref(u)),x=o.computed(()=>t.disabled?!1:o.unref(u)),N=o.computed(()=>t.appendTo||i.value),S=o.computed(()=>{var I;return(I=t.style)!=null?I:{}}),P=o.ref(!0),R=()=>{g(),X()&&Le(document.body),P.value=!0},k=()=>{if(o.unref(d))return!0},A=ze(k,()=>{t.enterable&&o.unref(p)==="hover"&&y()}),M=ze(k,()=>{o.unref(p)==="hover"&&h()}),U=()=>{var I,Y;(Y=(I=s.value)==null?void 0:I.updatePopper)==null||Y.call(I),v?.()},q=()=>{E?.()},oe=()=>{m()},W=()=>{t.virtualTriggering||h()},X=I=>{var Y;const Se=(Y=s.value)==null?void 0:Y.popperContentRef,G=I?.relatedTarget||document.activeElement;return Se?.contains(G)};return o.watch(()=>o.unref(u),I=>{I?(P.value=!1,l=Jc(a,()=>{if(o.unref(d))return;o.unref(p)!=="hover"&&h()})):l?.()},{flush:"post"}),o.watch(()=>t.content,()=>{var I,Y;(Y=(I=s.value)==null?void 0:I.updatePopper)==null||Y.call(I)}),e({contentRef:s,isFocusInsideContent:X}),(I,Y)=>(o.openBlock(),o.createBlock(o.unref(Sp),{disabled:!I.teleported,to:o.unref(N)},{default:o.withCtx(()=>[o.unref(b)||!P.value?(o.openBlock(),o.createBlock(o.Transition,{key:0,name:o.unref(C),appear:!o.unref(w),onAfterLeave:R,onBeforeEnter:U,onAfterEnter:oe,onBeforeLeave:q,persisted:""},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(o.unref(pp),o.mergeProps({id:o.unref(c),ref_key:"contentRef",ref:s},I.$attrs,{"aria-label":I.ariaLabel,"aria-hidden":P.value,"boundaries-padding":I.boundariesPadding,"fallback-placements":I.fallbackPlacements,"gpu-acceleration":I.gpuAcceleration,offset:I.offset,placement:I.placement,"popper-options":I.popperOptions,"arrow-offset":I.arrowOffset,strategy:I.strategy,effect:I.effect,enterable:I.enterable,pure:I.pure,"popper-class":I.popperClass,"popper-style":[I.popperStyle,o.unref(S)],"reference-el":I.referenceEl,"trigger-target-el":I.triggerTargetEl,visible:o.unref(x),"z-index":I.zIndex,onMouseenter:o.unref(A),onMouseleave:o.unref(M),onBlur:W,onClose:o.unref(h)}),{default:o.withCtx(()=>[o.renderSlot(I.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","arrow-offset","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"]),[[o.vShow,o.unref(x)]])]),_:3},8,["name","appear"])):o.createCommentVNode("v-if",!0)]),_:3},8,["disabled","to"]))}});var Dp=_e(Np,[["__file","content.vue"]]);const Pp=o.defineComponent({name:"ElTooltip"}),Ip=o.defineComponent({...Pp,props:wp,emits:Ep,setup(n,{expose:e,emit:t}){const i=n;Ap();const r=Ke("tooltip"),s=bd(),a=o.ref(),l=o.ref(),d=()=>{var w;const b=o.unref(a);b&&((w=b.popperInstanceRef)==null||w.update())},c=o.ref(!1),u=o.ref(),{show:p,hide:h,hasUpdateHandler:y}=bp({indicator:c,toggleReason:u}),{onOpen:m,onClose:g}=md({showAfter:o.toRef(i,"showAfter"),hideAfter:o.toRef(i,"hideAfter"),autoClose:o.toRef(i,"autoClose"),open:p,close:h}),v=o.computed(()=>Wr(i.visible)&&!y.value),E=o.computed(()=>[r.b(),i.popperClass]);o.provide(Fn,{controlled:v,id:s,open:o.readonly(c),trigger:o.toRef(i,"trigger"),onOpen:m,onClose:g,onToggle:w=>{o.unref(c)?g(w):m(w)},onShow:()=>{t("show",u.value)},onHide:()=>{t("hide",u.value)},onBeforeShow:()=>{t("before-show",u.value)},onBeforeHide:()=>{t("before-hide",u.value)},updatePopper:d}),o.watch(()=>i.disabled,w=>{w&&c.value&&(c.value=!1)});const C=w=>{var b;return(b=l.value)==null?void 0:b.isFocusInsideContent(w)};return o.onDeactivated(()=>c.value&&h()),e({popperRef:a,contentRef:l,isFocusInsideContent:C,updatePopper:d,onOpen:m,onClose:g,hide:h}),(w,b)=>(o.openBlock(),o.createBlock(o.unref(hp),{ref_key:"popperRef",ref:a,role:w.role},{default:o.withCtx(()=>[o.createVNode(Tp,{disabled:w.disabled,trigger:w.trigger,"trigger-keys":w.triggerKeys,"virtual-ref":w.virtualRef,"virtual-triggering":w.virtualTriggering},{default:o.withCtx(()=>[w.$slots.default?o.renderSlot(w.$slots,"default",{key:0}):o.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),o.createVNode(Dp,{ref_key:"contentRef",ref:l,"aria-label":w.ariaLabel,"boundaries-padding":w.boundariesPadding,content:w.content,disabled:w.disabled,effect:w.effect,enterable:w.enterable,"fallback-placements":w.fallbackPlacements,"hide-after":w.hideAfter,"gpu-acceleration":w.gpuAcceleration,offset:w.offset,persistent:w.persistent,"popper-class":o.unref(E),"popper-style":w.popperStyle,placement:w.placement,"popper-options":w.popperOptions,"arrow-offset":w.arrowOffset,pure:w.pure,"raw-content":w.rawContent,"reference-el":w.referenceEl,"trigger-target-el":w.triggerTargetEl,"show-after":w.showAfter,strategy:w.strategy,teleported:w.teleported,transition:w.transition,"virtual-triggering":w.virtualTriggering,"z-index":w.zIndex,"append-to":w.appendTo},{default:o.withCtx(()=>[o.renderSlot(w.$slots,"content",{},()=>[w.rawContent?(o.openBlock(),o.createElementBlock("span",{key:0,innerHTML:w.content},null,8,["innerHTML"])):(o.openBlock(),o.createElementBlock("span",{key:1},o.toDisplayString(w.content),1))]),w.showArrow?(o.openBlock(),o.createBlock(o.unref(Rd),{key:0})):o.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","arrow-offset","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var Lp=_e(Ip,[["__file","tooltip.vue"]]);const io=Vt(Lp),Mp=ue({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:cs},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),zp={close:n=>n instanceof MouseEvent,click:n=>n instanceof MouseEvent},$p=o.defineComponent({name:"ElTag"}),Bp=o.defineComponent({...$p,props:Mp,emits:zp,setup(n,{emit:e}){const t=n,i=xd(),r=Ke("tag"),s=o.computed(()=>{const{type:c,hit:u,effect:p,closable:h,round:y}=t;return[r.b(),r.is("closable",h),r.m(c||"primary"),r.m(i.value),r.m(p),r.is("hit",u),r.is("round",y)]}),a=c=>{e("close",c)},l=c=>{e("click",c)},d=c=>{var u,p,h;(h=(p=(u=c?.component)==null?void 0:u.subTree)==null?void 0:p.component)!=null&&h.bum&&(c.component.subTree.component.bum=null)};return(c,u)=>c.disableTransitions?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(o.unref(s)),style:o.normalizeStyle({backgroundColor:c.color}),onClick:l},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(r).e("content"))},[o.renderSlot(c.$slots,"default")],2),c.closable?(o.openBlock(),o.createBlock(o.unref(ds),{key:0,class:o.normalizeClass(o.unref(r).e("close")),onClick:o.withModifiers(a,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(Fi))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0)],6)):(o.openBlock(),o.createBlock(o.Transition,{key:1,name:`${o.unref(r).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:d},{default:o.withCtx(()=>[o.createElementVNode("span",{class:o.normalizeClass(o.unref(s)),style:o.normalizeStyle({backgroundColor:c.color}),onClick:l},[o.createElementVNode("span",{class:o.normalizeClass(o.unref(r).e("content"))},[o.renderSlot(c.$slots,"default")],2),c.closable?(o.openBlock(),o.createBlock(o.unref(ds),{key:0,class:o.normalizeClass(o.unref(r).e("close")),onClick:o.withModifiers(a,["stop"])},{default:o.withCtx(()=>[o.createVNode(o.unref(Fi))]),_:1},8,["class","onClick"])):o.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var Hp=_e(Bp,[["__file","tag.vue"]]);const Fp=Vt(Hp),Up={class:"tw-flex tw-flex-row tw-flex-wrap tw-gap-2"},Vp={class:"color-primary"},Wp={class:"color-secondary"},Gp={key:1,class:"empty"},jp={key:0,class:"clear-filter-div"},qp=Je(o.defineComponent({__name:"Filter",props:{order:{},exclude:{}},setup(n){const e=n,t=dt(),i=o.computed(()=>({...t.Filters})),r=o.computed(()=>{const c=i.value;return Object.keys(c).map(u=>({key:u,value:c[u]})).filter(({value:u})=>!(u==null||typeof u=="string"&&u.trim()===""||Array.isArray(u)&&u.length===0))}),s=o.computed(()=>{const c=new Set(e.exclude??[]),u=r.value.filter(p=>!c.has(p.key));if(e.order?.length){const p=new Map(e.order.map((h,y)=>[h,y]));u.sort((h,y)=>{const m=p.has(h.key)?p.get(h.key):Number.MAX_SAFE_INTEGER,g=p.has(y.key)?p.get(y.key):Number.MAX_SAFE_INTEGER;return m-g||h.key.localeCompare(y.key)})}else u.sort((p,h)=>p.key.localeCompare(h.key));return u});function a(c){return Array.isArray(c)?c.join(", "):c&&typeof c=="object"?JSON.stringify(c):String(c??"")}function l(c){const u=t;typeof u.clearFilter=="function"?u.clearFilter(c):typeof u.clearAllFilters=="function"?u.clearAllFilters(c):t.setFilter(c,void 0)}function d(){t.resetFilters({})}return(c,u)=>{const p=o.resolveComponent("el-icon"),h=o.resolveComponent("el-row");return o.openBlock(),o.createBlock(h,{class:"filter-wrapper",align:"middle",justify:"space-between"},{default:o.withCtx(()=>[o.createElementVNode("div",Up,[s.value.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(s.value,y=>(o.openBlock(),o.createBlock(o.unref(Fp),{key:y.key,closable:"",onClose:m=>l(y.key),effect:"dark",type:"info"},{default:o.withCtx(()=>[o.createElementVNode("b",Vp,o.toDisplayString(y.key)+": ",1),o.createElementVNode("span",Wp,o.toDisplayString(a(y.value)),1)]),_:2},1032,["onClose"]))),128)):(o.openBlock(),o.createElementBlock("span",Gp,"No filters"))]),s.value.length?(o.openBlock(),o.createElementBlock("div",jp,[o.createVNode(o.unref(io),{placement:"top-start",content:"Clear All Filters"},{default:o.withCtx(()=>[o.createVNode(p,{color:"#FFFF",onClick:d},{default:o.withCtx(()=>[o.createVNode(o.unref(bo))]),_:1})]),_:1})])):o.createCommentVNode("",!0)]),_:1})}}}),[["__scopeId","data-v-7bc31135"]]),Kp={key:0,class:"content-header dash-header-visible stick-to-top tw-flex tw-flex-row tw-items-center tw-justify-between tw-h-10"},Yp={class:"editing-div"},Xp={class:"tw-m-4 tw-leading-none tw-pl-1 widget-name"},Zp={class:"header-slot-icon"},Qp={key:1,class:"dash-header-hide content-header"},Jp={class:"header-slot-icon"},eh=Je({__name:"DashHeader",props:{widgetName:{type:String,required:!0},widgetID:{type:String,required:!0},hideHeader:Boolean},setup(n){const e=dt(),t=n,i=o.ref(null);o.watch(()=>t.widgetName,d=>{i.value=d},{immediate:!0});const r=o.ref(!1),s=o.ref(null);function a(){r.value=!0,s.value&&s.value.focus()}function l(){if(!r.value)return;r.value=!1;const d=e.getDashItem(t.widgetID);d.componentName=i}return(d,c)=>{const u=o.resolveComponent("el-input"),p=o.resolveDirective("click-out");return n.hideHeader?(o.openBlock(),o.createElementBlock("div",Qp,[o.createElementVNode("div",Jp,[o.renderSlot(d.$slots,"default",{},void 0,!0)])])):(o.openBlock(),o.createElementBlock("div",Kp,[o.createElementVNode("div",null,[o.withDirectives((o.openBlock(),o.createElementBlock("div",{onKeyup:o.withKeys(l,["enter"]),class:"tw-flex"},[o.withDirectives(o.createElementVNode("div",Yp,[o.createVNode(u,{onFocus:c[0]||(c[0]=h=>h.target.select()),ref_key:"textUserInput",ref:s,modelValue:i.value,"onUpdate:modelValue":c[1]||(c[1]=h=>i.value=h)},null,8,["modelValue"])],512),[[o.vShow,r.value]]),o.withDirectives(o.createElementVNode("div",{onClick:c[2]||(c[2]=h=>a()),class:"visible-div"},[o.createElementVNode("div",Xp,o.toDisplayString(i.value),1)],512),[[o.vShow,!r.value]])],32)),[[p,l]])]),o.createElementVNode("div",Zp,[o.renderSlot(d.$slots,"default",{},void 0,!0)])]))}}},[["__scopeId","data-v-1e30b12b"]]),th={class:"tw-flex"},ih=Je({__name:"WidgetWrapper",props:{widgetID:{type:String,required:!0},staticMode:{type:Boolean,required:!0},componentTag:{required:!0},componentProperties:{type:Object},componentName:{type:String},hideWidgetsHeader:{type:Boolean},isLocked:{type:Boolean,default:!1}},emits:["removeWidget","toggle-lock"],setup(n,{emit:e}){const t=e;dt();const i=n;let r=o.ref(null);const s=o.ref(!1);o.watch(()=>i.isLocked,d=>{s.value=d},{immediate:!0});const a=o.ref(null);o.watch(()=>i.hideWidgetsHeader,d=>{a.value=d},{immediate:!0});function l(){t("toggle-lock",{id:i.widgetID,isLocked:s.value})}return(d,c)=>{const u=o.resolveComponent("el-icon");return o.openBlock(),o.createElementBlock("div",{ref_key:"instance",ref:r,class:o.normalizeClass(["grid-stack-item-content",{"locked-widget":n.isLocked}])},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.componentTag),o.mergeProps({class:["widget-body",{"widget-body-no-head":a.value}],widgetID:n.widgetID,hideHeader:a.value},i.componentProperties,{style:{pointerEvents:s.value?"none":"auto"},isLocked:s.value}),{default:o.withCtx(p=>[p?(o.openBlock(),o.createBlock(eh,{key:0,widgetName:i.componentName,widgetID:n.widgetID,staticMode:n.staticMode,hideHeader:a.value},{default:o.withCtx(()=>[o.createElementVNode("div",th,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(p.childIcons,h=>(o.openBlock(),o.createBlock(o.unref(io),{placement:"bottom-start"},{content:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h.tooltip),1)]),default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h.comp),{class:"tw-w-4 header-icon",onClick:h.event},null,8,["onClick"]))]),_:2},1024))),256)),o.createVNode(u,{class:"header-icon lock-toggle",onClick:c[0]||(c[0]=h=>l())},{default:o.withCtx(()=>[s.value?(o.openBlock(),o.createBlock(o.unref(vo),{key:0})):(o.openBlock(),o.createBlock(o.unref(To),{key:1}))]),_:1}),!n.staticMode&&!n.isLocked?(o.openBlock(),o.createBlock(u,{key:0,class:"item-widget-button",onClick:c[1]||(c[1]=h=>d.$emit("removeWidget"))},{default:o.withCtx(()=>[o.createVNode(o.unref(Fi))]),_:1})):o.createCommentVNode("",!0)])]),_:2},1032,["widgetName","widgetID","staticMode","hideHeader"])):o.createCommentVNode("",!0)]),_:1},16,["class","widgetID","hideHeader","style","isLocked"]))],2)}}},[["__scopeId","data-v-a09963e5"]]),nh={class:"dashboard-app"},rh={key:0,class:"dash-header tw-max-h-screen tw-flex tw-flex-col"},sh={class:"tw-float-left tw-m-1 button"},oh={key:1,class:"tw-h-10 dash-header"},ah={class:"tw-float-left tw-m-1"},lh={class:"tw-m-4 tw-w-40"},ch=["gs-x","gs-y","gs-w","gs-h","gs-id","id","props","gs-locked","gs-no-move","gs-no-resize"],dh=Je(o.defineComponent({__name:"Dashboard",props:{hideHeader:{},options:{}},setup(n){const e=n,t=dt(),{DASHBOARD_ITEMS:i}=St.storeToRefs(t),r={apiUrl:o.computed(()=>t.Services?.ApiUrl),filters:t.filters,setFilter:t.setFilter,clearFilter:t.clearFilter,resetFilters:t.resetFilters};o.provide("GlobalVars",r);let s=o.ref("Edit Grid");const{gridInstance:a}=St.storeToRefs(t),l=o.ref(null);let d=o.ref(!0),c=0;const u=o.ref([]),{ComponentRegistry:p}=St.storeToRefs(t),h=o.reactive({});o.onBeforeMount(()=>{y(),t.loadFromLocalStorage(),c=i.value.length+1}),o.onMounted(()=>{m(),g()});function y(){t.DefaultLayout=e.options?.defaultLayout,t.setOptionServices(e.options?.services)}function m(){const b={float:!0,column:12,cellHeight:"70px",minRow:12,margin:5,alwaysShowResizeHandle:!0,resizable:{handles:"e,se,s,sw,w,n"}};a.value=z.init(b),a.value.setStatic(d.value)}o.watch(()=>e.options?.availableWidgets,b=>{p.value={},u.value=[],b&&b.forEach((x,N)=>{let S,P;if(x&&typeof x=="object"&&"name"in x&&"component"in x)S=x.name,P=x.component;else if(x&&typeof x=="object"&&"name"in x&&"loader"in x)S=x.name,P=o.defineAsyncComponent(async()=>{const R=await x.loader();return R.default??R});else if(x&&(typeof x=="function"||typeof x=="object"))console.log(x),P=x,S=x.name||`Widget${N+1}`;else if(typeof x=="function")return;!S||!P||p.value[S]||(p.value[S]=P,u.value.push(S))})},{immediate:!0,deep:!0});function g(){const b=e.options.globalData;if(b){t.clearOptionsDataItems();for(const x in b)t.addOptionsDataItems(x,b[x])}}o.watch(()=>d.value,b=>{a.value.setStatic(b),s.value=b?"Edit Grid":"Save Grid"});function v(b){if(!b)return;const x=`${b}-${c}`,N={id:x,w:2,h:6,autoPosition:!0,component:p.value[b],componentKey:b,componentName:b,Props:{}};c++,i.value.push(N),o.nextTick(()=>{a.value?.makeWidget(`#${x}`)})}function E(b){var x=i.value.findIndex(S=>S.id==b);i.value.splice(x,1);const N=`#${b}`;a.value.removeWidget(N,!1)}function C({id:b,isLocked:x}){const N=h[b];N&&a.value&&a.value.update(N,{locked:!x,noMove:!x,noResize:!x}),t.toggleWidgetLock(b)}function w(){d.value=!d.value,d.value&&t.saveToLocalStorage()}return(b,x)=>{const N=o.resolveComponent("el-button"),S=o.resolveComponent("el-option"),P=o.resolveComponent("el-select"),R=o.resolveComponent("el-col");return o.openBlock(),o.createElementBlock("div",nh,[b.hideHeader?(o.openBlock(),o.createElementBlock("div",oh,[x[2]||(x[2]=o.createTextVNode("x ",-1)),o.createElementVNode("span",ah,[o.createVNode(N,{class:"edit-button",onClick:x[1]||(x[1]=k=>w())},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)),1)]),_:1})])])):(o.openBlock(),o.createElementBlock("div",rh,[o.createElementVNode("span",sh,[o.createVNode(N,{class:"edit-button",onClick:x[0]||(x[0]=k=>w())},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(o.unref(s)),1)]),_:1})]),o.createVNode(qp)])),o.unref(d)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(R,{key:2},{default:o.withCtx(()=>[o.createElementVNode("div",lh,[o.createVNode(P,{placeholder:"Add New Widget"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.value,k=>(o.openBlock(),o.createBlock(S,{key:k,label:k,value:k,onClick:A=>v(k)},null,8,["label","value","onClick"]))),128))]),_:1})])]),_:1})),o.createElementVNode("div",{ref_key:"root",ref:l,class:"grid-stack tw-h-screen"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(i),k=>(o.openBlock(),o.createElementBlock("div",{class:"grid-stack-item",ref_for:!0,ref:A=>h[k.id]=A,"gs-x":k.x,"gs-y":k.y,"gs-w":k.w,"gs-h":k.h,"gs-id":k.id,id:k.id,key:k.id,props:k.Props,"gs-locked":k.Props?.locked,"gs-no-move":k.Props?.locked,"gs-no-resize":k.Props?.locked},[o.createVNode(ih,{widgetID:k.id,onRemoveWidget:A=>E(k.id),onToggleLock:C,"static-mode":o.unref(d),componentTag:k.component,componentProperties:k.Props,componentName:k.componentName,hideWidgetsHeader:k.hideHeader,"is-locked":k.Props?.locked},null,8,["widgetID","onRemoveWidget","static-mode","componentTag","componentProperties","componentName","hideWidgetsHeader","is-locked"])],8,ch))),128))],512)])}}}),[["__scopeId","data-v-eb3a2a65"]]);we.MarkdownWidget=Ba,we.PennsieveDashboard=dh,we.TextWidget=Do,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})}));