pennsieve-dashboard 0.2.0 → 0.2.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.
- package/dist/pennsieve-dashboard.es.js +223 -221
- package/dist/pennsieve-dashboard.umd.js +21 -21
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(q,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("pinia"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","pinia","element-plus"],a):(q=typeof globalThis<"u"?globalThis:q||self,a(q["pennsieve-dashboard"]={},q.Vue,q.Pinia,q.ElementPlus))})(this,(function(q,a,ce,yt){"use strict";var dn=Object.defineProperty;var un=(q,a,ce)=>a in q?dn(q,a,{enumerable:!0,configurable:!0,writable:!0,value:ce}):q[a]=ce;var P=(q,a,ce)=>un(q,typeof a!="symbol"?a+"":a,ce);/*! Element Plus Icons Vue v2.3.2 */var Pt;var ss=a.defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.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"})]))}}),rs=ss,ns=a.defineComponent({name:"Close",__name:"close",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.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"})]))}}),os=ns,ls=a.defineComponent({name:"Edit",__name:"edit",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.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"}),a.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"})]))}}),Qt=ls,as=a.defineComponent({name:"Lock",__name:"lock",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.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"}),a.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"})]))}}),hs=as,cs=a.defineComponent({name:"Unlock",__name:"unlock",setup(o){return(e,t)=>(a.openBlock(),a.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[a.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"}),a.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"})]))}}),ds=cs;const De=ce.defineStore("globalPensieveDashVars",()=>{const o=a.ref([]),e=a.ref({}),t="dashboard-globalVarsStore",i=a.ref([]),s=a.ref([]),r=a.ref({}),l=a.reactive({}),n=a.reactive({});function d(C,v,F=!1){l[C]=v,n[C]=F}function h(C={}){for(const v of Object.keys(l))delete l[v];Object.assign(l,C)}const c=C=>{delete l[C]};function f(){for(const C of Object.keys(l))delete l[C]}function u(){s.value=[...o.value],h({})}const _=C=>s.value.find(v=>v.id===C),b=(C,v)=>{i.value.push({name:C,value:v})},L=()=>{i.value=[]},H=C=>{const v=N(C);r.value=v},A=()=>r.value;function N(C){const v={};if(!C||typeof C!="object")return v;for(const[F,O]of Object.entries(C))if(O&&typeof O=="object"&&!(a.isRef(O)||a.isReactive(O))){const z=Object.getPrototypeOf(O)===Object.prototype;v[F]=z?{...O}:a.markRaw(O)}else v[F]=O;return v}const D=C=>{const v=s.value.find(F=>F.id===C);v&&(v.Props=v.Props||{},v.Props.locked=!v.Props.locked)},T=C=>C.map(v=>{const F=e.value[v.componentKey];return F?{...v,component:F}:null}).filter(v=>!!v);function B(C){}function y(){}return{DASHBOARD_ITEMS:s,DefaultLayout:o,ComponentRegistry:e,optionsData:i,Services:r,Filters:l,displayFilters:n,registerGridProvider:B,unregisterGridProvider:y,setFilter:d,clearFilter:c,clearAllFilters:f,resetFilters:h,resetGridLayout:u,getDashItem:_,toggleWidgetLock:D,addOptionsDataItems:b,clearOptionsDataItems:L,loadFromLocalStorage:()=>{const C=localStorage.getItem(t);if(!C){u();return}try{const v=JSON.parse(C);s.value=Array.isArray(v.items)?T(v.items):[...o.value],h(v.filters??{})}catch(v){console.error("Failed to parse globalVarsStore:",v),s.value=[...o.value],h({})}},setOptionServices:H,getServices:A}}),us={class:"widget-settings-container"},ps={class:"widget-setting"},fs={class:"dialog-footer"},gs=a.defineComponent({__name:"TextWidgetSettings",props:{showDialog:{type:Boolean},reactiveSourceValue:{},manualEntryValue:{},hideHeaderValue:{type:Boolean}},emits:["close-dialog","update-text-var"],setup(o,{emit:e}){const t=De(),{optionsData:i}=ce.storeToRefs(t),s=e,r=o,l=a.computed({get:()=>r.showDialog,set:f=>{f||s("close-dialog")}}),n=a.ref(r.reactiveSourceValue??""),d=a.ref(r.manualEntryValue??""),h=a.ref(!!r.hideHeaderValue);a.watch(()=>r.reactiveSourceValue,f=>{n.value=f??""}),a.watch(()=>r.manualEntryValue,f=>{d.value=f??""},{immediate:!0}),a.watch(()=>r.hideHeaderValue,f=>{h.value=!!f});function c(){var b;const f=(n.value||"").trim(),u=f!=="",_=u?null:((b=d.value)==null?void 0:b.trim())||"";s("update-text-var",{reactiveSource:u?f:null,manualEdit:_,hideHeader:h.value}),l.value=!1}return(f,u)=>{const _=a.resolveComponent("el-option"),b=a.resolveComponent("el-select"),L=a.resolveComponent("el-input"),H=a.resolveComponent("el-checkbox"),A=a.resolveComponent("el-button"),N=a.resolveComponent("el-dialog");return a.openBlock(),a.createBlock(N,{class:"full-dialog-dashboard",modelValue:l.value,"onUpdate:modelValue":u[4]||(u[4]=D=>l.value=D),title:"Text Widget Settings","append-to-body":!0},{footer:a.withCtx(()=>[a.createElementVNode("div",fs,[a.createVNode(A,{class:"secondary",onClick:u[3]||(u[3]=D=>l.value=!1)},{default:a.withCtx(()=>[...u[8]||(u[8]=[a.createTextVNode("Cancel",-1)])]),_:1}),a.createVNode(A,{onClick:c},{default:a.withCtx(()=>[...u[9]||(u[9]=[a.createTextVNode("Save",-1)])]),_:1})])]),default:a.withCtx(()=>[a.createElementVNode("div",us,[a.createElementVNode("div",ps,[u[5]||(u[5]=a.createElementVNode("h4",null,"Select This Widget's Value",-1)),u[6]||(u[6]=a.createElementVNode("h5",null,"Select From Variables",-1)),a.createVNode(b,{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=D=>n.value=D),class:"text-settings-height"},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(_,{value:"",key:"__manual__",label:"Manual entry"})),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(i),D=>(a.openBlock(),a.createBlock(_,{key:D.name,label:D.name,value:D.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),u[7]||(u[7]=a.createElementVNode("h5",null,"Manual Entry",-1)),a.createVNode(L,{modelValue:d.value,"onUpdate:modelValue":u[1]||(u[1]=D=>d.value=D),class:"text-settings-height"},null,8,["modelValue"]),a.createVNode(H,{modelValue:h.value,"onUpdate:modelValue":u[2]||(u[2]=D=>h.value=D),label:"Hide Header"},null,8,["modelValue"])])])]),_:1},8,["modelValue"])}}}),_e=(o,e)=>{const t=o.__vccOpts||o;for(const[i,s]of e)t[i]=s;return t},ms=_e(gs,[["__scopeId","data-v-769ea864"]]),_s={key:0},ys=_e(a.defineComponent({inheritAttrs:!1,__name:"TextWidget",props:{displayText:{},bindedKey:{},widgetID:{},hideHeader:{type:Boolean}},setup(o){const e=De(),t=o;a.inject("dashboard:globalVars",null);const i=a.ref(t.displayText??"");a.watch(()=>t.displayText,A=>{i.value=A??""},{immediate:!0});const s=a.computed(()=>!!(t.bindedKey&&t.bindedKey.trim()!=="")),r=a.computed(()=>{var T;const A=(T=t.bindedKey)==null?void 0:T.trim();if(!A)return"—";const N=e.optionsData.find(B=>(B==null?void 0:B.name)===A),D=N==null?void 0:N.value;return Array.isArray(D)?D.join(", "):D&&typeof D=="object"?JSON.stringify(D):D??"—"}),l=a.ref("Text Widget"),n=a.shallowRef([{comp:Qt,event:_,tooltip:"open Text settings"}]),d=a.ref(!1),h=a.ref(null);function c(){var A,N;d.value=!0,(N=(A=h.value)==null?void 0:A.focus)==null||N.call(A)}function f(){d.value=!1}const u=a.ref(!1);function _(){u.value=!0}function b(){u.value=!1}function L({manualEdit:A,reactiveSource:N,hideHeader:D}){const T=e.getDashItem(t.widgetID);T&&(T.hideHeader=D,N&&N.trim()!==""?(T.Props=T.Props||{},T.Props.bindedKey=N,T.Props.displayText=null,T.componentName=H(N)):(T.Props=T.Props||{},T.Props.bindedKey=null,T.Props.displayText=A??"",T.componentName=A??"Text"),e.saveToLocalStorage())}function H(A){return A?A.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,N=>N.toUpperCase()):""}return(A,N)=>{const D=a.resolveComponent("el-input"),T=a.resolveDirective("click-out");return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.renderSlot(A.$slots,"default",{widgetName:l.value,childIcons:n.value},void 0,!0),a.createElementVNode("div",a.mergeProps({class:"text-widget-wrap"},A.$attrs),[s.value?(a.openBlock(),a.createElementBlock("div",_s,[a.createElementVNode("h2",null,a.toDisplayString(r.value),1)])):a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:1,onKeyup:a.withKeys(f,["enter"]),class:"tw-flex"},[a.withDirectives(a.createElementVNode("div",null,[a.createVNode(D,{ref_key:"textUserInput",ref:h,modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=B=>i.value=B),onFocus:N[1]||(N[1]=B=>{var y,w;return(w=(y=B.target)==null?void 0:y.select)==null?void 0:w.call(y)})},null,8,["modelValue"])],512),[[a.vShow,d.value]]),a.withDirectives(a.createElementVNode("div",{onClick:N[2]||(N[2]=B=>c()),class:"tw-w-full tw-h-full"},[a.createElementVNode("h2",null,a.toDisplayString(i.value),1)],512),[[a.vShow,!d.value]])],32)),[[T,f]])],16),a.createVNode(ms,{"show-dialog":u.value,"reactive-source-value":t.bindedKey||"","manual-entry-value":i.value,"hide-header-value":t.hideHeader||!1,onCloseDialog:b,onUpdateTextVar:L},null,8,["show-dialog","reactive-source-value","manual-entry-value","hide-header-value"])],64)}}}),[["__scopeId","data-v-5e485ae3"]]);function wt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ye=wt();function Jt(o){ye=o}var Ne={exec:()=>null};function M(o,e=""){let t=typeof o=="string"?o:o.source,i={replace:(s,r)=>{let l=typeof r=="string"?r:r.source;return l=l.replace(K.caret,"$1"),t=t.replace(s,l),i},getRegex:()=>new RegExp(t,e)};return i}var K={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:o=>new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}#`),htmlBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}<(?:[a-z].*>|!--)`,"i")},ws=/^(?:[ \t]*(?:\n|$))+/,bs=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Le=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ks=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bt=/(?:[*+-]|\d{1,9}[.)])/,ei=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ti=M(ei).replace(/bull/g,bt).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(),Es=M(ei).replace(/bull/g,bt).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(),xt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,vs=/^[^\n]+/,kt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ts=M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",kt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Rs=M(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,bt).getRegex(),qe="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",Et=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Cs=M("^ {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",Et).replace("tag",qe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ii=M(xt).replace("hr",Le).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",qe).getRegex(),Ss=M(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ii).getRegex(),vt={blockquote:Ss,code:bs,def:Ts,fences:xs,heading:ks,hr:Le,html:Cs,lheading:ti,list:Rs,newline:ws,paragraph:ii,table:Ne,text:vs},si=M("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Le).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",qe).getRegex(),As={...vt,lheading:Es,table:si,paragraph:M(xt).replace("hr",Le).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",si).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",qe).getRegex()},Ds={...vt,html:M(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Et).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:Ne,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:M(xt).replace("hr",Le).replace("heading",` *#{1,6} *[^
|
|
2
|
-
]`).replace("lheading",ti).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ns=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ls=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ri=/^( {2,}|\\)\n(?!\s*$)/,zs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,je=/[\p{P}\p{S}]/u,Tt=/[\s\p{P}\p{S}]/u,ni=/[^\s\p{P}\p{S}]/u,Ms=M(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Tt).getRegex(),oi=/(?!~)[\p{P}\p{S}]/u,Is=/(?!~)[\s\p{P}\p{S}]/u,Hs=/(?:[^\s\p{P}\p{S}]|~)/u,Os=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,li=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ps=M(li,"u").replace(/punct/g,je).getRegex(),Bs=M(li,"u").replace(/punct/g,oi).getRegex(),ai="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$s=M(ai,"gu").replace(/notPunctSpace/g,ni).replace(/punctSpace/g,Tt).replace(/punct/g,je).getRegex(),Us=M(ai,"gu").replace(/notPunctSpace/g,Hs).replace(/punctSpace/g,Is).replace(/punct/g,oi).getRegex(),Fs=M("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ni).replace(/punctSpace/g,Tt).replace(/punct/g,je).getRegex(),Ws=M(/\\(punct)/,"gu").replace(/punct/g,je).getRegex(),Gs=M(/^<(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(),Vs=M(Et).replace("(?:-->|$)","-->").getRegex(),qs=M("^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",Vs).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ye=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,js=M(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ye).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),hi=M(/^!?\[(label)\]\[(ref)\]/).replace("label",Ye).replace("ref",kt).getRegex(),ci=M(/^!?\[(ref)\](?:\[\])?/).replace("ref",kt).getRegex(),Ys=M("reflink|nolink(?!\\()","g").replace("reflink",hi).replace("nolink",ci).getRegex(),Rt={_backpedal:Ne,anyPunctuation:Ws,autolink:Gs,blockSkip:Os,br:ri,code:Ls,del:Ne,emStrongLDelim:Ps,emStrongRDelimAst:$s,emStrongRDelimUnd:Fs,escape:Ns,link:js,nolink:ci,punctuation:Ms,reflink:hi,reflinkSearch:Ys,tag:qs,text:zs,url:Ne},Xs={...Rt,link:M(/^!?\[(label)\]\((.*?)\)/).replace("label",Ye).getRegex(),reflink:M(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ye).getRegex()},Ct={...Rt,emStrongRDelimAst:Us,emStrongLDelim:Bs,url:M(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Zs={...Ct,br:M(ri).replace("{2,}","*").getRegex(),text:M(Ct.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xe={normal:vt,gfm:As,pedantic:Ds},ze={normal:Rt,gfm:Ct,breaks:Zs,pedantic:Xs},Ks={"&":"&","<":"<",">":">",'"':""","'":"'"},di=o=>Ks[o];function oe(o,e){if(e){if(K.escapeTest.test(o))return o.replace(K.escapeReplace,di)}else if(K.escapeTestNoEncode.test(o))return o.replace(K.escapeReplaceNoEncode,di);return o}function ui(o){try{o=encodeURI(o).replace(K.percentDecode,"%")}catch{return null}return o}function pi(o,e){var r;let t=o.replace(K.findPipe,(
|
|
3
|
-
`).map(r=>{let
|
|
1
|
+
(function(q,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue"),require("pinia"),require("element-plus")):typeof define=="function"&&define.amd?define(["exports","vue","pinia","element-plus"],l):(q=typeof globalThis<"u"?globalThis:q||self,l(q["pennsieve-dashboard"]={},q.Vue,q.Pinia,q.ElementPlus))})(this,(function(q,l,ce,yt){"use strict";var dn=Object.defineProperty;var un=(q,l,ce)=>l in q?dn(q,l,{enumerable:!0,configurable:!0,writable:!0,value:ce}):q[l]=ce;var P=(q,l,ce)=>un(q,typeof l!="symbol"?l+"":l,ce);/*! Element Plus Icons Vue v2.3.2 */var Pt;var ss=l.defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup(o){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),rs=ss,ns=l.defineComponent({name:"Close",__name:"close",setup(o){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"})]))}}),os=ns,ls=l.defineComponent({name:"Edit",__name:"edit",setup(o){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"}),l.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"})]))}}),Qt=ls,as=l.defineComponent({name:"Lock",__name:"lock",setup(o){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"}),l.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"})]))}}),hs=as,cs=l.defineComponent({name:"Unlock",__name:"unlock",setup(o){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.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"}),l.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"})]))}}),ds=cs;const De=ce.defineStore("globalPensieveDashVars",()=>{const o=l.ref([]),e=l.ref({}),t="dashboard-globalVarsStore",i=l.ref([]),s=l.ref([]),r=l.ref({}),a=l.reactive({}),n=l.reactive({});function d(C,T,F=!1){a[C]=T,n[C]=F}function h(C={}){for(const T of Object.keys(a))delete a[T];Object.assign(a,C)}const c=C=>{delete a[C]};function f(){for(const C of Object.keys(a))delete a[C]}function u(){s.value=[...o.value],h({})}const _=C=>s.value.find(T=>T.id===C),b=(C,T)=>{i.value.push({name:C,value:T})},L=()=>{i.value=[]},H=C=>{r.value=N(C)},A=()=>r.value;function N(C){const T={};if(!C||typeof C!="object")return T;for(const[F,O]of Object.entries(C))if(O&&typeof O=="object"&&!(l.isRef(O)||l.isReactive(O))){const z=Object.getPrototypeOf(O)===Object.prototype;T[F]=z?{...O}:l.markRaw(O)}else T[F]=O;return T}const D=C=>{const T=s.value.find(F=>F.id===C);T&&(T.Props=T.Props||{},T.Props.locked=!T.Props.locked)},v=C=>C.map(T=>{const F=e.value[T.componentKey];return F?{...T,component:F}:null}).filter(T=>!!T);function B(C){}function w(){}return{DASHBOARD_ITEMS:s,DefaultLayout:o,ComponentRegistry:e,optionsData:i,Services:r,Filters:a,displayFilters:n,registerGridProvider:B,unregisterGridProvider:w,setFilter:d,clearFilter:c,clearAllFilters:f,resetFilters:h,resetGridLayout:u,getDashItem:_,toggleWidgetLock:D,addOptionsDataItems:b,clearOptionsDataItems:L,loadFromLocalStorage:()=>{const C=localStorage.getItem(t);if(!C){u();return}try{const T=JSON.parse(C);s.value=Array.isArray(T.items)?v(T.items):[...o.value],h(T.filters??{})}catch(T){console.error("Failed to parse globalVarsStore:",T),s.value=[...o.value],h({})}},setOptionServices:H,getServices:A}}),us={class:"widget-settings-container"},ps={class:"widget-setting"},fs={class:"dialog-footer"},gs=l.defineComponent({__name:"TextWidgetSettings",props:{showDialog:{type:Boolean},reactiveSourceValue:{},manualEntryValue:{},hideHeaderValue:{type:Boolean}},emits:["close-dialog","update-text-var"],setup(o,{emit:e}){const t=De(),{optionsData:i}=ce.storeToRefs(t),s=e,r=o,a=l.computed({get:()=>r.showDialog,set:f=>{f||s("close-dialog")}}),n=l.ref(r.reactiveSourceValue??""),d=l.ref(r.manualEntryValue??""),h=l.ref(!!r.hideHeaderValue);l.watch(()=>r.reactiveSourceValue,f=>{n.value=f??""}),l.watch(()=>r.manualEntryValue,f=>{d.value=f??""},{immediate:!0}),l.watch(()=>r.hideHeaderValue,f=>{h.value=!!f});function c(){var b;const f=(n.value||"").trim(),u=f!=="",_=u?null:((b=d.value)==null?void 0:b.trim())||"";s("update-text-var",{reactiveSource:u?f:null,manualEdit:_,hideHeader:h.value}),a.value=!1}return(f,u)=>{const _=l.resolveComponent("el-option"),b=l.resolveComponent("el-select"),L=l.resolveComponent("el-input"),H=l.resolveComponent("el-checkbox"),A=l.resolveComponent("el-button"),N=l.resolveComponent("el-dialog");return l.openBlock(),l.createBlock(N,{class:"full-dialog-dashboard",modelValue:a.value,"onUpdate:modelValue":u[4]||(u[4]=D=>a.value=D),title:"Text Widget Settings","append-to-body":!0},{footer:l.withCtx(()=>[l.createElementVNode("div",fs,[l.createVNode(A,{class:"secondary",onClick:u[3]||(u[3]=D=>a.value=!1)},{default:l.withCtx(()=>[...u[8]||(u[8]=[l.createTextVNode("Cancel",-1)])]),_:1}),l.createVNode(A,{onClick:c},{default:l.withCtx(()=>[...u[9]||(u[9]=[l.createTextVNode("Save",-1)])]),_:1})])]),default:l.withCtx(()=>[l.createElementVNode("div",us,[l.createElementVNode("div",ps,[u[5]||(u[5]=l.createElementVNode("h4",null,"Select This Widget's Value",-1)),u[6]||(u[6]=l.createElementVNode("h5",null,"Select From Variables",-1)),l.createVNode(b,{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=D=>n.value=D),class:"text-settings-height"},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(_,{value:"",key:"__manual__",label:"Manual entry"})),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(i),D=>(l.openBlock(),l.createBlock(_,{key:D.name,label:D.name,value:D.name},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),u[7]||(u[7]=l.createElementVNode("h5",null,"Manual Entry",-1)),l.createVNode(L,{modelValue:d.value,"onUpdate:modelValue":u[1]||(u[1]=D=>d.value=D),class:"text-settings-height"},null,8,["modelValue"]),l.createVNode(H,{modelValue:h.value,"onUpdate:modelValue":u[2]||(u[2]=D=>h.value=D),label:"Hide Header"},null,8,["modelValue"])])])]),_:1},8,["modelValue"])}}}),_e=(o,e)=>{const t=o.__vccOpts||o;for(const[i,s]of e)t[i]=s;return t},ms=_e(gs,[["__scopeId","data-v-769ea864"]]),_s={key:0},ys=_e(l.defineComponent({inheritAttrs:!1,__name:"TextWidget",props:{displayText:{},bindedKey:{},widgetID:{},hideHeader:{type:Boolean}},setup(o){const e=De(),t=o;l.inject("dashboard:globalVars",null);const i=l.ref(t.displayText??"");l.watch(()=>t.displayText,A=>{i.value=A??""},{immediate:!0});const s=l.computed(()=>!!(t.bindedKey&&t.bindedKey.trim()!=="")),r=l.computed(()=>{var v;const A=(v=t.bindedKey)==null?void 0:v.trim();if(!A)return"—";const N=e.optionsData.find(B=>(B==null?void 0:B.name)===A),D=N==null?void 0:N.value;return Array.isArray(D)?D.join(", "):D&&typeof D=="object"?JSON.stringify(D):D??"—"}),a=l.ref("Text Widget"),n=l.shallowRef([{comp:Qt,event:_,tooltip:"open Text settings"}]),d=l.ref(!1),h=l.ref(null);function c(){var A,N;d.value=!0,(N=(A=h.value)==null?void 0:A.focus)==null||N.call(A)}function f(){d.value=!1}const u=l.ref(!1);function _(){u.value=!0}function b(){u.value=!1}function L({manualEdit:A,reactiveSource:N,hideHeader:D}){const v=e.getDashItem(t.widgetID);v&&(v.hideHeader=D,N&&N.trim()!==""?(v.Props=v.Props||{},v.Props.bindedKey=N,v.Props.displayText=null,v.componentName=H(N)):(v.Props=v.Props||{},v.Props.bindedKey=null,v.Props.displayText=A??"",v.componentName=A??"Text"))}function H(A){return A?A.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,N=>N.toUpperCase()):""}return(A,N)=>{const D=l.resolveComponent("el-input"),v=l.resolveDirective("click-out");return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.renderSlot(A.$slots,"default",{widgetName:a.value,childIcons:n.value},void 0,!0),l.createElementVNode("div",l.mergeProps({class:"text-widget-wrap"},A.$attrs),[s.value?(l.openBlock(),l.createElementBlock("div",_s,[l.createElementVNode("h2",null,l.toDisplayString(r.value),1)])):l.withDirectives((l.openBlock(),l.createElementBlock("div",{key:1,onKeyup:l.withKeys(f,["enter"]),class:"tw-flex"},[l.withDirectives(l.createElementVNode("div",null,[l.createVNode(D,{ref_key:"textUserInput",ref:h,modelValue:i.value,"onUpdate:modelValue":N[0]||(N[0]=B=>i.value=B),onFocus:N[1]||(N[1]=B=>{var w,y;return(y=(w=B.target)==null?void 0:w.select)==null?void 0:y.call(w)})},null,8,["modelValue"])],512),[[l.vShow,d.value]]),l.withDirectives(l.createElementVNode("div",{onClick:N[2]||(N[2]=B=>c()),class:"tw-w-full tw-h-full"},[l.createElementVNode("h2",null,l.toDisplayString(i.value),1)],512),[[l.vShow,!d.value]])],32)),[[v,f]])],16),l.createVNode(ms,{"show-dialog":u.value,"reactive-source-value":t.bindedKey||"","manual-entry-value":i.value,"hide-header-value":t.hideHeader||!1,onCloseDialog:b,onUpdateTextVar:L},null,8,["show-dialog","reactive-source-value","manual-entry-value","hide-header-value"])],64)}}}),[["__scopeId","data-v-bbd00006"]]);function wt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ye=wt();function Jt(o){ye=o}var Ne={exec:()=>null};function M(o,e=""){let t=typeof o=="string"?o:o.source,i={replace:(s,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(K.caret,"$1"),t=t.replace(s,a),i},getRegex:()=>new RegExp(t,e)};return i}var K={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:o=>new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}#`),htmlBeginRegex:o=>new RegExp(`^ {0,${Math.min(3,o-1)}}<(?:[a-z].*>|!--)`,"i")},ws=/^(?:[ \t]*(?:\n|$))+/,bs=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xs=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Le=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ks=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bt=/(?:[*+-]|\d{1,9}[.)])/,ei=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ti=M(ei).replace(/bull/g,bt).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(),Es=M(ei).replace(/bull/g,bt).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(),xt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,vs=/^[^\n]+/,kt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ts=M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",kt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Rs=M(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,bt).getRegex(),qe="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",Et=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Cs=M("^ {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",Et).replace("tag",qe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ii=M(xt).replace("hr",Le).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",qe).getRegex(),Ss=M(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ii).getRegex(),vt={blockquote:Ss,code:bs,def:Ts,fences:xs,heading:ks,hr:Le,html:Cs,lheading:ti,list:Rs,newline:ws,paragraph:ii,table:Ne,text:vs},si=M("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Le).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",qe).getRegex(),As={...vt,lheading:Es,table:si,paragraph:M(xt).replace("hr",Le).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",si).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",qe).getRegex()},Ds={...vt,html:M(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Et).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:Ne,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:M(xt).replace("hr",Le).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",ti).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ns=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ls=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ri=/^( {2,}|\\)\n(?!\s*$)/,zs=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,je=/[\p{P}\p{S}]/u,Tt=/[\s\p{P}\p{S}]/u,ni=/[^\s\p{P}\p{S}]/u,Ms=M(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Tt).getRegex(),oi=/(?!~)[\p{P}\p{S}]/u,Is=/(?!~)[\s\p{P}\p{S}]/u,Hs=/(?:[^\s\p{P}\p{S}]|~)/u,Os=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,li=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ps=M(li,"u").replace(/punct/g,je).getRegex(),Bs=M(li,"u").replace(/punct/g,oi).getRegex(),ai="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$s=M(ai,"gu").replace(/notPunctSpace/g,ni).replace(/punctSpace/g,Tt).replace(/punct/g,je).getRegex(),Us=M(ai,"gu").replace(/notPunctSpace/g,Hs).replace(/punctSpace/g,Is).replace(/punct/g,oi).getRegex(),Fs=M("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ni).replace(/punctSpace/g,Tt).replace(/punct/g,je).getRegex(),Ws=M(/\\(punct)/,"gu").replace(/punct/g,je).getRegex(),Gs=M(/^<(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(),Vs=M(Et).replace("(?:-->|$)","-->").getRegex(),qs=M("^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",Vs).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ye=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,js=M(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ye).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),hi=M(/^!?\[(label)\]\[(ref)\]/).replace("label",Ye).replace("ref",kt).getRegex(),ci=M(/^!?\[(ref)\](?:\[\])?/).replace("ref",kt).getRegex(),Ys=M("reflink|nolink(?!\\()","g").replace("reflink",hi).replace("nolink",ci).getRegex(),Rt={_backpedal:Ne,anyPunctuation:Ws,autolink:Gs,blockSkip:Os,br:ri,code:Ls,del:Ne,emStrongLDelim:Ps,emStrongRDelimAst:$s,emStrongRDelimUnd:Fs,escape:Ns,link:js,nolink:ci,punctuation:Ms,reflink:hi,reflinkSearch:Ys,tag:qs,text:zs,url:Ne},Xs={...Rt,link:M(/^!?\[(label)\]\((.*?)\)/).replace("label",Ye).getRegex(),reflink:M(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ye).getRegex()},Ct={...Rt,emStrongRDelimAst:Us,emStrongLDelim:Bs,url:M(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Zs={...Ct,br:M(ri).replace("{2,}","*").getRegex(),text:M(Ct.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xe={normal:vt,gfm:As,pedantic:Ds},ze={normal:Rt,gfm:Ct,breaks:Zs,pedantic:Xs},Ks={"&":"&","<":"<",">":">",'"':""","'":"'"},di=o=>Ks[o];function oe(o,e){if(e){if(K.escapeTest.test(o))return o.replace(K.escapeReplace,di)}else if(K.escapeTestNoEncode.test(o))return o.replace(K.escapeReplaceNoEncode,di);return o}function ui(o){try{o=encodeURI(o).replace(K.percentDecode,"%")}catch{return null}return o}function pi(o,e){var r;let t=o.replace(K.findPipe,(a,n,d)=>{let h=!1,c=n;for(;--c>=0&&d[c]==="\\";)h=!h;return h?"|":" |"}),i=t.split(K.splitPipe),s=0;if(i[0].trim()||i.shift(),i.length>0&&!((r=i.at(-1))!=null&&r.trim())&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(K.slashPipe,"|");return i}function Me(o,e,t){let i=o.length;if(i===0)return"";let s=0;for(;s<i&&o.charAt(i-s-1)===e;)s++;return o.slice(0,i-s)}function Qs(o,e){if(o.indexOf(e[1])===-1)return-1;let t=0;for(let i=0;i<o.length;i++)if(o[i]==="\\")i++;else if(o[i]===e[0])t++;else if(o[i]===e[1]&&(t--,t<0))return i;return t>0?-2:-1}function fi(o,e,t,i,s){let r=e.href,a=e.title||null,n=o[1].replace(s.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:o[0].charAt(0)==="!"?"image":"link",raw:t,href:r,title:a,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,d}function Js(o,e,t){let i=o.match(t.other.indentCodeCompensation);if(i===null)return e;let s=i[1];return e.split(`
|
|
3
|
+
`).map(r=>{let a=r.match(t.other.beginningSpace);if(a===null)return r;let[n]=a;return n.length>=s.length?r.slice(s.length):r}).join(`
|
|
4
4
|
`)}var Ze=class{constructor(o){P(this,"options");P(this,"rules");P(this,"lexer");this.options=o||ye}space(o){let e=this.rules.block.newline.exec(o);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(o){let e=this.rules.block.code.exec(o);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Me(t,`
|
|
5
5
|
`)}}}fences(o){let e=this.rules.block.fences.exec(o);if(e){let t=e[0],i=Js(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(o){let e=this.rules.block.heading.exec(o);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let i=Me(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(o){let e=this.rules.block.hr.exec(o);if(e)return{type:"hr",raw:Me(e[0],`
|
|
6
6
|
`)}}blockquote(o){let e=this.rules.block.blockquote.exec(o);if(e){let t=Me(e[0],`
|
|
7
7
|
`).split(`
|
|
8
|
-
`),i="",s="",r=[];for(;t.length>0;){let
|
|
8
|
+
`),i="",s="",r=[];for(;t.length>0;){let a=!1,n=[],d;for(d=0;d<t.length;d++)if(this.rules.other.blockquoteStart.test(t[d]))n.push(t[d]),a=!0;else if(!a)n.push(t[d]);else break;t=t.slice(d);let h=n.join(`
|
|
9
9
|
`),c=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
10
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
|
|
11
11
|
${h}`:h,s=s?`${s}
|
|
@@ -14,51 +14,51 @@ ${c}`:c;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
14
14
|
`),L=this.blockquote(b);r[r.length-1]=L,i=i.substring(0,i.length-_.raw.length)+L.raw,s=s.substring(0,s.length-_.text.length)+L.text;break}else if((u==null?void 0:u.type)==="list"){let _=u,b=_.raw+`
|
|
15
15
|
`+t.join(`
|
|
16
16
|
`),L=this.list(b);r[r.length-1]=L,i=i.substring(0,i.length-u.raw.length)+L.raw,s=s.substring(0,s.length-_.raw.length)+L.raw,t=b.substring(r.at(-1).raw.length).split(`
|
|
17
|
-
`);continue}}return{type:"blockquote",raw:i,tokens:r,text:s}}}list(o){let e=this.rules.block.list.exec(o);if(e){let t=e[1].trim(),i=t.length>1,s={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 r=this.rules.other.listItemRegex(t),
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:i,tokens:r,text:s}}}list(o){let e=this.rules.block.list.exec(o);if(e){let t=e[1].trim(),i=t.length>1,s={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 r=this.rules.other.listItemRegex(t),a=!1;for(;o;){let d=!1,h="",c="";if(!(e=r.exec(o))||this.rules.block.hr.test(o))break;h=e[0],o=o.substring(h.length);let f=e[2].split(`
|
|
18
18
|
`,1)[0].replace(this.rules.other.listReplaceTabs,A=>" ".repeat(3*A.length)),u=o.split(`
|
|
19
19
|
`,1)[0],_=!f.trim(),b=0;if(this.options.pedantic?(b=2,c=f.trimStart()):_?b=e[1].length+1:(b=e[2].search(this.rules.other.nonSpaceChar),b=b>4?1:b,c=f.slice(b),b+=e[1].length),_&&this.rules.other.blankLine.test(u)&&(h+=u+`
|
|
20
|
-
`,o=o.substring(u.length+1),d=!0),!d){let A=this.rules.other.nextBulletRegex(b),N=this.rules.other.hrRegex(b),D=this.rules.other.fencesBeginRegex(b),
|
|
21
|
-
`,1)[0],
|
|
22
|
-
`+
|
|
23
|
-
`+u}!_&&!u.trim()&&(_=!0),h+=
|
|
24
|
-
`,o=o.substring(
|
|
20
|
+
`,o=o.substring(u.length+1),d=!0),!d){let A=this.rules.other.nextBulletRegex(b),N=this.rules.other.hrRegex(b),D=this.rules.other.fencesBeginRegex(b),v=this.rules.other.headingBeginRegex(b),B=this.rules.other.htmlBeginRegex(b);for(;o;){let w=o.split(`
|
|
21
|
+
`,1)[0],y;if(u=w,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),y=u):y=u.replace(this.rules.other.tabCharGlobal," "),D.test(u)||v.test(u)||B.test(u)||A.test(u)||N.test(u))break;if(y.search(this.rules.other.nonSpaceChar)>=b||!u.trim())c+=`
|
|
22
|
+
`+y.slice(b);else{if(_||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||D.test(f)||v.test(f)||N.test(f))break;c+=`
|
|
23
|
+
`+u}!_&&!u.trim()&&(_=!0),h+=w+`
|
|
24
|
+
`,o=o.substring(w.length+1),f=y.slice(b)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(a=!0));let L=null,H;this.options.gfm&&(L=this.rules.other.listIsTask.exec(c),L&&(H=L[0]!=="[ ] ",c=c.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:h,task:!!L,checked:H,loose:!1,text:c,tokens:[]}),s.raw+=h}let n=s.items.at(-1);if(n)n.raw=n.raw.trimEnd(),n.text=n.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let d=0;d<s.items.length;d++)if(this.lexer.state.top=!1,s.items[d].tokens=this.lexer.blockTokens(s.items[d].text,[]),!s.loose){let h=s.items[d].tokens.filter(f=>f.type==="space"),c=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=c}if(s.loose)for(let d=0;d<s.items.length;d++)s.items[d].loose=!0;return s}}html(o){let e=this.rules.block.html.exec(o);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(o){let e=this.rules.block.def.exec(o);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"):"",s=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:s}}}table(o){var a;let e=this.rules.block.table.exec(o);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=pi(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(a=e[3])!=null&&a.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
25
|
`):[],r={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===i.length){for(let n of i)this.rules.other.tableAlignRight.test(n)?r.align.push("right"):this.rules.other.tableAlignCenter.test(n)?r.align.push("center"):this.rules.other.tableAlignLeft.test(n)?r.align.push("left"):r.align.push(null);for(let n=0;n<t.length;n++)r.header.push({text:t[n],tokens:this.lexer.inline(t[n]),header:!0,align:r.align[n]});for(let n of s)r.rows.push(pi(n,r.header.length).map((d,h)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:r.align[h]})));return r}}lheading(o){let e=this.rules.block.lheading.exec(o);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(o){let e=this.rules.block.paragraph.exec(o);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(o){let e=this.rules.block.text.exec(o);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(o){let e=this.rules.inline.escape.exec(o);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(o){let e=this.rules.inline.tag.exec(o);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(o){let e=this.rules.inline.link.exec(o);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 r=Me(t.slice(0,-1),"\\");if((t.length-r.length)%2===0)return}else{let r=Qs(e[2],"()");if(r===-2)return;if(r>-1){let
|
|
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){var s,r,
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(o){let e=this.rules.block.text.exec(o);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(o){let e=this.rules.inline.escape.exec(o);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(o){let e=this.rules.inline.tag.exec(o);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(o){let e=this.rules.inline.link.exec(o);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 r=Me(t.slice(0,-1),"\\");if((t.length-r.length)%2===0)return}else{let r=Qs(e[2],"()");if(r===-2)return;if(r>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let i=e[2],s="";if(this.options.pedantic){let r=this.rules.other.pedanticHrefTitle.exec(i);r&&(i=r[1],s=r[3])}else s=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)),fi(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(o,e){let t;if((t=this.rules.inline.reflink.exec(o))||(t=this.rules.inline.nolink.exec(o))){let i=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[i.toLowerCase()];if(!s){let r=t[0].charAt(0);return{type:"text",raw:r,text:r}}return fi(t,s,t[0],this.lexer,this.rules)}}emStrong(o,e,t=""){let i=this.rules.inline.emStrongLDelim.exec(o);if(!(!i||i[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!t||this.rules.inline.punctuation.exec(t))){let s=[...i[0]].length-1,r,a,n=s,d=0,h=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*o.length+s);(i=h.exec(e))!=null;){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r)continue;if(a=[...r].length,i[3]||i[4]){n+=a;continue}else if((i[5]||i[6])&&s%3&&!((s+a)%3)){d+=a;continue}if(n-=a,n>0)continue;a=Math.min(a,a+n+d);let c=[...i[0]][0].length,f=o.slice(0,s+i.index+c+a);if(Math.min(s,a)%2){let _=f.slice(1,-1);return{type:"em",raw:f,text:_,tokens:this.lexer.inlineTokens(_)}}let u=f.slice(2,-2);return{type:"strong",raw:f,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(o){let e=this.rules.inline.code.exec(o);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return i&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(o){let e=this.rules.inline.br.exec(o);if(e)return{type:"br",raw:e[0]}}del(o){let e=this.rules.inline.del.exec(o);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(o){let e=this.rules.inline.autolink.exec(o);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(o){var t;let e;if(e=this.rules.inline.url.exec(o)){let i,s;if(e[2]==="@")i=e[0],s="mailto:"+i;else{let r;do r=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(r!==e[0]);i=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(o){let e=this.rules.inline.text.exec(o);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},de=class Zt{constructor(e){P(this,"tokens");P(this,"options");P(this,"state");P(this,"tokenizer");P(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ye,this.options.tokenizer=this.options.tokenizer||new Ze,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:K,block:Xe.normal,inline:ze.normal};this.options.pedantic?(t.block=Xe.pedantic,t.inline=ze.pedantic):this.options.gfm&&(t.block=Xe.gfm,this.options.breaks?t.inline=ze.breaks:t.inline=ze.gfm),this.tokenizer.rules=t}static get rules(){return{block:Xe,inline:ze}}static lex(e,t){return new Zt(t).lex(e)}static lexInline(e,t){return new Zt(t).inlineTokens(e)}lex(e){e=e.replace(K.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){var s,r,a;for(this.options.pedantic&&(e=e.replace(K.tabCharGlobal," ").replace(K.spaceLine,""));e;){let n;if((r=(s=this.options.extensions)==null?void 0:s.block)!=null&&r.some(h=>(n=h.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let h=t.at(-1);n.raw.length===1&&h!==void 0?h.raw+=`
|
|
28
28
|
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let h=t.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
29
29
|
`)?"":`
|
|
30
30
|
`)+n.raw,h.text+=`
|
|
31
31
|
`+n.text,this.inlineQueue.at(-1).src=h.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let h=t.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
32
32
|
`)?"":`
|
|
33
33
|
`)+n.raw,h.text+=`
|
|
34
|
-
`+n.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let d=e;if((
|
|
34
|
+
`+n.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let d=e;if((a=this.options.extensions)!=null&&a.startBlock){let h=1/0,c=e.slice(1),f;this.options.extensions.startBlock.forEach(u=>{f=u.call({lexer:this},c),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(d=e.substring(0,h+1))}if(this.state.top&&(n=this.tokenizer.paragraph(d))){let h=t.at(-1);i&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
|
|
35
35
|
`)?"":`
|
|
36
36
|
`)+n.raw,h.text+=`
|
|
37
37
|
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):t.push(n),i=d.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let h=t.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
38
38
|
`)?"":`
|
|
39
39
|
`)+n.raw,h.text+=`
|
|
40
|
-
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):t.push(n);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var n,d,h;let i=e,s=null;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)c.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,s.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let r=!1,
|
|
40
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):t.push(n);continue}if(e){let h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var n,d,h;let i=e,s=null;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)c.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,s.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let r=!1,a="";for(;e;){r||(a=""),r=!1;let c;if((d=(n=this.options.extensions)==null?void 0:n.inline)!=null&&d.some(u=>(c=u.call({lexer:this},e,t))?(e=e.substring(c.raw.length),t.push(c),!0):!1))continue;if(c=this.tokenizer.escape(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.tag(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.link(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(c.raw.length);let u=t.at(-1);c.type==="text"&&(u==null?void 0:u.type)==="text"?(u.raw+=c.raw,u.text+=c.text):t.push(c);continue}if(c=this.tokenizer.emStrong(e,i,a)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.codespan(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.br(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.del(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.autolink(e)){e=e.substring(c.raw.length),t.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(e))){e=e.substring(c.raw.length),t.push(c);continue}let f=e;if((h=this.options.extensions)!=null&&h.startInline){let u=1/0,_=e.slice(1),b;this.options.extensions.startInline.forEach(L=>{b=L.call({lexer:this},_),typeof b=="number"&&b>=0&&(u=Math.min(u,b))}),u<1/0&&u>=0&&(f=e.substring(0,u+1))}if(c=this.tokenizer.inlineText(f)){e=e.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(a=c.raw.slice(-1)),r=!0;let u=t.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=c.raw,u.text+=c.text):t.push(c);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return t}},Ke=class{constructor(o){P(this,"options");P(this,"parser");this.options=o||ye}space(o){return""}code({text:o,lang:e,escaped:t}){var r;let i=(r=(e||"").match(K.notSpaceStart))==null?void 0:r[0],s=o.replace(K.endingNewline,"")+`
|
|
41
41
|
`;return i?'<pre><code class="language-'+oe(i)+'">'+(t?s:oe(s,!0))+`</code></pre>
|
|
42
42
|
`:"<pre><code>"+(t?s:oe(s,!0))+`</code></pre>
|
|
43
43
|
`}blockquote({tokens:o}){return`<blockquote>
|
|
44
44
|
${this.parser.parse(o)}</blockquote>
|
|
45
45
|
`}html({text:o}){return o}def(o){return""}heading({tokens:o,depth:e}){return`<h${e}>${this.parser.parseInline(o)}</h${e}>
|
|
46
46
|
`}hr(o){return`<hr>
|
|
47
|
-
`}list(o){let e=o.ordered,t=o.start,i="";for(let
|
|
47
|
+
`}list(o){let e=o.ordered,t=o.start,i="";for(let a=0;a<o.items.length;a++){let n=o.items[a];i+=this.listitem(n)}let s=e?"ol":"ul",r=e&&t!==1?' start="'+t+'"':"";return"<"+s+r+`>
|
|
48
48
|
`+i+"</"+s+`>
|
|
49
49
|
`}listitem(o){var t;let e="";if(o.task){let i=this.checkbox({checked:!!o.checked});o.loose?((t=o.tokens[0])==null?void 0:t.type)==="paragraph"?(o.tokens[0].text=i+" "+o.tokens[0].text,o.tokens[0].tokens&&o.tokens[0].tokens.length>0&&o.tokens[0].tokens[0].type==="text"&&(o.tokens[0].tokens[0].text=i+" "+oe(o.tokens[0].tokens[0].text),o.tokens[0].tokens[0].escaped=!0)):o.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):e+=i+" "}return e+=this.parser.parse(o.tokens,!!o.loose),`<li>${e}</li>
|
|
50
50
|
`}checkbox({checked:o}){return"<input "+(o?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:o}){return`<p>${this.parser.parseInline(o)}</p>
|
|
51
|
-
`}table(o){let e="",t="";for(let s=0;s<o.header.length;s++)t+=this.tablecell(o.header[s]);e+=this.tablerow({text:t});let i="";for(let s=0;s<o.rows.length;s++){let r=o.rows[s];t="";for(let
|
|
51
|
+
`}table(o){let e="",t="";for(let s=0;s<o.header.length;s++)t+=this.tablecell(o.header[s]);e+=this.tablerow({text:t});let i="";for(let s=0;s<o.rows.length;s++){let r=o.rows[s];t="";for(let a=0;a<r.length;a++)t+=this.tablecell(r[a]);i+=this.tablerow({text:t})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
|
|
52
52
|
<thead>
|
|
53
53
|
`+e+`</thead>
|
|
54
54
|
`+i+`</table>
|
|
55
55
|
`}tablerow({text:o}){return`<tr>
|
|
56
56
|
${o}</tr>
|
|
57
57
|
`}tablecell(o){let e=this.parser.parseInline(o.tokens),t=o.header?"th":"td";return(o.align?`<${t} align="${o.align}">`:`<${t}>`)+e+`</${t}>
|
|
58
|
-
`}strong({tokens:o}){return`<strong>${this.parser.parseInline(o)}</strong>`}em({tokens:o}){return`<em>${this.parser.parseInline(o)}</em>`}codespan({text:o}){return`<code>${oe(o,!0)}</code>`}br(o){return"<br>"}del({tokens:o}){return`<del>${this.parser.parseInline(o)}</del>`}link({href:o,title:e,tokens:t}){let i=this.parser.parseInline(t),s=ui(o);if(s===null)return i;o=s;let r='<a href="'+o+'"';return e&&(r+=' title="'+oe(e)+'"'),r+=">"+i+"</a>",r}image({href:o,title:e,text:t,tokens:i}){i&&(t=this.parser.parseInline(i,this.parser.textRenderer));let s=ui(o);if(s===null)return oe(t);o=s;let r=`<img src="${o}" alt="${t}"`;return e&&(r+=` title="${oe(e)}"`),r+=">",r}text(o){return"tokens"in o&&o.tokens?this.parser.parseInline(o.tokens):"escaped"in o&&o.escaped?o.text:oe(o.text)}},St=class{strong({text:o}){return o}em({text:o}){return o}codespan({text:o}){return o}del({text:o}){return o}html({text:o}){return o}text({text:o}){return o}link({text:o}){return""+o}image({text:o}){return""+o}br(){return""}},ue=class Kt{constructor(e){P(this,"options");P(this,"renderer");P(this,"textRenderer");this.options=e||ye,this.options.renderer=this.options.renderer||new Ke,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new St}static parse(e,t){return new Kt(t).parse(e)}static parseInline(e,t){return new Kt(t).parseInline(e)}parse(e,t=!0){var s,r;let i="";for(let
|
|
59
|
-
`+this.renderer.text(h);t?i+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):i+=c;continue}default:{let h='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return i}parseInline(e,t=this.renderer){var s,r;let i="";for(let
|
|
60
|
-
Please report this to https://github.com/markedjs/marked.`,o){let i="<p>An error occurred:</p><pre>"+oe(t.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(t);throw t}}},we=new er;function I(o,e){return we.parse(o,e)}I.options=I.setOptions=function(o){return we.setOptions(o),I.defaults=we.defaults,Jt(I.defaults),I},I.getDefaults=wt,I.defaults=ye,I.use=function(...o){return we.use(...o),I.defaults=we.defaults,Jt(I.defaults),I},I.walkTokens=function(o,e){return we.walkTokens(o,e)},I.parseInline=we.parseInline,I.Parser=ue,I.parser=ue.parse,I.Renderer=Ke,I.TextRenderer=St,I.Lexer=de,I.lexer=de.lex,I.Tokenizer=Ze,I.Hooks=Qe,I.parse=I,I.options,I.setOptions,I.use,I.walkTokens,I.parseInline,ue.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:gi,setPrototypeOf:mi,isFrozen:tr,getPrototypeOf:ir,getOwnPropertyDescriptor:sr}=Object;let{freeze:Q,seal:se,create:_i}=Object,{apply:At,construct:Dt}=typeof Reflect<"u"&&Reflect;Q||(Q=function(e){return e}),se||(se=function(e){return e}),At||(At=function(e,t,i){return e.apply(t,i)}),Dt||(Dt=function(e,t){return new e(...t)});const Je=ee(Array.prototype.forEach),rr=ee(Array.prototype.lastIndexOf),yi=ee(Array.prototype.pop),Ie=ee(Array.prototype.push),nr=ee(Array.prototype.splice),et=ee(String.prototype.toLowerCase),Nt=ee(String.prototype.toString),wi=ee(String.prototype.match),He=ee(String.prototype.replace),or=ee(String.prototype.indexOf),lr=ee(String.prototype.trim),re=ee(Object.prototype.hasOwnProperty),J=ee(RegExp.prototype.test),Oe=ar(TypeError);function ee(o){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return At(o,e,i)}}function ar(o){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return Dt(o,t)}}function S(o,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:et;mi&&mi(o,null);let i=e.length;for(;i--;){let s=e[i];if(typeof s=="string"){const r=t(s);r!==s&&(tr(e)||(e[i]=r),s=r)}o[s]=!0}return o}function hr(o){for(let e=0;e<o.length;e++)re(o,e)||(o[e]=null);return o}function pe(o){const e=_i(null);for(const[t,i]of gi(o))re(o,t)&&(Array.isArray(i)?e[t]=hr(i):i&&typeof i=="object"&&i.constructor===Object?e[t]=pe(i):e[t]=i);return e}function Pe(o,e){for(;o!==null;){const i=sr(o,e);if(i){if(i.get)return ee(i.get);if(typeof i.value=="function")return ee(i.value)}o=ir(o)}function t(){return null}return t}const bi=Q(["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"]),Lt=Q(["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"]),zt=Q(["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"]),cr=Q(["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"]),Mt=Q(["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"]),dr=Q(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xi=Q(["#text"]),ki=Q(["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"]),It=Q(["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"]),Ei=Q(["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"]),tt=Q(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ur=se(/\{\{[\w\W]*|[\w\W]*\}\}/gm),pr=se(/<%[\w\W]*|[\w\W]*%>/gm),fr=se(/\$\{[\w\W]*/gm),gr=se(/^data-[\-\w.\u00B7-\uFFFF]+$/),mr=se(/^aria-[\-\w]+$/),vi=se(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_r=se(/^(?:\w+script|data):/i),yr=se(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ti=se(/^html$/i),wr=se(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ri=Object.freeze({__proto__:null,ARIA_ATTR:mr,ATTR_WHITESPACE:yr,CUSTOM_ELEMENT:wr,DATA_ATTR:gr,DOCTYPE_NAME:Ti,ERB_EXPR:pr,IS_ALLOWED_URI:vi,IS_SCRIPT_OR_DATA:_r,MUSTACHE_EXPR:ur,TMPLIT_EXPR:fr});const Be={element:1,text:3,progressingInstruction:7,comment:8,document:9},br=function(){return typeof window>"u"?null:window},xr=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(i=t.getAttribute(s));const r="dompurify"+(i?"#"+i:"");try{return e.createPolicy(r,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Ci=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Si(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:br();const e=k=>Si(k);if(e.version="3.2.6",e.removed=[],!o||!o.document||o.document.nodeType!==Be.document||!o.Element)return e.isSupported=!1,e;let{document:t}=o;const i=t,s=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:l,Node:n,Element:d,NodeFilter:h,NamedNodeMap:c=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:f,DOMParser:u,trustedTypes:_}=o,b=d.prototype,L=Pe(b,"cloneNode"),H=Pe(b,"remove"),A=Pe(b,"nextSibling"),N=Pe(b,"childNodes"),D=Pe(b,"parentNode");if(typeof l=="function"){const k=t.createElement("template");k.content&&k.content.ownerDocument&&(t=k.content.ownerDocument)}let T,B="";const{implementation:y,createNodeIterator:w,createDocumentFragment:C,getElementsByTagName:v}=t,{importNode:F}=i;let O=Ci();e.isSupported=typeof gi=="function"&&typeof D=="function"&&y&&y.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:be,TMPLIT_EXPR:ke,DATA_ATTR:at,ARIA_ATTR:ht,IS_SCRIPT_OR_DATA:ct,ATTR_WHITESPACE:Li,CUSTOM_ELEMENT:tn}=Ri;let{IS_ALLOWED_URI:zi}=Ri,G=null;const Mi=S({},[...bi,...Lt,...zt,...Mt,...xi]);let Y=null;const Ii=S({},[...ki,...It,...Ei,...tt]);let U=Object.seal(_i(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}})),Fe=null,Bt=null,Hi=!0,$t=!0,Oi=!1,Pi=!0,Ee=!1,dt=!0,xe=!1,Ut=!1,Ft=!1,ve=!1,ut=!1,pt=!1,Bi=!0,$i=!1;const sn="user-content-";let Wt=!0,We=!1,Te={},Re=null;const Ui=S({},["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 Fi=null;const Wi=S({},["audio","video","img","source","image","track"]);let Gt=null;const Gi=S({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ft="http://www.w3.org/1998/Math/MathML",gt="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let Ce=fe,Vt=!1,qt=null;const rn=S({},[ft,gt,fe],Nt);let mt=S({},["mi","mo","mn","ms","mtext"]),_t=S({},["annotation-xml"]);const nn=S({},["title","style","font","a","script"]);let Ge=null;const on=["application/xhtml+xml","text/html"],ln="text/html";let V=null,Se=null;const an=t.createElement("form"),Vi=function(p){return p instanceof RegExp||p instanceof Function},jt=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Se&&Se===p)){if((!p||typeof p!="object")&&(p={}),p=pe(p),Ge=on.indexOf(p.PARSER_MEDIA_TYPE)===-1?ln:p.PARSER_MEDIA_TYPE,V=Ge==="application/xhtml+xml"?Nt:et,G=re(p,"ALLOWED_TAGS")?S({},p.ALLOWED_TAGS,V):Mi,Y=re(p,"ALLOWED_ATTR")?S({},p.ALLOWED_ATTR,V):Ii,qt=re(p,"ALLOWED_NAMESPACES")?S({},p.ALLOWED_NAMESPACES,Nt):rn,Gt=re(p,"ADD_URI_SAFE_ATTR")?S(pe(Gi),p.ADD_URI_SAFE_ATTR,V):Gi,Fi=re(p,"ADD_DATA_URI_TAGS")?S(pe(Wi),p.ADD_DATA_URI_TAGS,V):Wi,Re=re(p,"FORBID_CONTENTS")?S({},p.FORBID_CONTENTS,V):Ui,Fe=re(p,"FORBID_TAGS")?S({},p.FORBID_TAGS,V):pe({}),Bt=re(p,"FORBID_ATTR")?S({},p.FORBID_ATTR,V):pe({}),Te=re(p,"USE_PROFILES")?p.USE_PROFILES:!1,Hi=p.ALLOW_ARIA_ATTR!==!1,$t=p.ALLOW_DATA_ATTR!==!1,Oi=p.ALLOW_UNKNOWN_PROTOCOLS||!1,Pi=p.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ee=p.SAFE_FOR_TEMPLATES||!1,dt=p.SAFE_FOR_XML!==!1,xe=p.WHOLE_DOCUMENT||!1,ve=p.RETURN_DOM||!1,ut=p.RETURN_DOM_FRAGMENT||!1,pt=p.RETURN_TRUSTED_TYPE||!1,Ft=p.FORCE_BODY||!1,Bi=p.SANITIZE_DOM!==!1,$i=p.SANITIZE_NAMED_PROPS||!1,Wt=p.KEEP_CONTENT!==!1,We=p.IN_PLACE||!1,zi=p.ALLOWED_URI_REGEXP||vi,Ce=p.NAMESPACE||fe,mt=p.MATHML_TEXT_INTEGRATION_POINTS||mt,_t=p.HTML_INTEGRATION_POINTS||_t,U=p.CUSTOM_ELEMENT_HANDLING||{},p.CUSTOM_ELEMENT_HANDLING&&Vi(p.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(U.tagNameCheck=p.CUSTOM_ELEMENT_HANDLING.tagNameCheck),p.CUSTOM_ELEMENT_HANDLING&&Vi(p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(U.attributeNameCheck=p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),p.CUSTOM_ELEMENT_HANDLING&&typeof p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(U.allowCustomizedBuiltInElements=p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&($t=!1),ut&&(ve=!0),Te&&(G=S({},xi),Y=[],Te.html===!0&&(S(G,bi),S(Y,ki)),Te.svg===!0&&(S(G,Lt),S(Y,It),S(Y,tt)),Te.svgFilters===!0&&(S(G,zt),S(Y,It),S(Y,tt)),Te.mathMl===!0&&(S(G,Mt),S(Y,Ei),S(Y,tt))),p.ADD_TAGS&&(G===Mi&&(G=pe(G)),S(G,p.ADD_TAGS,V)),p.ADD_ATTR&&(Y===Ii&&(Y=pe(Y)),S(Y,p.ADD_ATTR,V)),p.ADD_URI_SAFE_ATTR&&S(Gt,p.ADD_URI_SAFE_ATTR,V),p.FORBID_CONTENTS&&(Re===Ui&&(Re=pe(Re)),S(Re,p.FORBID_CONTENTS,V)),Wt&&(G["#text"]=!0),xe&&S(G,["html","head","body"]),G.table&&(S(G,["tbody"]),delete Fe.tbody),p.TRUSTED_TYPES_POLICY){if(typeof p.TRUSTED_TYPES_POLICY.createHTML!="function")throw Oe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof p.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Oe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=p.TRUSTED_TYPES_POLICY,B=T.createHTML("")}else T===void 0&&(T=xr(_,s)),T!==null&&typeof B=="string"&&(B=T.createHTML(""));Q&&Q(p),Se=p}},qi=S({},[...Lt,...zt,...cr]),ji=S({},[...Mt,...dr]),hn=function(p){let m=D(p);(!m||!m.tagName)&&(m={namespaceURI:Ce,tagName:"template"});const x=et(p.tagName),$=et(m.tagName);return qt[p.namespaceURI]?p.namespaceURI===gt?m.namespaceURI===fe?x==="svg":m.namespaceURI===ft?x==="svg"&&($==="annotation-xml"||mt[$]):!!qi[x]:p.namespaceURI===ft?m.namespaceURI===fe?x==="math":m.namespaceURI===gt?x==="math"&&_t[$]:!!ji[x]:p.namespaceURI===fe?m.namespaceURI===gt&&!_t[$]||m.namespaceURI===ft&&!mt[$]?!1:!ji[x]&&(nn[x]||!qi[x]):!!(Ge==="application/xhtml+xml"&&qt[p.namespaceURI]):!1},he=function(p){Ie(e.removed,{element:p});try{D(p).removeChild(p)}catch{H(p)}},Ae=function(p,m){try{Ie(e.removed,{attribute:m.getAttributeNode(p),from:m})}catch{Ie(e.removed,{attribute:null,from:m})}if(m.removeAttribute(p),p==="is")if(ve||ut)try{he(m)}catch{}else try{m.setAttribute(p,"")}catch{}},Yi=function(p){let m=null,x=null;if(Ft)p="<remove></remove>"+p;else{const W=wi(p,/^[\r\n\t ]+/);x=W&&W[0]}Ge==="application/xhtml+xml"&&Ce===fe&&(p='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+p+"</body></html>");const $=T?T.createHTML(p):p;if(Ce===fe)try{m=new u().parseFromString($,Ge)}catch{}if(!m||!m.documentElement){m=y.createDocument(Ce,"template",null);try{m.documentElement.innerHTML=Vt?B:$}catch{}}const X=m.body||m.documentElement;return p&&x&&X.insertBefore(t.createTextNode(x),X.childNodes[0]||null),Ce===fe?v.call(m,xe?"html":"body")[0]:xe?m.documentElement:X},Xi=function(p){return w.call(p.ownerDocument||p,p,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Yt=function(p){return p instanceof f&&(typeof p.nodeName!="string"||typeof p.textContent!="string"||typeof p.removeChild!="function"||!(p.attributes instanceof c)||typeof p.removeAttribute!="function"||typeof p.setAttribute!="function"||typeof p.namespaceURI!="string"||typeof p.insertBefore!="function"||typeof p.hasChildNodes!="function")},Zi=function(p){return typeof n=="function"&&p instanceof n};function ge(k,p,m){Je(k,x=>{x.call(e,p,m,Se)})}const Ki=function(p){let m=null;if(ge(O.beforeSanitizeElements,p,null),Yt(p))return he(p),!0;const x=V(p.nodeName);if(ge(O.uponSanitizeElement,p,{tagName:x,allowedTags:G}),dt&&p.hasChildNodes()&&!Zi(p.firstElementChild)&&J(/<[/\w!]/g,p.innerHTML)&&J(/<[/\w!]/g,p.textContent)||p.nodeType===Be.progressingInstruction||dt&&p.nodeType===Be.comment&&J(/<[/\w]/g,p.data))return he(p),!0;if(!G[x]||Fe[x]){if(!Fe[x]&&Ji(x)&&(U.tagNameCheck instanceof RegExp&&J(U.tagNameCheck,x)||U.tagNameCheck instanceof Function&&U.tagNameCheck(x)))return!1;if(Wt&&!Re[x]){const $=D(p)||p.parentNode,X=N(p)||p.childNodes;if(X&&$){const W=X.length;for(let te=W-1;te>=0;--te){const me=L(X[te],!0);me.__removalCount=(p.__removalCount||0)+1,$.insertBefore(me,A(p))}}}return he(p),!0}return p instanceof d&&!hn(p)||(x==="noscript"||x==="noembed"||x==="noframes")&&J(/<\/no(script|embed|frames)/i,p.innerHTML)?(he(p),!0):(Ee&&p.nodeType===Be.text&&(m=p.textContent,Je([z,be,ke],$=>{m=He(m,$," ")}),p.textContent!==m&&(Ie(e.removed,{element:p.cloneNode()}),p.textContent=m)),ge(O.afterSanitizeElements,p,null),!1)},Qi=function(p,m,x){if(Bi&&(m==="id"||m==="name")&&(x in t||x in an))return!1;if(!($t&&!Bt[m]&&J(at,m))){if(!(Hi&&J(ht,m))){if(!Y[m]||Bt[m]){if(!(Ji(p)&&(U.tagNameCheck instanceof RegExp&&J(U.tagNameCheck,p)||U.tagNameCheck instanceof Function&&U.tagNameCheck(p))&&(U.attributeNameCheck instanceof RegExp&&J(U.attributeNameCheck,m)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(m))||m==="is"&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&J(U.tagNameCheck,x)||U.tagNameCheck instanceof Function&&U.tagNameCheck(x))))return!1}else if(!Gt[m]){if(!J(zi,He(x,Li,""))){if(!((m==="src"||m==="xlink:href"||m==="href")&&p!=="script"&&or(x,"data:")===0&&Fi[p])){if(!(Oi&&!J(ct,He(x,Li,"")))){if(x)return!1}}}}}}return!0},Ji=function(p){return p!=="annotation-xml"&&wi(p,tn)},es=function(p){ge(O.beforeSanitizeAttributes,p,null);const{attributes:m}=p;if(!m||Yt(p))return;const x={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let $=m.length;for(;$--;){const X=m[$],{name:W,namespaceURI:te,value:me}=X,Ve=V(W),Xt=me;let Z=W==="value"?Xt:lr(Xt);if(x.attrName=Ve,x.attrValue=Z,x.keepAttr=!0,x.forceKeepAttr=void 0,ge(O.uponSanitizeAttribute,p,x),Z=x.attrValue,$i&&(Ve==="id"||Ve==="name")&&(Ae(W,p),Z=sn+Z),dt&&J(/((--!?|])>)|<\/(style|title)/i,Z)){Ae(W,p);continue}if(x.forceKeepAttr)continue;if(!x.keepAttr){Ae(W,p);continue}if(!Pi&&J(/\/>/i,Z)){Ae(W,p);continue}Ee&&Je([z,be,ke],is=>{Z=He(Z,is," ")});const ts=V(p.nodeName);if(!Qi(ts,Ve,Z)){Ae(W,p);continue}if(T&&typeof _=="object"&&typeof _.getAttributeType=="function"&&!te)switch(_.getAttributeType(ts,Ve)){case"TrustedHTML":{Z=T.createHTML(Z);break}case"TrustedScriptURL":{Z=T.createScriptURL(Z);break}}if(Z!==Xt)try{te?p.setAttributeNS(te,W,Z):p.setAttribute(W,Z),Yt(p)?he(p):yi(e.removed)}catch{Ae(W,p)}}ge(O.afterSanitizeAttributes,p,null)},cn=function k(p){let m=null;const x=Xi(p);for(ge(O.beforeSanitizeShadowDOM,p,null);m=x.nextNode();)ge(O.uponSanitizeShadowNode,m,null),Ki(m),es(m),m.content instanceof r&&k(m.content);ge(O.afterSanitizeShadowDOM,p,null)};return e.sanitize=function(k){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=null,x=null,$=null,X=null;if(Vt=!k,Vt&&(k="<!-->"),typeof k!="string"&&!Zi(k))if(typeof k.toString=="function"){if(k=k.toString(),typeof k!="string")throw Oe("dirty is not a string, aborting")}else throw Oe("toString is not a function");if(!e.isSupported)return k;if(Ut||jt(p),e.removed=[],typeof k=="string"&&(We=!1),We){if(k.nodeName){const me=V(k.nodeName);if(!G[me]||Fe[me])throw Oe("root node is forbidden and cannot be sanitized in-place")}}else if(k instanceof n)m=Yi("<!---->"),x=m.ownerDocument.importNode(k,!0),x.nodeType===Be.element&&x.nodeName==="BODY"||x.nodeName==="HTML"?m=x:m.appendChild(x);else{if(!ve&&!Ee&&!xe&&k.indexOf("<")===-1)return T&&pt?T.createHTML(k):k;if(m=Yi(k),!m)return ve?null:pt?B:""}m&&Ft&&he(m.firstChild);const W=Xi(We?k:m);for(;$=W.nextNode();)Ki($),es($),$.content instanceof r&&cn($.content);if(We)return k;if(ve){if(ut)for(X=C.call(m.ownerDocument);m.firstChild;)X.appendChild(m.firstChild);else X=m;return(Y.shadowroot||Y.shadowrootmode)&&(X=F.call(i,X,!0)),X}let te=xe?m.outerHTML:m.innerHTML;return xe&&G["!doctype"]&&m.ownerDocument&&m.ownerDocument.doctype&&m.ownerDocument.doctype.name&&J(Ti,m.ownerDocument.doctype.name)&&(te="<!DOCTYPE "+m.ownerDocument.doctype.name+`>
|
|
61
|
-
`+te),Ee&&Je([z,be,ke],me=>{te=He(te,me," ")}),T&&pt?T.createHTML(te):te},e.setConfig=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jt(k),Ut=!0},e.clearConfig=function(){Se=null,Ut=!1},e.isValidAttribute=function(k,p,m){Se||jt({});const x=V(k),$=V(p);return Qi(x,$,m)},e.addHook=function(k,p){typeof p=="function"&&Ie(O[k],p)},e.removeHook=function(k,p){if(p!==void 0){const m=rr(O[k],p);return m===-1?void 0:nr(O[k],m,1)[0]}return yi(O[k])},e.removeHooks=function(k){O[k]=[]},e.removeAllHooks=function(){O=Ci()},e}var kr=Si();const Er=["innerHTML"],vr="Markdown",Tr=_e(a.defineComponent({inheritAttrs:!1,__name:"Markdown",props:{markdownText:{},mode:{},sanitize:{type:Boolean},inputFormat:{}},emits:["update:markdownText","changeMode"],setup(o,{emit:e}){const t=o,i=e,s=a.shallowRef([{comp:Qt,event:h,tooltip:"Edit Markdown"}]);I.setOptions({gfm:!0,breaks:!0});const r=a.ref(t.markdownText??"");a.watch(()=>t.markdownText,c=>{c!==void 0&&c!==r.value&&(r.value=c)});const l=a.ref(t.mode?t.mode==="edit":!1);a.watch(()=>t.mode,c=>{c&&(l.value=c==="edit")});const n=a.computed(()=>{const c=t.inputFormat==="html"?r.value??"":I.parse(r.value??"");return t.sanitize===!1?c:kr.sanitize(c)});function d(){i("update:markdownText",r.value)}function h(){l.value=!l.value,i("changeMode",l.value?"edit":"preview")}return(c,f)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.renderSlot(c.$slots,"default",{widgetName:vr,childIcons:s.value},void 0,!0),a.createElementVNode("div",a.mergeProps({class:"markdown-widget-wrap"},c.$attrs),[l.value?a.withDirectives((a.openBlock(),a.createElementBlock("textarea",{key:0,"onUpdate:modelValue":f[0]||(f[0]=u=>r.value=u),onInput:d,class:"markdown-input",placeholder:"Write markdown here…"},null,544)),[[a.vModelText,r.value]]):(a.openBlock(),a.createElementBlock("div",{key:1,class:"markdown-output",innerHTML:n.value},null,8,Er))],16)],64))}}),[["__scopeId","data-v-b2d32c29"]]);function Rr(o,e,t,i,s){let r=(...l)=>(console.warn("gridstack.js: Function `"+t+"` is deprecated in "+s+" and has been replaced with `"+i+"`. It will be **removed** in a future release"),e.apply(o,l));return r.prototype=e.prototype,r}class g{static getElements(e,t=document){if(typeof e=="string"){const i="getElementById"in t?t:void 0;if(i&&!isNaN(+e[0])){const r=i.getElementById(e);return r?[r]:[]}let s=t.querySelectorAll(e);return!s.length&&e[0]!=="."&&e[0]!=="#"&&(s=t.querySelectorAll("."+e),s.length||(s=t.querySelectorAll("#"+e))),Array.from(s)}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 s=t.querySelector(e);return i&&!s&&(s=i.getElementById(e)),s||(s=t.querySelector("."+e)),s}return e}static shouldSizeToContent(e){return(e==null?void 0: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 g.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,s=e.x+e.w<t.x+t.w?e.x+e.w:t.x+t.w;if(s<=i)return 0;let r=e.y>t.y?e.y:t.y,l=e.y+e.h<t.y+t.h?e.y+e.h:t.y+t.h;return l<=r?0:(s-i)*(l-r)}static area(e){return e.w*e.h}static sort(e,t=1,i){return i=i||e.reduce((s,r)=>Math.max(r.x+r.w,s),0)||12,t===-1?e.sort((s,r)=>(r.x??1e3)+(r.y??1e3)*i-((s.x??1e3)+(s.y??1e3)*i)):e.sort((s,r)=>(s.x??1e3)+(s.y??1e3)*i-((r.x??1e3)+(r.y??1e3)*i))}static find(e,t){return t?e.find(i=>i.id===t):void 0}static createStylesheet(e,t,i){let s=document.createElement("style");const r=i==null?void 0:i.nonce;return r&&(s.nonce=r),s.setAttribute("type","text/css"),s.setAttribute("gs-style-id",e),s.styleSheet?s.styleSheet.cssText="":s.appendChild(document.createTextNode("")),t?t.insertBefore(s,t.firstChild):(t=document.getElementsByTagName("head")[0],t.appendChild(s)),s.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 s=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!s)throw new Error(`Invalid height val = ${e}`);i=s[2]||"px",t=parseFloat(s[1])}else t=e;return{h:t,unit:i}}static defaults(e,...t){return t.forEach(i=>{for(const s in i){if(!i.hasOwnProperty(s))return;e[s]===null||e[s]===void 0?e[s]=i[s]:typeof i[s]=="object"&&typeof e[s]=="object"&&this.defaults(e[s],i[s])}}),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 s=e[i];if(i[0]==="_"||s===t[i])delete e[i];else if(s&&typeof s=="object"&&t[i]!==void 0){for(let r in s)(s[r]===t[i][r]||r[0]==="_")&&delete s[r];Object.keys(s).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(...s)=>{i||(i=!0,setTimeout(()=>{e(...s),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 s=e.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight;if(s.top<0||s.bottom>r){let l=s.bottom-r,n=s.top,d=this.getScrollElement(e);if(d!==null){let h=d.scrollTop;s.top<0&&i<0?e.offsetHeight>r?d.scrollTop+=i:d.scrollTop+=Math.abs(n)>Math.abs(i)?i:n:i>0&&(e.offsetHeight>r?d.scrollTop+=i:d.scrollTop+=l>i?i:l),t.top+=d.scrollTop-h}}}static updateScrollResize(e,t,i){const s=this.getScrollElement(t),r=s.clientHeight,l=s===this.getScrollElement()?0:s.getBoundingClientRect().top,n=e.clientY-l,d=n<i,h=n>r-i;d?s.scrollBy({behavior:"smooth",top:n-i}):h&&s.scrollBy({behavior:"smooth",top:i-(r-n)})}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=g.clone(e);for(const s in i)i.hasOwnProperty(s)&&typeof i[s]=="object"&&s.substring(0,2)!=="__"&&!t.find(r=>r===s)&&(i[s]=g.cloneDeep(e[s]));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=g.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(s=>{e.style[i]=s}):e.style[i]=t[i])}static initEvent(e,t){const i={type:t.type},s={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(r=>i[r]=e[r]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(r=>i[r]=e[r]),{...i,...s}}static simulateMouseEvent(e,t,i){const s=document.createEvent("MouseEvents");s.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(s)}}class le{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,s={}){if(this.sortNodes(-1),i=i||this.collide(e,t),!i)return!1;if(e._moving&&!s.nested&&!this.float&&this.swap(e,i))return!0;let r=t;this._useEntireRowArea(e,t)&&(r={x:0,w:this.column,y:t.y,h:t.h},i=this.collide(e,r,s.skip));let l=!1,n={nested:!0,pack:!1};for(;i=i||this.collide(e,r,s.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,...n}),i.locked&&d?g.copyPos(t,e):!i.locked&&d&&s.pack&&(this._packNodes(),t.y=i.y+i.h,g.copyPos(e,t)),l=l||d):d=this.moveNode(i,{...i,y:t.y+t.h,skip:e,...n}),!d)return l;i=void 0}return l}collide(e,t=e,i){const s=e._id,r=i==null?void 0:i._id;return this.nodes.find(l=>l._id!==s&&l._id!==r&&g.isIntercepted(l,t))}collideAll(e,t=e,i){const s=e._id,r=i==null?void 0:i._id;return this.nodes.filter(l=>l._id!==s&&l._id!==r&&g.isIntercepted(l,t))}directionCollideCoverage(e,t,i){if(!t.rect||!e._rect)return;let s=e._rect,r={...t.rect};r.y>s.y?(r.h+=r.y-s.y,r.y=s.y):r.h+=s.y-r.y,r.x>s.x?(r.w+=r.x-s.x,r.x=s.x):r.w+=s.x-r.x;let l,n=.5;return i.forEach(d=>{if(d.locked||!d._rect)return;let h=d._rect,c=Number.MAX_VALUE,f=Number.MAX_VALUE;s.y<h.y?c=(r.y+r.h-h.y)/h.h:s.y+s.h>h.y+h.h&&(c=(h.y+h.h-r.y)/h.h),s.x<h.x?f=(r.x+r.w-h.x)/h.w:s.x+s.w>h.x+h.w&&(f=(h.x+h.w-r.x)/h.w);let u=Math.min(f,c);u>n&&(n=u,l=d)}),t.collide=l,l}cacheRects(e,t,i,s,r,l){return this.nodes.forEach(n=>n._rect={y:n.y*t+i,x:n.x*e+l,w:n.w*e-l-s,h:n.h*t-i-r}),this}swap(e,t){if(!t||t.locked||!e||e.locked)return!1;function i(){let r=t.x,l=t.y;return t.x=e.x,t.y=e.y,e.h!=t.h?(e.x=r,e.y=t.y+t.h):e.w!=t.w?(e.x=t.x+t.w,e.y=l):(e.x=r,e.y=l),e._dirty=t._dirty=!0,!0}let s;if(e.w===t.w&&e.h===t.h&&(e.x===t.x||e.y===t.y)&&(s=g.isTouching(e,t)))return i();if(s!==!1){if(e.w===t.w&&e.x===t.x&&(s||(s=g.isTouching(e,t)))){if(t.y<e.y){let r=e;e=t,t=r}return i()}if(s!==!1){if(e.h===t.h&&e.y===t.y&&(s||(s=g.isTouching(e,t)))){if(t.x<e.x){let r=e;e=t,t=r}return i()}return!1}}}isAreaEmpty(e,t,i,s){let r={x:e||0,y:t||0,w:i||1,h:s||1};return!this.collide(r)}compact(e="compact",t=!0){if(this.nodes.length===0)return this;t&&this.sortNodes();const i=this.batchMode;i||this.batchUpdate();const s=this._inColumnResize;s||(this._inColumnResize=!0);let r=this.nodes;return this.nodes=[],r.forEach((l,n,d)=>{let h;l.locked||(l.autoPosition=!0,e==="list"&&n&&(h=d[n-1])),this.addNode(l,!1,h)}),s||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=g.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??le._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 g.defaults(e,i),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,g.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||g.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 r={...e};r.autoPosition||r.x===void 0?(delete r.x,delete r.y):r.x=Math.min(11,r.x),r.w=Math.min(12,r.w||1),this.cacheOneLayout(r,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),g.samePos(e,i)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(t=>t._dirty&&!g.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=g.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{g.samePos(e,e._orig)||(g.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,t=this.nodes,i=this.column,s){let r=s?s.y*i+(s.x+s.w):0,l=!1;for(let n=r;!l;++n){let d=n%i,h=Math.floor(n/i);if(d+e.w>i)continue;let c={x:d,y:h,w:e.w,h:e.h};t.find(f=>g.isIntercepted(c,f))||((e.x!==d||e.y!==h)&&(e._dirty=!0),e.x=d,e.y=h,delete e.autoPosition,l=!0)}return l}addNode(e,t=!1,i){let s=this.nodes.find(l=>l._id===e._id);if(s)return s;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let r;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,i)&&(delete e.autoPosition,r=!0),this.nodes.push(e),t&&this.addedNodes.push(e),r||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,t=!0,i=!1){return this.nodes.find(s=>s._id===e._id)?(i&&this.removedNodes.push(e),t&&(e._removeDOM=!0),this.nodes=this.nodes.filter(s=>s._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,s=new le({column:this.column,float:this.float,nodes:this.nodes.map(l=>l._id===e._id?(i={...l},i):{...l})});if(!i)return!1;let r=s.moveNode(i,t)&&s.getRow()<=Math.max(this.getRow(),this.maxRow);if(!r&&!t.resizing&&t.collide){let l=t.collide.el.gridstackNode;if(this.swap(e,l))return this._notify(),!0}return r?(s.nodes.filter(l=>l._dirty).forEach(l=>{let n=this.nodes.find(d=>d._id===l._id);n&&(g.copyPos(n,l),n._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;let t=new le({column:this.column,float:this.float,nodes:this.nodes.map(s=>({...s}))}),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=g.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){var h,c;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 s=e.w!==t.w||e.h!==t.h,r=g.copyPos({},e,!0);if(g.copyPos(r,t),this.nodeBoundFix(r,s),g.copyPos(t,r),!t.forceCollide&&g.samePos(e,t))return!1;let l=g.copyPos({},e),n=this.collideAll(e,r,t.skip),d=!0;if(n.length){let f=e._moving&&!t.nested,u=f?this.directionCollideCoverage(e,t,n):n[0];if(f&&u&&((c=(h=e.grid)==null?void 0:h.opts)!=null&&c.subGridDynamic)&&!e.grid._isTemp){let _=g.areaIntercept(t.rect,u._rect),b=g.area(t.rect),L=g.area(u._rect);_/(b<L?b:L)>.8&&(u.grid.makeSubGrid(u.el,void 0,e),u=void 0)}u?d=!this._fixCollisions(e,r,u,t):(d=!1,i&&delete t.pack)}return d&&(e._dirty=!0,g.copyPos(e,r)),t.pack&&this._packNodes()._notify(),!g.samePos(e,l)}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){var l;let i=(l=this._layouts)==null?void 0:l.length,s=i&&this.column!==i-1?this._layouts[i-1]:null,r=[];return this.sortNodes(),this.nodes.forEach(n=>{let d=s==null?void 0:s.find(c=>c._id===n._id),h={...n,...d||{}};g.removeInternalForSave(h,!e),t&&t(n,h),r.push(h)}),r}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 s=i/this.column;e.forEach(r=>{if(!r._orig)return;let l=t.find(n=>n._id===r._id);l&&(l.y>=0&&r.y!==r._orig.y&&(l.y+=r.y-r._orig.y),r.x!==r._orig.x&&(l.x=Math.round(r.x*s)),r.w!==r._orig.w&&(l.w=Math.round(r.w*s)))})}}),this)}columnChanged(e,t,i,s="moveScale"){var d;if(!this.nodes.length||!t||e===t)return this;const r=s==="compact"||s==="list";r&&this.sortNodes(1,e),t<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let l=[],n=!1;if(t===1&&(i!=null&&i.length)){n=!0;let h=0;i.forEach(c=>{c.x=0,c.w=1,c.y=Math.max(c.y,h),h=c.y+c.h}),l=i,i=[]}else i=r?this.nodes:g.sort(this.nodes,-1,e);if(t>e&&this._layouts){const h=this._layouts[t]||[];let c=this._layouts.length-1;!h.length&&e!==c&&((d=this._layouts[c])!=null&&d.length)&&(e=c,this._layouts[c].forEach(f=>{let u=i.find(_=>_._id===f._id);u&&(!r&&!f.autoPosition&&(u.x=f.x??u.x,u.y=f.y??u.y),u.w=f.w??u.w,(f.x==null||f.y===void 0)&&(u.autoPosition=!0))})),h.forEach(f=>{let u=i.findIndex(_=>_._id===f._id);if(u!==-1){const _=i[u];if(r){_.w=f.w;return}(f.autoPosition||isNaN(f.x)||isNaN(f.y))&&this.findEmptyPosition(f,l),f.autoPosition||(_.x=f.x??_.x,_.y=f.y??_.y,_.w=f.w??_.w,l.push(_)),i.splice(u,1)}})}if(r)this.compact(s,!1);else{if(i.length){if(typeof s=="function")s(t,e,l,i);else if(!n){let h=r||s==="none"?1:t/e,c=s==="move"||s==="moveScale",f=s==="scale"||s==="moveScale";i.forEach(u=>{u.x=t===1?0:c?Math.round(u.x*h):Math.min(u.x,t-1),u.w=t===1||e===1?1:f?Math.round(u.w*h)||1:Math.min(u.w,t),l.push(u)}),i=[]}}n||(l=g.sort(l,-1,t)),this._inColumnResize=!0,this.nodes=[],l.forEach(h=>{this.addNode(h,!1),delete h._orig})}return this.nodes.forEach(h=>delete h._orig),this.batchUpdate(!1,!r),delete this._inColumnResize,this}cacheLayout(e,t,i=!1){let s=[];return e.forEach((r,l)=>{if(r._id===void 0){const n=r.id?this.nodes.find(d=>d.id===r.id):void 0;r._id=(n==null?void 0:n._id)??le._idSeq++}s[l]={x:r.x,y:r.y,w:r.w,_id:r._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[t]=s,this}cacheOneLayout(e,t){e._id=e._id??le._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 s=this.findCacheLayout(e,t);return s===-1?this._layouts[t].push(i):this._layouts[t][s]=i,this}findCacheLayout(e,t){var i,s;return((s=(i=this._layouts)==null?void 0:i[t])==null?void 0:s.findIndex(r=>r._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}}le._idSeq=0;const ie={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"},Cr={handle:".grid-stack-item-content",appendTo:"body"};class E{}const ne=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 ae{}function it(o,e){if(o.touches.length>1)return;o.cancelable&&o.preventDefault();const t=o.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),o.target.dispatchEvent(i)}function Ai(o,e){o.cancelable&&o.preventDefault();const t=document.createEvent("MouseEvents");t.initMouseEvent(e,!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),o.target.dispatchEvent(t)}function st(o){ae.touchHandled||(ae.touchHandled=!0,it(o,"mousedown"))}function rt(o){ae.touchHandled&&it(o,"mousemove")}function nt(o){if(!ae.touchHandled)return;ae.pointerLeaveTimeout&&(window.clearTimeout(ae.pointerLeaveTimeout),delete ae.pointerLeaveTimeout);const e=!!E.dragElement;it(o,"mouseup"),e||it(o,"click"),ae.touchHandled=!1}function ot(o){o.pointerType!=="mouse"&&o.target.releasePointerCapture(o.pointerId)}function Di(o){E.dragElement&&o.pointerType!=="mouse"&&Ai(o,"mouseenter")}function Ni(o){E.dragElement&&o.pointerType!=="mouse"&&(ae.pointerLeaveTimeout=window.setTimeout(()=>{delete ae.pointerLeaveTimeout,Ai(o,"mouseleave")},10))}class lt{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(`${lt.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),ne&&(this.el.addEventListener("touchstart",st),this.el.addEventListener("pointerdown",ot)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),ne&&(this.el.removeEventListener("touchstart",st),this.el.removeEventListener("pointerdown",ot)),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),ne&&(this.el.addEventListener("touchmove",rt),this.el.addEventListener("touchend",nt)),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),ne&&(this.el.removeEventListener("touchmove",rt),this.el.removeEventListener("touchend",nt)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_triggerEvent(e,t){return this.option[e]&&this.option[e](t),this}}lt.prefix="ui-resizable-";class Ht{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 $e extends Ht{constructor(e,t={}){super(),this.rectScale={x:1,y:1},this._ui=()=>{const s=this.el.parentElement.getBoundingClientRect(),r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},l=this.temporalRect||r;return{position:{left:(l.left-s.left)*this.rectScale.x,top:(l.top-s.top)*this.rectScale.y},size:{width:l.width*this.rectScale.x,height:l.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(s=>this.option[s]=e[s]),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),E.overResizeElement===this&&delete E.overResizeElement),this}_mouseOver(e){E.overResizeElement||E.dragElement||(E.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){E.overResizeElement===this&&(delete E.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 lt(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=g.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const t=g.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=g.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=g.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=$e._originStyleProp.map(s=>this.el.style[s]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,t=document.createElement("div");g.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 $e._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,s={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},r=e.clientX-i.clientX,l=e.clientY-i.clientY;t.indexOf("e")>-1?s.width+=r:t.indexOf("w")>-1&&(s.width-=r,s.left+=r),t.indexOf("s")>-1?s.height+=l:t.indexOf("n")>-1&&(s.height-=l,s.top+=l);const n=this._constrainSize(s.width,s.height);return Math.round(s.width)!==Math.round(n.width)&&(t.indexOf("w")>-1&&(s.left+=s.width-n.width),s.width=n.width),Math.round(s.height)!==Math.round(n.height)&&(t.indexOf("n")>-1&&(s.top+=s.height-n.height),s.height=n.height),s}_constrainSize(e,t){const i=this.option.maxWidth||Number.MAX_SAFE_INTEGER,s=this.option.minWidth/this.rectScale.x||e,r=this.option.maxHeight||Number.MAX_SAFE_INTEGER,l=this.option.minHeight/this.rectScale.y||t,n=Math.min(i,Math.max(s,e)),d=Math.min(r,Math.max(l,t));return{width:n,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:s}=t.getBoundingClientRect();e={left:i,top:s,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(t=>{const i=this.temporalRect[t],s=t==="width"||t==="left"?this.rectScale.x:t==="height"||t==="top"?this.rectScale.y:1;this.el.style[t]=(i-e[t])*s+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}}$e._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const Sr='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class Ue extends Ht{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),ne&&(this.dragEl.addEventListener("touchstart",st),this.dragEl.addEventListener("pointerdown",ot)),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEl.removeEventListener("mousedown",this._mouseDown),ne&&(this.dragEl.removeEventListener("touchstart",st),this.dragEl.removeEventListener("pointerdown",ot)),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(!E.mouseHandled)return e.button!==0||e.target.closest(Sr)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete E.dragElement,delete E.dropElement,document.addEventListener("mousemove",this._mouseMove,!0),document.addEventListener("mouseup",this._mouseUp,!0),ne&&(this.dragEl.addEventListener("touchmove",rt),this.dragEl.addEventListener("touchend",nt)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),E.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const t=g.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(e){var i;let t=this.mouseDownEvent;if(this.dragging)if(this._dragFollow(e),E.pauseDrag){const s=Number.isInteger(E.pauseDrag)?E.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),s)}else this._callDrag(e);else if(Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>3){this.dragging=!0,E.dragElement=this;let s=(i=this.el.gridstackNode)==null?void 0:i.grid;s?E.dropElement=s.el.ddElement.ddDroppable:delete E.dropElement,this.helper=this._createHelper(e),this._setupHelperContainmentStyle(),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment);const r=g.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){var t;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),ne&&(this.dragEl.removeEventListener("touchmove",rt,!0),this.dragEl.removeEventListener("touchend",nt,!0)),this.dragging){delete this.dragging,((t=E.dropElement)==null?void 0:t.el)===this.el.parentElement&&delete E.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper===this.el?this._removeHelperStyle():this.helper.remove();const i=g.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(i),this.triggerEvent("dragstop",i),E.dropElement&&E.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete E.dragElement,delete E.dropElement,delete E.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=g.cloneNode(this.el)),document.body.contains(t)||g.appendTo(t,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),t===this.el&&(this.dragElementOriginStyle=Ue.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(){var t;this.helper.classList.remove("ui-draggable-dragging");let e=(t=this.helper)==null?void 0:t.gridstackNode;if(!(e!=null&&e._isAboutToRemove)&&this.dragElementOriginStyle){let i=this.helper,s=this.dragElementOriginStyle.transition||null;i.style.transition=this.dragElementOriginStyle.transition="none",Ue.originStyleProp.forEach(r=>i.style[r]=this.dragElementOriginStyle[r]||null),setTimeout(()=>i.style.transition=s,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){let t={left:0,top:0};const i=this.helper.style,s=this.dragOffset;i.left=(e.clientX+s.offsetLeft-t.left)*this.dragScale.x+"px",i.top=(e.clientY+s.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 s=0,r=0;if(i){const n=document.createElement("div");g.addElStyles(n,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),i.appendChild(n);const d=n.getBoundingClientRect();i.removeChild(n),s=d.left,r=d.top,this.dragScale={x:1/d.width,y:1/d.height}}const l=t.getBoundingClientRect();return{left:l.left,top:l.top,offsetLeft:-e.clientX+l.left-s,offsetTop:-e.clientY+l.top-r,width:l.width*this.dragScale.x,height:l.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}}}}Ue.originStyleProp=["transition","pointerEvents","position","left","top","minWidth","willChange"];class Ar extends Ht{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),ne&&(this.el.addEventListener("pointerenter",Di),this.el.addEventListener("pointerleave",Ni)))}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),ne&&(this.el.removeEventListener("pointerenter",Di),this.el.removeEventListener("pointerleave",Ni)))}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(!E.dragElement||!this._canDrop(E.dragElement.el))return;e.preventDefault(),e.stopPropagation(),E.dropElement&&E.dropElement!==this&&E.dropElement._mouseLeave(e),E.dropElement=this;const t=g.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(E.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(e){var i;if(!E.dragElement||E.dropElement!==this)return;e.preventDefault(),e.stopPropagation();const t=g.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(t,this._ui(E.dragElement)),this.triggerEvent("dropout",t),E.dropElement===this){delete E.dropElement;let s,r=this.el.parentElement;for(;!s&&r;)s=(i=r.ddElement)==null?void 0:i.ddDroppable,r=r.parentElement;s&&s._mouseEnter(e)}}drop(e){e.preventDefault();const t=g.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(E.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 Ot{static init(e){return e.ddElement||(e.ddElement=new Ot(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 Ue(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 $e(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 Ar(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class Dr{resizable(e,t,i,s){return this._getDDElements(e).forEach(r=>{if(t==="disable"||t==="enable")r.ddResizable&&r.ddResizable[t]();else if(t==="destroy")r.ddResizable&&r.cleanResizable();else if(t==="option")r.setupResizable({[i]:s});else{const l=r.el.gridstackNode.grid;let n=r.el.getAttribute("gs-resize-handles")?r.el.getAttribute("gs-resize-handles"):l.opts.resizable.handles,d=!l.opts.alwaysShowResizeHandle;r.setupResizable({...l.opts.resizable,handles:n,autoHide:d,start:t.start,stop:t.stop,resize:t.resize})}}),this}draggable(e,t,i,s){return this._getDDElements(e).forEach(r=>{if(t==="disable"||t==="enable")r.ddDraggable&&r.ddDraggable[t]();else if(t==="destroy")r.ddDraggable&&r.cleanDraggable();else if(t==="option")r.setupDraggable({[i]:s});else{const l=r.el.gridstackNode.grid;r.setupDraggable({...l.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,s){return typeof t.accept=="function"&&!t._accept&&(t._accept=t.accept,t.accept=r=>t._accept(r)),this._getDDElements(e).forEach(r=>{t==="disable"||t==="enable"?r.ddDroppable&&r.ddDroppable[t]():t==="destroy"?r.ddDroppable&&r.cleanDroppable():t==="option"?r.setupDroppable({[i]:s}):r.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(s=>s.on(t,r=>{i(r,E.dragElement?E.dragElement.el:r.target,E.dragElement?E.dragElement.helper:null)})),this}off(e,t){return this._getDDElements(e).forEach(i=>i.off(t)),this}_getDDElements(e,t=!0){let i=g.getElements(e);if(!i.length)return[];let s=i.map(r=>r.ddElement||(t?Ot.init(r):null));return t||s.filter(r=>r),s}}/*!
|
|
58
|
+
`}strong({tokens:o}){return`<strong>${this.parser.parseInline(o)}</strong>`}em({tokens:o}){return`<em>${this.parser.parseInline(o)}</em>`}codespan({text:o}){return`<code>${oe(o,!0)}</code>`}br(o){return"<br>"}del({tokens:o}){return`<del>${this.parser.parseInline(o)}</del>`}link({href:o,title:e,tokens:t}){let i=this.parser.parseInline(t),s=ui(o);if(s===null)return i;o=s;let r='<a href="'+o+'"';return e&&(r+=' title="'+oe(e)+'"'),r+=">"+i+"</a>",r}image({href:o,title:e,text:t,tokens:i}){i&&(t=this.parser.parseInline(i,this.parser.textRenderer));let s=ui(o);if(s===null)return oe(t);o=s;let r=`<img src="${o}" alt="${t}"`;return e&&(r+=` title="${oe(e)}"`),r+=">",r}text(o){return"tokens"in o&&o.tokens?this.parser.parseInline(o.tokens):"escaped"in o&&o.escaped?o.text:oe(o.text)}},St=class{strong({text:o}){return o}em({text:o}){return o}codespan({text:o}){return o}del({text:o}){return o}html({text:o}){return o}text({text:o}){return o}link({text:o}){return""+o}image({text:o}){return""+o}br(){return""}},ue=class Kt{constructor(e){P(this,"options");P(this,"renderer");P(this,"textRenderer");this.options=e||ye,this.options.renderer=this.options.renderer||new Ke,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new St}static parse(e,t){return new Kt(t).parse(e)}static parseInline(e,t){return new Kt(t).parseInline(e)}parse(e,t=!0){var s,r;let i="";for(let a=0;a<e.length;a++){let n=e[a];if((r=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&r[n.type]){let h=n,c=this.options.extensions.renderers[h.type].call({parser:this},h);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(h.type)){i+=c||"";continue}}let d=n;switch(d.type){case"space":{i+=this.renderer.space(d);continue}case"hr":{i+=this.renderer.hr(d);continue}case"heading":{i+=this.renderer.heading(d);continue}case"code":{i+=this.renderer.code(d);continue}case"table":{i+=this.renderer.table(d);continue}case"blockquote":{i+=this.renderer.blockquote(d);continue}case"list":{i+=this.renderer.list(d);continue}case"html":{i+=this.renderer.html(d);continue}case"def":{i+=this.renderer.def(d);continue}case"paragraph":{i+=this.renderer.paragraph(d);continue}case"text":{let h=d,c=this.renderer.text(h);for(;a+1<e.length&&e[a+1].type==="text";)h=e[++a],c+=`
|
|
59
|
+
`+this.renderer.text(h);t?i+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):i+=c;continue}default:{let h='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return i}parseInline(e,t=this.renderer){var s,r;let i="";for(let a=0;a<e.length;a++){let n=e[a];if((r=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&r[n.type]){let h=this.options.extensions.renderers[n.type].call({parser:this},n);if(h!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){i+=h||"";continue}}let d=n;switch(d.type){case"escape":{i+=t.text(d);break}case"html":{i+=t.html(d);break}case"link":{i+=t.link(d);break}case"image":{i+=t.image(d);break}case"strong":{i+=t.strong(d);break}case"em":{i+=t.em(d);break}case"codespan":{i+=t.codespan(d);break}case"br":{i+=t.br(d);break}case"del":{i+=t.del(d);break}case"text":{i+=t.text(d);break}default:{let h='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return i}},Qe=(Pt=class{constructor(o){P(this,"options");P(this,"block");this.options=o||ye}preprocess(o){return o}postprocess(o){return o}processAllTokens(o){return o}provideLexer(){return this.block?de.lex:de.lexInline}provideParser(){return this.block?ue.parse:ue.parseInline}},P(Pt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Pt),er=class{constructor(...o){P(this,"defaults",wt());P(this,"options",this.setOptions);P(this,"parse",this.parseMarkdown(!0));P(this,"parseInline",this.parseMarkdown(!1));P(this,"Parser",ue);P(this,"Renderer",Ke);P(this,"TextRenderer",St);P(this,"Lexer",de);P(this,"Tokenizer",Ze);P(this,"Hooks",Qe);this.use(...o)}walkTokens(o,e){var i,s;let t=[];for(let r of o)switch(t=t.concat(e.call(this,r)),r.type){case"table":{let a=r;for(let n of a.header)t=t.concat(this.walkTokens(n.tokens,e));for(let n of a.rows)for(let d of n)t=t.concat(this.walkTokens(d.tokens,e));break}case"list":{let a=r;t=t.concat(this.walkTokens(a.items,e));break}default:{let a=r;(s=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&s[a.type]?this.defaults.extensions.childTokens[a.type].forEach(n=>{let d=a[n].flat(1/0);t=t.concat(this.walkTokens(d,e))}):a.tokens&&(t=t.concat(this.walkTokens(a.tokens,e)))}}return t}use(...o){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return o.forEach(t=>{let i={...t};if(i.async=this.defaults.async||i.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let r=e.renderers[s.name];r?e.renderers[s.name]=function(...a){let n=s.renderer.apply(this,a);return n===!1&&(n=r.apply(this,a)),n}:e.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 r=e[s.level];r?r.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),i.extensions=e),t.renderer){let s=this.defaults.renderer||new Ke(this.defaults);for(let r in t.renderer){if(!(r in s))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let a=r,n=t.renderer[a],d=s[a];s[a]=(...h)=>{let c=n.apply(s,h);return c===!1&&(c=d.apply(s,h)),c||""}}i.renderer=s}if(t.tokenizer){let s=this.defaults.tokenizer||new Ze(this.defaults);for(let r in t.tokenizer){if(!(r in s))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let a=r,n=t.tokenizer[a],d=s[a];s[a]=(...h)=>{let c=n.apply(s,h);return c===!1&&(c=d.apply(s,h)),c}}i.tokenizer=s}if(t.hooks){let s=this.defaults.hooks||new Qe;for(let r in t.hooks){if(!(r in s))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let a=r,n=t.hooks[a],d=s[a];Qe.passThroughHooks.has(r)?s[a]=h=>{if(this.defaults.async)return Promise.resolve(n.call(s,h)).then(f=>d.call(s,f));let c=n.call(s,h);return d.call(s,c)}:s[a]=(...h)=>{let c=n.apply(s,h);return c===!1&&(c=d.apply(s,h)),c}}i.hooks=s}if(t.walkTokens){let s=this.defaults.walkTokens,r=t.walkTokens;i.walkTokens=function(a){let n=[];return n.push(r.call(this,a)),s&&(n=n.concat(s.call(this,a))),n}}this.defaults={...this.defaults,...i}}),this}setOptions(o){return this.defaults={...this.defaults,...o},this}lexer(o,e){return de.lex(o,e??this.defaults)}parser(o,e){return ue.parse(o,e??this.defaults)}parseMarkdown(o){return(e,t)=>{let i={...t},s={...this.defaults,...i},r=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return r(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 e>"u"||e===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=o);let a=s.hooks?s.hooks.provideLexer():o?de.lex:de.lexInline,n=s.hooks?s.hooks.provideParser():o?ue.parse:ue.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(e):e).then(d=>a(d,s)).then(d=>s.hooks?s.hooks.processAllTokens(d):d).then(d=>s.walkTokens?Promise.all(this.walkTokens(d,s.walkTokens)).then(()=>d):d).then(d=>n(d,s)).then(d=>s.hooks?s.hooks.postprocess(d):d).catch(r);try{s.hooks&&(e=s.hooks.preprocess(e));let d=a(e,s);s.hooks&&(d=s.hooks.processAllTokens(d)),s.walkTokens&&this.walkTokens(d,s.walkTokens);let h=n(d,s);return s.hooks&&(h=s.hooks.postprocess(h)),h}catch(d){return r(d)}}}onError(o,e){return t=>{if(t.message+=`
|
|
60
|
+
Please report this to https://github.com/markedjs/marked.`,o){let i="<p>An error occurred:</p><pre>"+oe(t.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(t);throw t}}},we=new er;function I(o,e){return we.parse(o,e)}I.options=I.setOptions=function(o){return we.setOptions(o),I.defaults=we.defaults,Jt(I.defaults),I},I.getDefaults=wt,I.defaults=ye,I.use=function(...o){return we.use(...o),I.defaults=we.defaults,Jt(I.defaults),I},I.walkTokens=function(o,e){return we.walkTokens(o,e)},I.parseInline=we.parseInline,I.Parser=ue,I.parser=ue.parse,I.Renderer=Ke,I.TextRenderer=St,I.Lexer=de,I.lexer=de.lex,I.Tokenizer=Ze,I.Hooks=Qe,I.parse=I,I.options,I.setOptions,I.use,I.walkTokens,I.parseInline,ue.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:gi,setPrototypeOf:mi,isFrozen:tr,getPrototypeOf:ir,getOwnPropertyDescriptor:sr}=Object;let{freeze:Q,seal:se,create:_i}=Object,{apply:At,construct:Dt}=typeof Reflect<"u"&&Reflect;Q||(Q=function(e){return e}),se||(se=function(e){return e}),At||(At=function(e,t,i){return e.apply(t,i)}),Dt||(Dt=function(e,t){return new e(...t)});const Je=ee(Array.prototype.forEach),rr=ee(Array.prototype.lastIndexOf),yi=ee(Array.prototype.pop),Ie=ee(Array.prototype.push),nr=ee(Array.prototype.splice),et=ee(String.prototype.toLowerCase),Nt=ee(String.prototype.toString),wi=ee(String.prototype.match),He=ee(String.prototype.replace),or=ee(String.prototype.indexOf),lr=ee(String.prototype.trim),re=ee(Object.prototype.hasOwnProperty),J=ee(RegExp.prototype.test),Oe=ar(TypeError);function ee(o){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return At(o,e,i)}}function ar(o){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return Dt(o,t)}}function S(o,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:et;mi&&mi(o,null);let i=e.length;for(;i--;){let s=e[i];if(typeof s=="string"){const r=t(s);r!==s&&(tr(e)||(e[i]=r),s=r)}o[s]=!0}return o}function hr(o){for(let e=0;e<o.length;e++)re(o,e)||(o[e]=null);return o}function pe(o){const e=_i(null);for(const[t,i]of gi(o))re(o,t)&&(Array.isArray(i)?e[t]=hr(i):i&&typeof i=="object"&&i.constructor===Object?e[t]=pe(i):e[t]=i);return e}function Pe(o,e){for(;o!==null;){const i=sr(o,e);if(i){if(i.get)return ee(i.get);if(typeof i.value=="function")return ee(i.value)}o=ir(o)}function t(){return null}return t}const bi=Q(["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"]),Lt=Q(["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"]),zt=Q(["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"]),cr=Q(["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"]),Mt=Q(["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"]),dr=Q(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xi=Q(["#text"]),ki=Q(["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"]),It=Q(["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"]),Ei=Q(["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"]),tt=Q(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ur=se(/\{\{[\w\W]*|[\w\W]*\}\}/gm),pr=se(/<%[\w\W]*|[\w\W]*%>/gm),fr=se(/\$\{[\w\W]*/gm),gr=se(/^data-[\-\w.\u00B7-\uFFFF]+$/),mr=se(/^aria-[\-\w]+$/),vi=se(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),_r=se(/^(?:\w+script|data):/i),yr=se(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ti=se(/^html$/i),wr=se(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ri=Object.freeze({__proto__:null,ARIA_ATTR:mr,ATTR_WHITESPACE:yr,CUSTOM_ELEMENT:wr,DATA_ATTR:gr,DOCTYPE_NAME:Ti,ERB_EXPR:pr,IS_ALLOWED_URI:vi,IS_SCRIPT_OR_DATA:_r,MUSTACHE_EXPR:ur,TMPLIT_EXPR:fr});const Be={element:1,text:3,progressingInstruction:7,comment:8,document:9},br=function(){return typeof window>"u"?null:window},xr=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(i=t.getAttribute(s));const r="dompurify"+(i?"#"+i:"");try{return e.createPolicy(r,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Ci=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Si(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:br();const e=k=>Si(k);if(e.version="3.2.6",e.removed=[],!o||!o.document||o.document.nodeType!==Be.document||!o.Element)return e.isSupported=!1,e;let{document:t}=o;const i=t,s=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:a,Node:n,Element:d,NodeFilter:h,NamedNodeMap:c=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:f,DOMParser:u,trustedTypes:_}=o,b=d.prototype,L=Pe(b,"cloneNode"),H=Pe(b,"remove"),A=Pe(b,"nextSibling"),N=Pe(b,"childNodes"),D=Pe(b,"parentNode");if(typeof a=="function"){const k=t.createElement("template");k.content&&k.content.ownerDocument&&(t=k.content.ownerDocument)}let v,B="";const{implementation:w,createNodeIterator:y,createDocumentFragment:C,getElementsByTagName:T}=t,{importNode:F}=i;let O=Ci();e.isSupported=typeof gi=="function"&&typeof D=="function"&&w&&w.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:be,TMPLIT_EXPR:ke,DATA_ATTR:at,ARIA_ATTR:ht,IS_SCRIPT_OR_DATA:ct,ATTR_WHITESPACE:Li,CUSTOM_ELEMENT:tn}=Ri;let{IS_ALLOWED_URI:zi}=Ri,G=null;const Mi=S({},[...bi,...Lt,...zt,...Mt,...xi]);let Y=null;const Ii=S({},[...ki,...It,...Ei,...tt]);let U=Object.seal(_i(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}})),Fe=null,Bt=null,Hi=!0,$t=!0,Oi=!1,Pi=!0,Ee=!1,dt=!0,xe=!1,Ut=!1,Ft=!1,ve=!1,ut=!1,pt=!1,Bi=!0,$i=!1;const sn="user-content-";let Wt=!0,We=!1,Te={},Re=null;const Ui=S({},["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 Fi=null;const Wi=S({},["audio","video","img","source","image","track"]);let Gt=null;const Gi=S({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ft="http://www.w3.org/1998/Math/MathML",gt="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let Ce=fe,Vt=!1,qt=null;const rn=S({},[ft,gt,fe],Nt);let mt=S({},["mi","mo","mn","ms","mtext"]),_t=S({},["annotation-xml"]);const nn=S({},["title","style","font","a","script"]);let Ge=null;const on=["application/xhtml+xml","text/html"],ln="text/html";let V=null,Se=null;const an=t.createElement("form"),Vi=function(p){return p instanceof RegExp||p instanceof Function},jt=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Se&&Se===p)){if((!p||typeof p!="object")&&(p={}),p=pe(p),Ge=on.indexOf(p.PARSER_MEDIA_TYPE)===-1?ln:p.PARSER_MEDIA_TYPE,V=Ge==="application/xhtml+xml"?Nt:et,G=re(p,"ALLOWED_TAGS")?S({},p.ALLOWED_TAGS,V):Mi,Y=re(p,"ALLOWED_ATTR")?S({},p.ALLOWED_ATTR,V):Ii,qt=re(p,"ALLOWED_NAMESPACES")?S({},p.ALLOWED_NAMESPACES,Nt):rn,Gt=re(p,"ADD_URI_SAFE_ATTR")?S(pe(Gi),p.ADD_URI_SAFE_ATTR,V):Gi,Fi=re(p,"ADD_DATA_URI_TAGS")?S(pe(Wi),p.ADD_DATA_URI_TAGS,V):Wi,Re=re(p,"FORBID_CONTENTS")?S({},p.FORBID_CONTENTS,V):Ui,Fe=re(p,"FORBID_TAGS")?S({},p.FORBID_TAGS,V):pe({}),Bt=re(p,"FORBID_ATTR")?S({},p.FORBID_ATTR,V):pe({}),Te=re(p,"USE_PROFILES")?p.USE_PROFILES:!1,Hi=p.ALLOW_ARIA_ATTR!==!1,$t=p.ALLOW_DATA_ATTR!==!1,Oi=p.ALLOW_UNKNOWN_PROTOCOLS||!1,Pi=p.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ee=p.SAFE_FOR_TEMPLATES||!1,dt=p.SAFE_FOR_XML!==!1,xe=p.WHOLE_DOCUMENT||!1,ve=p.RETURN_DOM||!1,ut=p.RETURN_DOM_FRAGMENT||!1,pt=p.RETURN_TRUSTED_TYPE||!1,Ft=p.FORCE_BODY||!1,Bi=p.SANITIZE_DOM!==!1,$i=p.SANITIZE_NAMED_PROPS||!1,Wt=p.KEEP_CONTENT!==!1,We=p.IN_PLACE||!1,zi=p.ALLOWED_URI_REGEXP||vi,Ce=p.NAMESPACE||fe,mt=p.MATHML_TEXT_INTEGRATION_POINTS||mt,_t=p.HTML_INTEGRATION_POINTS||_t,U=p.CUSTOM_ELEMENT_HANDLING||{},p.CUSTOM_ELEMENT_HANDLING&&Vi(p.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(U.tagNameCheck=p.CUSTOM_ELEMENT_HANDLING.tagNameCheck),p.CUSTOM_ELEMENT_HANDLING&&Vi(p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(U.attributeNameCheck=p.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),p.CUSTOM_ELEMENT_HANDLING&&typeof p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(U.allowCustomizedBuiltInElements=p.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ee&&($t=!1),ut&&(ve=!0),Te&&(G=S({},xi),Y=[],Te.html===!0&&(S(G,bi),S(Y,ki)),Te.svg===!0&&(S(G,Lt),S(Y,It),S(Y,tt)),Te.svgFilters===!0&&(S(G,zt),S(Y,It),S(Y,tt)),Te.mathMl===!0&&(S(G,Mt),S(Y,Ei),S(Y,tt))),p.ADD_TAGS&&(G===Mi&&(G=pe(G)),S(G,p.ADD_TAGS,V)),p.ADD_ATTR&&(Y===Ii&&(Y=pe(Y)),S(Y,p.ADD_ATTR,V)),p.ADD_URI_SAFE_ATTR&&S(Gt,p.ADD_URI_SAFE_ATTR,V),p.FORBID_CONTENTS&&(Re===Ui&&(Re=pe(Re)),S(Re,p.FORBID_CONTENTS,V)),Wt&&(G["#text"]=!0),xe&&S(G,["html","head","body"]),G.table&&(S(G,["tbody"]),delete Fe.tbody),p.TRUSTED_TYPES_POLICY){if(typeof p.TRUSTED_TYPES_POLICY.createHTML!="function")throw Oe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof p.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Oe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');v=p.TRUSTED_TYPES_POLICY,B=v.createHTML("")}else v===void 0&&(v=xr(_,s)),v!==null&&typeof B=="string"&&(B=v.createHTML(""));Q&&Q(p),Se=p}},qi=S({},[...Lt,...zt,...cr]),ji=S({},[...Mt,...dr]),hn=function(p){let m=D(p);(!m||!m.tagName)&&(m={namespaceURI:Ce,tagName:"template"});const x=et(p.tagName),$=et(m.tagName);return qt[p.namespaceURI]?p.namespaceURI===gt?m.namespaceURI===fe?x==="svg":m.namespaceURI===ft?x==="svg"&&($==="annotation-xml"||mt[$]):!!qi[x]:p.namespaceURI===ft?m.namespaceURI===fe?x==="math":m.namespaceURI===gt?x==="math"&&_t[$]:!!ji[x]:p.namespaceURI===fe?m.namespaceURI===gt&&!_t[$]||m.namespaceURI===ft&&!mt[$]?!1:!ji[x]&&(nn[x]||!qi[x]):!!(Ge==="application/xhtml+xml"&&qt[p.namespaceURI]):!1},he=function(p){Ie(e.removed,{element:p});try{D(p).removeChild(p)}catch{H(p)}},Ae=function(p,m){try{Ie(e.removed,{attribute:m.getAttributeNode(p),from:m})}catch{Ie(e.removed,{attribute:null,from:m})}if(m.removeAttribute(p),p==="is")if(ve||ut)try{he(m)}catch{}else try{m.setAttribute(p,"")}catch{}},Yi=function(p){let m=null,x=null;if(Ft)p="<remove></remove>"+p;else{const W=wi(p,/^[\r\n\t ]+/);x=W&&W[0]}Ge==="application/xhtml+xml"&&Ce===fe&&(p='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+p+"</body></html>");const $=v?v.createHTML(p):p;if(Ce===fe)try{m=new u().parseFromString($,Ge)}catch{}if(!m||!m.documentElement){m=w.createDocument(Ce,"template",null);try{m.documentElement.innerHTML=Vt?B:$}catch{}}const X=m.body||m.documentElement;return p&&x&&X.insertBefore(t.createTextNode(x),X.childNodes[0]||null),Ce===fe?T.call(m,xe?"html":"body")[0]:xe?m.documentElement:X},Xi=function(p){return y.call(p.ownerDocument||p,p,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Yt=function(p){return p instanceof f&&(typeof p.nodeName!="string"||typeof p.textContent!="string"||typeof p.removeChild!="function"||!(p.attributes instanceof c)||typeof p.removeAttribute!="function"||typeof p.setAttribute!="function"||typeof p.namespaceURI!="string"||typeof p.insertBefore!="function"||typeof p.hasChildNodes!="function")},Zi=function(p){return typeof n=="function"&&p instanceof n};function ge(k,p,m){Je(k,x=>{x.call(e,p,m,Se)})}const Ki=function(p){let m=null;if(ge(O.beforeSanitizeElements,p,null),Yt(p))return he(p),!0;const x=V(p.nodeName);if(ge(O.uponSanitizeElement,p,{tagName:x,allowedTags:G}),dt&&p.hasChildNodes()&&!Zi(p.firstElementChild)&&J(/<[/\w!]/g,p.innerHTML)&&J(/<[/\w!]/g,p.textContent)||p.nodeType===Be.progressingInstruction||dt&&p.nodeType===Be.comment&&J(/<[/\w]/g,p.data))return he(p),!0;if(!G[x]||Fe[x]){if(!Fe[x]&&Ji(x)&&(U.tagNameCheck instanceof RegExp&&J(U.tagNameCheck,x)||U.tagNameCheck instanceof Function&&U.tagNameCheck(x)))return!1;if(Wt&&!Re[x]){const $=D(p)||p.parentNode,X=N(p)||p.childNodes;if(X&&$){const W=X.length;for(let te=W-1;te>=0;--te){const me=L(X[te],!0);me.__removalCount=(p.__removalCount||0)+1,$.insertBefore(me,A(p))}}}return he(p),!0}return p instanceof d&&!hn(p)||(x==="noscript"||x==="noembed"||x==="noframes")&&J(/<\/no(script|embed|frames)/i,p.innerHTML)?(he(p),!0):(Ee&&p.nodeType===Be.text&&(m=p.textContent,Je([z,be,ke],$=>{m=He(m,$," ")}),p.textContent!==m&&(Ie(e.removed,{element:p.cloneNode()}),p.textContent=m)),ge(O.afterSanitizeElements,p,null),!1)},Qi=function(p,m,x){if(Bi&&(m==="id"||m==="name")&&(x in t||x in an))return!1;if(!($t&&!Bt[m]&&J(at,m))){if(!(Hi&&J(ht,m))){if(!Y[m]||Bt[m]){if(!(Ji(p)&&(U.tagNameCheck instanceof RegExp&&J(U.tagNameCheck,p)||U.tagNameCheck instanceof Function&&U.tagNameCheck(p))&&(U.attributeNameCheck instanceof RegExp&&J(U.attributeNameCheck,m)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(m))||m==="is"&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&J(U.tagNameCheck,x)||U.tagNameCheck instanceof Function&&U.tagNameCheck(x))))return!1}else if(!Gt[m]){if(!J(zi,He(x,Li,""))){if(!((m==="src"||m==="xlink:href"||m==="href")&&p!=="script"&&or(x,"data:")===0&&Fi[p])){if(!(Oi&&!J(ct,He(x,Li,"")))){if(x)return!1}}}}}}return!0},Ji=function(p){return p!=="annotation-xml"&&wi(p,tn)},es=function(p){ge(O.beforeSanitizeAttributes,p,null);const{attributes:m}=p;if(!m||Yt(p))return;const x={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let $=m.length;for(;$--;){const X=m[$],{name:W,namespaceURI:te,value:me}=X,Ve=V(W),Xt=me;let Z=W==="value"?Xt:lr(Xt);if(x.attrName=Ve,x.attrValue=Z,x.keepAttr=!0,x.forceKeepAttr=void 0,ge(O.uponSanitizeAttribute,p,x),Z=x.attrValue,$i&&(Ve==="id"||Ve==="name")&&(Ae(W,p),Z=sn+Z),dt&&J(/((--!?|])>)|<\/(style|title)/i,Z)){Ae(W,p);continue}if(x.forceKeepAttr)continue;if(!x.keepAttr){Ae(W,p);continue}if(!Pi&&J(/\/>/i,Z)){Ae(W,p);continue}Ee&&Je([z,be,ke],is=>{Z=He(Z,is," ")});const ts=V(p.nodeName);if(!Qi(ts,Ve,Z)){Ae(W,p);continue}if(v&&typeof _=="object"&&typeof _.getAttributeType=="function"&&!te)switch(_.getAttributeType(ts,Ve)){case"TrustedHTML":{Z=v.createHTML(Z);break}case"TrustedScriptURL":{Z=v.createScriptURL(Z);break}}if(Z!==Xt)try{te?p.setAttributeNS(te,W,Z):p.setAttribute(W,Z),Yt(p)?he(p):yi(e.removed)}catch{Ae(W,p)}}ge(O.afterSanitizeAttributes,p,null)},cn=function k(p){let m=null;const x=Xi(p);for(ge(O.beforeSanitizeShadowDOM,p,null);m=x.nextNode();)ge(O.uponSanitizeShadowNode,m,null),Ki(m),es(m),m.content instanceof r&&k(m.content);ge(O.afterSanitizeShadowDOM,p,null)};return e.sanitize=function(k){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=null,x=null,$=null,X=null;if(Vt=!k,Vt&&(k="<!-->"),typeof k!="string"&&!Zi(k))if(typeof k.toString=="function"){if(k=k.toString(),typeof k!="string")throw Oe("dirty is not a string, aborting")}else throw Oe("toString is not a function");if(!e.isSupported)return k;if(Ut||jt(p),e.removed=[],typeof k=="string"&&(We=!1),We){if(k.nodeName){const me=V(k.nodeName);if(!G[me]||Fe[me])throw Oe("root node is forbidden and cannot be sanitized in-place")}}else if(k instanceof n)m=Yi("<!---->"),x=m.ownerDocument.importNode(k,!0),x.nodeType===Be.element&&x.nodeName==="BODY"||x.nodeName==="HTML"?m=x:m.appendChild(x);else{if(!ve&&!Ee&&!xe&&k.indexOf("<")===-1)return v&&pt?v.createHTML(k):k;if(m=Yi(k),!m)return ve?null:pt?B:""}m&&Ft&&he(m.firstChild);const W=Xi(We?k:m);for(;$=W.nextNode();)Ki($),es($),$.content instanceof r&&cn($.content);if(We)return k;if(ve){if(ut)for(X=C.call(m.ownerDocument);m.firstChild;)X.appendChild(m.firstChild);else X=m;return(Y.shadowroot||Y.shadowrootmode)&&(X=F.call(i,X,!0)),X}let te=xe?m.outerHTML:m.innerHTML;return xe&&G["!doctype"]&&m.ownerDocument&&m.ownerDocument.doctype&&m.ownerDocument.doctype.name&&J(Ti,m.ownerDocument.doctype.name)&&(te="<!DOCTYPE "+m.ownerDocument.doctype.name+`>
|
|
61
|
+
`+te),Ee&&Je([z,be,ke],me=>{te=He(te,me," ")}),v&&pt?v.createHTML(te):te},e.setConfig=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jt(k),Ut=!0},e.clearConfig=function(){Se=null,Ut=!1},e.isValidAttribute=function(k,p,m){Se||jt({});const x=V(k),$=V(p);return Qi(x,$,m)},e.addHook=function(k,p){typeof p=="function"&&Ie(O[k],p)},e.removeHook=function(k,p){if(p!==void 0){const m=rr(O[k],p);return m===-1?void 0:nr(O[k],m,1)[0]}return yi(O[k])},e.removeHooks=function(k){O[k]=[]},e.removeAllHooks=function(){O=Ci()},e}var kr=Si();const Er=["innerHTML"],vr="Markdown",Tr=_e(l.defineComponent({inheritAttrs:!1,__name:"Markdown",props:{markdownText:{},mode:{},sanitize:{type:Boolean},inputFormat:{}},emits:["update:markdownText","changeMode"],setup(o,{emit:e}){const t=o,i=e,s=l.shallowRef([{comp:Qt,event:h,tooltip:"Edit Markdown"}]);I.setOptions({gfm:!0,breaks:!0});const r=l.ref(t.markdownText??"");l.watch(()=>t.markdownText,c=>{c!==void 0&&c!==r.value&&(r.value=c)});const a=l.ref(t.mode?t.mode==="edit":!1);l.watch(()=>t.mode,c=>{c&&(a.value=c==="edit")});const n=l.computed(()=>{const c=t.inputFormat==="html"?r.value??"":I.parse(r.value??"");return t.sanitize===!1?c:kr.sanitize(c)});function d(){i("update:markdownText",r.value)}function h(){a.value=!a.value,i("changeMode",a.value?"edit":"preview")}return(c,f)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.renderSlot(c.$slots,"default",{widgetName:vr,childIcons:s.value},void 0,!0),l.createElementVNode("div",l.mergeProps({class:"markdown-widget-wrap"},c.$attrs),[a.value?l.withDirectives((l.openBlock(),l.createElementBlock("textarea",{key:0,"onUpdate:modelValue":f[0]||(f[0]=u=>r.value=u),onInput:d,class:"markdown-input",placeholder:"Write markdown here…"},null,544)),[[l.vModelText,r.value]]):(l.openBlock(),l.createElementBlock("div",{key:1,class:"markdown-output",innerHTML:n.value},null,8,Er))],16)],64))}}),[["__scopeId","data-v-5bf532d5"]]);function Rr(o,e,t,i,s){let r=(...a)=>(console.warn("gridstack.js: Function `"+t+"` is deprecated in "+s+" and has been replaced with `"+i+"`. It will be **removed** in a future release"),e.apply(o,a));return r.prototype=e.prototype,r}class g{static getElements(e,t=document){if(typeof e=="string"){const i="getElementById"in t?t:void 0;if(i&&!isNaN(+e[0])){const r=i.getElementById(e);return r?[r]:[]}let s=t.querySelectorAll(e);return!s.length&&e[0]!=="."&&e[0]!=="#"&&(s=t.querySelectorAll("."+e),s.length||(s=t.querySelectorAll("#"+e))),Array.from(s)}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 s=t.querySelector(e);return i&&!s&&(s=i.getElementById(e)),s||(s=t.querySelector("."+e)),s}return e}static shouldSizeToContent(e){return(e==null?void 0: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 g.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,s=e.x+e.w<t.x+t.w?e.x+e.w:t.x+t.w;if(s<=i)return 0;let r=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<=r?0:(s-i)*(a-r)}static area(e){return e.w*e.h}static sort(e,t=1,i){return i=i||e.reduce((s,r)=>Math.max(r.x+r.w,s),0)||12,t===-1?e.sort((s,r)=>(r.x??1e3)+(r.y??1e3)*i-((s.x??1e3)+(s.y??1e3)*i)):e.sort((s,r)=>(s.x??1e3)+(s.y??1e3)*i-((r.x??1e3)+(r.y??1e3)*i))}static find(e,t){return t?e.find(i=>i.id===t):void 0}static createStylesheet(e,t,i){let s=document.createElement("style");const r=i==null?void 0:i.nonce;return r&&(s.nonce=r),s.setAttribute("type","text/css"),s.setAttribute("gs-style-id",e),s.styleSheet?s.styleSheet.cssText="":s.appendChild(document.createTextNode("")),t?t.insertBefore(s,t.firstChild):(t=document.getElementsByTagName("head")[0],t.appendChild(s)),s.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 s=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);if(!s)throw new Error(`Invalid height val = ${e}`);i=s[2]||"px",t=parseFloat(s[1])}else t=e;return{h:t,unit:i}}static defaults(e,...t){return t.forEach(i=>{for(const s in i){if(!i.hasOwnProperty(s))return;e[s]===null||e[s]===void 0?e[s]=i[s]:typeof i[s]=="object"&&typeof e[s]=="object"&&this.defaults(e[s],i[s])}}),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 s=e[i];if(i[0]==="_"||s===t[i])delete e[i];else if(s&&typeof s=="object"&&t[i]!==void 0){for(let r in s)(s[r]===t[i][r]||r[0]==="_")&&delete s[r];Object.keys(s).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(...s)=>{i||(i=!0,setTimeout(()=>{e(...s),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 s=e.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight;if(s.top<0||s.bottom>r){let a=s.bottom-r,n=s.top,d=this.getScrollElement(e);if(d!==null){let h=d.scrollTop;s.top<0&&i<0?e.offsetHeight>r?d.scrollTop+=i:d.scrollTop+=Math.abs(n)>Math.abs(i)?i:n:i>0&&(e.offsetHeight>r?d.scrollTop+=i:d.scrollTop+=a>i?i:a),t.top+=d.scrollTop-h}}}static updateScrollResize(e,t,i){const s=this.getScrollElement(t),r=s.clientHeight,a=s===this.getScrollElement()?0:s.getBoundingClientRect().top,n=e.clientY-a,d=n<i,h=n>r-i;d?s.scrollBy({behavior:"smooth",top:n-i}):h&&s.scrollBy({behavior:"smooth",top:i-(r-n)})}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=g.clone(e);for(const s in i)i.hasOwnProperty(s)&&typeof i[s]=="object"&&s.substring(0,2)!=="__"&&!t.find(r=>r===s)&&(i[s]=g.cloneDeep(e[s]));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=g.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(s=>{e.style[i]=s}):e.style[i]=t[i])}static initEvent(e,t){const i={type:t.type},s={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(r=>i[r]=e[r]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(r=>i[r]=e[r]),{...i,...s}}static simulateMouseEvent(e,t,i){const s=document.createEvent("MouseEvents");s.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(s)}}class le{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,s={}){if(this.sortNodes(-1),i=i||this.collide(e,t),!i)return!1;if(e._moving&&!s.nested&&!this.float&&this.swap(e,i))return!0;let r=t;this._useEntireRowArea(e,t)&&(r={x:0,w:this.column,y:t.y,h:t.h},i=this.collide(e,r,s.skip));let a=!1,n={nested:!0,pack:!1};for(;i=i||this.collide(e,r,s.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,...n}),i.locked&&d?g.copyPos(t,e):!i.locked&&d&&s.pack&&(this._packNodes(),t.y=i.y+i.h,g.copyPos(e,t)),a=a||d):d=this.moveNode(i,{...i,y:t.y+t.h,skip:e,...n}),!d)return a;i=void 0}return a}collide(e,t=e,i){const s=e._id,r=i==null?void 0:i._id;return this.nodes.find(a=>a._id!==s&&a._id!==r&&g.isIntercepted(a,t))}collideAll(e,t=e,i){const s=e._id,r=i==null?void 0:i._id;return this.nodes.filter(a=>a._id!==s&&a._id!==r&&g.isIntercepted(a,t))}directionCollideCoverage(e,t,i){if(!t.rect||!e._rect)return;let s=e._rect,r={...t.rect};r.y>s.y?(r.h+=r.y-s.y,r.y=s.y):r.h+=s.y-r.y,r.x>s.x?(r.w+=r.x-s.x,r.x=s.x):r.w+=s.x-r.x;let a,n=.5;return i.forEach(d=>{if(d.locked||!d._rect)return;let h=d._rect,c=Number.MAX_VALUE,f=Number.MAX_VALUE;s.y<h.y?c=(r.y+r.h-h.y)/h.h:s.y+s.h>h.y+h.h&&(c=(h.y+h.h-r.y)/h.h),s.x<h.x?f=(r.x+r.w-h.x)/h.w:s.x+s.w>h.x+h.w&&(f=(h.x+h.w-r.x)/h.w);let u=Math.min(f,c);u>n&&(n=u,a=d)}),t.collide=a,a}cacheRects(e,t,i,s,r,a){return this.nodes.forEach(n=>n._rect={y:n.y*t+i,x:n.x*e+a,w:n.w*e-a-s,h:n.h*t-i-r}),this}swap(e,t){if(!t||t.locked||!e||e.locked)return!1;function i(){let r=t.x,a=t.y;return t.x=e.x,t.y=e.y,e.h!=t.h?(e.x=r,e.y=t.y+t.h):e.w!=t.w?(e.x=t.x+t.w,e.y=a):(e.x=r,e.y=a),e._dirty=t._dirty=!0,!0}let s;if(e.w===t.w&&e.h===t.h&&(e.x===t.x||e.y===t.y)&&(s=g.isTouching(e,t)))return i();if(s!==!1){if(e.w===t.w&&e.x===t.x&&(s||(s=g.isTouching(e,t)))){if(t.y<e.y){let r=e;e=t,t=r}return i()}if(s!==!1){if(e.h===t.h&&e.y===t.y&&(s||(s=g.isTouching(e,t)))){if(t.x<e.x){let r=e;e=t,t=r}return i()}return!1}}}isAreaEmpty(e,t,i,s){let r={x:e||0,y:t||0,w:i||1,h:s||1};return!this.collide(r)}compact(e="compact",t=!0){if(this.nodes.length===0)return this;t&&this.sortNodes();const i=this.batchMode;i||this.batchUpdate();const s=this._inColumnResize;s||(this._inColumnResize=!0);let r=this.nodes;return this.nodes=[],r.forEach((a,n,d)=>{let h;a.locked||(a.autoPosition=!0,e==="list"&&n&&(h=d[n-1])),this.addNode(a,!1,h)}),s||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=g.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??le._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 g.defaults(e,i),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,g.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||g.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 r={...e};r.autoPosition||r.x===void 0?(delete r.x,delete r.y):r.x=Math.min(11,r.x),r.w=Math.min(12,r.w||1),this.cacheOneLayout(r,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),g.samePos(e,i)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(t=>t._dirty&&!g.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=g.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{g.samePos(e,e._orig)||(g.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,t=this.nodes,i=this.column,s){let r=s?s.y*i+(s.x+s.w):0,a=!1;for(let n=r;!a;++n){let d=n%i,h=Math.floor(n/i);if(d+e.w>i)continue;let c={x:d,y:h,w:e.w,h:e.h};t.find(f=>g.isIntercepted(c,f))||((e.x!==d||e.y!==h)&&(e._dirty=!0),e.x=d,e.y=h,delete e.autoPosition,a=!0)}return a}addNode(e,t=!1,i){let s=this.nodes.find(a=>a._id===e._id);if(s)return s;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let r;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,i)&&(delete e.autoPosition,r=!0),this.nodes.push(e),t&&this.addedNodes.push(e),r||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,t=!0,i=!1){return this.nodes.find(s=>s._id===e._id)?(i&&this.removedNodes.push(e),t&&(e._removeDOM=!0),this.nodes=this.nodes.filter(s=>s._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,s=new le({column:this.column,float:this.float,nodes:this.nodes.map(a=>a._id===e._id?(i={...a},i):{...a})});if(!i)return!1;let r=s.moveNode(i,t)&&s.getRow()<=Math.max(this.getRow(),this.maxRow);if(!r&&!t.resizing&&t.collide){let a=t.collide.el.gridstackNode;if(this.swap(e,a))return this._notify(),!0}return r?(s.nodes.filter(a=>a._dirty).forEach(a=>{let n=this.nodes.find(d=>d._id===a._id);n&&(g.copyPos(n,a),n._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;let t=new le({column:this.column,float:this.float,nodes:this.nodes.map(s=>({...s}))}),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=g.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){var h,c;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 s=e.w!==t.w||e.h!==t.h,r=g.copyPos({},e,!0);if(g.copyPos(r,t),this.nodeBoundFix(r,s),g.copyPos(t,r),!t.forceCollide&&g.samePos(e,t))return!1;let a=g.copyPos({},e),n=this.collideAll(e,r,t.skip),d=!0;if(n.length){let f=e._moving&&!t.nested,u=f?this.directionCollideCoverage(e,t,n):n[0];if(f&&u&&((c=(h=e.grid)==null?void 0:h.opts)!=null&&c.subGridDynamic)&&!e.grid._isTemp){let _=g.areaIntercept(t.rect,u._rect),b=g.area(t.rect),L=g.area(u._rect);_/(b<L?b:L)>.8&&(u.grid.makeSubGrid(u.el,void 0,e),u=void 0)}u?d=!this._fixCollisions(e,r,u,t):(d=!1,i&&delete t.pack)}return d&&(e._dirty=!0,g.copyPos(e,r)),t.pack&&this._packNodes()._notify(),!g.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){var a;let i=(a=this._layouts)==null?void 0:a.length,s=i&&this.column!==i-1?this._layouts[i-1]:null,r=[];return this.sortNodes(),this.nodes.forEach(n=>{let d=s==null?void 0:s.find(c=>c._id===n._id),h={...n,...d||{}};g.removeInternalForSave(h,!e),t&&t(n,h),r.push(h)}),r}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 s=i/this.column;e.forEach(r=>{if(!r._orig)return;let a=t.find(n=>n._id===r._id);a&&(a.y>=0&&r.y!==r._orig.y&&(a.y+=r.y-r._orig.y),r.x!==r._orig.x&&(a.x=Math.round(r.x*s)),r.w!==r._orig.w&&(a.w=Math.round(r.w*s)))})}}),this)}columnChanged(e,t,i,s="moveScale"){var d;if(!this.nodes.length||!t||e===t)return this;const r=s==="compact"||s==="list";r&&this.sortNodes(1,e),t<e&&this.cacheLayout(this.nodes,e),this.batchUpdate();let a=[],n=!1;if(t===1&&(i!=null&&i.length)){n=!0;let h=0;i.forEach(c=>{c.x=0,c.w=1,c.y=Math.max(c.y,h),h=c.y+c.h}),a=i,i=[]}else i=r?this.nodes:g.sort(this.nodes,-1,e);if(t>e&&this._layouts){const h=this._layouts[t]||[];let c=this._layouts.length-1;!h.length&&e!==c&&((d=this._layouts[c])!=null&&d.length)&&(e=c,this._layouts[c].forEach(f=>{let u=i.find(_=>_._id===f._id);u&&(!r&&!f.autoPosition&&(u.x=f.x??u.x,u.y=f.y??u.y),u.w=f.w??u.w,(f.x==null||f.y===void 0)&&(u.autoPosition=!0))})),h.forEach(f=>{let u=i.findIndex(_=>_._id===f._id);if(u!==-1){const _=i[u];if(r){_.w=f.w;return}(f.autoPosition||isNaN(f.x)||isNaN(f.y))&&this.findEmptyPosition(f,a),f.autoPosition||(_.x=f.x??_.x,_.y=f.y??_.y,_.w=f.w??_.w,a.push(_)),i.splice(u,1)}})}if(r)this.compact(s,!1);else{if(i.length){if(typeof s=="function")s(t,e,a,i);else if(!n){let h=r||s==="none"?1:t/e,c=s==="move"||s==="moveScale",f=s==="scale"||s==="moveScale";i.forEach(u=>{u.x=t===1?0:c?Math.round(u.x*h):Math.min(u.x,t-1),u.w=t===1||e===1?1:f?Math.round(u.w*h)||1:Math.min(u.w,t),a.push(u)}),i=[]}}n||(a=g.sort(a,-1,t)),this._inColumnResize=!0,this.nodes=[],a.forEach(h=>{this.addNode(h,!1),delete h._orig})}return this.nodes.forEach(h=>delete h._orig),this.batchUpdate(!1,!r),delete this._inColumnResize,this}cacheLayout(e,t,i=!1){let s=[];return e.forEach((r,a)=>{if(r._id===void 0){const n=r.id?this.nodes.find(d=>d.id===r.id):void 0;r._id=(n==null?void 0:n._id)??le._idSeq++}s[a]={x:r.x,y:r.y,w:r.w,_id:r._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[t]=s,this}cacheOneLayout(e,t){e._id=e._id??le._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 s=this.findCacheLayout(e,t);return s===-1?this._layouts[t].push(i):this._layouts[t][s]=i,this}findCacheLayout(e,t){var i,s;return((s=(i=this._layouts)==null?void 0:i[t])==null?void 0:s.findIndex(r=>r._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}}le._idSeq=0;const ie={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"},Cr={handle:".grid-stack-item-content",appendTo:"body"};class E{}const ne=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 ae{}function it(o,e){if(o.touches.length>1)return;o.cancelable&&o.preventDefault();const t=o.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),o.target.dispatchEvent(i)}function Ai(o,e){o.cancelable&&o.preventDefault();const t=document.createEvent("MouseEvents");t.initMouseEvent(e,!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),o.target.dispatchEvent(t)}function st(o){ae.touchHandled||(ae.touchHandled=!0,it(o,"mousedown"))}function rt(o){ae.touchHandled&&it(o,"mousemove")}function nt(o){if(!ae.touchHandled)return;ae.pointerLeaveTimeout&&(window.clearTimeout(ae.pointerLeaveTimeout),delete ae.pointerLeaveTimeout);const e=!!E.dragElement;it(o,"mouseup"),e||it(o,"click"),ae.touchHandled=!1}function ot(o){o.pointerType!=="mouse"&&o.target.releasePointerCapture(o.pointerId)}function Di(o){E.dragElement&&o.pointerType!=="mouse"&&Ai(o,"mouseenter")}function Ni(o){E.dragElement&&o.pointerType!=="mouse"&&(ae.pointerLeaveTimeout=window.setTimeout(()=>{delete ae.pointerLeaveTimeout,Ai(o,"mouseleave")},10))}class lt{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(`${lt.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),ne&&(this.el.addEventListener("touchstart",st),this.el.addEventListener("pointerdown",ot)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),ne&&(this.el.removeEventListener("touchstart",st),this.el.removeEventListener("pointerdown",ot)),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),ne&&(this.el.addEventListener("touchmove",rt),this.el.addEventListener("touchend",nt)),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),ne&&(this.el.removeEventListener("touchmove",rt),this.el.removeEventListener("touchend",nt)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_triggerEvent(e,t){return this.option[e]&&this.option[e](t),this}}lt.prefix="ui-resizable-";class Ht{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 $e extends Ht{constructor(e,t={}){super(),this.rectScale={x:1,y:1},this._ui=()=>{const s=this.el.parentElement.getBoundingClientRect(),r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},a=this.temporalRect||r;return{position:{left:(a.left-s.left)*this.rectScale.x,top:(a.top-s.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(s=>this.option[s]=e[s]),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),E.overResizeElement===this&&delete E.overResizeElement),this}_mouseOver(e){E.overResizeElement||E.dragElement||(E.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){E.overResizeElement===this&&(delete E.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 lt(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=g.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const t=g.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=g.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=g.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=$e._originStyleProp.map(s=>this.el.style[s]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,t=document.createElement("div");g.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 $e._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,s={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},r=e.clientX-i.clientX,a=e.clientY-i.clientY;t.indexOf("e")>-1?s.width+=r:t.indexOf("w")>-1&&(s.width-=r,s.left+=r),t.indexOf("s")>-1?s.height+=a:t.indexOf("n")>-1&&(s.height-=a,s.top+=a);const n=this._constrainSize(s.width,s.height);return Math.round(s.width)!==Math.round(n.width)&&(t.indexOf("w")>-1&&(s.left+=s.width-n.width),s.width=n.width),Math.round(s.height)!==Math.round(n.height)&&(t.indexOf("n")>-1&&(s.top+=s.height-n.height),s.height=n.height),s}_constrainSize(e,t){const i=this.option.maxWidth||Number.MAX_SAFE_INTEGER,s=this.option.minWidth/this.rectScale.x||e,r=this.option.maxHeight||Number.MAX_SAFE_INTEGER,a=this.option.minHeight/this.rectScale.y||t,n=Math.min(i,Math.max(s,e)),d=Math.min(r,Math.max(a,t));return{width:n,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:s}=t.getBoundingClientRect();e={left:i,top:s,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(t=>{const i=this.temporalRect[t],s=t==="width"||t==="left"?this.rectScale.x:t==="height"||t==="top"?this.rectScale.y:1;this.el.style[t]=(i-e[t])*s+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}}$e._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const Sr='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class Ue extends Ht{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),ne&&(this.dragEl.addEventListener("touchstart",st),this.dragEl.addEventListener("pointerdown",ot)),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEl.removeEventListener("mousedown",this._mouseDown),ne&&(this.dragEl.removeEventListener("touchstart",st),this.dragEl.removeEventListener("pointerdown",ot)),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(!E.mouseHandled)return e.button!==0||e.target.closest(Sr)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete E.dragElement,delete E.dropElement,document.addEventListener("mousemove",this._mouseMove,!0),document.addEventListener("mouseup",this._mouseUp,!0),ne&&(this.dragEl.addEventListener("touchmove",rt),this.dragEl.addEventListener("touchend",nt)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),E.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const t=g.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(e){var i;let t=this.mouseDownEvent;if(this.dragging)if(this._dragFollow(e),E.pauseDrag){const s=Number.isInteger(E.pauseDrag)?E.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),s)}else this._callDrag(e);else if(Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>3){this.dragging=!0,E.dragElement=this;let s=(i=this.el.gridstackNode)==null?void 0:i.grid;s?E.dropElement=s.el.ddElement.ddDroppable:delete E.dropElement,this.helper=this._createHelper(e),this._setupHelperContainmentStyle(),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment);const r=g.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){var t;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),ne&&(this.dragEl.removeEventListener("touchmove",rt,!0),this.dragEl.removeEventListener("touchend",nt,!0)),this.dragging){delete this.dragging,((t=E.dropElement)==null?void 0:t.el)===this.el.parentElement&&delete E.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper===this.el?this._removeHelperStyle():this.helper.remove();const i=g.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(i),this.triggerEvent("dragstop",i),E.dropElement&&E.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete E.dragElement,delete E.dropElement,delete E.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=g.cloneNode(this.el)),document.body.contains(t)||g.appendTo(t,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),t===this.el&&(this.dragElementOriginStyle=Ue.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(){var t;this.helper.classList.remove("ui-draggable-dragging");let e=(t=this.helper)==null?void 0:t.gridstackNode;if(!(e!=null&&e._isAboutToRemove)&&this.dragElementOriginStyle){let i=this.helper,s=this.dragElementOriginStyle.transition||null;i.style.transition=this.dragElementOriginStyle.transition="none",Ue.originStyleProp.forEach(r=>i.style[r]=this.dragElementOriginStyle[r]||null),setTimeout(()=>i.style.transition=s,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){let t={left:0,top:0};const i=this.helper.style,s=this.dragOffset;i.left=(e.clientX+s.offsetLeft-t.left)*this.dragScale.x+"px",i.top=(e.clientY+s.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 s=0,r=0;if(i){const n=document.createElement("div");g.addElStyles(n,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),i.appendChild(n);const d=n.getBoundingClientRect();i.removeChild(n),s=d.left,r=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-s,offsetTop:-e.clientY+a.top-r,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}}}}Ue.originStyleProp=["transition","pointerEvents","position","left","top","minWidth","willChange"];class Ar extends Ht{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),ne&&(this.el.addEventListener("pointerenter",Di),this.el.addEventListener("pointerleave",Ni)))}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),ne&&(this.el.removeEventListener("pointerenter",Di),this.el.removeEventListener("pointerleave",Ni)))}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(!E.dragElement||!this._canDrop(E.dragElement.el))return;e.preventDefault(),e.stopPropagation(),E.dropElement&&E.dropElement!==this&&E.dropElement._mouseLeave(e),E.dropElement=this;const t=g.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(E.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(e){var i;if(!E.dragElement||E.dropElement!==this)return;e.preventDefault(),e.stopPropagation();const t=g.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(t,this._ui(E.dragElement)),this.triggerEvent("dropout",t),E.dropElement===this){delete E.dropElement;let s,r=this.el.parentElement;for(;!s&&r;)s=(i=r.ddElement)==null?void 0:i.ddDroppable,r=r.parentElement;s&&s._mouseEnter(e)}}drop(e){e.preventDefault();const t=g.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(E.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 Ot{static init(e){return e.ddElement||(e.ddElement=new Ot(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 Ue(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 $e(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 Ar(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class Dr{resizable(e,t,i,s){return this._getDDElements(e).forEach(r=>{if(t==="disable"||t==="enable")r.ddResizable&&r.ddResizable[t]();else if(t==="destroy")r.ddResizable&&r.cleanResizable();else if(t==="option")r.setupResizable({[i]:s});else{const a=r.el.gridstackNode.grid;let n=r.el.getAttribute("gs-resize-handles")?r.el.getAttribute("gs-resize-handles"):a.opts.resizable.handles,d=!a.opts.alwaysShowResizeHandle;r.setupResizable({...a.opts.resizable,handles:n,autoHide:d,start:t.start,stop:t.stop,resize:t.resize})}}),this}draggable(e,t,i,s){return this._getDDElements(e).forEach(r=>{if(t==="disable"||t==="enable")r.ddDraggable&&r.ddDraggable[t]();else if(t==="destroy")r.ddDraggable&&r.cleanDraggable();else if(t==="option")r.setupDraggable({[i]:s});else{const a=r.el.gridstackNode.grid;r.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,s){return typeof t.accept=="function"&&!t._accept&&(t._accept=t.accept,t.accept=r=>t._accept(r)),this._getDDElements(e).forEach(r=>{t==="disable"||t==="enable"?r.ddDroppable&&r.ddDroppable[t]():t==="destroy"?r.ddDroppable&&r.cleanDroppable():t==="option"?r.setupDroppable({[i]:s}):r.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(s=>s.on(t,r=>{i(r,E.dragElement?E.dragElement.el:r.target,E.dragElement?E.dragElement.helper:null)})),this}off(e,t){return this._getDDElements(e).forEach(i=>i.off(t)),this}_getDDElements(e,t=!0){let i=g.getElements(e);if(!i.length)return[];let s=i.map(r=>r.ddElement||(t?Ot.init(r):null));return t||s.filter(r=>r),s}}/*!
|
|
62
62
|
* GridStack 9.5.1
|
|
63
63
|
* https://gridstackjs.com/
|
|
64
64
|
*
|
|
@@ -66,4 +66,4 @@ Please report this to https://github.com/markedjs/marked.`,o){let i="<p>An error
|
|
|
66
66
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
67
67
|
*/const j=new Dr;class R{static init(e={},t=".grid-stack"){let i=R.getGridElement(t);return i?(i.gridstack||(i.gridstack=new R(i,g.cloneDeep(e))),i.gridstack):(console.error(typeof t=="string"?'GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ?
|
|
68
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 R.getGridElements(t).forEach(s=>{s.gridstack||(s.gridstack=new R(s,g.cloneDeep(e))),i.push(s.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 l=i.gridstack;return t&&(l.opts={...l.opts,...t}),t.children!==void 0&&l.load(t.children),l}if(!e.classList.contains("grid-stack")||R.addRemoveCB)if(R.addRemoveCB)i=R.addRemoveCB(e,t,!0,!0);else{let l=document.implementation.createHTMLDocument("");l.body.innerHTML=`<div class="grid-stack ${t.class||""}"></div>`,i=l.body.children[0],e.appendChild(i)}return R.init(t,i)}static registerEngine(e){R.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,ie.itemClass,this.opts.itemClass),this.placeholder.appendChild(e)}return this._placeholder}constructor(e,t={}){var d,h;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=g.toNumber(e.getAttribute("gs-row"));t.column==="auto"&&delete t.column,t.alwaysShowResizeHandle!==void 0&&(t._alwaysShowResizeHandle=t.alwaysShowResizeHandle);let s={...g.cloneDeep(ie),column:g.toNumber(e.getAttribute("gs-column"))||ie.column,minRow:i||g.toNumber(e.getAttribute("gs-min-row"))||ie.minRow,maxRow:i||g.toNumber(e.getAttribute("gs-max-row"))||ie.maxRow,staticGrid:g.toBool(e.getAttribute("gs-static"))||ie.staticGrid,draggable:{handle:(t.handleClass?"."+t.handleClass:t.handle?t.handle:"")||ie.draggable.handle},removableOptions:{accept:t.itemClass||ie.removableOptions.accept,decline:ie.removableOptions.decline}};e.getAttribute("gs-animate")&&(s.animate=g.toBool(e.getAttribute("gs-animate"))),this.opts=g.defaults(t,s),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 r=(d=this.el.parentElement)==null?void 0:d.parentElement;let l=r!=null&&r.classList.contains(ie.itemClass)?r.gridstackNode:void 0;l&&(l.subGrid=this,this.parentGridItem=l,this.el.classList.add("grid-stack-nested"),l.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!==ie.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=ne),this._styleSheetClass="gs-id-"+le._idSeq++,this.el.classList.add(this._styleSheetClass),this._setStaticClass();let n=this.opts.engineClass||R.engineClass||le;if(this.engine=new n({column:this.getColumn(),float:this.opts.float,maxRow:this.opts.maxRow,onChange:c=>{let f=0;this.engine.nodes.forEach(u=>{f=Math.max(f,u.y+u.h)}),c.forEach(u=>{let _=u.el;_&&(u._removeDOM?(_&&_.remove(),delete u._removeDOM):this._writePosAttr(_,u))}),this._updateStyles(!1,f)}}),this.opts.auto&&(this.batchUpdate(),this.getGridItems().forEach(c=>this._prepareElement(c)),this.batchUpdate(!1)),this.opts.children){let c=this.opts.children;delete this.opts.children,c.length&&this.load(c)}this.setAnimation(this.opts.animate),this._updateStyles(),this.el.classList.add("gs-"+this.opts.column),this.opts.subGridDynamic&&!E.pauseDrag&&(E.pauseDrag=!0),((h=this.opts.draggable)==null?void 0:h.pause)!==void 0&&(E.pauseDrag=this.opts.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}addWidget(e,t){function i(n){return n.el!==void 0||n.x!==void 0||n.y!==void 0||n.w!==void 0||n.h!==void 0||n.content!==void 0}let s,r;if(typeof e=="string"){let n=document.implementation.createHTMLDocument("");n.body.innerHTML=e,s=n.body.children[0]}else if(arguments.length===0||arguments.length===1&&i(e))if(r=t=e,r!=null&&r.el)s=r.el;else if(R.addRemoveCB)s=R.addRemoveCB(this.el,t,!0,!1);else{let n=(t==null?void 0:t.content)||"",d=document.implementation.createHTMLDocument("");d.body.innerHTML=`<div class="grid-stack-item ${this.opts.itemClass||""}"><div class="grid-stack-item-content">${n}</div></div>`,s=d.body.children[0]}else s=e;if(!s)return;if(r=s.gridstackNode,r&&s.parentElement===this.el&&this.engine.nodes.find(n=>n._id===r._id))return s;let l=this._readAttr(s);return t=g.cloneDeep(t)||{},g.defaults(t,l),r=this.engine.prepareNode(t),this._writeAttr(s,t),this._insertNotAppend?this.el.prepend(s):this.el.appendChild(s),this.makeWidget(s,t),s}makeSubGrid(e,t,i,s=!0){var _,b,L;let r=e.gridstackNode;if(r||(r=this.makeWidget(e).gridstackNode),(_=r.subGrid)!=null&&_.el)return r.subGrid;let l,n=this;for(;n&&!l;)l=(b=n.opts)==null?void 0:b.subGridOpts,n=(L=n.parentGridItem)==null?void 0:L.grid;t=g.cloneDeep({...l||{},children:void 0,...t||r.subGridOpts}),r.subGridOpts=t;let d;t.column==="auto"&&(d=!0,t.column=Math.max(r.w||1,(i==null?void 0:i.w)||1),t.disableOneColumnMode=!0);let h=r.el.querySelector(".grid-stack-item-content"),c,f;if(s){if(this._removeDD(r.el),f={...r,x:0,y:0},g.removeInternalForSave(f),delete f.subGridOpts,r.content&&(f.content=r.content,delete r.content),R.addRemoveCB)c=R.addRemoveCB(this.el,f,!0,!1);else{let H=document.implementation.createHTMLDocument("");H.body.innerHTML='<div class="grid-stack-item"></div>',c=H.body.children[0],c.appendChild(h),H.body.innerHTML='<div class="grid-stack-item-content"></div>',h=H.body.children[0],r.el.appendChild(h)}this._prepareDragDropByNode(r)}if(i){let H=d?t.column:r.w,A=r.h+i.h,N=r.el.style;N.transition="none",this.update(r.el,{w:H,h:A}),setTimeout(()=>N.transition=null)}let u=r.subGrid=R.addGrid(h,t);return i!=null&&i._moving&&(u._isTemp=!0),d&&(u._autoColumn=!0),s&&u.addWidget(c,f),i&&(i._moving?window.setTimeout(()=>g.simulateMouseEvent(i._event,"mouseenter",u.el),0):u.addWidget(r.el,r)),u}removeAsSubGrid(e){var i;let t=(i=this.parentGridItem)==null?void 0:i.grid;t&&(t.batchUpdate(),t.removeWidget(this.parentGridItem.el,!0,!0),this.engine.nodes.forEach(s=>{s.x+=this.parentGridItem.x,s.y+=this.parentGridItem.y,t.addWidget(s.el,s)}),t.batchUpdate(!1),this.parentGridItem&&delete this.parentGridItem.subGrid,delete this.parentGridItem,e&&window.setTimeout(()=>g.simulateMouseEvent(e._event,"mouseenter",t.el),0))}save(e=!0,t=!1,i=R.saveCB){let s=this.engine.save(e,i);if(s.forEach(r=>{var l;if(e&&r.el&&!r.subGrid&&!i){let n=r.el.querySelector(".grid-stack-item-content");r.content=n?n.innerHTML:void 0,r.content||delete r.content}else if(!e&&!i&&delete r.content,(l=r.subGrid)!=null&&l.el){const n=r.subGrid.save(e,t,i);r.subGridOpts=t?n:{children:n},delete r.subGrid}delete r.el}),t){let r=g.cloneDeep(this.opts);r.marginBottom===r.marginTop&&r.marginRight===r.marginLeft&&r.marginTop===r.marginRight&&(r.margin=r.marginTop,delete r.marginTop,delete r.marginRight,delete r.marginBottom,delete r.marginLeft),r.rtl===(this.el.style.direction==="rtl")&&(r.rtl="auto"),this._isAutoCellHeight&&(r.cellHeight="auto"),this._autoColumn&&(r.column="auto",delete r.disableOneColumnMode);const l=r._alwaysShowResizeHandle;return delete r._alwaysShowResizeHandle,l!==void 0?r.alwaysShowResizeHandle=l:delete r.alwaysShowResizeHandle,g.removeInternalAndSame(r,ie),r.children=s,r}return s}load(e,t=R.addRemoveCB||!0){e=g.cloneDeep(e);const i=e.some(h=>h.x!==void 0||h.y!==void 0);i&&(e=g.sort(e,-1,this._prevColumn||this.getColumn())),this._insertNotAppend=i;const s=this.opts.column;this._prevColumn&&this._prevColumn!==s&&e.some(h=>(h.x||0)+h.w>s)&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(e,this._prevColumn,!0));const r=R.addRemoveCB;typeof t=="function"&&(R.addRemoveCB=t);let l=[];this.batchUpdate(),t&&[...this.engine.nodes].forEach(c=>{if(!c.id)return;g.find(e,c.id)||(R.addRemoveCB&&R.addRemoveCB(this.el,c,!1,!1),l.push(c),this.removeWidget(c.el,!0,!1))});let n=[];this.engine.nodes=this.engine.nodes.filter(h=>g.find(e,h.id)?(n.push(h),!1):!0);let d=!1;return e.forEach(h=>{var f;let c=g.find(n,h.id);if(c){if(g.shouldSizeToContent(c)&&(h.h=c.h),this.engine.nodeBoundFix(h),(h.autoPosition||h.x===void 0||h.y===void 0)&&(h.w=h.w||c.w,h.h=h.h||c.h,this.engine.findEmptyPosition(h)),d=d||h.w!==void 0&&h.w!==c.w,this.engine.nodes.push(c),g.samePos(c,h)&&this.moveNode(c,{...h,forceCollide:!0}),this.update(c.el,h),(f=h.subGridOpts)!=null&&f.children){let u=c.el.querySelector(".grid-stack");u&&u.gridstack&&(u.gridstack.load(h.subGridOpts.children),this._insertNotAppend=!0)}}else t&&this.addWidget(h)}),this.engine.removedNodes=l,this.doContentResize(d,!0),this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this._insertNotAppend,r?R.addRemoveCB=r:delete R.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 s=g.toNumber(t.getAttribute("gs-h"))||1;return Math.round(t.offsetHeight/s)}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 s=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+s}let i=g.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 s;return e===1&&this.opts.oneColumnModeDomSort&&(s=[],this.getGridItems().forEach(r=>{r.gridstackNode&&s.push(r.gridstackNode)}),s.length||(s=void 0)),this.engine.columnChanged(i,e,s,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(),s;t?s={top:i.top+document.documentElement.scrollTop,left:i.left}:s={top:this.el.offsetTop,left:this.el.offsetLeft};let r=e.left-s.left,l=e.top-s.top,n=i.width/this.getColumn(),d=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(r/n),y:Math.floor(l/d)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(e,t,i,s){return this.engine.isAreaEmpty(e,t,i,s)}makeWidget(e,t){let i=R.getElement(e);this._prepareElement(i,!0,t);const s=i.gridstackNode;return this._updateContainerHeight(),this.doContentResize(!1,!1,s),s.subGridOpts&&this.makeSubGrid(i,s.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(s=>this.on(s,t)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=s=>t(s):this._gsEventHandler[e]=s=>t(s,s.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 R.getElements(e).forEach(s=>{if(s.parentElement&&s.parentElement!==this.el)return;let r=s.gridstackNode;r||(r=this.engine.nodes.find(l=>s===l.el)),r&&(R.addRemoveCB&&R.addRemoveCB(this.el,r,!1,!1),delete s.gridstackNode,this._removeDD(s),this.engine.removeNode(r,t,i),t&&s.parentElement&&s.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(s=>{this._prepareDragDropByNode(s),s.subGrid&&i&&s.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,s=1;return t={x:i[s++],y:i[s++],w:i[s++],h:i[s++]},this.update(e,t)}return R.getElements(e).forEach(i=>{var c;let s=i==null?void 0:i.gridstackNode;if(!s)return;let r=g.cloneDeep(t);this.engine.nodeBoundFix(r),delete r.autoPosition,delete r.id;let l=["x","y","w","h"],n;if(l.some(f=>r[f]!==void 0&&r[f]!==s[f])&&(n={},l.forEach(f=>{n[f]=r[f]!==void 0?r[f]:s[f],delete r[f]})),!n&&(r.minW||r.minH||r.maxW||r.maxH)&&(n={}),r.content!==void 0){const f=i.querySelector(".grid-stack-item-content");f&&f.innerHTML!==r.content&&(f.innerHTML=r.content,(c=s.subGrid)!=null&&c.el&&(f.appendChild(s.subGrid.el),s.subGrid.opts.styleInHead||s.subGrid._updateStyles(!0))),delete r.content}let d=!1,h=!1;for(const f in r)f[0]!=="_"&&s[f]!==r[f]&&(s[f]=r[f],d=!0,h=h||!this.opts.staticGrid&&(f==="noResize"||f==="noMove"||f==="locked"));g.sanitizeMinMax(s),n&&this.moveNode(s,n),(n||d)&&this._writeAttr(i,s),h&&this._prepareDragDropByNode(s)}),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 s=i.grid;if(!s||e.parentElement!==s.el)return;const r=s.getCellHeight();if(!r)return;let l=t&&i.h?i.h*r:e.clientHeight,n;if(i.resizeToContentParent&&(n=e.querySelector(i.resizeToContentParent)),n||(n=e.querySelector(R.resizeToContentParent)),!n)return;const d=e.clientHeight-n.clientHeight,h=t&&i.h?i.h*r-d:n.clientHeight;let c;if(i.subGrid)c=i.subGrid.getRow()*i.subGrid.getCellHeight();else{const _=n.firstElementChild;if(!_){console.log(`Error: resizeToContent() '${R.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=_.getBoundingClientRect().height||h}if(h===c)return;l+=c-h;let f=Math.ceil(l/r);const u=Number.isInteger(i.sizeToContent)?i.sizeToContent:0;u&&f>u&&(f=u,e.classList.add("size-to-content-max")),i.minH&&f<i.minH?f=i.minH:i.maxH&&f>i.maxH&&(f=i.maxH),f!==i.h&&(s._ignoreLayoutsNodeChange=!0,s.moveNode(i,{h:f}),delete s._ignoreLayoutsNodeChange)}resizeToContentCheck(e,t=!1){R.resizeToContentCB?R.resizeToContentCB(e,t):this.resizeToContent(e,t)}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){let i=g.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,s={x:t[i++],y:t[i++],w:t[i++],h:t[i++],autoPosition:t[i++]};return this.willItFit(s)}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(){var e;return this.engine.batchMode?this:((e=this.engine.addedNodes)!=null&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(t=>{delete t._dirty}),this._triggerEvent("added",this.engine.addedNodes),this.engine.addedNodes=[]),this)}_triggerRemoveEvent(){var e;return this.engine.batchMode?this:((e=this.engine.removedNodes)!=null&&e.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&&(g.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,s=this.opts.cellHeightUnit,r=`.${this._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){let l=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=g.createStylesheet(this._styleSheetClass,l,{nonce:this.opts.nonce}),!this._styles)return this;this._styles._max=0,g.addCSSRule(this._styles,r,`height: ${i}${s}`);let n=this.opts.marginTop+this.opts.marginUnit,d=this.opts.marginBottom+this.opts.marginUnit,h=this.opts.marginRight+this.opts.marginUnit,c=this.opts.marginLeft+this.opts.marginUnit,f=`${r} > .grid-stack-item-content`,u=`.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;g.addCSSRule(this._styles,f,`top: ${n}; right: ${h}; bottom: ${d}; left: ${c};`),g.addCSSRule(this._styles,u,`top: ${n}; right: ${h}; bottom: ${d}; left: ${c};`),g.addCSSRule(this._styles,`${r} > .ui-resizable-ne`,`right: ${h}`),g.addCSSRule(this._styles,`${r} > .ui-resizable-e`,`right: ${h}`),g.addCSSRule(this._styles,`${r} > .ui-resizable-se`,`right: ${h}; bottom: ${d}`),g.addCSSRule(this._styles,`${r} > .ui-resizable-nw`,`left: ${c}`),g.addCSSRule(this._styles,`${r} > .ui-resizable-w`,`left: ${c}`),g.addCSSRule(this._styles,`${r} > .ui-resizable-sw`,`left: ${c}; bottom: ${d}`)}if(t=t||this._styles._max,t>this._styles._max){let l=n=>i*n+s;for(let n=this._styles._max+1;n<=t;n++)g.addCSSRule(this._styles,`${r}[gs-y="${n}"]`,`top: ${l(n)}`),g.addCSSRule(this._styles,`${r}[gs-h="${n+1}"]`,`height: ${l(n+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,s=this.opts.cellHeightUnit;if(!i)return this;if(!e){const r=g.parseHeight(getComputedStyle(this.el).minHeight);if(r.h>0&&r.unit===s){const l=Math.floor(r.h/i);t<l&&(t=l)}}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+s),e&&!e.grid.engine.batchMode&&g.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 s={...i};return i=this.engine.addNode(i,t),g.same(i,s)||this._writeAttr(e,i),g.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 s in i)t[s]?e.setAttribute(i[s],String(t[s])):e.removeAttribute(i[s]);return this}_readAttr(e,t=!0){let i={};i.x=g.toNumber(e.getAttribute("gs-x")),i.y=g.toNumber(e.getAttribute("gs-y")),i.w=g.toNumber(e.getAttribute("gs-w")),i.h=g.toNumber(e.getAttribute("gs-h")),i.autoPosition=g.toBool(e.getAttribute("gs-auto-position")),i.noResize=g.toBool(e.getAttribute("gs-no-resize")),i.noMove=g.toBool(e.getAttribute("gs-no-move")),i.locked=g.toBool(e.getAttribute("gs-locked")),i.id=e.getAttribute("gs-id"),i.maxW=g.toNumber(e.getAttribute("gs-max-w")),i.minW=g.toNumber(e.getAttribute("gs-min-w")),i.maxH=g.toNumber(e.getAttribute("gs-max-h")),i.minH=g.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 s in i){if(!i.hasOwnProperty(s))return;!i[s]&&i[s]!==0&&delete i[s]}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(){var t;if(!((t=this.el)!=null&&t.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 i=!this.opts.disableOneColumnMode&&this.el.clientWidth<=this.opts.oneColumnSize||this.opts.column===1&&!this._prevColumn;this.opts.column===1!==i&&(this.column(i?1:this._prevColumn),e=!0)}return this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(i=>{i.subGrid&&i.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)g.shouldSizeToContent(i)&&this.resizeToContentCheck(i.el,t);else if(this.engine.nodes.some(s=>g.shouldSizeToContent(s))){const s=[...this.engine.nodes];this.batchUpdate(),s.forEach(r=>{g.shouldSizeToContent(r)&&this.resizeToContentCheck(r.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=g.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 g.getElement(e)}static getElements(e=".grid-stack-item"){return g.getElements(e)}static getGridElement(e){return R.getElement(e)}static getGridElements(e){return g.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=g.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=g.parseHeight(this.opts.marginTop),this.opts.marginTop=e.h,delete this.opts.margin),this.opts.marginBottom===void 0?this.opts.marginBottom=t:(e=g.parseHeight(this.opts.marginBottom),this.opts.marginBottom=e.h,delete this.opts.margin),this.opts.marginRight===void 0?this.opts.marginRight=t:(e=g.parseHeight(this.opts.marginRight),this.opts.marginRight=e.h,delete this.opts.margin),this.opts.marginLeft===void 0?this.opts.marginLeft=t:(e=g.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==null?void 0:t.pause)!==void 0&&(E.pauseDrag=t.pause),t={...Cr,...t||{}};let s=typeof e=="string"?g.getElements(e,i):e;s.length&&(s==null||s.forEach(r=>{j.isDraggable(r)||j.dragIn(r,t)}))}movable(e,t){return this.opts.staticGrid?this:(R.getElements(e).forEach(i=>{let s=i.gridstackNode;s&&(t?delete s.noMove:s.noMove=!0,this._prepareDragDropByNode(s))}),this)}resizable(e,t){return this.opts.staticGrid?this:(R.getElements(e).forEach(i=>{let s=i.gridstackNode;s&&(t?delete s.noResize:s.noResize=!0,this._prepareDragDropByNode(s))}),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=(s,r,l)=>{let n=r.gridstackNode;if(!n)return;l=l||r;let d=this.el.getBoundingClientRect(),{top:h,left:c}=l.getBoundingClientRect();c-=d.left,h-=d.top;let f={position:{top:h,left:c}};if(n._temporaryRemoved){if(n.x=Math.max(0,Math.round(c/t)),n.y=Math.max(0,Math.round(h/e)),delete n.autoPosition,this.engine.nodeBoundFix(n),!this.engine.willItFit(n)){if(n.autoPosition=!0,!this.engine.willItFit(n)){j.off(r,"drag");return}n._willFitPos&&(g.copyPos(n,n._willFitPos),delete n._willFitPos)}this._onStartMoving(l,s,f,n,t,e)}else this._dragOrResize(l,s,f,n,t,e)};return j.droppable(this.el,{accept:s=>{let r=s.gridstackNode;if((r==null?void 0:r.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let l=!0;if(typeof this.opts.acceptWidgets=="function")l=this.opts.acceptWidgets(s);else{let n=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;l=s.matches(n)}if(l&&r&&this.opts.maxRow){let n={w:r.w,h:r.h,minW:r.minW,minH:r.minH};l=this.engine.willItFit(n)}return l}}).on(this.el,"dropover",(s,r,l)=>{let n=r.gridstackNode;if((n==null?void 0:n.grid)===this&&!n._temporaryRemoved)return!1;n!=null&&n.grid&&n.grid!==this&&!n._temporaryRemoved&&n.grid._leave(r,l),t=this.cellWidth(),e=this.getCellHeight(!0),n||(n=this._readAttr(r,!1)),n.grid||(n._isExternal=!0,r.gridstackNode=n),l=l||r;let d=n.w||Math.round(l.offsetWidth/t)||1,h=n.h||Math.round(l.offsetHeight/e)||1;return n.grid&&n.grid!==this?(r._gridstackNodeOrig||(r._gridstackNodeOrig=n),r.gridstackNode=n={...n,w:d,h,grid:this},delete n.x,delete n.y,this.engine.cleanupNode(n).nodeBoundFix(n),n._initDD=n._isExternal=n._temporaryRemoved=!0):(n.w=d,n.h=h,n._temporaryRemoved=!0),this._itemRemoving(n.el,!1),j.on(r,"drag",i),i(s,r,l),!1}).on(this.el,"dropout",(s,r,l)=>{let n=r.gridstackNode;return n&&(!n.grid||n.grid===this)&&(this._leave(r,l),this._isTemp&&this.removeAsSubGrid(n)),!1}).on(this.el,"drop",(s,r,l)=>{var f,u;let n=r.gridstackNode;if((n==null?void 0:n.grid)===this&&!n._isExternal)return!1;let d=!!this.placeholder.parentElement;this.placeholder.remove();let h=r._gridstackNodeOrig;if(delete r._gridstackNodeOrig,d&&(h!=null&&h.grid)&&h.grid!==this){let _=h.grid;_.engine.removeNodeFromLayoutCache(h),_.engine.removedNodes.push(h),_._triggerRemoveEvent()._triggerChangeEvent(),_.parentGridItem&&!_.engine.nodes.length&&_.opts.subGridDynamic&&_.removeAsSubGrid()}if(!n||(d&&(this.engine.cleanupNode(n),n.grid=this),delete n.grid._isTemp,j.off(r,"drag"),l!==r?(l.remove(),r.gridstackNode=h,d&&(r=r.cloneNode(!0))):(r.remove(),this._removeDD(r)),!d))return!1;r.gridstackNode=n,n.el=r;let c=(u=(f=n.subGrid)==null?void 0:f.el)==null?void 0:u.gridstack;return g.copyPos(n,this._readAttr(this.placeholder)),g.removePositioningStyles(r),this._writeAttr(r,n),r.classList.add(ie.itemClass,this.opts.itemClass),this.el.appendChild(r),c&&(c.parentGridItem=n,c.opts.styleInHead||c._updateStyles(!0)),this._prepareDragDropByNode(n),this._updateContainerHeight(),this.engine.addedNodes.push(n),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...s,type:"dropped"},h&&h.grid?h:void 0,n),!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,s=e.noResize||this.opts.disableResize;if(this.opts.staticGrid||i&&s)return e._initDD&&(this._removeDD(t),delete e._initDD),t.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!e._initDD){let r,l,n=(c,f)=>{this._gsEventHandler[c.type]&&this._gsEventHandler[c.type](c,c.target),r=this.cellWidth(),l=this.getCellHeight(!0),this._onStartMoving(t,c,f,e,r,l)},d=(c,f)=>{this._dragOrResize(t,c,f,e,r,l)},h=c=>{this.placeholder.remove(),delete e._moving,delete e._event,delete e._lastTried;let f=c.target;if(!(!f.gridstackNode||f.gridstackNode.grid!==this)){if(e.el=f,e._isAboutToRemove){let u=t.gridstackNode.grid;u._gsEventHandler[c.type]&&u._gsEventHandler[c.type](c,f),u.engine.nodes.push(e),u.removeWidget(t,!0,!0)}else g.removePositioningStyles(f),e._temporaryRemoved?(g.copyPos(e,e._orig),this._writePosAttr(f,e),this.engine.addNode(e)):this._writePosAttr(f,e),this._gsEventHandler[c.type]&&this._gsEventHandler[c.type](c,f);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),c.type==="resizestop"&&(Number.isInteger(e.sizeToContent)&&(e.sizeToContent=e.h),this.doContentResize(!1,!0,e))}};j.draggable(t,{start:n,stop:h,drag:d}).resizable(t,{start:n,stop:h,resize:d}),e._initDD=!0}return j.draggable(t,i?"disable":"enable").resizable(t,s?"disable":"enable"),this}_onStartMoving(e,t,i,s,r,l){this.engine.cleanNodes().beginUpdate(s),this._writePosAttr(this.placeholder,s),this.el.appendChild(this.placeholder),s.el=this.placeholder,s._lastUiPosition=i.position,s._prevYPix=i.position.top,s._moving=t.type==="dragstart",delete s._lastTried,t.type==="dropover"&&s._temporaryRemoved&&(this.engine.addNode(s),s._moving=!0),this.engine.cacheRects(r,l,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),t.type==="resizestart"&&(j.resizable(e,"option","minWidth",r*(s.minW||1)).resizable(e,"option","minHeight",l*(s.minH||1)),s.maxW&&j.resizable(e,"option","maxWidth",r*s.maxW),s.maxH&&j.resizable(e,"option","maxHeight",l*s.maxH))}_dragOrResize(e,t,i,s,r,l){let n={...s._orig},d,h=this.opts.marginLeft,c=this.opts.marginRight,f=this.opts.marginTop,u=this.opts.marginBottom,_=Math.round(l*.1),b=Math.round(r*.1);if(h=Math.min(h,b),c=Math.min(c,b),f=Math.min(f,_),u=Math.min(u,_),t.type==="drag"){if(s._temporaryRemoved)return;let H=i.position.top-s._prevYPix;s._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&g.updateScrollPosition(e,i.position,H);let A=i.position.left+(i.position.left>s._lastUiPosition.left?-c:h),N=i.position.top+(i.position.top>s._lastUiPosition.top?-u:f);n.x=Math.round(A/r),n.y=Math.round(N/l);let D=this._extraDragRow;if(this.engine.collide(s,n)){let T=this.getRow(),B=Math.max(0,n.y+s.h-T);this.opts.maxRow&&T+B>this.opts.maxRow&&(B=Math.max(0,this.opts.maxRow-T)),this._extraDragRow=B}else this._extraDragRow=0;if(this._extraDragRow!==D&&this._updateContainerHeight(),s.x===n.x&&s.y===n.y)return}else if(t.type==="resize"){if(n.x<0||(g.updateScrollResize(t,e,l),n.w=Math.round((i.size.width-h)/r),n.h=Math.round((i.size.height-f)/l),s.w===n.w&&s.h===n.h)||s._lastTried&&s._lastTried.w===n.w&&s._lastTried.h===n.h)return;let H=i.position.left+h,A=i.position.top+f;n.x=Math.round(H/r),n.y=Math.round(A/l),d=!0}s._event=t,s._lastTried=n;let L={x:i.position.left+h,y:i.position.top+f,w:(i.size?i.size.width:s.w*r)-h-c,h:(i.size?i.size.height:s.h*l)-f-u};if(this.engine.moveNodeCheck(s,{...n,cellWidth:r,cellHeight:l,rect:L,resizing:d})){s._lastUiPosition=i.position,this.engine.cacheRects(r,l,f,c,u,h),delete s._skipDown,d&&s.subGrid&&s.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let H=t.target;this._writePosAttr(H,s),this._gsEventHandler[t.type]&&this._gsEventHandler[t.type](t,H)}}_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 Rr(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}R.resizeToContentParent=".grid-stack-item-content",R.Utils=g,R.Engine=le,R.GDRev="9.5.1";const Nr={class:"tw-flex tw-flex-row tw-flex-wrap tw-gap-2"},Lr={class:"color-primary"},zr={class:"color-secondary"},Mr={key:1,class:"empty"},Ir={key:0,class:"clear-filter-div"},Hr=_e(a.defineComponent({__name:"Filter",props:{order:{}},setup(o){const e=o,t=De(),i=a.computed(()=>({...t.Filters})),s=a.computed(()=>({...t.displayFilters})),r=a.computed(()=>{const c=i.value;return Object.keys(c).map(f=>({key:f,value:c[f]})).filter(({value:f})=>!(f==null||typeof f=="string"&&f.trim()===""||Array.isArray(f)&&f.length===0))}),l=a.computed(()=>{var f;const c=r.value.filter(u=>s.value.hasOwnProperty(u.key)&&s.value[u.key]);if((f=e.order)!=null&&f.length){const u=new Map(e.order.map((_,b)=>[_,b]));c.sort((_,b)=>{const L=u.has(_.key)?u.get(_.key):Number.MAX_SAFE_INTEGER,H=u.has(b.key)?u.get(b.key):Number.MAX_SAFE_INTEGER;return L-H||_.key.localeCompare(b.key)})}else c.sort((u,_)=>u.key.localeCompare(_.key));return c});function n(c){return Array.isArray(c)?a.toRaw(c).map(u=>u&&typeof u=="object"?u.name??JSON.stringify(u).replace(/[{}"]/g,""):String(u??"")).join(", "):c&&typeof c=="object"?JSON.stringify(c).replace(/[{}"]/g,""):String(c??"")}function d(c){const f=t;typeof f.clearFilter=="function"?f.clearFilter(c):typeof f.clearAllFilters=="function"?f.clearAllFilters(c):t.setFilter(c,void 0)}function h(){t.resetFilters({})}return(c,f)=>{const u=a.resolveComponent("el-icon"),_=a.resolveComponent("el-row");return a.openBlock(),a.createBlock(_,{class:"filter-wrapper tw-m-1",align:"middle",justify:"space-between"},{default:a.withCtx(()=>[a.createElementVNode("div",Nr,[l.value.length?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:0},a.renderList(l.value,b=>(a.openBlock(),a.createBlock(a.unref(yt.ElTag),{class:"color-background",key:b.key,closable:"",onClose:L=>d(b.key),effect:"dark",type:"info"},{default:a.withCtx(()=>[a.createElementVNode("b",Lr,a.toDisplayString(b.key)+": ",1),a.createElementVNode("span",zr,a.toDisplayString(n(b.value)),1)]),_:2},1032,["onClose"]))),128)):(a.openBlock(),a.createElementBlock("span",Mr))]),l.value.length?(a.openBlock(),a.createElementBlock("div",Ir,[a.createVNode(a.unref(yt.ElTooltip),{placement:"top-start",content:"Clear All Filters"},{default:a.withCtx(()=>[a.createVNode(u,{color:"#FFFF",onClick:h},{default:a.withCtx(()=>[a.createVNode(a.unref(rs))]),_:1})]),_:1})])):a.createCommentVNode("",!0)]),_:1})}}}),[["__scopeId","data-v-55b985b8"]]),Or={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"},Pr={class:"editing-div"},Br={class:"tw-m-4 tw-leading-none tw-pl-1 widget-name"},$r={class:"header-slot-icon"},Ur={key:1,class:"dash-header-hide content-header"},Fr={class:"header-slot-icon"},Wr=_e({__name:"DashHeader",props:{widgetName:{type:String,required:!0},widgetID:{type:String,required:!0},hideHeader:Boolean},setup(o){const e=De(),t=o,i=a.ref(null);a.watch(()=>t.widgetName,d=>{i.value=d},{immediate:!0});const s=a.ref(!1),r=a.ref(null);function l(){s.value=!0,r.value&&r.value.focus()}function n(){if(!s.value)return;s.value=!1;const d=e.getDashItem(t.widgetID);d.componentName=i}return(d,h)=>{const c=a.resolveComponent("el-input"),f=a.resolveDirective("click-out");return o.hideHeader?(a.openBlock(),a.createElementBlock("div",Ur,[a.createElementVNode("div",Fr,[a.renderSlot(d.$slots,"default",{},void 0,!0)])])):(a.openBlock(),a.createElementBlock("div",Or,[a.createElementVNode("div",null,[a.withDirectives((a.openBlock(),a.createElementBlock("div",{onKeyup:a.withKeys(n,["enter"]),class:"tw-flex"},[a.withDirectives(a.createElementVNode("div",Pr,[a.createVNode(c,{onFocus:h[0]||(h[0]=u=>u.target.select()),ref_key:"textUserInput",ref:r,modelValue:i.value,"onUpdate:modelValue":h[1]||(h[1]=u=>i.value=u)},null,8,["modelValue"])],512),[[a.vShow,s.value]]),a.withDirectives(a.createElementVNode("div",{onClick:h[2]||(h[2]=u=>l()),class:"visible-div"},[a.createElementVNode("div",Br,a.toDisplayString(i.value),1)],512),[[a.vShow,!s.value]])],32)),[[f,n]])]),a.createElementVNode("div",$r,[a.renderSlot(d.$slots,"default",{},void 0,!0)])]))}}},[["__scopeId","data-v-4f4aa869"]]),Gr={class:"tw-flex"},Vr=_e({__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(o,{emit:e}){const t=e,i=o;let s=a.ref(null);const r=a.ref(!1);a.watch(()=>i.isLocked,d=>{r.value=d},{immediate:!0});const l=a.ref(null);a.watch(()=>i.hideWidgetsHeader,d=>{l.value=d},{immediate:!0});function n(){t("toggle-lock",{id:i.widgetID,isLocked:r.value})}return(d,h)=>{const c=a.resolveComponent("el-icon");return a.openBlock(),a.createElementBlock("div",{ref_key:"instance",ref:s,class:a.normalizeClass(["grid-stack-item-content",{"locked-widget":o.isLocked}])},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.componentTag),a.mergeProps({class:["widget-body",{"widget-body-no-head":l.value}],widgetID:o.widgetID,hideHeader:l.value},i.componentProperties,{style:{pointerEvents:r.value?"none":"auto"},isLocked:r.value}),{default:a.withCtx(f=>[f?(a.openBlock(),a.createBlock(Wr,{key:0,widgetName:i.componentName,widgetID:o.widgetID,staticMode:o.staticMode,hideHeader:l.value},{default:a.withCtx(()=>[a.createElementVNode("div",Gr,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(f.childIcons,u=>(a.openBlock(),a.createBlock(a.unref(yt.ElTooltip),{placement:"bottom-start"},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(u.tooltip),1)]),default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(u.comp),{class:"tw-w-4 header-icon",onClick:u.event},null,8,["onClick"]))]),_:2},1024))),256)),a.createVNode(c,{class:"header-icon lock-toggle",onClick:h[0]||(h[0]=u=>n())},{default:a.withCtx(()=>[r.value?(a.openBlock(),a.createBlock(a.unref(hs),{key:0})):(a.openBlock(),a.createBlock(a.unref(ds),{key:1}))]),_:1}),!o.staticMode&&!o.isLocked?(a.openBlock(),a.createBlock(c,{key:0,class:"item-widget-button",onClick:h[1]||(h[1]=u=>d.$emit("removeWidget"))},{default:a.withCtx(()=>[a.createVNode(a.unref(os))]),_:1})):a.createCommentVNode("",!0)])]),_:2},1032,["widgetName","widgetID","staticMode","hideHeader"])):a.createCommentVNode("",!0)]),_:1},16,["class","widgetID","hideHeader","style","isLocked"]))],2)}}},[["__scopeId","data-v-a2daf4ac"]]),qr={class:"dashboard-app"},jr={key:0,class:"dash-header tw-max-h-screen tw-flex tw-flex-col"},Yr={class:"tw-float-left tw-m-1 button"},Xr={key:1,class:"tw-h-10 dash-header"},Zr={class:"tw-float-left tw-m-1"},Kr={class:"tw-m-4 tw-w-50 tw-flex-row tw-flex"},Qr={class:"tw-m-w-4 tw-w-40"},Jr=["gs-x","gs-y","gs-w","gs-h","gs-id","id","props","gs-locked","gs-no-move","gs-no-resize"],en=_e(a.defineComponent({__name:"Dashboard",props:{hideHeader:{},options:{}},setup(o){const e=o,t=De(),{DASHBOARD_ITEMS:i}=ce.storeToRefs(t),s={apiUrl:a.computed(()=>{var y;return(y=t.Services)==null?void 0:y.ApiUrl}),s3Url:a.computed(()=>{var y;return(y=t.Services)==null?void 0:y.s3Url}),services:a.computed(()=>t.Services),filters:t.Filters,setFilter:t.setFilter,clearFilter:t.clearFilter,resetFilters:t.resetFilters};a.provide("dashboard:globalVars",s);let r=a.ref("Edit Grid"),l=null;const n=a.ref(null);let d=a.ref(!0),h=0;const c=a.ref([]),{ComponentRegistry:f}=ce.storeToRefs(t),u=a.reactive({});a.onBeforeMount(()=>{var y;_(),t.loadFromLocalStorage(),h=((y=i.value)==null?void 0:y.length)+1}),a.onMounted(()=>{L(),A()}),a.onBeforeUnmount(()=>{H(),t.unregisterGridProvider()});function _(){var y,w;t.DefaultLayout=(y=e.options)==null?void 0:y.defaultLayout,t.setOptionServices((w=e.options)==null?void 0:w.services)}async function b(){if(t.resetGridLayout(),await a.nextTick(),!!l){l.batchUpdate(),l.removeAll();for(const y of i.value){const w=document.getElementById(y.id);if(!w){console.warn("makeWidget: element not found for id",y.id);continue}w.classList.add("grid-stack-item"),y.w!=null&&w.setAttribute("gs-w",String(y.w)),y.h!=null&&w.setAttribute("gs-h",String(y.h)),y.x!=null&&w.setAttribute("gs-x",String(y.x)),y.y!=null&&w.setAttribute("gs-y",String(y.y)),y.x==null&&y.y==null&&y.autoPosition&&w.setAttribute("gs-auto-position","true"),!w.gridstackNode&&l.makeWidget(w)}l.commit()}}function L(){const y={float:!0,column:12,cellHeight:"70px",minRow:12,margin:5,alwaysShowResizeHandle:!0,resizable:{handles:"e,se,s,sw,w,n"}};l=R.init(y),t.registerGridProvider(()=>l),l.setStatic(d.value)}function H(){l&&(l.destroy(!1),l=null)}a.watch(()=>{var y;return(y=e.options)==null?void 0:y.availableWidgets},y=>{f.value={},c.value=[],y&&y.forEach((w,C)=>{let v,F;if(w&&typeof w=="object"&&"name"in w&&"component"in w)v=w.name,F=w.component;else if(w&&typeof w=="object"&&"name"in w&&"loader"in w)v=w.name,F=a.defineAsyncComponent(async()=>{const O=await w.loader();return O.default??O});else if(w&&(typeof w=="function"||typeof w=="object"))F=w,v=w.name||`Widget${C+1}`;else if(typeof w=="function")return;!v||!F||f.value[v]||(f.value[v]=F,c.value.push(v))})},{immediate:!0,deep:!0});function A(){const y=e.options.globalData;if(y){t.clearOptionsDataItems();for(const w in y)t.addOptionsDataItems(w,y[w])}}a.watch(()=>d.value,y=>{l.setStatic(y),r.value=y?"Edit Grid":"Save Grid"});function N(y){if(!y)return;const w=`${y}-${h}`,C={id:w,w:2,h:6,autoPosition:!0,component:f.value[y],componentKey:y,componentName:y,Props:{}};h++,i.value.push(C),a.nextTick(()=>{l==null||l.makeWidget(`#${w}`)})}function D(y){var w=i.value.findIndex(v=>v.id==y);i.value.splice(w,1);const C=`#${y}`;l.removeWidget(C,!1)}function T({id:y,isLocked:w}){const C=u[y];C&&l&&l.update(C,{locked:!w,noMove:!w,noResize:!w}),t.toggleWidgetLock(y)}function B(){d.value=!d.value,d.value}return(y,w)=>{const C=a.resolveComponent("el-button"),v=a.resolveComponent("el-option"),F=a.resolveComponent("el-select"),O=a.resolveComponent("el-col");return a.openBlock(),a.createElementBlock("div",qr,[y.hideHeader?(a.openBlock(),a.createElementBlock("div",Xr,[w[3]||(w[3]=a.createTextVNode("x ",-1)),a.createElementVNode("span",Zr,[a.createVNode(C,{class:"edit-button",onClick:w[1]||(w[1]=z=>B())},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(r)),1)]),_:1})])])):(a.openBlock(),a.createElementBlock("div",jr,[a.createElementVNode("span",Yr,[a.createVNode(C,{class:"edit-button",onClick:w[0]||(w[0]=z=>B())},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(a.unref(r)),1)]),_:1})]),a.createVNode(Hr)])),a.unref(d)?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(O,{key:2},{default:a.withCtx(()=>[a.createElementVNode("div",Kr,[a.createVNode(F,{placeholder:"Add New Widget"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.value,z=>(a.openBlock(),a.createBlock(v,{key:z,label:z,value:z,onClick:be=>N(z)},null,8,["label","value","onClick"]))),128))]),_:1}),a.createElementVNode("div",Qr,[a.createVNode(C,{onClick:w[2]||(w[2]=z=>b())},{default:a.withCtx(()=>[...w[4]||(w[4]=[a.createTextVNode("Reset Grid Layout",-1)])]),_:1})])])]),_:1})),a.createElementVNode("div",{ref_key:"root",ref:n,class:"grid-stack tw-h-screen"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(i),z=>{var be,ke,at,ht;return a.openBlock(),a.createElementBlock("div",{class:"grid-stack-item",ref_for:!0,ref:ct=>u[z.id]=ct,"gs-x":z.x,"gs-y":z.y,"gs-w":z.w,"gs-h":z.h,"gs-id":z.id,id:z.id,key:z.id,props:z.Props,"gs-locked":(be=z.Props)==null?void 0:be.locked,"gs-no-move":(ke=z.Props)==null?void 0:ke.locked,"gs-no-resize":(at=z.Props)==null?void 0:at.locked},[a.createVNode(Vr,{widgetID:z.id,onRemoveWidget:ct=>D(z.id),onToggleLock:T,"static-mode":a.unref(d),componentTag:z.component,componentProperties:z.Props,componentName:z.componentName,hideWidgetsHeader:z.hideHeader,"is-locked":(ht=z.Props)==null?void 0:ht.locked},null,8,["widgetID","onRemoveWidget","static-mode","componentTag","componentProperties","componentName","hideWidgetsHeader","is-locked"])],8,Jr)}),128))],512)])}}}),[["__scopeId","data-v-4ac6b9b5"]]);q.MarkdownWidget=Tr,q.PennsieveDashboard=en,q.TextWidget=ys,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})}));
|
|
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")||R.addRemoveCB)if(R.addRemoveCB)i=R.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 R.init(t,i)}static registerEngine(e){R.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,ie.itemClass,this.opts.itemClass),this.placeholder.appendChild(e)}return this._placeholder}constructor(e,t={}){var d,h;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=g.toNumber(e.getAttribute("gs-row"));t.column==="auto"&&delete t.column,t.alwaysShowResizeHandle!==void 0&&(t._alwaysShowResizeHandle=t.alwaysShowResizeHandle);let s={...g.cloneDeep(ie),column:g.toNumber(e.getAttribute("gs-column"))||ie.column,minRow:i||g.toNumber(e.getAttribute("gs-min-row"))||ie.minRow,maxRow:i||g.toNumber(e.getAttribute("gs-max-row"))||ie.maxRow,staticGrid:g.toBool(e.getAttribute("gs-static"))||ie.staticGrid,draggable:{handle:(t.handleClass?"."+t.handleClass:t.handle?t.handle:"")||ie.draggable.handle},removableOptions:{accept:t.itemClass||ie.removableOptions.accept,decline:ie.removableOptions.decline}};e.getAttribute("gs-animate")&&(s.animate=g.toBool(e.getAttribute("gs-animate"))),this.opts=g.defaults(t,s),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 r=(d=this.el.parentElement)==null?void 0:d.parentElement;let a=r!=null&&r.classList.contains(ie.itemClass)?r.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!==ie.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=ne),this._styleSheetClass="gs-id-"+le._idSeq++,this.el.classList.add(this._styleSheetClass),this._setStaticClass();let n=this.opts.engineClass||R.engineClass||le;if(this.engine=new n({column:this.getColumn(),float:this.opts.float,maxRow:this.opts.maxRow,onChange:c=>{let f=0;this.engine.nodes.forEach(u=>{f=Math.max(f,u.y+u.h)}),c.forEach(u=>{let _=u.el;_&&(u._removeDOM?(_&&_.remove(),delete u._removeDOM):this._writePosAttr(_,u))}),this._updateStyles(!1,f)}}),this.opts.auto&&(this.batchUpdate(),this.getGridItems().forEach(c=>this._prepareElement(c)),this.batchUpdate(!1)),this.opts.children){let c=this.opts.children;delete this.opts.children,c.length&&this.load(c)}this.setAnimation(this.opts.animate),this._updateStyles(),this.el.classList.add("gs-"+this.opts.column),this.opts.subGridDynamic&&!E.pauseDrag&&(E.pauseDrag=!0),((h=this.opts.draggable)==null?void 0:h.pause)!==void 0&&(E.pauseDrag=this.opts.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}addWidget(e,t){function i(n){return n.el!==void 0||n.x!==void 0||n.y!==void 0||n.w!==void 0||n.h!==void 0||n.content!==void 0}let s,r;if(typeof e=="string"){let n=document.implementation.createHTMLDocument("");n.body.innerHTML=e,s=n.body.children[0]}else if(arguments.length===0||arguments.length===1&&i(e))if(r=t=e,r!=null&&r.el)s=r.el;else if(R.addRemoveCB)s=R.addRemoveCB(this.el,t,!0,!1);else{let n=(t==null?void 0:t.content)||"",d=document.implementation.createHTMLDocument("");d.body.innerHTML=`<div class="grid-stack-item ${this.opts.itemClass||""}"><div class="grid-stack-item-content">${n}</div></div>`,s=d.body.children[0]}else s=e;if(!s)return;if(r=s.gridstackNode,r&&s.parentElement===this.el&&this.engine.nodes.find(n=>n._id===r._id))return s;let a=this._readAttr(s);return t=g.cloneDeep(t)||{},g.defaults(t,a),r=this.engine.prepareNode(t),this._writeAttr(s,t),this._insertNotAppend?this.el.prepend(s):this.el.appendChild(s),this.makeWidget(s,t),s}makeSubGrid(e,t,i,s=!0){var _,b,L;let r=e.gridstackNode;if(r||(r=this.makeWidget(e).gridstackNode),(_=r.subGrid)!=null&&_.el)return r.subGrid;let a,n=this;for(;n&&!a;)a=(b=n.opts)==null?void 0:b.subGridOpts,n=(L=n.parentGridItem)==null?void 0:L.grid;t=g.cloneDeep({...a||{},children:void 0,...t||r.subGridOpts}),r.subGridOpts=t;let d;t.column==="auto"&&(d=!0,t.column=Math.max(r.w||1,(i==null?void 0:i.w)||1),t.disableOneColumnMode=!0);let h=r.el.querySelector(".grid-stack-item-content"),c,f;if(s){if(this._removeDD(r.el),f={...r,x:0,y:0},g.removeInternalForSave(f),delete f.subGridOpts,r.content&&(f.content=r.content,delete r.content),R.addRemoveCB)c=R.addRemoveCB(this.el,f,!0,!1);else{let H=document.implementation.createHTMLDocument("");H.body.innerHTML='<div class="grid-stack-item"></div>',c=H.body.children[0],c.appendChild(h),H.body.innerHTML='<div class="grid-stack-item-content"></div>',h=H.body.children[0],r.el.appendChild(h)}this._prepareDragDropByNode(r)}if(i){let H=d?t.column:r.w,A=r.h+i.h,N=r.el.style;N.transition="none",this.update(r.el,{w:H,h:A}),setTimeout(()=>N.transition=null)}let u=r.subGrid=R.addGrid(h,t);return i!=null&&i._moving&&(u._isTemp=!0),d&&(u._autoColumn=!0),s&&u.addWidget(c,f),i&&(i._moving?window.setTimeout(()=>g.simulateMouseEvent(i._event,"mouseenter",u.el),0):u.addWidget(r.el,r)),u}removeAsSubGrid(e){var i;let t=(i=this.parentGridItem)==null?void 0:i.grid;t&&(t.batchUpdate(),t.removeWidget(this.parentGridItem.el,!0,!0),this.engine.nodes.forEach(s=>{s.x+=this.parentGridItem.x,s.y+=this.parentGridItem.y,t.addWidget(s.el,s)}),t.batchUpdate(!1),this.parentGridItem&&delete this.parentGridItem.subGrid,delete this.parentGridItem,e&&window.setTimeout(()=>g.simulateMouseEvent(e._event,"mouseenter",t.el),0))}save(e=!0,t=!1,i=R.saveCB){let s=this.engine.save(e,i);if(s.forEach(r=>{var a;if(e&&r.el&&!r.subGrid&&!i){let n=r.el.querySelector(".grid-stack-item-content");r.content=n?n.innerHTML:void 0,r.content||delete r.content}else if(!e&&!i&&delete r.content,(a=r.subGrid)!=null&&a.el){const n=r.subGrid.save(e,t,i);r.subGridOpts=t?n:{children:n},delete r.subGrid}delete r.el}),t){let r=g.cloneDeep(this.opts);r.marginBottom===r.marginTop&&r.marginRight===r.marginLeft&&r.marginTop===r.marginRight&&(r.margin=r.marginTop,delete r.marginTop,delete r.marginRight,delete r.marginBottom,delete r.marginLeft),r.rtl===(this.el.style.direction==="rtl")&&(r.rtl="auto"),this._isAutoCellHeight&&(r.cellHeight="auto"),this._autoColumn&&(r.column="auto",delete r.disableOneColumnMode);const a=r._alwaysShowResizeHandle;return delete r._alwaysShowResizeHandle,a!==void 0?r.alwaysShowResizeHandle=a:delete r.alwaysShowResizeHandle,g.removeInternalAndSame(r,ie),r.children=s,r}return s}load(e,t=R.addRemoveCB||!0){e=g.cloneDeep(e);const i=e.some(h=>h.x!==void 0||h.y!==void 0);i&&(e=g.sort(e,-1,this._prevColumn||this.getColumn())),this._insertNotAppend=i;const s=this.opts.column;this._prevColumn&&this._prevColumn!==s&&e.some(h=>(h.x||0)+h.w>s)&&(this._ignoreLayoutsNodeChange=!0,this.engine.cacheLayout(e,this._prevColumn,!0));const r=R.addRemoveCB;typeof t=="function"&&(R.addRemoveCB=t);let a=[];this.batchUpdate(),t&&[...this.engine.nodes].forEach(c=>{if(!c.id)return;g.find(e,c.id)||(R.addRemoveCB&&R.addRemoveCB(this.el,c,!1,!1),a.push(c),this.removeWidget(c.el,!0,!1))});let n=[];this.engine.nodes=this.engine.nodes.filter(h=>g.find(e,h.id)?(n.push(h),!1):!0);let d=!1;return e.forEach(h=>{var f;let c=g.find(n,h.id);if(c){if(g.shouldSizeToContent(c)&&(h.h=c.h),this.engine.nodeBoundFix(h),(h.autoPosition||h.x===void 0||h.y===void 0)&&(h.w=h.w||c.w,h.h=h.h||c.h,this.engine.findEmptyPosition(h)),d=d||h.w!==void 0&&h.w!==c.w,this.engine.nodes.push(c),g.samePos(c,h)&&this.moveNode(c,{...h,forceCollide:!0}),this.update(c.el,h),(f=h.subGridOpts)!=null&&f.children){let u=c.el.querySelector(".grid-stack");u&&u.gridstack&&(u.gridstack.load(h.subGridOpts.children),this._insertNotAppend=!0)}}else t&&this.addWidget(h)}),this.engine.removedNodes=a,this.doContentResize(d,!0),this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this._insertNotAppend,r?R.addRemoveCB=r:delete R.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 s=g.toNumber(t.getAttribute("gs-h"))||1;return Math.round(t.offsetHeight/s)}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 s=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+s}let i=g.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 s;return e===1&&this.opts.oneColumnModeDomSort&&(s=[],this.getGridItems().forEach(r=>{r.gridstackNode&&s.push(r.gridstackNode)}),s.length||(s=void 0)),this.engine.columnChanged(i,e,s,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(),s;t?s={top:i.top+document.documentElement.scrollTop,left:i.left}:s={top:this.el.offsetTop,left:this.el.offsetLeft};let r=e.left-s.left,a=e.top-s.top,n=i.width/this.getColumn(),d=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(r/n),y:Math.floor(a/d)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow)}isAreaEmpty(e,t,i,s){return this.engine.isAreaEmpty(e,t,i,s)}makeWidget(e,t){let i=R.getElement(e);this._prepareElement(i,!0,t);const s=i.gridstackNode;return this._updateContainerHeight(),this.doContentResize(!1,!1,s),s.subGridOpts&&this.makeSubGrid(i,s.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(s=>this.on(s,t)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=s=>t(s):this._gsEventHandler[e]=s=>t(s,s.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 R.getElements(e).forEach(s=>{if(s.parentElement&&s.parentElement!==this.el)return;let r=s.gridstackNode;r||(r=this.engine.nodes.find(a=>s===a.el)),r&&(R.addRemoveCB&&R.addRemoveCB(this.el,r,!1,!1),delete s.gridstackNode,this._removeDD(s),this.engine.removeNode(r,t,i),t&&s.parentElement&&s.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(s=>{this._prepareDragDropByNode(s),s.subGrid&&i&&s.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,s=1;return t={x:i[s++],y:i[s++],w:i[s++],h:i[s++]},this.update(e,t)}return R.getElements(e).forEach(i=>{var c;let s=i==null?void 0:i.gridstackNode;if(!s)return;let r=g.cloneDeep(t);this.engine.nodeBoundFix(r),delete r.autoPosition,delete r.id;let a=["x","y","w","h"],n;if(a.some(f=>r[f]!==void 0&&r[f]!==s[f])&&(n={},a.forEach(f=>{n[f]=r[f]!==void 0?r[f]:s[f],delete r[f]})),!n&&(r.minW||r.minH||r.maxW||r.maxH)&&(n={}),r.content!==void 0){const f=i.querySelector(".grid-stack-item-content");f&&f.innerHTML!==r.content&&(f.innerHTML=r.content,(c=s.subGrid)!=null&&c.el&&(f.appendChild(s.subGrid.el),s.subGrid.opts.styleInHead||s.subGrid._updateStyles(!0))),delete r.content}let d=!1,h=!1;for(const f in r)f[0]!=="_"&&s[f]!==r[f]&&(s[f]=r[f],d=!0,h=h||!this.opts.staticGrid&&(f==="noResize"||f==="noMove"||f==="locked"));g.sanitizeMinMax(s),n&&this.moveNode(s,n),(n||d)&&this._writeAttr(i,s),h&&this._prepareDragDropByNode(s)}),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 s=i.grid;if(!s||e.parentElement!==s.el)return;const r=s.getCellHeight();if(!r)return;let a=t&&i.h?i.h*r:e.clientHeight,n;if(i.resizeToContentParent&&(n=e.querySelector(i.resizeToContentParent)),n||(n=e.querySelector(R.resizeToContentParent)),!n)return;const d=e.clientHeight-n.clientHeight,h=t&&i.h?i.h*r-d:n.clientHeight;let c;if(i.subGrid)c=i.subGrid.getRow()*i.subGrid.getCellHeight();else{const _=n.firstElementChild;if(!_){console.log(`Error: resizeToContent() '${R.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=_.getBoundingClientRect().height||h}if(h===c)return;a+=c-h;let f=Math.ceil(a/r);const u=Number.isInteger(i.sizeToContent)?i.sizeToContent:0;u&&f>u&&(f=u,e.classList.add("size-to-content-max")),i.minH&&f<i.minH?f=i.minH:i.maxH&&f>i.maxH&&(f=i.maxH),f!==i.h&&(s._ignoreLayoutsNodeChange=!0,s.moveNode(i,{h:f}),delete s._ignoreLayoutsNodeChange)}resizeToContentCheck(e,t=!1){R.resizeToContentCB?R.resizeToContentCB(e,t):this.resizeToContent(e,t)}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){let i=g.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,s={x:t[i++],y:t[i++],w:t[i++],h:t[i++],autoPosition:t[i++]};return this.willItFit(s)}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(){var e;return this.engine.batchMode?this:((e=this.engine.addedNodes)!=null&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(t=>{delete t._dirty}),this._triggerEvent("added",this.engine.addedNodes),this.engine.addedNodes=[]),this)}_triggerRemoveEvent(){var e;return this.engine.batchMode?this:((e=this.engine.removedNodes)!=null&&e.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&&(g.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,s=this.opts.cellHeightUnit,r=`.${this._styleSheetClass} > .${this.opts.itemClass}`;if(!this._styles){let a=this.opts.styleInHead?void 0:this.el.parentNode;if(this._styles=g.createStylesheet(this._styleSheetClass,a,{nonce:this.opts.nonce}),!this._styles)return this;this._styles._max=0,g.addCSSRule(this._styles,r,`height: ${i}${s}`);let n=this.opts.marginTop+this.opts.marginUnit,d=this.opts.marginBottom+this.opts.marginUnit,h=this.opts.marginRight+this.opts.marginUnit,c=this.opts.marginLeft+this.opts.marginUnit,f=`${r} > .grid-stack-item-content`,u=`.${this._styleSheetClass} > .grid-stack-placeholder > .placeholder-content`;g.addCSSRule(this._styles,f,`top: ${n}; right: ${h}; bottom: ${d}; left: ${c};`),g.addCSSRule(this._styles,u,`top: ${n}; right: ${h}; bottom: ${d}; left: ${c};`),g.addCSSRule(this._styles,`${r} > .ui-resizable-ne`,`right: ${h}`),g.addCSSRule(this._styles,`${r} > .ui-resizable-e`,`right: ${h}`),g.addCSSRule(this._styles,`${r} > .ui-resizable-se`,`right: ${h}; bottom: ${d}`),g.addCSSRule(this._styles,`${r} > .ui-resizable-nw`,`left: ${c}`),g.addCSSRule(this._styles,`${r} > .ui-resizable-w`,`left: ${c}`),g.addCSSRule(this._styles,`${r} > .ui-resizable-sw`,`left: ${c}; bottom: ${d}`)}if(t=t||this._styles._max,t>this._styles._max){let a=n=>i*n+s;for(let n=this._styles._max+1;n<=t;n++)g.addCSSRule(this._styles,`${r}[gs-y="${n}"]`,`top: ${a(n)}`),g.addCSSRule(this._styles,`${r}[gs-h="${n+1}"]`,`height: ${a(n+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,s=this.opts.cellHeightUnit;if(!i)return this;if(!e){const r=g.parseHeight(getComputedStyle(this.el).minHeight);if(r.h>0&&r.unit===s){const a=Math.floor(r.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+s),e&&!e.grid.engine.batchMode&&g.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 s={...i};return i=this.engine.addNode(i,t),g.same(i,s)||this._writeAttr(e,i),g.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 s in i)t[s]?e.setAttribute(i[s],String(t[s])):e.removeAttribute(i[s]);return this}_readAttr(e,t=!0){let i={};i.x=g.toNumber(e.getAttribute("gs-x")),i.y=g.toNumber(e.getAttribute("gs-y")),i.w=g.toNumber(e.getAttribute("gs-w")),i.h=g.toNumber(e.getAttribute("gs-h")),i.autoPosition=g.toBool(e.getAttribute("gs-auto-position")),i.noResize=g.toBool(e.getAttribute("gs-no-resize")),i.noMove=g.toBool(e.getAttribute("gs-no-move")),i.locked=g.toBool(e.getAttribute("gs-locked")),i.id=e.getAttribute("gs-id"),i.maxW=g.toNumber(e.getAttribute("gs-max-w")),i.minW=g.toNumber(e.getAttribute("gs-min-w")),i.maxH=g.toNumber(e.getAttribute("gs-max-h")),i.minH=g.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 s in i){if(!i.hasOwnProperty(s))return;!i[s]&&i[s]!==0&&delete i[s]}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(){var t;if(!((t=this.el)!=null&&t.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 i=!this.opts.disableOneColumnMode&&this.el.clientWidth<=this.opts.oneColumnSize||this.opts.column===1&&!this._prevColumn;this.opts.column===1!==i&&(this.column(i?1:this._prevColumn),e=!0)}return this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(i=>{i.subGrid&&i.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)g.shouldSizeToContent(i)&&this.resizeToContentCheck(i.el,t);else if(this.engine.nodes.some(s=>g.shouldSizeToContent(s))){const s=[...this.engine.nodes];this.batchUpdate(),s.forEach(r=>{g.shouldSizeToContent(r)&&this.resizeToContentCheck(r.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=g.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 g.getElement(e)}static getElements(e=".grid-stack-item"){return g.getElements(e)}static getGridElement(e){return R.getElement(e)}static getGridElements(e){return g.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=g.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=g.parseHeight(this.opts.marginTop),this.opts.marginTop=e.h,delete this.opts.margin),this.opts.marginBottom===void 0?this.opts.marginBottom=t:(e=g.parseHeight(this.opts.marginBottom),this.opts.marginBottom=e.h,delete this.opts.margin),this.opts.marginRight===void 0?this.opts.marginRight=t:(e=g.parseHeight(this.opts.marginRight),this.opts.marginRight=e.h,delete this.opts.margin),this.opts.marginLeft===void 0?this.opts.marginLeft=t:(e=g.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==null?void 0:t.pause)!==void 0&&(E.pauseDrag=t.pause),t={...Cr,...t||{}};let s=typeof e=="string"?g.getElements(e,i):e;s.length&&(s==null||s.forEach(r=>{j.isDraggable(r)||j.dragIn(r,t)}))}movable(e,t){return this.opts.staticGrid?this:(R.getElements(e).forEach(i=>{let s=i.gridstackNode;s&&(t?delete s.noMove:s.noMove=!0,this._prepareDragDropByNode(s))}),this)}resizable(e,t){return this.opts.staticGrid?this:(R.getElements(e).forEach(i=>{let s=i.gridstackNode;s&&(t?delete s.noResize:s.noResize=!0,this._prepareDragDropByNode(s))}),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=(s,r,a)=>{let n=r.gridstackNode;if(!n)return;a=a||r;let d=this.el.getBoundingClientRect(),{top:h,left:c}=a.getBoundingClientRect();c-=d.left,h-=d.top;let f={position:{top:h,left:c}};if(n._temporaryRemoved){if(n.x=Math.max(0,Math.round(c/t)),n.y=Math.max(0,Math.round(h/e)),delete n.autoPosition,this.engine.nodeBoundFix(n),!this.engine.willItFit(n)){if(n.autoPosition=!0,!this.engine.willItFit(n)){j.off(r,"drag");return}n._willFitPos&&(g.copyPos(n,n._willFitPos),delete n._willFitPos)}this._onStartMoving(a,s,f,n,t,e)}else this._dragOrResize(a,s,f,n,t,e)};return j.droppable(this.el,{accept:s=>{let r=s.gridstackNode;if((r==null?void 0:r.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let a=!0;if(typeof this.opts.acceptWidgets=="function")a=this.opts.acceptWidgets(s);else{let n=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;a=s.matches(n)}if(a&&r&&this.opts.maxRow){let n={w:r.w,h:r.h,minW:r.minW,minH:r.minH};a=this.engine.willItFit(n)}return a}}).on(this.el,"dropover",(s,r,a)=>{let n=r.gridstackNode;if((n==null?void 0:n.grid)===this&&!n._temporaryRemoved)return!1;n!=null&&n.grid&&n.grid!==this&&!n._temporaryRemoved&&n.grid._leave(r,a),t=this.cellWidth(),e=this.getCellHeight(!0),n||(n=this._readAttr(r,!1)),n.grid||(n._isExternal=!0,r.gridstackNode=n),a=a||r;let d=n.w||Math.round(a.offsetWidth/t)||1,h=n.h||Math.round(a.offsetHeight/e)||1;return n.grid&&n.grid!==this?(r._gridstackNodeOrig||(r._gridstackNodeOrig=n),r.gridstackNode=n={...n,w:d,h,grid:this},delete n.x,delete n.y,this.engine.cleanupNode(n).nodeBoundFix(n),n._initDD=n._isExternal=n._temporaryRemoved=!0):(n.w=d,n.h=h,n._temporaryRemoved=!0),this._itemRemoving(n.el,!1),j.on(r,"drag",i),i(s,r,a),!1}).on(this.el,"dropout",(s,r,a)=>{let n=r.gridstackNode;return n&&(!n.grid||n.grid===this)&&(this._leave(r,a),this._isTemp&&this.removeAsSubGrid(n)),!1}).on(this.el,"drop",(s,r,a)=>{var f,u;let n=r.gridstackNode;if((n==null?void 0:n.grid)===this&&!n._isExternal)return!1;let d=!!this.placeholder.parentElement;this.placeholder.remove();let h=r._gridstackNodeOrig;if(delete r._gridstackNodeOrig,d&&(h!=null&&h.grid)&&h.grid!==this){let _=h.grid;_.engine.removeNodeFromLayoutCache(h),_.engine.removedNodes.push(h),_._triggerRemoveEvent()._triggerChangeEvent(),_.parentGridItem&&!_.engine.nodes.length&&_.opts.subGridDynamic&&_.removeAsSubGrid()}if(!n||(d&&(this.engine.cleanupNode(n),n.grid=this),delete n.grid._isTemp,j.off(r,"drag"),a!==r?(a.remove(),r.gridstackNode=h,d&&(r=r.cloneNode(!0))):(r.remove(),this._removeDD(r)),!d))return!1;r.gridstackNode=n,n.el=r;let c=(u=(f=n.subGrid)==null?void 0:f.el)==null?void 0:u.gridstack;return g.copyPos(n,this._readAttr(this.placeholder)),g.removePositioningStyles(r),this._writeAttr(r,n),r.classList.add(ie.itemClass,this.opts.itemClass),this.el.appendChild(r),c&&(c.parentGridItem=n,c.opts.styleInHead||c._updateStyles(!0)),this._prepareDragDropByNode(n),this._updateContainerHeight(),this.engine.addedNodes.push(n),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...s,type:"dropped"},h&&h.grid?h:void 0,n),!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,s=e.noResize||this.opts.disableResize;if(this.opts.staticGrid||i&&s)return e._initDD&&(this._removeDD(t),delete e._initDD),t.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!e._initDD){let r,a,n=(c,f)=>{this._gsEventHandler[c.type]&&this._gsEventHandler[c.type](c,c.target),r=this.cellWidth(),a=this.getCellHeight(!0),this._onStartMoving(t,c,f,e,r,a)},d=(c,f)=>{this._dragOrResize(t,c,f,e,r,a)},h=c=>{this.placeholder.remove(),delete e._moving,delete e._event,delete e._lastTried;let f=c.target;if(!(!f.gridstackNode||f.gridstackNode.grid!==this)){if(e.el=f,e._isAboutToRemove){let u=t.gridstackNode.grid;u._gsEventHandler[c.type]&&u._gsEventHandler[c.type](c,f),u.engine.nodes.push(e),u.removeWidget(t,!0,!0)}else g.removePositioningStyles(f),e._temporaryRemoved?(g.copyPos(e,e._orig),this._writePosAttr(f,e),this.engine.addNode(e)):this._writePosAttr(f,e),this._gsEventHandler[c.type]&&this._gsEventHandler[c.type](c,f);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),c.type==="resizestop"&&(Number.isInteger(e.sizeToContent)&&(e.sizeToContent=e.h),this.doContentResize(!1,!0,e))}};j.draggable(t,{start:n,stop:h,drag:d}).resizable(t,{start:n,stop:h,resize:d}),e._initDD=!0}return j.draggable(t,i?"disable":"enable").resizable(t,s?"disable":"enable"),this}_onStartMoving(e,t,i,s,r,a){this.engine.cleanNodes().beginUpdate(s),this._writePosAttr(this.placeholder,s),this.el.appendChild(this.placeholder),s.el=this.placeholder,s._lastUiPosition=i.position,s._prevYPix=i.position.top,s._moving=t.type==="dragstart",delete s._lastTried,t.type==="dropover"&&s._temporaryRemoved&&(this.engine.addNode(s),s._moving=!0),this.engine.cacheRects(r,a,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),t.type==="resizestart"&&(j.resizable(e,"option","minWidth",r*(s.minW||1)).resizable(e,"option","minHeight",a*(s.minH||1)),s.maxW&&j.resizable(e,"option","maxWidth",r*s.maxW),s.maxH&&j.resizable(e,"option","maxHeight",a*s.maxH))}_dragOrResize(e,t,i,s,r,a){let n={...s._orig},d,h=this.opts.marginLeft,c=this.opts.marginRight,f=this.opts.marginTop,u=this.opts.marginBottom,_=Math.round(a*.1),b=Math.round(r*.1);if(h=Math.min(h,b),c=Math.min(c,b),f=Math.min(f,_),u=Math.min(u,_),t.type==="drag"){if(s._temporaryRemoved)return;let H=i.position.top-s._prevYPix;s._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&g.updateScrollPosition(e,i.position,H);let A=i.position.left+(i.position.left>s._lastUiPosition.left?-c:h),N=i.position.top+(i.position.top>s._lastUiPosition.top?-u:f);n.x=Math.round(A/r),n.y=Math.round(N/a);let D=this._extraDragRow;if(this.engine.collide(s,n)){let v=this.getRow(),B=Math.max(0,n.y+s.h-v);this.opts.maxRow&&v+B>this.opts.maxRow&&(B=Math.max(0,this.opts.maxRow-v)),this._extraDragRow=B}else this._extraDragRow=0;if(this._extraDragRow!==D&&this._updateContainerHeight(),s.x===n.x&&s.y===n.y)return}else if(t.type==="resize"){if(n.x<0||(g.updateScrollResize(t,e,a),n.w=Math.round((i.size.width-h)/r),n.h=Math.round((i.size.height-f)/a),s.w===n.w&&s.h===n.h)||s._lastTried&&s._lastTried.w===n.w&&s._lastTried.h===n.h)return;let H=i.position.left+h,A=i.position.top+f;n.x=Math.round(H/r),n.y=Math.round(A/a),d=!0}s._event=t,s._lastTried=n;let L={x:i.position.left+h,y:i.position.top+f,w:(i.size?i.size.width:s.w*r)-h-c,h:(i.size?i.size.height:s.h*a)-f-u};if(this.engine.moveNodeCheck(s,{...n,cellWidth:r,cellHeight:a,rect:L,resizing:d})){s._lastUiPosition=i.position,this.engine.cacheRects(r,a,f,c,u,h),delete s._skipDown,d&&s.subGrid&&s.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let H=t.target;this._writePosAttr(H,s),this._gsEventHandler[t.type]&&this._gsEventHandler[t.type](t,H)}}_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 Rr(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}R.resizeToContentParent=".grid-stack-item-content",R.Utils=g,R.Engine=le,R.GDRev="9.5.1";const Nr={class:"tw-flex tw-flex-row tw-flex-wrap tw-gap-2"},Lr={class:"color-primary"},zr={class:"color-secondary"},Mr={key:1,class:"empty"},Ir={key:0,class:"clear-filter-div"},Hr=_e(l.defineComponent({__name:"Filter",props:{order:{}},setup(o){const e=o,t=De(),i=l.computed(()=>({...t.Filters})),s=l.computed(()=>({...t.displayFilters})),r=l.computed(()=>{const c=i.value;return Object.keys(c).map(f=>({key:f,value:c[f]})).filter(({value:f})=>!(f==null||typeof f=="string"&&f.trim()===""||Array.isArray(f)&&f.length===0))}),a=l.computed(()=>{var f;const c=r.value.filter(u=>s.value.hasOwnProperty(u.key)&&s.value[u.key]);if((f=e.order)!=null&&f.length){const u=new Map(e.order.map((_,b)=>[_,b]));c.sort((_,b)=>{const L=u.has(_.key)?u.get(_.key):Number.MAX_SAFE_INTEGER,H=u.has(b.key)?u.get(b.key):Number.MAX_SAFE_INTEGER;return L-H||_.key.localeCompare(b.key)})}else c.sort((u,_)=>u.key.localeCompare(_.key));return c});function n(c){return Array.isArray(c)?l.toRaw(c).map(u=>u&&typeof u=="object"?u.name??JSON.stringify(u).replace(/[{}"]/g,""):String(u??"")).join(", "):c&&typeof c=="object"?JSON.stringify(c).replace(/[{}"]/g,""):String(c??"")}function d(c){const f=t;typeof f.clearFilter=="function"?f.clearFilter(c):typeof f.clearAllFilters=="function"?f.clearAllFilters(c):t.setFilter(c,void 0)}function h(){t.resetFilters({})}return(c,f)=>{const u=l.resolveComponent("el-icon"),_=l.resolveComponent("el-row");return l.openBlock(),l.createBlock(_,{class:"filter-wrapper tw-m-1",align:"middle",justify:"space-between"},{default:l.withCtx(()=>[l.createElementVNode("div",Nr,[a.value.length?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(a.value,b=>(l.openBlock(),l.createBlock(l.unref(yt.ElTag),{class:"color-background",key:b.key,closable:"",onClose:L=>d(b.key),effect:"dark",type:"info"},{default:l.withCtx(()=>[l.createElementVNode("b",Lr,l.toDisplayString(b.key)+": ",1),l.createElementVNode("span",zr,l.toDisplayString(n(b.value)),1)]),_:2},1032,["onClose"]))),128)):(l.openBlock(),l.createElementBlock("span",Mr))]),a.value.length?(l.openBlock(),l.createElementBlock("div",Ir,[l.createVNode(l.unref(yt.ElTooltip),{placement:"top-start",content:"Clear All Filters"},{default:l.withCtx(()=>[l.createVNode(u,{color:"#FFFF",onClick:h},{default:l.withCtx(()=>[l.createVNode(l.unref(rs))]),_:1})]),_:1})])):l.createCommentVNode("",!0)]),_:1})}}}),[["__scopeId","data-v-55b985b8"]]),Or={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"},Pr={class:"editing-div"},Br={class:"tw-m-4 tw-leading-none tw-pl-1 widget-name"},$r={class:"header-slot-icon"},Ur={key:1,class:"dash-header-hide content-header"},Fr={class:"header-slot-icon"},Wr=_e({__name:"DashHeader",props:{widgetName:{type:String,required:!0},widgetID:{type:String,required:!0},hideHeader:Boolean},setup(o){const e=De(),t=o,i=l.ref(null);l.watch(()=>t.widgetName,d=>{i.value=d},{immediate:!0});const s=l.ref(!1),r=l.ref(null);function a(){s.value=!0,r.value&&r.value.focus()}function n(){if(!s.value)return;s.value=!1;const d=e.getDashItem(t.widgetID);d.componentName=i}return(d,h)=>{const c=l.resolveComponent("el-input"),f=l.resolveDirective("click-out");return o.hideHeader?(l.openBlock(),l.createElementBlock("div",Ur,[l.createElementVNode("div",Fr,[l.renderSlot(d.$slots,"default",{},void 0,!0)])])):(l.openBlock(),l.createElementBlock("div",Or,[l.createElementVNode("div",null,[l.withDirectives((l.openBlock(),l.createElementBlock("div",{onKeyup:l.withKeys(n,["enter"]),class:"tw-flex"},[l.withDirectives(l.createElementVNode("div",Pr,[l.createVNode(c,{onFocus:h[0]||(h[0]=u=>u.target.select()),ref_key:"textUserInput",ref:r,modelValue:i.value,"onUpdate:modelValue":h[1]||(h[1]=u=>i.value=u)},null,8,["modelValue"])],512),[[l.vShow,s.value]]),l.withDirectives(l.createElementVNode("div",{onClick:h[2]||(h[2]=u=>a()),class:"visible-div"},[l.createElementVNode("div",Br,l.toDisplayString(i.value),1)],512),[[l.vShow,!s.value]])],32)),[[f,n]])]),l.createElementVNode("div",$r,[l.renderSlot(d.$slots,"default",{},void 0,!0)])]))}}},[["__scopeId","data-v-4f4aa869"]]),Gr={class:"tw-flex"},Vr=_e({__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(o,{emit:e}){const t=e,i=o;let s=l.ref(null);const r=l.ref(!1);l.watch(()=>i.isLocked,d=>{r.value=d},{immediate:!0});const a=l.ref(null);l.watch(()=>i.hideWidgetsHeader,d=>{a.value=d},{immediate:!0});function n(){t("toggle-lock",{id:i.widgetID,isLocked:r.value})}return(d,h)=>{const c=l.resolveComponent("el-icon");return l.openBlock(),l.createElementBlock("div",{ref_key:"instance",ref:s,class:l.normalizeClass(["grid-stack-item-content",{"locked-widget":o.isLocked}])},[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(o.componentTag),l.mergeProps({class:["widget-body",{"widget-body-no-head":a.value}],widgetID:o.widgetID,hideHeader:a.value},i.componentProperties,{style:{pointerEvents:r.value?"none":"auto"},isLocked:r.value}),{default:l.withCtx(f=>[f?(l.openBlock(),l.createBlock(Wr,{key:0,widgetName:i.componentName,widgetID:o.widgetID,staticMode:o.staticMode,hideHeader:a.value},{default:l.withCtx(()=>[l.createElementVNode("div",Gr,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f.childIcons,u=>(l.openBlock(),l.createBlock(l.unref(yt.ElTooltip),{placement:"bottom-start"},{content:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(u.tooltip),1)]),default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(u.comp),{class:"tw-w-4 header-icon",onClick:u.event},null,8,["onClick"]))]),_:2},1024))),256)),l.createVNode(c,{class:"header-icon lock-toggle",onClick:h[0]||(h[0]=u=>n())},{default:l.withCtx(()=>[r.value?(l.openBlock(),l.createBlock(l.unref(hs),{key:0})):(l.openBlock(),l.createBlock(l.unref(ds),{key:1}))]),_:1}),!o.staticMode&&!o.isLocked?(l.openBlock(),l.createBlock(c,{key:0,class:"item-widget-button",onClick:h[1]||(h[1]=u=>d.$emit("removeWidget"))},{default:l.withCtx(()=>[l.createVNode(l.unref(os))]),_:1})):l.createCommentVNode("",!0)])]),_:2},1032,["widgetName","widgetID","staticMode","hideHeader"])):l.createCommentVNode("",!0)]),_:1},16,["class","widgetID","hideHeader","style","isLocked"]))],2)}}},[["__scopeId","data-v-a2daf4ac"]]),qr={class:"dashboard-app"},jr={key:0,class:"dash-header tw-max-h-screen tw-flex tw-flex-col"},Yr={class:"tw-float-left tw-m-1 button"},Xr={key:1,class:"tw-h-10 dash-header"},Zr={class:"tw-float-left tw-m-1"},Kr={class:"tw-m-4 tw-w-50 tw-flex-row tw-flex"},Qr={class:"tw-m-w-4 tw-w-40"},Jr=["gs-x","gs-y","gs-w","gs-h","gs-id","id","props","gs-locked","gs-no-move","gs-no-resize"],en=_e(l.defineComponent({__name:"Dashboard",props:{hideHeader:{},options:{}},setup(o){const e=o,t=De(),{DASHBOARD_ITEMS:i}=ce.storeToRefs(t);let s=l.ref("Edit Grid"),r=null;const a=l.ref(null);let n=l.ref(!0),d=0;const h=l.ref([]),{ComponentRegistry:c}=ce.storeToRefs(t),f=l.reactive({});l.onBeforeMount(()=>{var w;u(),_(),t.loadFromLocalStorage(),d=((w=i.value)==null?void 0:w.length)+1}),l.onMounted(()=>{L(),A()}),l.onBeforeUnmount(()=>{H(),t.unregisterGridProvider()});function u(){var w,y;t.DefaultLayout=(w=e.options)==null?void 0:w.defaultLayout,t.setOptionServices((y=e.options)==null?void 0:y.services)}function _(){const w={apiUrl:l.computed(()=>{var y;return(y=t.Services)==null?void 0:y.ApiUrl}),s3Url:l.computed(()=>{var y;return(y=t.Services)==null?void 0:y.s3Url}),services:t.Services,filters:t.Filters,setFilter:t.setFilter,clearFilter:t.clearFilter,resetFilters:t.resetFilters};l.provide("dashboard:globalVars",w)}async function b(){if(t.resetGridLayout(),await l.nextTick(),!!r){r.batchUpdate(),r.removeAll();for(const w of i.value){const y=document.getElementById(w.id);if(!y){console.warn("makeWidget: element not found for id",w.id);continue}y.classList.add("grid-stack-item"),w.w!=null&&y.setAttribute("gs-w",String(w.w)),w.h!=null&&y.setAttribute("gs-h",String(w.h)),w.x!=null&&y.setAttribute("gs-x",String(w.x)),w.y!=null&&y.setAttribute("gs-y",String(w.y)),w.x==null&&w.y==null&&w.autoPosition&&y.setAttribute("gs-auto-position","true"),!y.gridstackNode&&r.makeWidget(y)}r.commit()}}function L(){const w={float:!0,column:12,cellHeight:"70px",minRow:12,margin:5,alwaysShowResizeHandle:!0,resizable:{handles:"e,se,s,sw,w,n"}};r=R.init(w),t.registerGridProvider(()=>r),r.setStatic(n.value)}function H(){r&&(r.destroy(!1),r=null)}l.watch(()=>{var w;return(w=e.options)==null?void 0:w.availableWidgets},w=>{c.value={},h.value=[],w&&w.forEach((y,C)=>{let T,F;if(y&&typeof y=="object"&&"name"in y&&"component"in y)T=y.name,F=y.component;else if(y&&typeof y=="object"&&"name"in y&&"loader"in y)T=y.name,F=l.defineAsyncComponent(async()=>{const O=await y.loader();return O.default??O});else if(y&&(typeof y=="function"||typeof y=="object"))F=y,T=y.name||`Widget${C+1}`;else if(typeof y=="function")return;!T||!F||c.value[T]||(c.value[T]=F,h.value.push(T))})},{immediate:!0,deep:!0});function A(){const w=e.options.globalData;if(w){t.clearOptionsDataItems();for(const y in w)t.addOptionsDataItems(y,w[y])}}l.watch(()=>n.value,w=>{r.setStatic(w),s.value=w?"Edit Grid":"Save Grid"});function N(w){if(!w)return;const y=`${w}-${d}`,C={id:y,w:2,h:6,autoPosition:!0,component:c.value[w],componentKey:w,componentName:w,Props:{}};d++,i.value.push(C),l.nextTick(()=>{r==null||r.makeWidget(`#${y}`)})}function D(w){var y=i.value.findIndex(T=>T.id==w);i.value.splice(y,1);const C=`#${w}`;r.removeWidget(C,!1)}function v({id:w,isLocked:y}){const C=f[w];C&&r&&r.update(C,{locked:!y,noMove:!y,noResize:!y}),t.toggleWidgetLock(w)}function B(){n.value=!n.value,n.value}return(w,y)=>{const C=l.resolveComponent("el-button"),T=l.resolveComponent("el-option"),F=l.resolveComponent("el-select"),O=l.resolveComponent("el-col");return l.openBlock(),l.createElementBlock("div",qr,[w.hideHeader?(l.openBlock(),l.createElementBlock("div",Xr,[y[3]||(y[3]=l.createTextVNode("x ",-1)),l.createElementVNode("span",Zr,[l.createVNode(C,{class:"edit-button",onClick:y[1]||(y[1]=z=>B())},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(s)),1)]),_:1})])])):(l.openBlock(),l.createElementBlock("div",jr,[l.createElementVNode("span",Yr,[l.createVNode(C,{class:"edit-button",onClick:y[0]||(y[0]=z=>B())},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(s)),1)]),_:1})]),l.createVNode(Hr)])),l.unref(n)?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(O,{key:2},{default:l.withCtx(()=>[l.createElementVNode("div",Kr,[l.createVNode(F,{placeholder:"Add New Widget"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.value,z=>(l.openBlock(),l.createBlock(T,{key:z,label:z,value:z,onClick:be=>N(z)},null,8,["label","value","onClick"]))),128))]),_:1}),l.createElementVNode("div",Qr,[l.createVNode(C,{onClick:y[2]||(y[2]=z=>b())},{default:l.withCtx(()=>[...y[4]||(y[4]=[l.createTextVNode("Reset Grid Layout",-1)])]),_:1})])])]),_:1})),l.createElementVNode("div",{ref_key:"root",ref:a,class:"grid-stack tw-h-screen"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(i),z=>{var be,ke,at,ht;return l.openBlock(),l.createElementBlock("div",{class:"grid-stack-item",ref_for:!0,ref:ct=>f[z.id]=ct,"gs-x":z.x,"gs-y":z.y,"gs-w":z.w,"gs-h":z.h,"gs-id":z.id,id:z.id,key:z.id,props:z.Props,"gs-locked":(be=z.Props)==null?void 0:be.locked,"gs-no-move":(ke=z.Props)==null?void 0:ke.locked,"gs-no-resize":(at=z.Props)==null?void 0:at.locked},[l.createVNode(Vr,{widgetID:z.id,onRemoveWidget:ct=>D(z.id),onToggleLock:v,"static-mode":l.unref(n),componentTag:z.component,componentProperties:z.Props,componentName:z.componentName,hideWidgetsHeader:z.hideHeader,"is-locked":(ht=z.Props)==null?void 0:ht.locked},null,8,["widgetID","onRemoveWidget","static-mode","componentTag","componentProperties","componentName","hideWidgetsHeader","is-locked"])],8,Jr)}),128))],512)])}}}),[["__scopeId","data-v-240ef3ec"]]);q.MarkdownWidget=Tr,q.PennsieveDashboard=en,q.TextWidget=ys,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})}));
|