From e4a7ecf0e65574522eb9fbe70b7339f41de0bbe2 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Tue, 31 Dec 2024 13:13:54 +0000 Subject: [PATCH] rebuild --- packages/forms/dist/components/file-upload.js | 2 +- packages/forms/dist/components/rich-editor.js | 36 +++++++++---------- packages/forms/dist/components/select.js | 4 +-- packages/panels/dist/fonts/inter/index.css | 2 +- packages/support/dist/index.js | 12 +++---- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/forms/dist/components/file-upload.js b/packages/forms/dist/components/file-upload.js index f8d37ba34ea..bf860cd6fc4 100644 --- a/packages/forms/dist/components/file-upload.js +++ b/packages/forms/dist/components/file-upload.js @@ -42,7 +42,7 @@ ${p.outerHTML}${w} filepond/dist/filepond.esm.js: (*! - * FilePond 4.32.5 + * FilePond 4.32.6 * Licensed under MIT, https://opensource.org/licenses/MIT/ * Please visit https://pqina.nl/filepond/ for details. *) diff --git a/packages/forms/dist/components/rich-editor.js b/packages/forms/dist/components/rich-editor.js index b84eac023a7..121e40e5208 100644 --- a/packages/forms/dist/components/rich-editor.js +++ b/packages/forms/dist/components/rich-editor.js @@ -1,4 +1,4 @@ -var po="2.1.11",wt="[data-trix-attachment]",mi={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},W={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,htmlAttributes:["language"],text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test(i){return Gi(i.parentNode)===W[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test(i){return Gi(i.parentNode)===W[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}},Gi=i=>{var t;return i==null||(t=i.tagName)===null||t===void 0?void 0:t.toLowerCase()},$i=navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i),En=$i&&parseInt($i[1]),xe={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:En&&En>12,samsungAndroid:En&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:typeof InputEvent<"u"&&["data","getTargetRanges","inputType"].every(i=>i in InputEvent.prototype)},Lr={ADD_ATTR:["language"],SAFE_FOR_XML:!1,RETURN_DOM:!0},m={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption\u2026",code:"Code",heading1:"Heading",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",url:"URL",urlPlaceholder:"Enter a URL\u2026",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"},fo=[m.bytes,m.KB,m.MB,m.GB,m.TB,m.PB],Dr={prefix:"IEC",precision:2,formatter(i){switch(i){case 0:return"0 ".concat(m.bytes);case 1:return"1 ".concat(m.byte);default:let t;this.prefix==="SI"?t=1e3:this.prefix==="IEC"&&(t=1024);let e=Math.floor(Math.log(i)/Math.log(t)),n=(i/Math.pow(t,e)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"");return"".concat(n," ").concat(fo[e])}}},an="\uFEFF",bt="\xA0",Nr=function(i){for(let t in i){let e=i[t];this[t]=e}return this},pi=document.documentElement,bo=pi.matches,S=function(i){let{onElement:t,matchingSelector:e,withCallback:n,inPhase:r,preventDefault:o,times:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=t||pi,c=e,u=r==="capturing",d=function(C){s!=null&&--s==0&&d.destroy();let T=vt(C.target,{matchingSelector:c});T!=null&&(n?.call(T,C,T),o&&C.preventDefault())};return d.destroy=()=>l.removeEventListener(i,d,u),l.addEventListener(i,d,u),d},he=function(i){let{onElement:t,bubbles:e,cancelable:n,attributes:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=t??pi;e=e!==!1,n=n!==!1;let s=document.createEvent("Events");return s.initEvent(i,e,n),r!=null&&Nr.call(s,r),o.dispatchEvent(s)},Ir=function(i,t){if(i?.nodeType===1)return bo.call(i,t)},vt=function(i){let{matchingSelector:t,untilNode:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(;i&&i.nodeType!==Node.ELEMENT_NODE;)i=i.parentNode;if(i!=null){if(t==null)return i;if(i.closest&&e==null)return i.closest(t);for(;i&&i!==e;){if(Ir(i,t))return i;i=i.parentNode}}},fi=i=>document.activeElement!==i&&Tt(i,document.activeElement),Tt=function(i,t){if(i&&t)for(;t;){if(t===i)return!0;t=t.parentNode}},Sn=function(i){var t;if((t=i)===null||t===void 0||!t.parentNode)return;let e=0;for(i=i.previousSibling;i;)e++,i=i.previousSibling;return e},At=i=>{var t;return i==null||(t=i.parentNode)===null||t===void 0?void 0:t.removeChild(i)},je=function(i){let{onlyNodesOfType:t,usingFilter:e,expandEntityReferences:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(()=>{switch(t){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}})();return document.createTreeWalker(i,r,e??null,n===!0)},j=i=>{var t;return i==null||(t=i.tagName)===null||t===void 0?void 0:t.toLowerCase()},p=function(i){let t,e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof i=="object"?(n=i,i=n.tagName):n={attributes:n};let r=document.createElement(i);if(n.editable!=null&&(n.attributes==null&&(n.attributes={}),n.attributes.contenteditable=n.editable),n.attributes)for(t in n.attributes)e=n.attributes[t],r.setAttribute(t,e);if(n.style)for(t in n.style)e=n.style[t],r.style[t]=e;if(n.data)for(t in n.data)e=n.data[t],r.dataset[t]=e;return n.className&&n.className.split(" ").forEach(o=>{r.classList.add(o)}),n.textContent&&(r.textContent=n.textContent),n.childNodes&&[].concat(n.childNodes).forEach(o=>{r.appendChild(o)}),r},ie,de=function(){if(ie!=null)return ie;ie=[];for(let i in W){let t=W[i];t.tagName&&ie.push(t.tagName)}return ie},kn=i=>qt(i?.firstChild),Yi=function(i){let{strict:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{strict:!0};return t?qt(i):qt(i)||!qt(i.firstChild)&&function(e){return de().includes(j(e))&&!de().includes(j(e.firstChild))}(i)},qt=i=>vo(i)&&i?.data==="block",vo=i=>i?.nodeType===Node.COMMENT_NODE,Ht=function(i){let{name:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i)return ge(i)?i.data===an?!t||i.parentNode.dataset.trixCursorTarget===t:void 0:Ht(i.firstChild)},Lt=i=>Ir(i,wt),Or=i=>ge(i)&&i?.data==="",ge=i=>i?.nodeType===Node.TEXT_NODE,bi={level2Enabled:!0,getLevel(){return this.level2Enabled&&xe.supportsInputEvents?2:0},pickFiles(i){let t=p("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId});t.addEventListener("change",()=>{i(t.files),At(t)}),At(document.getElementById(this.fileInputId)),document.body.appendChild(t),t.click()}},Me={removeBlankTableCells:!1,tableCellSeparator:" | ",tableRowSeparator:` +var po="2.1.12",wt="[data-trix-attachment]",mi={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},W={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,htmlAttributes:["language"],text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test(i){return Gi(i.parentNode)===W[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test(i){return Gi(i.parentNode)===W[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}},Gi=i=>{var t;return i==null||(t=i.tagName)===null||t===void 0?void 0:t.toLowerCase()},$i=navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i),Sn=$i&&parseInt($i[1]),xe={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:Sn&&Sn>12,samsungAndroid:Sn&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:typeof InputEvent<"u"&&["data","getTargetRanges","inputType"].every(i=>i in InputEvent.prototype)},Lr={ADD_ATTR:["language"],SAFE_FOR_XML:!1,RETURN_DOM:!0},m={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption\u2026",code:"Code",heading1:"Heading",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",url:"URL",urlPlaceholder:"Enter a URL\u2026",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"},fo=[m.bytes,m.KB,m.MB,m.GB,m.TB,m.PB],Dr={prefix:"IEC",precision:2,formatter(i){switch(i){case 0:return"0 ".concat(m.bytes);case 1:return"1 ".concat(m.byte);default:let t;this.prefix==="SI"?t=1e3:this.prefix==="IEC"&&(t=1024);let e=Math.floor(Math.log(i)/Math.log(t)),n=(i/Math.pow(t,e)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"");return"".concat(n," ").concat(fo[e])}}},ln="\uFEFF",bt="\xA0",Nr=function(i){for(let t in i){let e=i[t];this[t]=e}return this},pi=document.documentElement,bo=pi.matches,S=function(i){let{onElement:t,matchingSelector:e,withCallback:n,inPhase:r,preventDefault:o,times:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=t||pi,c=e,u=r==="capturing",d=function(C){s!=null&&--s==0&&d.destroy();let T=vt(C.target,{matchingSelector:c});T!=null&&(n?.call(T,C,T),o&&C.preventDefault())};return d.destroy=()=>l.removeEventListener(i,d,u),l.addEventListener(i,d,u),d},he=function(i){let{onElement:t,bubbles:e,cancelable:n,attributes:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=t??pi;e=e!==!1,n=n!==!1;let s=document.createEvent("Events");return s.initEvent(i,e,n),r!=null&&Nr.call(s,r),o.dispatchEvent(s)},Ir=function(i,t){if(i?.nodeType===1)return bo.call(i,t)},vt=function(i){let{matchingSelector:t,untilNode:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(;i&&i.nodeType!==Node.ELEMENT_NODE;)i=i.parentNode;if(i!=null){if(t==null)return i;if(i.closest&&e==null)return i.closest(t);for(;i&&i!==e;){if(Ir(i,t))return i;i=i.parentNode}}},fi=i=>document.activeElement!==i&&Tt(i,document.activeElement),Tt=function(i,t){if(i&&t)for(;t;){if(t===i)return!0;t=t.parentNode}},kn=function(i){var t;if((t=i)===null||t===void 0||!t.parentNode)return;let e=0;for(i=i.previousSibling;i;)e++,i=i.previousSibling;return e},At=i=>{var t;return i==null||(t=i.parentNode)===null||t===void 0?void 0:t.removeChild(i)},je=function(i){let{onlyNodesOfType:t,usingFilter:e,expandEntityReferences:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(()=>{switch(t){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}})();return document.createTreeWalker(i,r,e??null,n===!0)},j=i=>{var t;return i==null||(t=i.tagName)===null||t===void 0?void 0:t.toLowerCase()},p=function(i){let t,e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof i=="object"?(n=i,i=n.tagName):n={attributes:n};let r=document.createElement(i);if(n.editable!=null&&(n.attributes==null&&(n.attributes={}),n.attributes.contenteditable=n.editable),n.attributes)for(t in n.attributes)e=n.attributes[t],r.setAttribute(t,e);if(n.style)for(t in n.style)e=n.style[t],r.style[t]=e;if(n.data)for(t in n.data)e=n.data[t],r.dataset[t]=e;return n.className&&n.className.split(" ").forEach(o=>{r.classList.add(o)}),n.textContent&&(r.textContent=n.textContent),n.childNodes&&[].concat(n.childNodes).forEach(o=>{r.appendChild(o)}),r},ie,de=function(){if(ie!=null)return ie;ie=[];for(let i in W){let t=W[i];t.tagName&&ie.push(t.tagName)}return ie},Rn=i=>qt(i?.firstChild),Yi=function(i){let{strict:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{strict:!0};return t?qt(i):qt(i)||!qt(i.firstChild)&&function(e){return de().includes(j(e))&&!de().includes(j(e.firstChild))}(i)},qt=i=>vo(i)&&i?.data==="block",vo=i=>i?.nodeType===Node.COMMENT_NODE,Ht=function(i){let{name:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i)return ge(i)?i.data===ln?!t||i.parentNode.dataset.trixCursorTarget===t:void 0:Ht(i.firstChild)},Lt=i=>Ir(i,wt),Or=i=>ge(i)&&i?.data==="",ge=i=>i?.nodeType===Node.TEXT_NODE,bi={level2Enabled:!0,getLevel(){return this.level2Enabled&&xe.supportsInputEvents?2:0},pickFiles(i){let t=p("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId});t.addEventListener("change",()=>{i(t.files),At(t)}),At(document.getElementById(this.fileInputId)),document.body.appendChild(t),t.click()}},Me={removeBlankTableCells:!1,tableCellSeparator:" | ",tableRowSeparator:` `},It={bold:{tagName:"strong",inheritable:!0,parser(i){let t=window.getComputedStyle(i);return t.fontWeight==="bold"||t.fontWeight>=600}},italic:{tagName:"em",inheritable:!0,parser:i=>window.getComputedStyle(i).fontStyle==="italic"},href:{groupTagName:"a",parser(i){let t="a:not(".concat(wt,")"),e=i.closest(t);if(e)return e.getAttribute("href")}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}},Fr={getDefaultHTML:()=>`
@@ -32,47 +32,47 @@ var po="2.1.11",wt="[data-trix-attachment]",mi={preview:{presentation:"gallery",
-
`)},$n={interval:5e3},Ce=Object.freeze({__proto__:null,attachments:mi,blockAttributes:W,browser:xe,css:{attachment:"attachment",attachmentCaption:"attachment__caption",attachmentCaptionEditor:"attachment__caption-editor",attachmentMetadata:"attachment__metadata",attachmentMetadataContainer:"attachment__metadata-container",attachmentName:"attachment__name",attachmentProgress:"attachment__progress",attachmentSize:"attachment__size",attachmentToolbar:"attachment__toolbar",attachmentGallery:"attachment-gallery"},dompurify:Lr,fileSize:Dr,input:bi,keyNames:{8:"backspace",9:"tab",13:"return",27:"escape",37:"left",39:"right",46:"delete",68:"d",72:"h",79:"o"},lang:m,parser:Me,textAttributes:It,toolbar:Fr,undo:$n}),R=class{static proxyMethod(t){let{name:e,toMethod:n,toProperty:r,optional:o}=Ao(t);this.prototype[e]=function(){let s,l;var c,u;return n?l=o?(c=this[n])===null||c===void 0?void 0:c.call(this):this[n]():r&&(l=this[r]),o?(s=(u=l)===null||u===void 0?void 0:u[e],s?Xi.call(s,l,arguments):void 0):(s=l[e],Xi.call(s,l,arguments))}}},Ao=function(i){let t=i.match(yo);if(!t)throw new Error("can't parse @proxyMethod expression: ".concat(i));let e={name:t[4]};return t[2]!=null?e.toMethod=t[1]:e.toProperty=t[1],t[3]!=null&&(e.optional=!0),e},{apply:Xi}=Function.prototype,yo=new RegExp("^(.+?)(\\(\\))?(\\?)?\\.(.+?)$"),Rn,Tn,wn,Ot=class extends R{static box(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return t instanceof this?t:this.fromUCS2String(t?.toString())}static fromUCS2String(t){return new this(t,Yn(t))}static fromCodepoints(t){return new this(Xn(t),t)}constructor(t,e){super(...arguments),this.ucs2String=t,this.codepoints=e,this.length=this.codepoints.length,this.ucs2Length=this.ucs2String.length}offsetToUCS2Offset(t){return Xn(this.codepoints.slice(0,Math.max(0,t))).length}offsetFromUCS2Offset(t){return Yn(this.ucs2String.slice(0,Math.max(0,t))).length}slice(){return this.constructor.fromCodepoints(this.codepoints.slice(...arguments))}charAt(t){return this.slice(t,t+1)}isEqualTo(t){return this.constructor.box(t).ucs2String===this.ucs2String}toJSON(){return this.ucs2String}getCacheKey(){return this.ucs2String}toString(){return this.ucs2String}},xo=((Rn=Array.from)===null||Rn===void 0?void 0:Rn.call(Array,"\u{1F47C}").length)===1,Co=((Tn=" ".codePointAt)===null||Tn===void 0?void 0:Tn.call(" ",0))!=null,Eo=((wn=String.fromCodePoint)===null||wn===void 0?void 0:wn.call(String,32,128124))===" \u{1F47C}",Yn,Xn;Yn=xo&&Co?i=>Array.from(i).map(t=>t.codePointAt(0)):function(i){let t=[],e=0,{length:n}=i;for(;eString.fromCodePoint(...Array.from(i||[])):function(i){return(()=>{let t=[];return Array.from(i).forEach(e=>{let n="";e>65535&&(e-=65536,n+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t.push(n+String.fromCharCode(e))}),t})().join("")};var So=0,dt=class extends R{static fromJSONString(t){return this.fromJSON(JSON.parse(t))}constructor(){super(...arguments),this.id=++So}hasSameConstructorAs(t){return this.constructor===t?.constructor}isEqualTo(t){return this===t}inspect(){let t=[],e=this.contentsForInspection()||{};for(let n in e){let r=e[n];t.push("".concat(n,"=").concat(r))}return"#<".concat(this.constructor.name,":").concat(this.id).concat(t.length?" ".concat(t.join(", ")):"",">")}contentsForInspection(){}toJSONString(){return JSON.stringify(this)}toUTF16String(){return Ot.box(this)}getCacheKey(){return this.id.toString()}},Ft=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(i.length!==t.length)return!1;for(let e=0;e1?e-1:0),r=1;r(Ln||(Ln=wo().concat(To())),Ln),L=i=>W[i],To=()=>(Dn||(Dn=Object.keys(W)),Dn),Qn=i=>It[i],wo=()=>(Nn||(Nn=Object.keys(It)),Nn),Pr=function(i,t){Lo(i).textContent=t.replace(/%t/g,i)},Lo=function(i){let t=document.createElement("style");t.setAttribute("type","text/css"),t.setAttribute("data-tag-name",i.toLowerCase());let e=Do();return e&&t.setAttribute("nonce",e),document.head.insertBefore(t,document.head.firstChild),t},Do=function(){let i=Zi("trix-csp-nonce")||Zi("csp-nonce");if(i){let{nonce:t,content:e}=i;return t==""?e:t}},Zi=i=>document.head.querySelector("meta[name=".concat(i,"]")),Qi={"application/x-trix-feature-detection":"test"},Mr=function(i){let t=i.getData("text/plain"),e=i.getData("text/html");if(!t||!e)return t?.length;{let{body:n}=new DOMParser().parseFromString(e,"text/html");if(n.textContent===t)return!n.querySelector("*")}},Br=/Mac|^iP/.test(navigator.platform)?i=>i.metaKey:i=>i.ctrlKey,Ai=i=>setTimeout(i,1),_r=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={};for(let e in i){let n=i[e];t[e]=n}return t},Xt=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Object.keys(i).length!==Object.keys(t).length)return!1;for(let e in i)if(i[e]!==t[e])return!1;return!0},y=function(i){if(i!=null)return Array.isArray(i)||(i=[i,i]),[tr(i[0]),tr(i[1]!=null?i[1]:i[0])]},ht=function(i){if(i==null)return;let[t,e]=y(i);return ti(t,e)},We=function(i,t){if(i==null||t==null)return;let[e,n]=y(i),[r,o]=y(t);return ti(e,r)&&ti(n,o)},tr=function(i){return typeof i=="number"?i:_r(i)},ti=function(i,t){return typeof i=="number"?i===t:Xt(i,t)},Ue=class extends R{constructor(){super(...arguments),this.update=this.update.bind(this),this.selectionManagers=[]}start(){this.started||(this.started=!0,document.addEventListener("selectionchange",this.update,!0))}stop(){if(this.started)return this.started=!1,document.removeEventListener("selectionchange",this.update,!0)}registerSelectionManager(t){if(!this.selectionManagers.includes(t))return this.selectionManagers.push(t),this.start()}unregisterSelectionManager(t){if(this.selectionManagers=this.selectionManagers.filter(e=>e!==t),this.selectionManagers.length===0)return this.stop()}notifySelectionManagersOfSelectionChange(){return this.selectionManagers.map(t=>t.selectionDidChange())}update(){this.notifySelectionManagersOfSelectionChange()}reset(){this.update()}},Pt=new Ue,jr=function(){let i=window.getSelection();if(i.rangeCount>0)return i},me=function(){var i;let t=(i=jr())===null||i===void 0?void 0:i.getRangeAt(0);if(t&&!No(t))return t},Wr=function(i){let t=window.getSelection();return t.removeAllRanges(),t.addRange(i),Pt.update()},No=i=>er(i.startContainer)||er(i.endContainer),er=i=>!Object.getPrototypeOf(i),ue=i=>i.replace(new RegExp("".concat(an),"g"),"").replace(new RegExp("".concat(bt),"g")," "),yi=new RegExp("[^\\S".concat(bt,"]")),xi=i=>i.replace(new RegExp("".concat(yi.source),"g")," ").replace(/\ {2,}/g," "),nr=function(i,t){if(i.isEqualTo(t))return["",""];let e=In(i,t),{length:n}=e.utf16String,r;if(n){let{offset:o}=e,s=i.codepoints.slice(0,o).concat(i.codepoints.slice(o+n));r=In(t,Ot.fromCodepoints(s))}else r=In(t,i);return[e.utf16String.toString(),r.utf16String.toString()]},In=function(i,t){let e=0,n=i.length,r=t.length;for(;ee+1&&i.charAt(n-1).isEqualTo(t.charAt(r-1));)n--,r--;return{utf16String:i.slice(e,n),offset:e}},U=class extends dt{static fromCommonAttributesOfObjects(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(!t.length)return new this;let e=re(t[0]),n=e.getKeys();return t.slice(1).forEach(r=>{n=e.getKeysCommonToHash(re(r)),e=e.slice(n)}),e}static box(t){return re(t)}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(...arguments),this.values=Be(t)}add(t,e){return this.merge(Io(t,e))}remove(t){return new U(Be(this.values,t))}get(t){return this.values[t]}has(t){return t in this.values}merge(t){return new U(Oo(this.values,Fo(t)))}slice(t){let e={};return Array.from(t).forEach(n=>{this.has(n)&&(e[n]=this.values[n])}),new U(e)}getKeys(){return Object.keys(this.values)}getKeysCommonToHash(t){return t=re(t),this.getKeys().filter(e=>this.values[e]===t.values[e])}isEqualTo(t){return Ft(this.toArray(),re(t).toArray())}isEmpty(){return this.getKeys().length===0}toArray(){if(!this.array){let t=[];for(let e in this.values){let n=this.values[e];t.push(t.push(e,n))}this.array=t.slice(0)}return this.array}toObject(){return Be(this.values)}toJSON(){return this.toObject()}contentsForInspection(){return{values:JSON.stringify(this.values)}}},Io=function(i,t){let e={};return e[i]=t,e},Oo=function(i,t){let e=Be(i);for(let n in t){let r=t[n];e[n]=r}return e},Be=function(i,t){let e={};return Object.keys(i).sort().forEach(n=>{n!==t&&(e[n]=i[n])}),e},re=function(i){return i instanceof U?i:new U(i)},Fo=function(i){return i instanceof U?i.values:i},fe=class{static groupObjects(){let t,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{depth:n,asTree:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};r&&n==null&&(n=0);let o=[];return Array.from(e).forEach(s=>{var l;if(t){var c,u,d;if((c=s.canBeGrouped)!==null&&c!==void 0&&c.call(s,n)&&(u=(d=t[t.length-1]).canBeGroupedWith)!==null&&u!==void 0&&u.call(d,s,n))return void t.push(s);o.push(new this(t,{depth:n,asTree:r})),t=null}(l=s.canBeGrouped)!==null&&l!==void 0&&l.call(s,n)?t=[s]:o.push(s)}),t&&o.push(new this(t,{depth:n,asTree:r})),o}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{depth:e,asTree:n}=arguments.length>1?arguments[1]:void 0;this.objects=t,n&&(this.depth=e,this.objects=this.constructor.groupObjects(this.objects,{asTree:n,depth:this.depth+1}))}getObjects(){return this.objects}getDepth(){return this.depth}getCacheKey(){let t=["objectGroup"];return Array.from(this.getObjects()).forEach(e=>{t.push(e.getCacheKey())}),t.join("/")}},ei=class extends R{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.objects={},Array.from(t).forEach(e=>{let n=JSON.stringify(e);this.objects[n]==null&&(this.objects[n]=e)})}find(t){let e=JSON.stringify(t);return this.objects[e]}},ni=class{constructor(t){this.reset(t)}add(t){let e=ir(t);this.elements[e]=t}remove(t){let e=ir(t),n=this.elements[e];if(n)return delete this.elements[e],n}reset(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return this.elements={},Array.from(t).forEach(e=>{this.add(e)}),t}},ir=i=>i.dataset.trixStoreKey,Jt=class extends R{isPerforming(){return this.performing===!0}hasPerformed(){return this.performed===!0}hasSucceeded(){return this.performed&&this.succeeded}hasFailed(){return this.performed&&!this.succeeded}getPromise(){return this.promise||(this.promise=new Promise((t,e)=>(this.performing=!0,this.perform((n,r)=>{this.succeeded=n,this.performing=!1,this.performed=!0,this.succeeded?t(r):e(r)})))),this.promise}perform(t){return t(!1)}release(){var t,e;(t=this.promise)===null||t===void 0||(e=t.cancel)===null||e===void 0||e.call(t),this.promise=null,this.performing=null,this.performed=null,this.succeeded=null}};Jt.proxyMethod("getPromise().then"),Jt.proxyMethod("getPromise().catch");var gt=class extends R{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.object=t,this.options=e,this.childViews=[],this.rootView=this}getNodes(){return this.nodes||(this.nodes=this.createNodes()),this.nodes.map(t=>t.cloneNode(!0))}invalidate(){var t;return this.nodes=null,this.childViews=[],(t=this.parentView)===null||t===void 0?void 0:t.invalidate()}invalidateViewForObject(t){var e;return(e=this.findViewForObject(t))===null||e===void 0?void 0:e.invalidate()}findOrCreateCachedChildView(t,e,n){let r=this.getCachedViewForObject(e);return r?this.recordChildView(r):(r=this.createChildView(...arguments),this.cacheViewForObject(r,e)),r}createChildView(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};e instanceof fe&&(n.viewClass=t,t=ii);let r=new t(e,n);return this.recordChildView(r)}recordChildView(t){return t.parentView=this,t.rootView=this.rootView,this.childViews.push(t),t}getAllChildViews(){let t=[];return this.childViews.forEach(e=>{t.push(e),t=t.concat(e.getAllChildViews())}),t}findElement(){return this.findElementForObject(this.object)}findElementForObject(t){let e=t?.id;if(e)return this.rootView.element.querySelector("[data-trix-id='".concat(e,"']"))}findViewForObject(t){for(let e of this.getAllChildViews())if(e.object===t)return e}getViewCache(){return this.rootView!==this?this.rootView.getViewCache():this.isViewCachingEnabled()?(this.viewCache||(this.viewCache={}),this.viewCache):void 0}isViewCachingEnabled(){return this.shouldCacheViews!==!1}enableViewCaching(){this.shouldCacheViews=!0}disableViewCaching(){this.shouldCacheViews=!1}getCachedViewForObject(t){var e;return(e=this.getViewCache())===null||e===void 0?void 0:e[t.getCacheKey()]}cacheViewForObject(t,e){let n=this.getViewCache();n&&(n[e.getCacheKey()]=t)}garbageCollectCachedViews(){let t=this.getViewCache();if(t){let e=this.getAllChildViews().concat(this).map(n=>n.object.getCacheKey());for(let n in t)e.includes(n)||delete t[n]}}},ii=class extends gt{constructor(){super(...arguments),this.objectGroup=this.object,this.viewClass=this.options.viewClass,delete this.options.viewClass}getChildViews(){return this.childViews.length||Array.from(this.objectGroup.getObjects()).forEach(t=>{this.findOrCreateCachedChildView(this.viewClass,t,this.options)}),this.childViews}createNodes(){let t=this.createContainerElement();return this.getChildViews().forEach(e=>{Array.from(e.getNodes()).forEach(n=>{t.appendChild(n)})}),[t]}createContainerElement(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.objectGroup.getDepth();return this.getChildViews()[0].createContainerElement(t)}};var{entries:Ur,setPrototypeOf:rr,isFrozen:Po,getPrototypeOf:Mo,getOwnPropertyDescriptor:Bo}=Object,{freeze:V,seal:Y,create:Vr}=Object,{apply:ri,construct:oi}=typeof Reflect<"u"&&Reflect;V||(V=function(i){return i}),Y||(Y=function(i){return i}),ri||(ri=function(i,t,e){return i.apply(t,e)}),oi||(oi=function(i,t){return new i(...t)});var Ne=G(Array.prototype.forEach),or=G(Array.prototype.pop),oe=G(Array.prototype.push),_e=G(String.prototype.toLowerCase),On=G(String.prototype.toString),sr=G(String.prototype.match),se=G(String.prototype.replace),_o=G(String.prototype.indexOf),jo=G(String.prototype.trim),X=G(Object.prototype.hasOwnProperty),_=G(RegExp.prototype.test),ae=(ar=TypeError,function(){for(var i=arguments.length,t=new Array(i),e=0;e1?e-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:_e;rr&&rr(i,null);let n=t.length;for(;n--;){let r=t[n];if(typeof r=="string"){let o=e(r);o!==r&&(Po(t)||(t[n]=o),r=o)}i[r]=!0}return i}function Wo(i){for(let t=0;t/gm),Ho=Y(/\$\{[\w\W]*}/gm),Jo=Y(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ko=Y(/^aria-[\-\w]+$/),zr=Y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Go=Y(/^(?:\w+script|data):/i),$o=Y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qr=Y(/^html$/i),Yo=Y(/^[a-z][.\w]*(-[.\w]+)+$/i),dr=Object.freeze({__proto__:null,ARIA_ATTR:Ko,ATTR_WHITESPACE:$o,CUSTOM_ELEMENT:Yo,DATA_ATTR:Jo,DOCTYPE_NAME:qr,ERB_EXPR:qo,IS_ALLOWED_URI:zr,IS_SCRIPT_OR_DATA:Go,MUSTACHE_EXPR:zo,TMPLIT_EXPR:Ho}),Xo=1,Zo=3,Qo=7,ts=8,es=9,ns=function(){return typeof window>"u"?null:window},si=function i(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ns(),e=a=>i(a);if(e.version="3.2.3",e.removed=[],!t||!t.document||t.document.nodeType!==es)return e.isSupported=!1,e;let{document:n}=t,r=n,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:l,Node:c,Element:u,NodeFilter:d,NamedNodeMap:C=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:T,DOMParser:H,trustedTypes:tt}=t,M=u.prototype,pt=le(M,"cloneNode"),Ct=le(M,"remove"),Zt=le(M,"nextSibling"),Qt=le(M,"childNodes"),F=le(M,"parentNode");if(typeof l=="function"){let a=n.createElement("template");a.content&&a.content.ownerDocument&&(n=a.content.ownerDocument)}let k,ot="",{implementation:Et,createNodeIterator:eo,createDocumentFragment:no,getElementsByTagName:io}=n,{importNode:ro}=r,J={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};e.isSupported=typeof Ur=="function"&&typeof F=="function"&&Et&&Et.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:cn,ERB_EXPR:un,TMPLIT_EXPR:hn,DATA_ATTR:oo,ARIA_ATTR:so,IS_SCRIPT_OR_DATA:ao,ATTR_WHITESPACE:Ei,CUSTOM_ELEMENT:lo}=dr,{IS_ALLOWED_URI:Si}=dr,N=null,ki=b({},[...lr,...Fn,...Pn,...Mn,...cr]),O=null,Ri=b({},[...ur,...Bn,...hr,...Ie]),w=Object.seal(Vr(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}})),te=null,dn=null,Ti=!0,gn=!0,wi=!1,Li=!0,Bt=!1,mn=!0,St=!1,pn=!1,fn=!1,_t=!1,Ee=!1,Se=!1,Di=!0,Ni=!1,bn=!0,ee=!1,jt={},Wt=null,Ii=b({},["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"]),Oi=null,Fi=b({},["audio","video","img","source","image","track"]),vn=null,Pi=b({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ke="http://www.w3.org/1998/Math/MathML",Re="http://www.w3.org/2000/svg",st="http://www.w3.org/1999/xhtml",Ut=st,An=!1,yn=null,co=b({},[ke,Re,st],On),Te=b({},["mi","mo","mn","ms","mtext"]),we=b({},["annotation-xml"]),uo=b({},["title","style","font","a","script"]),ne=null,ho=["application/xhtml+xml","text/html"],I=null,Vt=null,go=n.createElement("form"),Mi=function(a){return a instanceof RegExp||a instanceof Function},xn=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!Vt||Vt!==a){if(a&&typeof a=="object"||(a={}),a=Rt(a),ne=ho.indexOf(a.PARSER_MEDIA_TYPE)===-1?"text/html":a.PARSER_MEDIA_TYPE,I=ne==="application/xhtml+xml"?On:_e,N=X(a,"ALLOWED_TAGS")?b({},a.ALLOWED_TAGS,I):ki,O=X(a,"ALLOWED_ATTR")?b({},a.ALLOWED_ATTR,I):Ri,yn=X(a,"ALLOWED_NAMESPACES")?b({},a.ALLOWED_NAMESPACES,On):co,vn=X(a,"ADD_URI_SAFE_ATTR")?b(Rt(Pi),a.ADD_URI_SAFE_ATTR,I):Pi,Oi=X(a,"ADD_DATA_URI_TAGS")?b(Rt(Fi),a.ADD_DATA_URI_TAGS,I):Fi,Wt=X(a,"FORBID_CONTENTS")?b({},a.FORBID_CONTENTS,I):Ii,te=X(a,"FORBID_TAGS")?b({},a.FORBID_TAGS,I):{},dn=X(a,"FORBID_ATTR")?b({},a.FORBID_ATTR,I):{},jt=!!X(a,"USE_PROFILES")&&a.USE_PROFILES,Ti=a.ALLOW_ARIA_ATTR!==!1,gn=a.ALLOW_DATA_ATTR!==!1,wi=a.ALLOW_UNKNOWN_PROTOCOLS||!1,Li=a.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Bt=a.SAFE_FOR_TEMPLATES||!1,mn=a.SAFE_FOR_XML!==!1,St=a.WHOLE_DOCUMENT||!1,_t=a.RETURN_DOM||!1,Ee=a.RETURN_DOM_FRAGMENT||!1,Se=a.RETURN_TRUSTED_TYPE||!1,fn=a.FORCE_BODY||!1,Di=a.SANITIZE_DOM!==!1,Ni=a.SANITIZE_NAMED_PROPS||!1,bn=a.KEEP_CONTENT!==!1,ee=a.IN_PLACE||!1,Si=a.ALLOWED_URI_REGEXP||zr,Ut=a.NAMESPACE||st,Te=a.MATHML_TEXT_INTEGRATION_POINTS||Te,we=a.HTML_INTEGRATION_POINTS||we,w=a.CUSTOM_ELEMENT_HANDLING||{},a.CUSTOM_ELEMENT_HANDLING&&Mi(a.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(w.tagNameCheck=a.CUSTOM_ELEMENT_HANDLING.tagNameCheck),a.CUSTOM_ELEMENT_HANDLING&&Mi(a.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(w.attributeNameCheck=a.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),a.CUSTOM_ELEMENT_HANDLING&&typeof a.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(w.allowCustomizedBuiltInElements=a.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Bt&&(gn=!1),Ee&&(_t=!0),jt&&(N=b({},cr),O=[],jt.html===!0&&(b(N,lr),b(O,ur)),jt.svg===!0&&(b(N,Fn),b(O,Bn),b(O,Ie)),jt.svgFilters===!0&&(b(N,Pn),b(O,Bn),b(O,Ie)),jt.mathMl===!0&&(b(N,Mn),b(O,hr),b(O,Ie))),a.ADD_TAGS&&(N===ki&&(N=Rt(N)),b(N,a.ADD_TAGS,I)),a.ADD_ATTR&&(O===Ri&&(O=Rt(O)),b(O,a.ADD_ATTR,I)),a.ADD_URI_SAFE_ATTR&&b(vn,a.ADD_URI_SAFE_ATTR,I),a.FORBID_CONTENTS&&(Wt===Ii&&(Wt=Rt(Wt)),b(Wt,a.FORBID_CONTENTS,I)),bn&&(N["#text"]=!0),St&&b(N,["html","head","body"]),N.table&&(b(N,["tbody"]),delete te.tbody),a.TRUSTED_TYPES_POLICY){if(typeof a.TRUSTED_TYPES_POLICY.createHTML!="function")throw ae('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof a.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ae('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=a.TRUSTED_TYPES_POLICY,ot=k.createHTML("")}else k===void 0&&(k=function(g,h){if(typeof g!="object"||typeof g.createPolicy!="function")return null;let v=null,A="data-tt-policy-suffix";h&&h.hasAttribute(A)&&(v=h.getAttribute(A));let f="dompurify"+(v?"#"+v:"");try{return g.createPolicy(f,{createHTML:D=>D,createScriptURL:D=>D})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}}(tt,o)),k!==null&&typeof ot=="string"&&(ot=k.createHTML(""));V&&V(a),Vt=a}},Bi=b({},[...Fn,...Pn,...Uo]),_i=b({},[...Mn,...Vo]),et=function(a){oe(e.removed,{element:a});try{F(a).removeChild(a)}catch{Ct(a)}},Le=function(a,g){try{oe(e.removed,{attribute:g.getAttributeNode(a),from:g})}catch{oe(e.removed,{attribute:null,from:g})}if(g.removeAttribute(a),a==="is")if(_t||Ee)try{et(g)}catch{}else try{g.setAttribute(a,"")}catch{}},ji=function(a){let g=null,h=null;if(fn)a=""+a;else{let f=sr(a,/^[\r\n\t ]+/);h=f&&f[0]}ne==="application/xhtml+xml"&&Ut===st&&(a=''+a+"");let v=k?k.createHTML(a):a;if(Ut===st)try{g=new H().parseFromString(v,ne)}catch{}if(!g||!g.documentElement){g=Et.createDocument(Ut,"template",null);try{g.documentElement.innerHTML=An?ot:v}catch{}}let A=g.body||g.documentElement;return a&&h&&A.insertBefore(n.createTextNode(h),A.childNodes[0]||null),Ut===st?io.call(g,St?"html":"body")[0]:St?g.documentElement:A},Wi=function(a){return eo.call(a.ownerDocument||a,a,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Cn=function(a){return a instanceof T&&(typeof a.nodeName!="string"||typeof a.textContent!="string"||typeof a.removeChild!="function"||!(a.attributes instanceof C)||typeof a.removeAttribute!="function"||typeof a.setAttribute!="function"||typeof a.namespaceURI!="string"||typeof a.insertBefore!="function"||typeof a.hasChildNodes!="function")},Ui=function(a){return typeof c=="function"&&a instanceof c};function at(a,g,h){Ne(a,v=>{v.call(e,g,h,Vt)})}let Vi=function(a){let g=null;if(at(J.beforeSanitizeElements,a,null),Cn(a))return et(a),!0;let h=I(a.nodeName);if(at(J.uponSanitizeElement,a,{tagName:h,allowedTags:N}),a.hasChildNodes()&&!Ui(a.firstElementChild)&&_(/<[/\w]/g,a.innerHTML)&&_(/<[/\w]/g,a.textContent)||a.nodeType===Qo||mn&&a.nodeType===ts&&_(/<[/\w]/g,a.data))return et(a),!0;if(!N[h]||te[h]){if(!te[h]&&qi(h)&&(w.tagNameCheck instanceof RegExp&&_(w.tagNameCheck,h)||w.tagNameCheck instanceof Function&&w.tagNameCheck(h)))return!1;if(bn&&!Wt[h]){let v=F(a)||a.parentNode,A=Qt(a)||a.childNodes;if(A&&v)for(let f=A.length-1;f>=0;--f){let D=pt(A[f],!0);D.__removalCount=(a.__removalCount||0)+1,v.insertBefore(D,Zt(a))}}return et(a),!0}return a instanceof u&&!function(v){let A=F(v);A&&A.tagName||(A={namespaceURI:Ut,tagName:"template"});let f=_e(v.tagName),D=_e(A.tagName);return!!yn[v.namespaceURI]&&(v.namespaceURI===Re?A.namespaceURI===st?f==="svg":A.namespaceURI===ke?f==="svg"&&(D==="annotation-xml"||Te[D]):!!Bi[f]:v.namespaceURI===ke?A.namespaceURI===st?f==="math":A.namespaceURI===Re?f==="math"&&we[D]:!!_i[f]:v.namespaceURI===st?!(A.namespaceURI===Re&&!we[D])&&!(A.namespaceURI===ke&&!Te[D])&&!_i[f]&&(uo[f]||!Bi[f]):!(ne!=="application/xhtml+xml"||!yn[v.namespaceURI]))}(a)?(et(a),!0):h!=="noscript"&&h!=="noembed"&&h!=="noframes"||!_(/<\/no(script|embed|frames)/i,a.innerHTML)?(Bt&&a.nodeType===Zo&&(g=a.textContent,Ne([cn,un,hn],v=>{g=se(g,v," ")}),a.textContent!==g&&(oe(e.removed,{element:a.cloneNode()}),a.textContent=g)),at(J.afterSanitizeElements,a,null),!1):(et(a),!0)},zi=function(a,g,h){if(Di&&(g==="id"||g==="name")&&(h in n||h in go))return!1;if(!(gn&&!dn[g]&&_(oo,g))){if(!(Ti&&_(so,g))){if(!O[g]||dn[g]){if(!(qi(a)&&(w.tagNameCheck instanceof RegExp&&_(w.tagNameCheck,a)||w.tagNameCheck instanceof Function&&w.tagNameCheck(a))&&(w.attributeNameCheck instanceof RegExp&&_(w.attributeNameCheck,g)||w.attributeNameCheck instanceof Function&&w.attributeNameCheck(g))||g==="is"&&w.allowCustomizedBuiltInElements&&(w.tagNameCheck instanceof RegExp&&_(w.tagNameCheck,h)||w.tagNameCheck instanceof Function&&w.tagNameCheck(h))))return!1}else if(!vn[g]){if(!_(Si,se(h,Ei,""))){if((g!=="src"&&g!=="xlink:href"&&g!=="href"||a==="script"||_o(h,"data:")!==0||!Oi[a])&&!(wi&&!_(ao,se(h,Ei,"")))){if(h)return!1}}}}}return!0},qi=function(a){return a!=="annotation-xml"&&sr(a,lo)},Hi=function(a){at(J.beforeSanitizeAttributes,a,null);let{attributes:g}=a;if(!g||Cn(a))return;let h={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:O,forceKeepAttr:void 0},v=g.length;for(;v--;){let A=g[v],{name:f,namespaceURI:D,value:lt}=A,nt=I(f),B=f==="value"?lt:jo(lt);if(h.attrName=nt,h.attrValue=B,h.keepAttr=!0,h.forceKeepAttr=void 0,at(J.uponSanitizeAttribute,a,h),B=h.attrValue,!Ni||nt!=="id"&&nt!=="name"||(Le(f,a),B="user-content-"+B),mn&&_(/((--!?|])>)|<\/(style|title)/i,B)){Le(f,a);continue}if(h.forceKeepAttr||(Le(f,a),!h.keepAttr))continue;if(!Li&&_(/\/>/i,B)){Le(f,a);continue}Bt&&Ne([cn,un,hn],Ki=>{B=se(B,Ki," ")});let Ji=I(a.nodeName);if(zi(Ji,nt,B)){if(k&&typeof tt=="object"&&typeof tt.getAttributeType=="function"&&!D)switch(tt.getAttributeType(Ji,nt)){case"TrustedHTML":B=k.createHTML(B);break;case"TrustedScriptURL":B=k.createScriptURL(B)}try{D?a.setAttributeNS(D,f,B):a.setAttribute(f,B),Cn(a)?et(a):or(e.removed)}catch{}}}at(J.afterSanitizeAttributes,a,null)},mo=function a(g){let h=null,v=Wi(g);for(at(J.beforeSanitizeShadowDOM,g,null);h=v.nextNode();)at(J.uponSanitizeShadowNode,h,null),Vi(h),Hi(h),h.content instanceof s&&a(h.content);at(J.afterSanitizeShadowDOM,g,null)};return e.sanitize=function(a){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=null,v=null,A=null,f=null;if(An=!a,An&&(a=""),typeof a!="string"&&!Ui(a)){if(typeof a.toString!="function")throw ae("toString is not a function");if(typeof(a=a.toString())!="string")throw ae("dirty is not a string, aborting")}if(!e.isSupported)return a;if(pn||xn(g),e.removed=[],typeof a=="string"&&(ee=!1),ee){if(a.nodeName){let nt=I(a.nodeName);if(!N[nt]||te[nt])throw ae("root node is forbidden and cannot be sanitized in-place")}}else if(a instanceof c)h=ji(""),v=h.ownerDocument.importNode(a,!0),v.nodeType===Xo&&v.nodeName==="BODY"||v.nodeName==="HTML"?h=v:h.appendChild(v);else{if(!_t&&!Bt&&!St&&a.indexOf("<")===-1)return k&&Se?k.createHTML(a):a;if(h=ji(a),!h)return _t?null:Se?ot:""}h&&fn&&et(h.firstChild);let D=Wi(ee?a:h);for(;A=D.nextNode();)Vi(A),Hi(A),A.content instanceof s&&mo(A.content);if(ee)return a;if(_t){if(Ee)for(f=no.call(h.ownerDocument);h.firstChild;)f.appendChild(h.firstChild);else f=h;return(O.shadowroot||O.shadowrootmode)&&(f=ro.call(r,f,!0)),f}let lt=St?h.outerHTML:h.innerHTML;return St&&N["!doctype"]&&h.ownerDocument&&h.ownerDocument.doctype&&h.ownerDocument.doctype.name&&_(qr,h.ownerDocument.doctype.name)&&(lt=" -`+lt),Bt&&Ne([cn,un,hn],nt=>{lt=se(lt,nt," ")}),k&&Se?k.createHTML(lt):lt},e.setConfig=function(){xn(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),pn=!0},e.clearConfig=function(){Vt=null,pn=!1},e.isValidAttribute=function(a,g,h){Vt||xn({});let v=I(a),A=I(g);return zi(v,A,h)},e.addHook=function(a,g){typeof g=="function"&&oe(J[a],g)},e.removeHook=function(a){return or(J[a])},e.removeHooks=function(a){J[a]=[]},e.removeAllHooks=function(){J={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},e}();si.addHook("uponSanitizeAttribute",function(i,t){/^data-trix-/.test(t.attrName)&&(t.forceKeepAttr=!0)});var is="style href src width height language class".split(" "),rs="javascript:".split(" "),os="script iframe form noscript".split(" "),Kt=class extends R{static setHTML(t,e){let n=new this(e).sanitize(),r=n.getHTML?n.getHTML():n.outerHTML;t.innerHTML=r}static sanitize(t,e){let n=new this(t,e);return n.sanitize(),n}constructor(t){let{allowedAttributes:e,forbiddenProtocols:n,forbiddenElements:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.allowedAttributes=e||is,this.forbiddenProtocols=n||rs,this.forbiddenElements=r||os,this.body=ss(t)}sanitize(){return this.sanitizeElements(),this.normalizeListElementNesting(),si.setConfig(Lr),this.body=si.sanitize(this.body),this.body}getHTML(){return this.body.innerHTML}getBody(){return this.body}sanitizeElements(){let t=je(this.body),e=[];for(;t.nextNode();){let n=t.currentNode;switch(n.nodeType){case Node.ELEMENT_NODE:this.elementIsRemovable(n)?e.push(n):this.sanitizeElement(n);break;case Node.COMMENT_NODE:e.push(n)}}return e.forEach(n=>At(n)),this.body}sanitizeElement(t){return t.hasAttribute("href")&&this.forbiddenProtocols.includes(t.protocol)&&t.removeAttribute("href"),Array.from(t.attributes).forEach(e=>{let{name:n}=e;this.allowedAttributes.includes(n)||n.indexOf("data-trix")===0||t.removeAttribute(n)}),t}normalizeListElementNesting(){return Array.from(this.body.querySelectorAll("ul,ol")).forEach(t=>{let e=t.previousElementSibling;e&&j(e)==="li"&&e.appendChild(t)}),this.body}elementIsRemovable(t){if(t?.nodeType===Node.ELEMENT_NODE)return this.elementIsForbidden(t)||this.elementIsntSerializable(t)}elementIsForbidden(t){return this.forbiddenElements.includes(j(t))}elementIsntSerializable(t){return t.getAttribute("data-trix-serialize")==="false"&&!Lt(t)}},ss=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";i=i.replace(/<\/html[^>]*>[^]*$/i,"");let t=document.implementation.createHTMLDocument("");return t.documentElement.innerHTML=i,Array.from(t.head.querySelectorAll("style")).forEach(e=>{t.body.appendChild(e)}),t.body},{css:ft}=Ce,be=class extends gt{constructor(){super(...arguments),this.attachment=this.object,this.attachment.uploadProgressDelegate=this,this.attachmentPiece=this.options.piece}createContentNodes(){return[]}createNodes(){let t,e=t=p({tagName:"figure",className:this.getClassName(),data:this.getData(),editable:!1}),n=this.getHref();return n&&(t=p({tagName:"a",editable:!1,attributes:{href:n,tabindex:-1}}),e.appendChild(t)),this.attachment.hasContent()?Kt.setHTML(t,this.attachment.getContent()):this.createContentNodes().forEach(r=>{t.appendChild(r)}),t.appendChild(this.createCaptionElement()),this.attachment.isPending()&&(this.progressElement=p({tagName:"progress",attributes:{class:ft.attachmentProgress,value:this.attachment.getUploadProgress(),max:100},data:{trixMutable:!0,trixStoreKey:["progressElement",this.attachment.id].join("/")}}),e.appendChild(this.progressElement)),[gr("left"),e,gr("right")]}createCaptionElement(){let t=p({tagName:"figcaption",className:ft.attachmentCaption}),e=this.attachmentPiece.getCaption();if(e)t.classList.add("".concat(ft.attachmentCaption,"--edited")),t.textContent=e;else{let n,r,o=this.getCaptionConfig();if(o.name&&(n=this.attachment.getFilename()),o.size&&(r=this.attachment.getFormattedFilesize()),n){let s=p({tagName:"span",className:ft.attachmentName,textContent:n});t.appendChild(s)}if(r){n&&t.appendChild(document.createTextNode(" "));let s=p({tagName:"span",className:ft.attachmentSize,textContent:r});t.appendChild(s)}}return t}getClassName(){let t=[ft.attachment,"".concat(ft.attachment,"--").concat(this.attachment.getType())],e=this.attachment.getExtension();return e&&t.push("".concat(ft.attachment,"--").concat(e)),t.join(" ")}getData(){let t={trixAttachment:JSON.stringify(this.attachment),trixContentType:this.attachment.getContentType(),trixId:this.attachment.id},{attributes:e}=this.attachmentPiece;return e.isEmpty()||(t.trixAttributes=JSON.stringify(e)),this.attachment.isPending()&&(t.trixSerialize=!1),t}getHref(){if(!as(this.attachment.getContent(),"a"))return this.attachment.getHref()}getCaptionConfig(){var t;let e=this.attachment.getType(),n=_r((t=mi[e])===null||t===void 0?void 0:t.caption);return e==="file"&&(n.name=!0),n}findProgressElement(){var t;return(t=this.findElement())===null||t===void 0?void 0:t.querySelector("progress")}attachmentDidChangeUploadProgress(){let t=this.attachment.getUploadProgress(),e=this.findProgressElement();e&&(e.value=t)}},gr=i=>p({tagName:"span",textContent:an,data:{trixCursorTarget:i,trixSerialize:!1}}),as=function(i,t){let e=p("div");return Kt.setHTML(e,i||""),e.querySelector(t)},Ve=class extends be{constructor(){super(...arguments),this.attachment.previewDelegate=this}createContentNodes(){return this.image=p({tagName:"img",attributes:{src:""},data:{trixMutable:!0}}),this.refresh(this.image),[this.image]}createCaptionElement(){let t=super.createCaptionElement(...arguments);return t.textContent||t.setAttribute("data-trix-placeholder",m.captionPlaceholder),t}refresh(t){var e;if(t||(t=(e=this.findElement())===null||e===void 0?void 0:e.querySelector("img")),t)return this.updateAttributesForImage(t)}updateAttributesForImage(t){let e=this.attachment.getURL(),n=this.attachment.getPreviewURL();if(t.src=n||e,n===e)t.removeAttribute("data-trix-serialized-attributes");else{let l=JSON.stringify({src:e});t.setAttribute("data-trix-serialized-attributes",l)}let r=this.attachment.getWidth(),o=this.attachment.getHeight();r!=null&&(t.width=r),o!=null&&(t.height=o);let s=["imageElement",this.attachment.id,t.src,t.width,t.height].join("/");t.dataset.trixStoreKey=s}attachmentDidChangeAttributes(){return this.refresh(this.image),this.refresh()}},ze=class extends gt{constructor(){super(...arguments),this.piece=this.object,this.attributes=this.piece.getAttributes(),this.textConfig=this.options.textConfig,this.context=this.options.context,this.piece.attachment?this.attachment=this.piece.attachment:this.string=this.piece.toString()}createNodes(){let t=this.attachment?this.createAttachmentNodes():this.createStringNodes(),e=this.createElement();if(e){let n=function(r){for(;(o=r)!==null&&o!==void 0&&o.firstElementChild;){var o;r=r.firstElementChild}return r}(e);Array.from(t).forEach(r=>{n.appendChild(r)}),t=[e]}return t}createAttachmentNodes(){let t=this.attachment.isPreviewable()?Ve:be;return this.createChildView(t,this.piece.attachment,{piece:this.piece}).getNodes()}createStringNodes(){var t;if((t=this.textConfig)!==null&&t!==void 0&&t.plaintext)return[document.createTextNode(this.string)];{let e=[],n=this.string.split(` -`);for(let r=0;r0){let s=p("br");e.push(s)}if(o.length){let s=document.createTextNode(this.preserveSpaces(o));e.push(s)}}return e}}createElement(){let t,e,n,r={};for(e in this.attributes){n=this.attributes[e];let s=Qn(e);if(s){if(s.tagName){var o;let l=p(s.tagName);o?(o.appendChild(l),o=l):t=o=l}if(s.styleProperty&&(r[s.styleProperty]=n),s.style)for(e in s.style)n=s.style[e],r[e]=n}}if(Object.keys(r).length)for(e in t||(t=p("span")),r)n=r[e],t.style[e]=n;return t}createContainerElement(){for(let t in this.attributes){let e=this.attributes[t],n=Qn(t);if(n&&n.groupTagName){let r={};return r[t]=e,p(n.groupTagName,r)}}}preserveSpaces(t){return this.context.isLast&&(t=t.replace(/\ $/,bt)),t=t.replace(/(\S)\ {3}(\S)/g,"$1 ".concat(bt," $2")).replace(/\ {2}/g,"".concat(bt," ")).replace(/\ {2}/g," ".concat(bt)),(this.context.isFirst||this.context.followsWhitespace)&&(t=t.replace(/^\ /,bt)),t}},qe=class extends gt{constructor(){super(...arguments),this.text=this.object,this.textConfig=this.options.textConfig}createNodes(){let t=[],e=fe.groupObjects(this.getPieces()),n=e.length-1;for(let o=0;o!t.hasAttribute("blockBreak"))}},ls=i=>/\s$/.test(i?.toString()),{css:mr}=Ce,He=class extends gt{constructor(){super(...arguments),this.block=this.object,this.attributes=this.block.getAttributes()}createNodes(){let t=[document.createComment("block")];if(this.block.isEmpty())t.push(p("br"));else{var e;let n=(e=L(this.block.getLastAttribute()))===null||e===void 0?void 0:e.text,r=this.findOrCreateCachedChildView(qe,this.block.text,{textConfig:n});t.push(...Array.from(r.getNodes()||[])),this.shouldAddExtraNewlineElement()&&t.push(p("br"))}if(this.attributes.length)return t;{let n,{tagName:r}=W.default;this.block.isRTL()&&(n={dir:"rtl"});let o=p({tagName:r,attributes:n});return t.forEach(s=>o.appendChild(s)),[o]}}createContainerElement(t){let e={},n,r=this.attributes[t],{tagName:o,htmlAttributes:s=[]}=L(r);if(t===0&&this.block.isRTL()&&Object.assign(e,{dir:"rtl"}),r==="attachmentGallery"){let l=this.block.getBlockBreakPosition();n="".concat(mr.attachmentGallery," ").concat(mr.attachmentGallery,"--").concat(l)}return Object.entries(this.block.htmlAttributes).forEach(l=>{let[c,u]=l;s.includes(c)&&(e[c]=u)}),p({tagName:o,className:n,attributes:e})}shouldAddExtraNewlineElement(){return/\n\n$/.test(this.block.toString())}},Gt=class extends gt{static render(t){let e=p("div"),n=new this(t,{element:e});return n.render(),n.sync(),e}constructor(){super(...arguments),this.element=this.options.element,this.elementStore=new ni,this.setDocument(this.object)}setDocument(t){t.isEqualTo(this.document)||(this.document=this.object=t)}render(){if(this.childViews=[],this.shadowElement=p("div"),!this.document.isEmpty()){let t=fe.groupObjects(this.document.getBlocks(),{asTree:!0});Array.from(t).forEach(e=>{let n=this.findOrCreateCachedChildView(He,e);Array.from(n.getNodes()).map(r=>this.shadowElement.appendChild(r))})}}isSynced(){return cs(this.shadowElement,this.element)}sync(){let t=this.createDocumentFragmentForSync();for(;this.element.lastChild;)this.element.removeChild(this.element.lastChild);return this.element.appendChild(t),this.didSync()}didSync(){return this.elementStore.reset(pr(this.element)),Ai(()=>this.garbageCollectCachedViews())}createDocumentFragmentForSync(){let t=document.createDocumentFragment();return Array.from(this.shadowElement.childNodes).forEach(e=>{t.appendChild(e.cloneNode(!0))}),Array.from(pr(t)).forEach(e=>{let n=this.elementStore.remove(e);n&&e.parentNode.replaceChild(n,e)}),t}},pr=i=>i.querySelectorAll("[data-trix-store-key]"),cs=(i,t)=>fr(i.innerHTML)===fr(t.innerHTML),fr=i=>i.replace(/ /g," ");function Oe(i){var t,e;function n(o,s){try{var l=i[o](s),c=l.value,u=c instanceof us;Promise.resolve(u?c.v:c).then(function(d){if(u){var C=o==="return"?"return":"next";if(!c.k||d.done)return n(C,d);d=i[C](d).value}r(l.done?"return":"normal",d)},function(d){n("throw",d)})}catch(d){r("throw",d)}}function r(o,s){switch(o){case"return":t.resolve({value:s,done:!0});break;case"throw":t.reject(s);break;default:t.resolve({value:s,done:!1})}(t=t.next)?n(t.key,t.arg):e=null}this._invoke=function(o,s){return new Promise(function(l,c){var u={key:o,arg:s,resolve:l,reject:c,next:null};e?e=e.next=u:(t=e=u,n(o,s))})},typeof i.return!="function"&&(this.return=void 0)}function us(i,t){this.v=i,this.k=t}function q(i,t,e){return(t=hs(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function hs(i){var t=function(e,n){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,n||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}(i,"string");return typeof t=="symbol"?t:String(t)}Oe.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Oe.prototype.next=function(i){return this._invoke("next",i)},Oe.prototype.throw=function(i){return this._invoke("throw",i)},Oe.prototype.return=function(i){return this._invoke("return",i)};function x(i,t){return ds(i,Hr(i,t,"get"))}function Ci(i,t,e){return gs(i,Hr(i,t,"set"),e),e}function Hr(i,t,e){if(!t.has(i))throw new TypeError("attempted to "+e+" private field on non-instance");return t.get(i)}function ds(i,t){return t.get?t.get.call(i):t.value}function gs(i,t,e){if(t.set)t.set.call(i,e);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=e}}function Fe(i,t,e){if(!t.has(i))throw new TypeError("attempted to get private field on non-instance");return e}function Jr(i,t){if(t.has(i))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pe(i,t,e){Jr(i,t),t.set(i,e)}var mt=class extends dt{static registerType(t,e){e.type=t,this.types[t]=e}static fromJSON(t){let e=this.types[t.type];if(e)return e.fromJSON(t)}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.attributes=U.box(e)}copyWithAttributes(t){return new this.constructor(this.getValue(),t)}copyWithAdditionalAttributes(t){return this.copyWithAttributes(this.attributes.merge(t))}copyWithoutAttribute(t){return this.copyWithAttributes(this.attributes.remove(t))}copy(){return this.copyWithAttributes(this.attributes)}getAttribute(t){return this.attributes.get(t)}getAttributesHash(){return this.attributes}getAttributes(){return this.attributes.toObject()}hasAttribute(t){return this.attributes.has(t)}hasSameStringValueAsPiece(t){return t&&this.toString()===t.toString()}hasSameAttributesAsPiece(t){return t&&(this.attributes===t.attributes||this.attributes.isEqualTo(t.attributes))}isBlockBreak(){return!1}isEqualTo(t){return super.isEqualTo(...arguments)||this.hasSameConstructorAs(t)&&this.hasSameStringValueAsPiece(t)&&this.hasSameAttributesAsPiece(t)}isEmpty(){return this.length===0}isSerializable(){return!0}toJSON(){return{type:this.constructor.type,attributes:this.getAttributes()}}contentsForInspection(){return{type:this.constructor.type,attributes:this.attributes.inspect()}}canBeGrouped(){return this.hasAttribute("href")}canBeGroupedWith(t){return this.getAttribute("href")===t.getAttribute("href")}getLength(){return this.length}canBeConsolidatedWith(t){return!1}};q(mt,"types",{});var Je=class extends Jt{constructor(t){super(...arguments),this.url=t}perform(t){let e=new Image;e.onload=()=>(e.width=this.width=e.naturalWidth,e.height=this.height=e.naturalHeight,t(!0,e)),e.onerror=()=>t(!1),e.src=this.url}},yt=class extends dt{static attachmentForFile(t){let e=new this(this.attributesForFile(t));return e.setFile(t),e}static attributesForFile(t){return new U({filename:t.name,filesize:t.size,contentType:t.type})}static fromJSON(t){return new this(t)}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(t),this.releaseFile=this.releaseFile.bind(this),this.attributes=U.box(t),this.didChangeAttributes()}getAttribute(t){return this.attributes.get(t)}hasAttribute(t){return this.attributes.has(t)}getAttributes(){return this.attributes.toObject()}setAttributes(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=this.attributes.merge(t);var n,r,o,s;if(!this.attributes.isEqualTo(e))return this.attributes=e,this.didChangeAttributes(),(n=this.previewDelegate)===null||n===void 0||(r=n.attachmentDidChangeAttributes)===null||r===void 0||r.call(n,this),(o=this.delegate)===null||o===void 0||(s=o.attachmentDidChangeAttributes)===null||s===void 0?void 0:s.call(o,this)}didChangeAttributes(){if(this.isPreviewable())return this.preloadURL()}isPending(){return this.file!=null&&!(this.getURL()||this.getHref())}isPreviewable(){return this.attributes.has("previewable")?this.attributes.get("previewable"):yt.previewablePattern.test(this.getContentType())}getType(){return this.hasContent()?"content":this.isPreviewable()?"preview":"file"}getURL(){return this.attributes.get("url")}getHref(){return this.attributes.get("href")}getFilename(){return this.attributes.get("filename")||""}getFilesize(){return this.attributes.get("filesize")}getFormattedFilesize(){let t=this.attributes.get("filesize");return typeof t=="number"?Dr.formatter(t):""}getExtension(){var t;return(t=this.getFilename().match(/\.(\w+)$/))===null||t===void 0?void 0:t[1].toLowerCase()}getContentType(){return this.attributes.get("contentType")}hasContent(){return this.attributes.has("content")}getContent(){return this.attributes.get("content")}getWidth(){return this.attributes.get("width")}getHeight(){return this.attributes.get("height")}getFile(){return this.file}setFile(t){if(this.file=t,this.isPreviewable())return this.preloadFile()}releaseFile(){this.releasePreloadedFile(),this.file=null}getUploadProgress(){return this.uploadProgress!=null?this.uploadProgress:0}setUploadProgress(t){var e,n;if(this.uploadProgress!==t)return this.uploadProgress=t,(e=this.uploadProgressDelegate)===null||e===void 0||(n=e.attachmentDidChangeUploadProgress)===null||n===void 0?void 0:n.call(e,this)}toJSON(){return this.getAttributes()}getCacheKey(){return[super.getCacheKey(...arguments),this.attributes.getCacheKey(),this.getPreviewURL()].join("/")}getPreviewURL(){return this.previewURL||this.preloadingURL}setPreviewURL(t){var e,n,r,o;if(t!==this.getPreviewURL())return this.previewURL=t,(e=this.previewDelegate)===null||e===void 0||(n=e.attachmentDidChangeAttributes)===null||n===void 0||n.call(e,this),(r=this.delegate)===null||r===void 0||(o=r.attachmentDidChangePreviewURL)===null||o===void 0?void 0:o.call(r,this)}preloadURL(){return this.preload(this.getURL(),this.releaseFile)}preloadFile(){if(this.file)return this.fileObjectURL=URL.createObjectURL(this.file),this.preload(this.fileObjectURL)}releasePreloadedFile(){this.fileObjectURL&&(URL.revokeObjectURL(this.fileObjectURL),this.fileObjectURL=null)}preload(t,e){if(t&&t!==this.getPreviewURL())return this.preloadingURL=t,new Je(t).then(n=>{let{width:r,height:o}=n;return this.getWidth()&&this.getHeight()||this.setAttributes({width:r,height:o}),this.preloadingURL=null,this.setPreviewURL(t),e?.()}).catch(()=>(this.preloadingURL=null,e?.()))}};q(yt,"previewablePattern",/^image(\/(gif|png|webp|jpe?g)|$)/);var xt=class extends mt{static fromJSON(t){return new this(yt.fromJSON(t.attachment),t.attributes)}constructor(t){super(...arguments),this.attachment=t,this.length=1,this.ensureAttachmentExclusivelyHasAttribute("href"),this.attachment.hasContent()||this.removeProhibitedAttributes()}ensureAttachmentExclusivelyHasAttribute(t){this.hasAttribute(t)&&(this.attachment.hasAttribute(t)||this.attachment.setAttributes(this.attributes.slice([t])),this.attributes=this.attributes.remove(t))}removeProhibitedAttributes(){let t=this.attributes.slice(xt.permittedAttributes);t.isEqualTo(this.attributes)||(this.attributes=t)}getValue(){return this.attachment}isSerializable(){return!this.attachment.isPending()}getCaption(){return this.attributes.get("caption")||""}isEqualTo(t){var e;return super.isEqualTo(t)&&this.attachment.id===(t==null||(e=t.attachment)===null||e===void 0?void 0:e.id)}toString(){return"\uFFFC"}toJSON(){let t=super.toJSON(...arguments);return t.attachment=this.attachment,t}getCacheKey(){return[super.getCacheKey(...arguments),this.attachment.getCacheKey()].join("/")}toConsole(){return JSON.stringify(this.toString())}};q(xt,"permittedAttributes",["caption","presentation"]),mt.registerType("attachment",xt);var ve=class extends mt{static fromJSON(t){return new this(t.string,t.attributes)}constructor(t){super(...arguments),this.string=(e=>e.replace(/\r\n?/g,` +
`)},Yn={interval:5e3},Ce=Object.freeze({__proto__:null,attachments:mi,blockAttributes:W,browser:xe,css:{attachment:"attachment",attachmentCaption:"attachment__caption",attachmentCaptionEditor:"attachment__caption-editor",attachmentMetadata:"attachment__metadata",attachmentMetadataContainer:"attachment__metadata-container",attachmentName:"attachment__name",attachmentProgress:"attachment__progress",attachmentSize:"attachment__size",attachmentToolbar:"attachment__toolbar",attachmentGallery:"attachment-gallery"},dompurify:Lr,fileSize:Dr,input:bi,keyNames:{8:"backspace",9:"tab",13:"return",27:"escape",37:"left",39:"right",46:"delete",68:"d",72:"h",79:"o"},lang:m,parser:Me,textAttributes:It,toolbar:Fr,undo:Yn}),R=class{static proxyMethod(t){let{name:e,toMethod:n,toProperty:r,optional:o}=Ao(t);this.prototype[e]=function(){let s,l;var c,u;return n?l=o?(c=this[n])===null||c===void 0?void 0:c.call(this):this[n]():r&&(l=this[r]),o?(s=(u=l)===null||u===void 0?void 0:u[e],s?Xi.call(s,l,arguments):void 0):(s=l[e],Xi.call(s,l,arguments))}}},Ao=function(i){let t=i.match(yo);if(!t)throw new Error("can't parse @proxyMethod expression: ".concat(i));let e={name:t[4]};return t[2]!=null?e.toMethod=t[1]:e.toProperty=t[1],t[3]!=null&&(e.optional=!0),e},{apply:Xi}=Function.prototype,yo=new RegExp("^(.+?)(\\(\\))?(\\?)?\\.(.+?)$"),Tn,wn,Ln,Ot=class extends R{static box(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return t instanceof this?t:this.fromUCS2String(t?.toString())}static fromUCS2String(t){return new this(t,Xn(t))}static fromCodepoints(t){return new this(Zn(t),t)}constructor(t,e){super(...arguments),this.ucs2String=t,this.codepoints=e,this.length=this.codepoints.length,this.ucs2Length=this.ucs2String.length}offsetToUCS2Offset(t){return Zn(this.codepoints.slice(0,Math.max(0,t))).length}offsetFromUCS2Offset(t){return Xn(this.ucs2String.slice(0,Math.max(0,t))).length}slice(){return this.constructor.fromCodepoints(this.codepoints.slice(...arguments))}charAt(t){return this.slice(t,t+1)}isEqualTo(t){return this.constructor.box(t).ucs2String===this.ucs2String}toJSON(){return this.ucs2String}getCacheKey(){return this.ucs2String}toString(){return this.ucs2String}},xo=((Tn=Array.from)===null||Tn===void 0?void 0:Tn.call(Array,"\u{1F47C}").length)===1,Co=((wn=" ".codePointAt)===null||wn===void 0?void 0:wn.call(" ",0))!=null,Eo=((Ln=String.fromCodePoint)===null||Ln===void 0?void 0:Ln.call(String,32,128124))===" \u{1F47C}",Xn,Zn;Xn=xo&&Co?i=>Array.from(i).map(t=>t.codePointAt(0)):function(i){let t=[],e=0,{length:n}=i;for(;eString.fromCodePoint(...Array.from(i||[])):function(i){return(()=>{let t=[];return Array.from(i).forEach(e=>{let n="";e>65535&&(e-=65536,n+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t.push(n+String.fromCharCode(e))}),t})().join("")};var So=0,dt=class extends R{static fromJSONString(t){return this.fromJSON(JSON.parse(t))}constructor(){super(...arguments),this.id=++So}hasSameConstructorAs(t){return this.constructor===t?.constructor}isEqualTo(t){return this===t}inspect(){let t=[],e=this.contentsForInspection()||{};for(let n in e){let r=e[n];t.push("".concat(n,"=").concat(r))}return"#<".concat(this.constructor.name,":").concat(this.id).concat(t.length?" ".concat(t.join(", ")):"",">")}contentsForInspection(){}toJSONString(){return JSON.stringify(this)}toUTF16String(){return Ot.box(this)}getCacheKey(){return this.id.toString()}},Ft=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(i.length!==t.length)return!1;for(let e=0;e1?e-1:0),r=1;r(Dn||(Dn=wo().concat(To())),Dn),L=i=>W[i],To=()=>(Nn||(Nn=Object.keys(W)),Nn),ti=i=>It[i],wo=()=>(In||(In=Object.keys(It)),In),Pr=function(i,t){Lo(i).textContent=t.replace(/%t/g,i)},Lo=function(i){let t=document.createElement("style");t.setAttribute("type","text/css"),t.setAttribute("data-tag-name",i.toLowerCase());let e=Do();return e&&t.setAttribute("nonce",e),document.head.insertBefore(t,document.head.firstChild),t},Do=function(){let i=Zi("trix-csp-nonce")||Zi("csp-nonce");if(i){let{nonce:t,content:e}=i;return t==""?e:t}},Zi=i=>document.head.querySelector("meta[name=".concat(i,"]")),Qi={"application/x-trix-feature-detection":"test"},Mr=function(i){let t=i.getData("text/plain"),e=i.getData("text/html");if(!t||!e)return t?.length;{let{body:n}=new DOMParser().parseFromString(e,"text/html");if(n.textContent===t)return!n.querySelector("*")}},Br=/Mac|^iP/.test(navigator.platform)?i=>i.metaKey:i=>i.ctrlKey,Ai=i=>setTimeout(i,1),_r=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={};for(let e in i){let n=i[e];t[e]=n}return t},Xt=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Object.keys(i).length!==Object.keys(t).length)return!1;for(let e in i)if(i[e]!==t[e])return!1;return!0},y=function(i){if(i!=null)return Array.isArray(i)||(i=[i,i]),[tr(i[0]),tr(i[1]!=null?i[1]:i[0])]},ht=function(i){if(i==null)return;let[t,e]=y(i);return ei(t,e)},We=function(i,t){if(i==null||t==null)return;let[e,n]=y(i),[r,o]=y(t);return ei(e,r)&&ei(n,o)},tr=function(i){return typeof i=="number"?i:_r(i)},ei=function(i,t){return typeof i=="number"?i===t:Xt(i,t)},Ue=class extends R{constructor(){super(...arguments),this.update=this.update.bind(this),this.selectionManagers=[]}start(){this.started||(this.started=!0,document.addEventListener("selectionchange",this.update,!0))}stop(){if(this.started)return this.started=!1,document.removeEventListener("selectionchange",this.update,!0)}registerSelectionManager(t){if(!this.selectionManagers.includes(t))return this.selectionManagers.push(t),this.start()}unregisterSelectionManager(t){if(this.selectionManagers=this.selectionManagers.filter(e=>e!==t),this.selectionManagers.length===0)return this.stop()}notifySelectionManagersOfSelectionChange(){return this.selectionManagers.map(t=>t.selectionDidChange())}update(){this.notifySelectionManagersOfSelectionChange()}reset(){this.update()}},Pt=new Ue,jr=function(){let i=window.getSelection();if(i.rangeCount>0)return i},me=function(){var i;let t=(i=jr())===null||i===void 0?void 0:i.getRangeAt(0);if(t&&!No(t))return t},Wr=function(i){let t=window.getSelection();return t.removeAllRanges(),t.addRange(i),Pt.update()},No=i=>er(i.startContainer)||er(i.endContainer),er=i=>!Object.getPrototypeOf(i),ue=i=>i.replace(new RegExp("".concat(ln),"g"),"").replace(new RegExp("".concat(bt),"g")," "),yi=new RegExp("[^\\S".concat(bt,"]")),xi=i=>i.replace(new RegExp("".concat(yi.source),"g")," ").replace(/\ {2,}/g," "),nr=function(i,t){if(i.isEqualTo(t))return["",""];let e=On(i,t),{length:n}=e.utf16String,r;if(n){let{offset:o}=e,s=i.codepoints.slice(0,o).concat(i.codepoints.slice(o+n));r=On(t,Ot.fromCodepoints(s))}else r=On(t,i);return[e.utf16String.toString(),r.utf16String.toString()]},On=function(i,t){let e=0,n=i.length,r=t.length;for(;ee+1&&i.charAt(n-1).isEqualTo(t.charAt(r-1));)n--,r--;return{utf16String:i.slice(e,n),offset:e}},U=class extends dt{static fromCommonAttributesOfObjects(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(!t.length)return new this;let e=re(t[0]),n=e.getKeys();return t.slice(1).forEach(r=>{n=e.getKeysCommonToHash(re(r)),e=e.slice(n)}),e}static box(t){return re(t)}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(...arguments),this.values=Be(t)}add(t,e){return this.merge(Io(t,e))}remove(t){return new U(Be(this.values,t))}get(t){return this.values[t]}has(t){return t in this.values}merge(t){return new U(Oo(this.values,Fo(t)))}slice(t){let e={};return Array.from(t).forEach(n=>{this.has(n)&&(e[n]=this.values[n])}),new U(e)}getKeys(){return Object.keys(this.values)}getKeysCommonToHash(t){return t=re(t),this.getKeys().filter(e=>this.values[e]===t.values[e])}isEqualTo(t){return Ft(this.toArray(),re(t).toArray())}isEmpty(){return this.getKeys().length===0}toArray(){if(!this.array){let t=[];for(let e in this.values){let n=this.values[e];t.push(t.push(e,n))}this.array=t.slice(0)}return this.array}toObject(){return Be(this.values)}toJSON(){return this.toObject()}contentsForInspection(){return{values:JSON.stringify(this.values)}}},Io=function(i,t){let e={};return e[i]=t,e},Oo=function(i,t){let e=Be(i);for(let n in t){let r=t[n];e[n]=r}return e},Be=function(i,t){let e={};return Object.keys(i).sort().forEach(n=>{n!==t&&(e[n]=i[n])}),e},re=function(i){return i instanceof U?i:new U(i)},Fo=function(i){return i instanceof U?i.values:i},fe=class{static groupObjects(){let t,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{depth:n,asTree:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};r&&n==null&&(n=0);let o=[];return Array.from(e).forEach(s=>{var l;if(t){var c,u,d;if((c=s.canBeGrouped)!==null&&c!==void 0&&c.call(s,n)&&(u=(d=t[t.length-1]).canBeGroupedWith)!==null&&u!==void 0&&u.call(d,s,n))return void t.push(s);o.push(new this(t,{depth:n,asTree:r})),t=null}(l=s.canBeGrouped)!==null&&l!==void 0&&l.call(s,n)?t=[s]:o.push(s)}),t&&o.push(new this(t,{depth:n,asTree:r})),o}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{depth:e,asTree:n}=arguments.length>1?arguments[1]:void 0;this.objects=t,n&&(this.depth=e,this.objects=this.constructor.groupObjects(this.objects,{asTree:n,depth:this.depth+1}))}getObjects(){return this.objects}getDepth(){return this.depth}getCacheKey(){let t=["objectGroup"];return Array.from(this.getObjects()).forEach(e=>{t.push(e.getCacheKey())}),t.join("/")}},ni=class extends R{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.objects={},Array.from(t).forEach(e=>{let n=JSON.stringify(e);this.objects[n]==null&&(this.objects[n]=e)})}find(t){let e=JSON.stringify(t);return this.objects[e]}},ii=class{constructor(t){this.reset(t)}add(t){let e=ir(t);this.elements[e]=t}remove(t){let e=ir(t),n=this.elements[e];if(n)return delete this.elements[e],n}reset(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return this.elements={},Array.from(t).forEach(e=>{this.add(e)}),t}},ir=i=>i.dataset.trixStoreKey,Jt=class extends R{isPerforming(){return this.performing===!0}hasPerformed(){return this.performed===!0}hasSucceeded(){return this.performed&&this.succeeded}hasFailed(){return this.performed&&!this.succeeded}getPromise(){return this.promise||(this.promise=new Promise((t,e)=>(this.performing=!0,this.perform((n,r)=>{this.succeeded=n,this.performing=!1,this.performed=!0,this.succeeded?t(r):e(r)})))),this.promise}perform(t){return t(!1)}release(){var t,e;(t=this.promise)===null||t===void 0||(e=t.cancel)===null||e===void 0||e.call(t),this.promise=null,this.performing=null,this.performed=null,this.succeeded=null}};Jt.proxyMethod("getPromise().then"),Jt.proxyMethod("getPromise().catch");var gt=class extends R{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.object=t,this.options=e,this.childViews=[],this.rootView=this}getNodes(){return this.nodes||(this.nodes=this.createNodes()),this.nodes.map(t=>t.cloneNode(!0))}invalidate(){var t;return this.nodes=null,this.childViews=[],(t=this.parentView)===null||t===void 0?void 0:t.invalidate()}invalidateViewForObject(t){var e;return(e=this.findViewForObject(t))===null||e===void 0?void 0:e.invalidate()}findOrCreateCachedChildView(t,e,n){let r=this.getCachedViewForObject(e);return r?this.recordChildView(r):(r=this.createChildView(...arguments),this.cacheViewForObject(r,e)),r}createChildView(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};e instanceof fe&&(n.viewClass=t,t=ri);let r=new t(e,n);return this.recordChildView(r)}recordChildView(t){return t.parentView=this,t.rootView=this.rootView,this.childViews.push(t),t}getAllChildViews(){let t=[];return this.childViews.forEach(e=>{t.push(e),t=t.concat(e.getAllChildViews())}),t}findElement(){return this.findElementForObject(this.object)}findElementForObject(t){let e=t?.id;if(e)return this.rootView.element.querySelector("[data-trix-id='".concat(e,"']"))}findViewForObject(t){for(let e of this.getAllChildViews())if(e.object===t)return e}getViewCache(){return this.rootView!==this?this.rootView.getViewCache():this.isViewCachingEnabled()?(this.viewCache||(this.viewCache={}),this.viewCache):void 0}isViewCachingEnabled(){return this.shouldCacheViews!==!1}enableViewCaching(){this.shouldCacheViews=!0}disableViewCaching(){this.shouldCacheViews=!1}getCachedViewForObject(t){var e;return(e=this.getViewCache())===null||e===void 0?void 0:e[t.getCacheKey()]}cacheViewForObject(t,e){let n=this.getViewCache();n&&(n[e.getCacheKey()]=t)}garbageCollectCachedViews(){let t=this.getViewCache();if(t){let e=this.getAllChildViews().concat(this).map(n=>n.object.getCacheKey());for(let n in t)e.includes(n)||delete t[n]}}},ri=class extends gt{constructor(){super(...arguments),this.objectGroup=this.object,this.viewClass=this.options.viewClass,delete this.options.viewClass}getChildViews(){return this.childViews.length||Array.from(this.objectGroup.getObjects()).forEach(t=>{this.findOrCreateCachedChildView(this.viewClass,t,this.options)}),this.childViews}createNodes(){let t=this.createContainerElement();return this.getChildViews().forEach(e=>{Array.from(e.getNodes()).forEach(n=>{t.appendChild(n)})}),[t]}createContainerElement(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.objectGroup.getDepth();return this.getChildViews()[0].createContainerElement(t)}};var{entries:Ur,setPrototypeOf:rr,isFrozen:Po,getPrototypeOf:Mo,getOwnPropertyDescriptor:Bo}=Object,{freeze:V,seal:Y,create:Vr}=Object,{apply:oi,construct:si}=typeof Reflect<"u"&&Reflect;V||(V=function(i){return i}),Y||(Y=function(i){return i}),oi||(oi=function(i,t,e){return i.apply(t,e)}),si||(si=function(i,t){return new i(...t)});var Ne=G(Array.prototype.forEach),or=G(Array.prototype.pop),oe=G(Array.prototype.push),_e=G(String.prototype.toLowerCase),Fn=G(String.prototype.toString),sr=G(String.prototype.match),se=G(String.prototype.replace),_o=G(String.prototype.indexOf),jo=G(String.prototype.trim),X=G(Object.prototype.hasOwnProperty),_=G(RegExp.prototype.test),ae=(ar=TypeError,function(){for(var i=arguments.length,t=new Array(i),e=0;e1?e-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:_e;rr&&rr(i,null);let n=t.length;for(;n--;){let r=t[n];if(typeof r=="string"){let o=e(r);o!==r&&(Po(t)||(t[n]=o),r=o)}i[r]=!0}return i}function Wo(i){for(let t=0;t/gm),Ho=Y(/\$\{[\w\W]*}/gm),Jo=Y(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ko=Y(/^aria-[\-\w]+$/),zr=Y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Go=Y(/^(?:\w+script|data):/i),$o=Y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qr=Y(/^html$/i),Yo=Y(/^[a-z][.\w]*(-[.\w]+)+$/i),dr=Object.freeze({__proto__:null,ARIA_ATTR:Ko,ATTR_WHITESPACE:$o,CUSTOM_ELEMENT:Yo,DATA_ATTR:Jo,DOCTYPE_NAME:qr,ERB_EXPR:qo,IS_ALLOWED_URI:zr,IS_SCRIPT_OR_DATA:Go,MUSTACHE_EXPR:zo,TMPLIT_EXPR:Ho}),Xo=1,Zo=3,Qo=7,ts=8,es=9,ns=function(){return typeof window>"u"?null:window},Ve=function i(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ns(),e=a=>i(a);if(e.version="3.2.3",e.removed=[],!t||!t.document||t.document.nodeType!==es)return e.isSupported=!1,e;let{document:n}=t,r=n,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:l,Node:c,Element:u,NodeFilter:d,NamedNodeMap:C=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:T,DOMParser:H,trustedTypes:tt}=t,M=u.prototype,pt=le(M,"cloneNode"),Ct=le(M,"remove"),Zt=le(M,"nextSibling"),Qt=le(M,"childNodes"),F=le(M,"parentNode");if(typeof l=="function"){let a=n.createElement("template");a.content&&a.content.ownerDocument&&(n=a.content.ownerDocument)}let k,ot="",{implementation:Et,createNodeIterator:eo,createDocumentFragment:no,getElementsByTagName:io}=n,{importNode:ro}=r,J={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};e.isSupported=typeof Ur=="function"&&typeof F=="function"&&Et&&Et.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:un,ERB_EXPR:hn,TMPLIT_EXPR:dn,DATA_ATTR:oo,ARIA_ATTR:so,IS_SCRIPT_OR_DATA:ao,ATTR_WHITESPACE:Ei,CUSTOM_ELEMENT:lo}=dr,{IS_ALLOWED_URI:Si}=dr,N=null,ki=b({},[...lr,...Pn,...Mn,...Bn,...cr]),O=null,Ri=b({},[...ur,..._n,...hr,...Ie]),w=Object.seal(Vr(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}})),te=null,gn=null,Ti=!0,mn=!0,wi=!1,Li=!0,Bt=!1,pn=!0,St=!1,fn=!1,bn=!1,_t=!1,Ee=!1,Se=!1,Di=!0,Ni=!1,vn=!0,ee=!1,jt={},Wt=null,Ii=b({},["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"]),Oi=null,Fi=b({},["audio","video","img","source","image","track"]),An=null,Pi=b({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ke="http://www.w3.org/1998/Math/MathML",Re="http://www.w3.org/2000/svg",st="http://www.w3.org/1999/xhtml",Ut=st,yn=!1,xn=null,co=b({},[ke,Re,st],Fn),Te=b({},["mi","mo","mn","ms","mtext"]),we=b({},["annotation-xml"]),uo=b({},["title","style","font","a","script"]),ne=null,ho=["application/xhtml+xml","text/html"],I=null,Vt=null,go=n.createElement("form"),Mi=function(a){return a instanceof RegExp||a instanceof Function},Cn=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!Vt||Vt!==a){if(a&&typeof a=="object"||(a={}),a=Rt(a),ne=ho.indexOf(a.PARSER_MEDIA_TYPE)===-1?"text/html":a.PARSER_MEDIA_TYPE,I=ne==="application/xhtml+xml"?Fn:_e,N=X(a,"ALLOWED_TAGS")?b({},a.ALLOWED_TAGS,I):ki,O=X(a,"ALLOWED_ATTR")?b({},a.ALLOWED_ATTR,I):Ri,xn=X(a,"ALLOWED_NAMESPACES")?b({},a.ALLOWED_NAMESPACES,Fn):co,An=X(a,"ADD_URI_SAFE_ATTR")?b(Rt(Pi),a.ADD_URI_SAFE_ATTR,I):Pi,Oi=X(a,"ADD_DATA_URI_TAGS")?b(Rt(Fi),a.ADD_DATA_URI_TAGS,I):Fi,Wt=X(a,"FORBID_CONTENTS")?b({},a.FORBID_CONTENTS,I):Ii,te=X(a,"FORBID_TAGS")?b({},a.FORBID_TAGS,I):{},gn=X(a,"FORBID_ATTR")?b({},a.FORBID_ATTR,I):{},jt=!!X(a,"USE_PROFILES")&&a.USE_PROFILES,Ti=a.ALLOW_ARIA_ATTR!==!1,mn=a.ALLOW_DATA_ATTR!==!1,wi=a.ALLOW_UNKNOWN_PROTOCOLS||!1,Li=a.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Bt=a.SAFE_FOR_TEMPLATES||!1,pn=a.SAFE_FOR_XML!==!1,St=a.WHOLE_DOCUMENT||!1,_t=a.RETURN_DOM||!1,Ee=a.RETURN_DOM_FRAGMENT||!1,Se=a.RETURN_TRUSTED_TYPE||!1,bn=a.FORCE_BODY||!1,Di=a.SANITIZE_DOM!==!1,Ni=a.SANITIZE_NAMED_PROPS||!1,vn=a.KEEP_CONTENT!==!1,ee=a.IN_PLACE||!1,Si=a.ALLOWED_URI_REGEXP||zr,Ut=a.NAMESPACE||st,Te=a.MATHML_TEXT_INTEGRATION_POINTS||Te,we=a.HTML_INTEGRATION_POINTS||we,w=a.CUSTOM_ELEMENT_HANDLING||{},a.CUSTOM_ELEMENT_HANDLING&&Mi(a.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(w.tagNameCheck=a.CUSTOM_ELEMENT_HANDLING.tagNameCheck),a.CUSTOM_ELEMENT_HANDLING&&Mi(a.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(w.attributeNameCheck=a.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),a.CUSTOM_ELEMENT_HANDLING&&typeof a.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(w.allowCustomizedBuiltInElements=a.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Bt&&(mn=!1),Ee&&(_t=!0),jt&&(N=b({},cr),O=[],jt.html===!0&&(b(N,lr),b(O,ur)),jt.svg===!0&&(b(N,Pn),b(O,_n),b(O,Ie)),jt.svgFilters===!0&&(b(N,Mn),b(O,_n),b(O,Ie)),jt.mathMl===!0&&(b(N,Bn),b(O,hr),b(O,Ie))),a.ADD_TAGS&&(N===ki&&(N=Rt(N)),b(N,a.ADD_TAGS,I)),a.ADD_ATTR&&(O===Ri&&(O=Rt(O)),b(O,a.ADD_ATTR,I)),a.ADD_URI_SAFE_ATTR&&b(An,a.ADD_URI_SAFE_ATTR,I),a.FORBID_CONTENTS&&(Wt===Ii&&(Wt=Rt(Wt)),b(Wt,a.FORBID_CONTENTS,I)),vn&&(N["#text"]=!0),St&&b(N,["html","head","body"]),N.table&&(b(N,["tbody"]),delete te.tbody),a.TRUSTED_TYPES_POLICY){if(typeof a.TRUSTED_TYPES_POLICY.createHTML!="function")throw ae('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof a.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ae('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=a.TRUSTED_TYPES_POLICY,ot=k.createHTML("")}else k===void 0&&(k=function(g,h){if(typeof g!="object"||typeof g.createPolicy!="function")return null;let v=null,A="data-tt-policy-suffix";h&&h.hasAttribute(A)&&(v=h.getAttribute(A));let f="dompurify"+(v?"#"+v:"");try{return g.createPolicy(f,{createHTML:D=>D,createScriptURL:D=>D})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}}(tt,o)),k!==null&&typeof ot=="string"&&(ot=k.createHTML(""));V&&V(a),Vt=a}},Bi=b({},[...Pn,...Mn,...Uo]),_i=b({},[...Bn,...Vo]),et=function(a){oe(e.removed,{element:a});try{F(a).removeChild(a)}catch{Ct(a)}},Le=function(a,g){try{oe(e.removed,{attribute:g.getAttributeNode(a),from:g})}catch{oe(e.removed,{attribute:null,from:g})}if(g.removeAttribute(a),a==="is")if(_t||Ee)try{et(g)}catch{}else try{g.setAttribute(a,"")}catch{}},ji=function(a){let g=null,h=null;if(bn)a=""+a;else{let f=sr(a,/^[\r\n\t ]+/);h=f&&f[0]}ne==="application/xhtml+xml"&&Ut===st&&(a=''+a+"");let v=k?k.createHTML(a):a;if(Ut===st)try{g=new H().parseFromString(v,ne)}catch{}if(!g||!g.documentElement){g=Et.createDocument(Ut,"template",null);try{g.documentElement.innerHTML=yn?ot:v}catch{}}let A=g.body||g.documentElement;return a&&h&&A.insertBefore(n.createTextNode(h),A.childNodes[0]||null),Ut===st?io.call(g,St?"html":"body")[0]:St?g.documentElement:A},Wi=function(a){return eo.call(a.ownerDocument||a,a,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},En=function(a){return a instanceof T&&(typeof a.nodeName!="string"||typeof a.textContent!="string"||typeof a.removeChild!="function"||!(a.attributes instanceof C)||typeof a.removeAttribute!="function"||typeof a.setAttribute!="function"||typeof a.namespaceURI!="string"||typeof a.insertBefore!="function"||typeof a.hasChildNodes!="function")},Ui=function(a){return typeof c=="function"&&a instanceof c};function at(a,g,h){Ne(a,v=>{v.call(e,g,h,Vt)})}let Vi=function(a){let g=null;if(at(J.beforeSanitizeElements,a,null),En(a))return et(a),!0;let h=I(a.nodeName);if(at(J.uponSanitizeElement,a,{tagName:h,allowedTags:N}),a.hasChildNodes()&&!Ui(a.firstElementChild)&&_(/<[/\w]/g,a.innerHTML)&&_(/<[/\w]/g,a.textContent)||a.nodeType===Qo||pn&&a.nodeType===ts&&_(/<[/\w]/g,a.data))return et(a),!0;if(!N[h]||te[h]){if(!te[h]&&qi(h)&&(w.tagNameCheck instanceof RegExp&&_(w.tagNameCheck,h)||w.tagNameCheck instanceof Function&&w.tagNameCheck(h)))return!1;if(vn&&!Wt[h]){let v=F(a)||a.parentNode,A=Qt(a)||a.childNodes;if(A&&v)for(let f=A.length-1;f>=0;--f){let D=pt(A[f],!0);D.__removalCount=(a.__removalCount||0)+1,v.insertBefore(D,Zt(a))}}return et(a),!0}return a instanceof u&&!function(v){let A=F(v);A&&A.tagName||(A={namespaceURI:Ut,tagName:"template"});let f=_e(v.tagName),D=_e(A.tagName);return!!xn[v.namespaceURI]&&(v.namespaceURI===Re?A.namespaceURI===st?f==="svg":A.namespaceURI===ke?f==="svg"&&(D==="annotation-xml"||Te[D]):!!Bi[f]:v.namespaceURI===ke?A.namespaceURI===st?f==="math":A.namespaceURI===Re?f==="math"&&we[D]:!!_i[f]:v.namespaceURI===st?!(A.namespaceURI===Re&&!we[D])&&!(A.namespaceURI===ke&&!Te[D])&&!_i[f]&&(uo[f]||!Bi[f]):!(ne!=="application/xhtml+xml"||!xn[v.namespaceURI]))}(a)?(et(a),!0):h!=="noscript"&&h!=="noembed"&&h!=="noframes"||!_(/<\/no(script|embed|frames)/i,a.innerHTML)?(Bt&&a.nodeType===Zo&&(g=a.textContent,Ne([un,hn,dn],v=>{g=se(g,v," ")}),a.textContent!==g&&(oe(e.removed,{element:a.cloneNode()}),a.textContent=g)),at(J.afterSanitizeElements,a,null),!1):(et(a),!0)},zi=function(a,g,h){if(Di&&(g==="id"||g==="name")&&(h in n||h in go))return!1;if(!(mn&&!gn[g]&&_(oo,g))){if(!(Ti&&_(so,g))){if(!O[g]||gn[g]){if(!(qi(a)&&(w.tagNameCheck instanceof RegExp&&_(w.tagNameCheck,a)||w.tagNameCheck instanceof Function&&w.tagNameCheck(a))&&(w.attributeNameCheck instanceof RegExp&&_(w.attributeNameCheck,g)||w.attributeNameCheck instanceof Function&&w.attributeNameCheck(g))||g==="is"&&w.allowCustomizedBuiltInElements&&(w.tagNameCheck instanceof RegExp&&_(w.tagNameCheck,h)||w.tagNameCheck instanceof Function&&w.tagNameCheck(h))))return!1}else if(!An[g]){if(!_(Si,se(h,Ei,""))){if((g!=="src"&&g!=="xlink:href"&&g!=="href"||a==="script"||_o(h,"data:")!==0||!Oi[a])&&!(wi&&!_(ao,se(h,Ei,"")))){if(h)return!1}}}}}return!0},qi=function(a){return a!=="annotation-xml"&&sr(a,lo)},Hi=function(a){at(J.beforeSanitizeAttributes,a,null);let{attributes:g}=a;if(!g||En(a))return;let h={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:O,forceKeepAttr:void 0},v=g.length;for(;v--;){let A=g[v],{name:f,namespaceURI:D,value:lt}=A,nt=I(f),B=f==="value"?lt:jo(lt);if(h.attrName=nt,h.attrValue=B,h.keepAttr=!0,h.forceKeepAttr=void 0,at(J.uponSanitizeAttribute,a,h),B=h.attrValue,!Ni||nt!=="id"&&nt!=="name"||(Le(f,a),B="user-content-"+B),pn&&_(/((--!?|])>)|<\/(style|title)/i,B)){Le(f,a);continue}if(h.forceKeepAttr||(Le(f,a),!h.keepAttr))continue;if(!Li&&_(/\/>/i,B)){Le(f,a);continue}Bt&&Ne([un,hn,dn],Ki=>{B=se(B,Ki," ")});let Ji=I(a.nodeName);if(zi(Ji,nt,B)){if(k&&typeof tt=="object"&&typeof tt.getAttributeType=="function"&&!D)switch(tt.getAttributeType(Ji,nt)){case"TrustedHTML":B=k.createHTML(B);break;case"TrustedScriptURL":B=k.createScriptURL(B)}try{D?a.setAttributeNS(D,f,B):a.setAttribute(f,B),En(a)?et(a):or(e.removed)}catch{}}}at(J.afterSanitizeAttributes,a,null)},mo=function a(g){let h=null,v=Wi(g);for(at(J.beforeSanitizeShadowDOM,g,null);h=v.nextNode();)at(J.uponSanitizeShadowNode,h,null),Vi(h),Hi(h),h.content instanceof s&&a(h.content);at(J.afterSanitizeShadowDOM,g,null)};return e.sanitize=function(a){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=null,v=null,A=null,f=null;if(yn=!a,yn&&(a=""),typeof a!="string"&&!Ui(a)){if(typeof a.toString!="function")throw ae("toString is not a function");if(typeof(a=a.toString())!="string")throw ae("dirty is not a string, aborting")}if(!e.isSupported)return a;if(fn||Cn(g),e.removed=[],typeof a=="string"&&(ee=!1),ee){if(a.nodeName){let nt=I(a.nodeName);if(!N[nt]||te[nt])throw ae("root node is forbidden and cannot be sanitized in-place")}}else if(a instanceof c)h=ji(""),v=h.ownerDocument.importNode(a,!0),v.nodeType===Xo&&v.nodeName==="BODY"||v.nodeName==="HTML"?h=v:h.appendChild(v);else{if(!_t&&!Bt&&!St&&a.indexOf("<")===-1)return k&&Se?k.createHTML(a):a;if(h=ji(a),!h)return _t?null:Se?ot:""}h&&bn&&et(h.firstChild);let D=Wi(ee?a:h);for(;A=D.nextNode();)Vi(A),Hi(A),A.content instanceof s&&mo(A.content);if(ee)return a;if(_t){if(Ee)for(f=no.call(h.ownerDocument);h.firstChild;)f.appendChild(h.firstChild);else f=h;return(O.shadowroot||O.shadowrootmode)&&(f=ro.call(r,f,!0)),f}let lt=St?h.outerHTML:h.innerHTML;return St&&N["!doctype"]&&h.ownerDocument&&h.ownerDocument.doctype&&h.ownerDocument.doctype.name&&_(qr,h.ownerDocument.doctype.name)&&(lt=" +`+lt),Bt&&Ne([un,hn,dn],nt=>{lt=se(lt,nt," ")}),k&&Se?k.createHTML(lt):lt},e.setConfig=function(){Cn(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),fn=!0},e.clearConfig=function(){Vt=null,fn=!1},e.isValidAttribute=function(a,g,h){Vt||Cn({});let v=I(a),A=I(g);return zi(v,A,h)},e.addHook=function(a,g){typeof g=="function"&&oe(J[a],g)},e.removeHook=function(a){return or(J[a])},e.removeHooks=function(a){J[a]=[]},e.removeAllHooks=function(){J={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},e}();Ve.addHook("uponSanitizeAttribute",function(i,t){/^data-trix-/.test(t.attrName)&&(t.forceKeepAttr=!0)});var is="style href src width height language class".split(" "),rs="javascript:".split(" "),os="script iframe form noscript".split(" "),Kt=class extends R{static setHTML(t,e){let n=new this(e).sanitize(),r=n.getHTML?n.getHTML():n.outerHTML;t.innerHTML=r}static sanitize(t,e){let n=new this(t,e);return n.sanitize(),n}constructor(t){let{allowedAttributes:e,forbiddenProtocols:n,forbiddenElements:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.allowedAttributes=e||is,this.forbiddenProtocols=n||rs,this.forbiddenElements=r||os,this.body=ss(t)}sanitize(){return this.sanitizeElements(),this.normalizeListElementNesting(),Ve.setConfig(Lr),this.body=Ve.sanitize(this.body),this.body}getHTML(){return this.body.innerHTML}getBody(){return this.body}sanitizeElements(){let t=je(this.body),e=[];for(;t.nextNode();){let n=t.currentNode;switch(n.nodeType){case Node.ELEMENT_NODE:this.elementIsRemovable(n)?e.push(n):this.sanitizeElement(n);break;case Node.COMMENT_NODE:e.push(n)}}return e.forEach(n=>At(n)),this.body}sanitizeElement(t){return t.hasAttribute("href")&&this.forbiddenProtocols.includes(t.protocol)&&t.removeAttribute("href"),Array.from(t.attributes).forEach(e=>{let{name:n}=e;this.allowedAttributes.includes(n)||n.indexOf("data-trix")===0||t.removeAttribute(n)}),t}normalizeListElementNesting(){return Array.from(this.body.querySelectorAll("ul,ol")).forEach(t=>{let e=t.previousElementSibling;e&&j(e)==="li"&&e.appendChild(t)}),this.body}elementIsRemovable(t){if(t?.nodeType===Node.ELEMENT_NODE)return this.elementIsForbidden(t)||this.elementIsntSerializable(t)}elementIsForbidden(t){return this.forbiddenElements.includes(j(t))}elementIsntSerializable(t){return t.getAttribute("data-trix-serialize")==="false"&&!Lt(t)}},ss=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";i=i.replace(/<\/html[^>]*>[^]*$/i,"");let t=document.implementation.createHTMLDocument("");return t.documentElement.innerHTML=i,Array.from(t.head.querySelectorAll("style")).forEach(e=>{t.body.appendChild(e)}),t.body},{css:ft}=Ce,be=class extends gt{constructor(){super(...arguments),this.attachment=this.object,this.attachment.uploadProgressDelegate=this,this.attachmentPiece=this.options.piece}createContentNodes(){return[]}createNodes(){let t,e=t=p({tagName:"figure",className:this.getClassName(),data:this.getData(),editable:!1}),n=this.getHref();return n&&(t=p({tagName:"a",editable:!1,attributes:{href:n,tabindex:-1}}),e.appendChild(t)),this.attachment.hasContent()?Kt.setHTML(t,this.attachment.getContent()):this.createContentNodes().forEach(r=>{t.appendChild(r)}),t.appendChild(this.createCaptionElement()),this.attachment.isPending()&&(this.progressElement=p({tagName:"progress",attributes:{class:ft.attachmentProgress,value:this.attachment.getUploadProgress(),max:100},data:{trixMutable:!0,trixStoreKey:["progressElement",this.attachment.id].join("/")}}),e.appendChild(this.progressElement)),[gr("left"),e,gr("right")]}createCaptionElement(){let t=p({tagName:"figcaption",className:ft.attachmentCaption}),e=this.attachmentPiece.getCaption();if(e)t.classList.add("".concat(ft.attachmentCaption,"--edited")),t.textContent=e;else{let n,r,o=this.getCaptionConfig();if(o.name&&(n=this.attachment.getFilename()),o.size&&(r=this.attachment.getFormattedFilesize()),n){let s=p({tagName:"span",className:ft.attachmentName,textContent:n});t.appendChild(s)}if(r){n&&t.appendChild(document.createTextNode(" "));let s=p({tagName:"span",className:ft.attachmentSize,textContent:r});t.appendChild(s)}}return t}getClassName(){let t=[ft.attachment,"".concat(ft.attachment,"--").concat(this.attachment.getType())],e=this.attachment.getExtension();return e&&t.push("".concat(ft.attachment,"--").concat(e)),t.join(" ")}getData(){let t={trixAttachment:JSON.stringify(this.attachment),trixContentType:this.attachment.getContentType(),trixId:this.attachment.id},{attributes:e}=this.attachmentPiece;return e.isEmpty()||(t.trixAttributes=JSON.stringify(e)),this.attachment.isPending()&&(t.trixSerialize=!1),t}getHref(){if(!as(this.attachment.getContent(),"a"))return this.attachment.getHref()}getCaptionConfig(){var t;let e=this.attachment.getType(),n=_r((t=mi[e])===null||t===void 0?void 0:t.caption);return e==="file"&&(n.name=!0),n}findProgressElement(){var t;return(t=this.findElement())===null||t===void 0?void 0:t.querySelector("progress")}attachmentDidChangeUploadProgress(){let t=this.attachment.getUploadProgress(),e=this.findProgressElement();e&&(e.value=t)}},gr=i=>p({tagName:"span",textContent:ln,data:{trixCursorTarget:i,trixSerialize:!1}}),as=function(i,t){let e=p("div");return Kt.setHTML(e,i||""),e.querySelector(t)},ze=class extends be{constructor(){super(...arguments),this.attachment.previewDelegate=this}createContentNodes(){return this.image=p({tagName:"img",attributes:{src:""},data:{trixMutable:!0}}),this.refresh(this.image),[this.image]}createCaptionElement(){let t=super.createCaptionElement(...arguments);return t.textContent||t.setAttribute("data-trix-placeholder",m.captionPlaceholder),t}refresh(t){var e;if(t||(t=(e=this.findElement())===null||e===void 0?void 0:e.querySelector("img")),t)return this.updateAttributesForImage(t)}updateAttributesForImage(t){let e=this.attachment.getURL(),n=this.attachment.getPreviewURL();if(t.src=n||e,n===e)t.removeAttribute("data-trix-serialized-attributes");else{let l=JSON.stringify({src:e});t.setAttribute("data-trix-serialized-attributes",l)}let r=this.attachment.getWidth(),o=this.attachment.getHeight();r!=null&&(t.width=r),o!=null&&(t.height=o);let s=["imageElement",this.attachment.id,t.src,t.width,t.height].join("/");t.dataset.trixStoreKey=s}attachmentDidChangeAttributes(){return this.refresh(this.image),this.refresh()}},qe=class extends gt{constructor(){super(...arguments),this.piece=this.object,this.attributes=this.piece.getAttributes(),this.textConfig=this.options.textConfig,this.context=this.options.context,this.piece.attachment?this.attachment=this.piece.attachment:this.string=this.piece.toString()}createNodes(){let t=this.attachment?this.createAttachmentNodes():this.createStringNodes(),e=this.createElement();if(e){let n=function(r){for(;(o=r)!==null&&o!==void 0&&o.firstElementChild;){var o;r=r.firstElementChild}return r}(e);Array.from(t).forEach(r=>{n.appendChild(r)}),t=[e]}return t}createAttachmentNodes(){let t=this.attachment.isPreviewable()?ze:be;return this.createChildView(t,this.piece.attachment,{piece:this.piece}).getNodes()}createStringNodes(){var t;if((t=this.textConfig)!==null&&t!==void 0&&t.plaintext)return[document.createTextNode(this.string)];{let e=[],n=this.string.split(` +`);for(let r=0;r0){let s=p("br");e.push(s)}if(o.length){let s=document.createTextNode(this.preserveSpaces(o));e.push(s)}}return e}}createElement(){let t,e,n,r={};for(e in this.attributes){n=this.attributes[e];let s=ti(e);if(s){if(s.tagName){var o;let l=p(s.tagName);o?(o.appendChild(l),o=l):t=o=l}if(s.styleProperty&&(r[s.styleProperty]=n),s.style)for(e in s.style)n=s.style[e],r[e]=n}}if(Object.keys(r).length)for(e in t||(t=p("span")),r)n=r[e],t.style[e]=n;return t}createContainerElement(){for(let t in this.attributes){let e=this.attributes[t],n=ti(t);if(n&&n.groupTagName){let r={};return r[t]=e,p(n.groupTagName,r)}}}preserveSpaces(t){return this.context.isLast&&(t=t.replace(/\ $/,bt)),t=t.replace(/(\S)\ {3}(\S)/g,"$1 ".concat(bt," $2")).replace(/\ {2}/g,"".concat(bt," ")).replace(/\ {2}/g," ".concat(bt)),(this.context.isFirst||this.context.followsWhitespace)&&(t=t.replace(/^\ /,bt)),t}},He=class extends gt{constructor(){super(...arguments),this.text=this.object,this.textConfig=this.options.textConfig}createNodes(){let t=[],e=fe.groupObjects(this.getPieces()),n=e.length-1;for(let o=0;o!t.hasAttribute("blockBreak"))}},ls=i=>/\s$/.test(i?.toString()),{css:mr}=Ce,Je=class extends gt{constructor(){super(...arguments),this.block=this.object,this.attributes=this.block.getAttributes()}createNodes(){let t=[document.createComment("block")];if(this.block.isEmpty())t.push(p("br"));else{var e;let n=(e=L(this.block.getLastAttribute()))===null||e===void 0?void 0:e.text,r=this.findOrCreateCachedChildView(He,this.block.text,{textConfig:n});t.push(...Array.from(r.getNodes()||[])),this.shouldAddExtraNewlineElement()&&t.push(p("br"))}if(this.attributes.length)return t;{let n,{tagName:r}=W.default;this.block.isRTL()&&(n={dir:"rtl"});let o=p({tagName:r,attributes:n});return t.forEach(s=>o.appendChild(s)),[o]}}createContainerElement(t){let e={},n,r=this.attributes[t],{tagName:o,htmlAttributes:s=[]}=L(r);if(t===0&&this.block.isRTL()&&Object.assign(e,{dir:"rtl"}),r==="attachmentGallery"){let l=this.block.getBlockBreakPosition();n="".concat(mr.attachmentGallery," ").concat(mr.attachmentGallery,"--").concat(l)}return Object.entries(this.block.htmlAttributes).forEach(l=>{let[c,u]=l;s.includes(c)&&(e[c]=u)}),p({tagName:o,className:n,attributes:e})}shouldAddExtraNewlineElement(){return/\n\n$/.test(this.block.toString())}},Gt=class extends gt{static render(t){let e=p("div"),n=new this(t,{element:e});return n.render(),n.sync(),e}constructor(){super(...arguments),this.element=this.options.element,this.elementStore=new ii,this.setDocument(this.object)}setDocument(t){t.isEqualTo(this.document)||(this.document=this.object=t)}render(){if(this.childViews=[],this.shadowElement=p("div"),!this.document.isEmpty()){let t=fe.groupObjects(this.document.getBlocks(),{asTree:!0});Array.from(t).forEach(e=>{let n=this.findOrCreateCachedChildView(Je,e);Array.from(n.getNodes()).map(r=>this.shadowElement.appendChild(r))})}}isSynced(){return cs(this.shadowElement,this.element)}sync(){let t=this.createDocumentFragmentForSync();for(;this.element.lastChild;)this.element.removeChild(this.element.lastChild);return this.element.appendChild(t),this.didSync()}didSync(){return this.elementStore.reset(pr(this.element)),Ai(()=>this.garbageCollectCachedViews())}createDocumentFragmentForSync(){let t=document.createDocumentFragment();return Array.from(this.shadowElement.childNodes).forEach(e=>{t.appendChild(e.cloneNode(!0))}),Array.from(pr(t)).forEach(e=>{let n=this.elementStore.remove(e);n&&e.parentNode.replaceChild(n,e)}),t}},pr=i=>i.querySelectorAll("[data-trix-store-key]"),cs=(i,t)=>fr(i.innerHTML)===fr(t.innerHTML),fr=i=>i.replace(/ /g," ");function Oe(i){var t,e;function n(o,s){try{var l=i[o](s),c=l.value,u=c instanceof us;Promise.resolve(u?c.v:c).then(function(d){if(u){var C=o==="return"?"return":"next";if(!c.k||d.done)return n(C,d);d=i[C](d).value}r(l.done?"return":"normal",d)},function(d){n("throw",d)})}catch(d){r("throw",d)}}function r(o,s){switch(o){case"return":t.resolve({value:s,done:!0});break;case"throw":t.reject(s);break;default:t.resolve({value:s,done:!1})}(t=t.next)?n(t.key,t.arg):e=null}this._invoke=function(o,s){return new Promise(function(l,c){var u={key:o,arg:s,resolve:l,reject:c,next:null};e?e=e.next=u:(t=e=u,n(o,s))})},typeof i.return!="function"&&(this.return=void 0)}function us(i,t){this.v=i,this.k=t}function q(i,t,e){return(t=hs(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function hs(i){var t=function(e,n){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,n||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}(i,"string");return typeof t=="symbol"?t:String(t)}Oe.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Oe.prototype.next=function(i){return this._invoke("next",i)},Oe.prototype.throw=function(i){return this._invoke("throw",i)},Oe.prototype.return=function(i){return this._invoke("return",i)};function x(i,t){return ds(i,Hr(i,t,"get"))}function Ci(i,t,e){return gs(i,Hr(i,t,"set"),e),e}function Hr(i,t,e){if(!t.has(i))throw new TypeError("attempted to "+e+" private field on non-instance");return t.get(i)}function ds(i,t){return t.get?t.get.call(i):t.value}function gs(i,t,e){if(t.set)t.set.call(i,e);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=e}}function Fe(i,t,e){if(!t.has(i))throw new TypeError("attempted to get private field on non-instance");return e}function Jr(i,t){if(t.has(i))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pe(i,t,e){Jr(i,t),t.set(i,e)}var mt=class extends dt{static registerType(t,e){e.type=t,this.types[t]=e}static fromJSON(t){let e=this.types[t.type];if(e)return e.fromJSON(t)}constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.attributes=U.box(e)}copyWithAttributes(t){return new this.constructor(this.getValue(),t)}copyWithAdditionalAttributes(t){return this.copyWithAttributes(this.attributes.merge(t))}copyWithoutAttribute(t){return this.copyWithAttributes(this.attributes.remove(t))}copy(){return this.copyWithAttributes(this.attributes)}getAttribute(t){return this.attributes.get(t)}getAttributesHash(){return this.attributes}getAttributes(){return this.attributes.toObject()}hasAttribute(t){return this.attributes.has(t)}hasSameStringValueAsPiece(t){return t&&this.toString()===t.toString()}hasSameAttributesAsPiece(t){return t&&(this.attributes===t.attributes||this.attributes.isEqualTo(t.attributes))}isBlockBreak(){return!1}isEqualTo(t){return super.isEqualTo(...arguments)||this.hasSameConstructorAs(t)&&this.hasSameStringValueAsPiece(t)&&this.hasSameAttributesAsPiece(t)}isEmpty(){return this.length===0}isSerializable(){return!0}toJSON(){return{type:this.constructor.type,attributes:this.getAttributes()}}contentsForInspection(){return{type:this.constructor.type,attributes:this.attributes.inspect()}}canBeGrouped(){return this.hasAttribute("href")}canBeGroupedWith(t){return this.getAttribute("href")===t.getAttribute("href")}getLength(){return this.length}canBeConsolidatedWith(t){return!1}};q(mt,"types",{});var Ke=class extends Jt{constructor(t){super(...arguments),this.url=t}perform(t){let e=new Image;e.onload=()=>(e.width=this.width=e.naturalWidth,e.height=this.height=e.naturalHeight,t(!0,e)),e.onerror=()=>t(!1),e.src=this.url}},yt=class extends dt{static attachmentForFile(t){let e=new this(this.attributesForFile(t));return e.setFile(t),e}static attributesForFile(t){return new U({filename:t.name,filesize:t.size,contentType:t.type})}static fromJSON(t){return new this(t)}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(t),this.releaseFile=this.releaseFile.bind(this),this.attributes=U.box(t),this.didChangeAttributes()}getAttribute(t){return this.attributes.get(t)}hasAttribute(t){return this.attributes.has(t)}getAttributes(){return this.attributes.toObject()}setAttributes(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=this.attributes.merge(t);var n,r,o,s;if(!this.attributes.isEqualTo(e))return this.attributes=e,this.didChangeAttributes(),(n=this.previewDelegate)===null||n===void 0||(r=n.attachmentDidChangeAttributes)===null||r===void 0||r.call(n,this),(o=this.delegate)===null||o===void 0||(s=o.attachmentDidChangeAttributes)===null||s===void 0?void 0:s.call(o,this)}didChangeAttributes(){if(this.isPreviewable())return this.preloadURL()}isPending(){return this.file!=null&&!(this.getURL()||this.getHref())}isPreviewable(){return this.attributes.has("previewable")?this.attributes.get("previewable"):yt.previewablePattern.test(this.getContentType())}getType(){return this.hasContent()?"content":this.isPreviewable()?"preview":"file"}getURL(){return this.attributes.get("url")}getHref(){return this.attributes.get("href")}getFilename(){return this.attributes.get("filename")||""}getFilesize(){return this.attributes.get("filesize")}getFormattedFilesize(){let t=this.attributes.get("filesize");return typeof t=="number"?Dr.formatter(t):""}getExtension(){var t;return(t=this.getFilename().match(/\.(\w+)$/))===null||t===void 0?void 0:t[1].toLowerCase()}getContentType(){return this.attributes.get("contentType")}hasContent(){return this.attributes.has("content")}getContent(){return this.attributes.get("content")}getWidth(){return this.attributes.get("width")}getHeight(){return this.attributes.get("height")}getFile(){return this.file}setFile(t){if(this.file=t,this.isPreviewable())return this.preloadFile()}releaseFile(){this.releasePreloadedFile(),this.file=null}getUploadProgress(){return this.uploadProgress!=null?this.uploadProgress:0}setUploadProgress(t){var e,n;if(this.uploadProgress!==t)return this.uploadProgress=t,(e=this.uploadProgressDelegate)===null||e===void 0||(n=e.attachmentDidChangeUploadProgress)===null||n===void 0?void 0:n.call(e,this)}toJSON(){return this.getAttributes()}getCacheKey(){return[super.getCacheKey(...arguments),this.attributes.getCacheKey(),this.getPreviewURL()].join("/")}getPreviewURL(){return this.previewURL||this.preloadingURL}setPreviewURL(t){var e,n,r,o;if(t!==this.getPreviewURL())return this.previewURL=t,(e=this.previewDelegate)===null||e===void 0||(n=e.attachmentDidChangeAttributes)===null||n===void 0||n.call(e,this),(r=this.delegate)===null||r===void 0||(o=r.attachmentDidChangePreviewURL)===null||o===void 0?void 0:o.call(r,this)}preloadURL(){return this.preload(this.getURL(),this.releaseFile)}preloadFile(){if(this.file)return this.fileObjectURL=URL.createObjectURL(this.file),this.preload(this.fileObjectURL)}releasePreloadedFile(){this.fileObjectURL&&(URL.revokeObjectURL(this.fileObjectURL),this.fileObjectURL=null)}preload(t,e){if(t&&t!==this.getPreviewURL())return this.preloadingURL=t,new Ke(t).then(n=>{let{width:r,height:o}=n;return this.getWidth()&&this.getHeight()||this.setAttributes({width:r,height:o}),this.preloadingURL=null,this.setPreviewURL(t),e?.()}).catch(()=>(this.preloadingURL=null,e?.()))}};q(yt,"previewablePattern",/^image(\/(gif|png|webp|jpe?g)|$)/);var xt=class extends mt{static fromJSON(t){return new this(yt.fromJSON(t.attachment),t.attributes)}constructor(t){super(...arguments),this.attachment=t,this.length=1,this.ensureAttachmentExclusivelyHasAttribute("href"),this.attachment.hasContent()||this.removeProhibitedAttributes()}ensureAttachmentExclusivelyHasAttribute(t){this.hasAttribute(t)&&(this.attachment.hasAttribute(t)||this.attachment.setAttributes(this.attributes.slice([t])),this.attributes=this.attributes.remove(t))}removeProhibitedAttributes(){let t=this.attributes.slice(xt.permittedAttributes);t.isEqualTo(this.attributes)||(this.attributes=t)}getValue(){return this.attachment}isSerializable(){return!this.attachment.isPending()}getCaption(){return this.attributes.get("caption")||""}isEqualTo(t){var e;return super.isEqualTo(t)&&this.attachment.id===(t==null||(e=t.attachment)===null||e===void 0?void 0:e.id)}toString(){return"\uFFFC"}toJSON(){let t=super.toJSON(...arguments);return t.attachment=this.attachment,t}getCacheKey(){return[super.getCacheKey(...arguments),this.attachment.getCacheKey()].join("/")}toConsole(){return JSON.stringify(this.toString())}};q(xt,"permittedAttributes",["caption","presentation"]),mt.registerType("attachment",xt);var ve=class extends mt{static fromJSON(t){return new this(t.string,t.attributes)}constructor(t){super(...arguments),this.string=(e=>e.replace(/\r\n?/g,` `))(t),this.length=this.string.length}getValue(){return this.string}toString(){return this.string.toString()}isBlockBreak(){return this.toString()===` `&&this.getAttribute("blockBreak")===!0}toJSON(){let t=super.toJSON(...arguments);return t.string=this.string,t}canBeConsolidatedWith(t){return t&&this.hasSameConstructorAs(t)&&this.hasSameAttributesAsPiece(t)}consolidateWith(t){return new this.constructor(this.toString()+t.toString(),this.attributes)}splitAtOffset(t){let e,n;return t===0?(e=null,n=this):t===this.length?(e=this,n=null):(e=new this.constructor(this.string.slice(0,t),this.attributes),n=new this.constructor(this.string.slice(t),this.attributes)),[e,n]}toConsole(){let{string:t}=this;return t.length>15&&(t=t.slice(0,14)+"\u2026"),JSON.stringify(t.toString())}};mt.registerType("string",ve);var $t=class extends dt{static box(t){return t instanceof this?t:new this(t)}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.objects=t.slice(0),this.length=this.objects.length}indexOf(t){return this.objects.indexOf(t)}splice(){for(var t=arguments.length,e=new Array(t),n=0;nt(e,n))}insertObjectAtIndex(t,e){return this.splice(e,0,t)}insertSplittableListAtIndex(t,e){return this.splice(e,0,...t.objects)}insertSplittableListAtPosition(t,e){let[n,r]=this.splitObjectAtPosition(e);return new this.constructor(n).insertSplittableListAtIndex(t,r)}editObjectAtIndex(t,e){return this.replaceObjectAtIndex(e(this.objects[t]),t)}replaceObjectAtIndex(t,e){return this.splice(e,1,t)}removeObjectAtIndex(t){return this.splice(t,1)}getObjectAtIndex(t){return this.objects[t]}getSplittableListInRange(t){let[e,n,r]=this.splitObjectsAtRange(t);return new this.constructor(e.slice(n,r+1))}selectSplittableList(t){let e=this.objects.filter(n=>t(n));return new this.constructor(e)}removeObjectsInRange(t){let[e,n,r]=this.splitObjectsAtRange(t);return new this.constructor(e).splice(n,r-n+1)}transformObjectsInRange(t,e){let[n,r,o]=this.splitObjectsAtRange(t),s=n.map((l,c)=>r<=c&&c<=o?e(l):l);return new this.constructor(s)}splitObjectsAtRange(t){let e,[n,r,o]=this.splitObjectAtPosition(ps(t));return[n,e]=new this.constructor(n).splitObjectAtPosition(fs(t)+o),[n,r,e-1]}getObjectAtPosition(t){let{index:e}=this.findIndexAndOffsetAtPosition(t);return this.objects[e]}splitObjectAtPosition(t){let e,n,{index:r,offset:o}=this.findIndexAndOffsetAtPosition(t),s=this.objects.slice(0);if(r!=null)if(o===0)e=r,n=0;else{let l=this.getObjectAtIndex(r),[c,u]=l.splitAtOffset(o);s.splice(r,1,c,u),e=r+1,n=c.getLength()-o}else e=s.length,n=0;return[s,e,n]}consolidate(){let t=[],e=this.objects[0];return this.objects.slice(1).forEach(n=>{var r,o;(r=(o=e).canBeConsolidatedWith)!==null&&r!==void 0&&r.call(o,n)?e=e.consolidateWith(n):(t.push(e),e=n)}),e&&t.push(e),new this.constructor(t)}consolidateFromIndexToIndex(t,e){let n=this.objects.slice(0).slice(t,e+1),r=new this.constructor(n).consolidate().toArray();return this.splice(t,n.length,...r)}findIndexAndOffsetAtPosition(t){let e,n=0;for(e=0;ethis.endPosition+=t.getLength())),this.endPosition}toString(){return this.objects.join("")}toArray(){return this.objects.slice(0)}toJSON(){return this.toArray()}isEqualTo(t){return super.isEqualTo(...arguments)||ms(this.objects,t?.objects)}contentsForInspection(){return{objects:"[".concat(this.objects.map(t=>t.inspect()).join(", "),"]")}}},ms=function(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(i.length!==t.length)return!1;let e=!0;for(let n=0;ni[0],fs=i=>i[1],K=class extends dt{static textForAttachmentWithAttributes(t,e){return new this([new xt(t,e)])}static textForStringWithAttributes(t,e){return new this([new ve(t,e)])}static fromJSON(t){return new this(Array.from(t).map(e=>mt.fromJSON(e)))}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments);let e=t.filter(n=>!n.isEmpty());this.pieceList=new $t(e)}copy(){return this.copyWithPieceList(this.pieceList)}copyWithPieceList(t){return new this.constructor(t.consolidate().toArray())}copyUsingObjectMap(t){let e=this.getPieces().map(n=>t.find(n)||n);return new this.constructor(e)}appendText(t){return this.insertTextAtPosition(t,this.getLength())}insertTextAtPosition(t,e){return this.copyWithPieceList(this.pieceList.insertSplittableListAtPosition(t.pieceList,e))}removeTextAtRange(t){return this.copyWithPieceList(this.pieceList.removeObjectsInRange(t))}replaceTextAtRange(t,e){return this.removeTextAtRange(e).insertTextAtPosition(t,e[0])}moveTextFromRangeToPosition(t,e){if(t[0]<=e&&e<=t[1])return;let n=this.getTextAtRange(t),r=n.getLength();return t[0]n.copyWithAdditionalAttributes(t)))}removeAttributeAtRange(t,e){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e,n=>n.copyWithoutAttribute(t)))}setAttributesAtRange(t,e){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e,n=>n.copyWithAttributes(t)))}getAttributesAtPosition(t){var e;return((e=this.pieceList.getObjectAtPosition(t))===null||e===void 0?void 0:e.getAttributes())||{}}getCommonAttributes(){let t=Array.from(this.pieceList.toArray()).map(e=>e.getAttributes());return U.fromCommonAttributesOfObjects(t).toObject()}getCommonAttributesAtRange(t){return this.getTextAtRange(t).getCommonAttributes()||{}}getExpandedRangeForAttributeAtOffset(t,e){let n,r=n=e,o=this.getLength();for(;r>0&&this.getCommonAttributesAtRange([r-1,n])[t];)r--;for(;n!!t.attachment)}getAttachments(){return this.getAttachmentPieces().map(t=>t.attachment)}getAttachmentAndPositionById(t){let e=0;for(let r of this.pieceList.toArray()){var n;if(((n=r.attachment)===null||n===void 0?void 0:n.id)===t)return{attachment:r.attachment,position:e};e+=r.length}return{attachment:null,position:null}}getAttachmentById(t){let{attachment:e}=this.getAttachmentAndPositionById(t);return e}getRangeOfAttachment(t){let e=this.getAttachmentAndPositionById(t.id),n=e.position;if(t=e.attachment)return[n,n+1]}updateAttributesForAttachment(t,e){let n=this.getRangeOfAttachment(e);return n?this.addAttributesAtRange(t,n):this}getLength(){return this.pieceList.getEndPosition()}isEmpty(){return this.getLength()===0}isEqualTo(t){var e;return super.isEqualTo(t)||(t==null||(e=t.pieceList)===null||e===void 0?void 0:e.isEqualTo(this.pieceList))}isBlockBreak(){return this.getLength()===1&&this.pieceList.getObjectAtIndex(0).isBlockBreak()}eachPiece(t){return this.pieceList.eachObject(t)}getPieces(){return this.pieceList.toArray()}getPieceAtPosition(t){return this.pieceList.getObjectAtPosition(t)}contentsForInspection(){return{pieceList:this.pieceList.inspect()}}toSerializableText(){let t=this.pieceList.selectSplittableList(e=>e.isSerializable());return this.copyWithPieceList(t)}toString(){return this.pieceList.toString()}toJSON(){return this.pieceList.toJSON()}toConsole(){return JSON.stringify(this.pieceList.toArray().map(t=>JSON.parse(t.toConsole())))}getDirection(){return Ro(this.toString())}isRTL(){return this.getDirection()==="rtl"}},$=class extends dt{static fromJSON(t){return new this(K.fromJSON(t.text),t.attributes,t.htmlAttributes)}constructor(t,e,n){super(...arguments),this.text=bs(t||new K),this.attributes=e||[],this.htmlAttributes=n||{}}isEmpty(){return this.text.isBlockBreak()}isEqualTo(t){return!!super.isEqualTo(t)||this.text.isEqualTo(t?.text)&&Ft(this.attributes,t?.attributes)&&Xt(this.htmlAttributes,t?.htmlAttributes)}copyWithText(t){return new $(t,this.attributes,this.htmlAttributes)}copyWithoutText(){return this.copyWithText(null)}copyWithAttributes(t){return new $(this.text,t,this.htmlAttributes)}copyWithoutAttributes(){return this.copyWithAttributes(null)}copyUsingObjectMap(t){let e=t.find(this.text);return e?this.copyWithText(e):this.copyWithText(this.text.copyUsingObjectMap(t))}addAttribute(t){let e=this.attributes.concat(br(t));return this.copyWithAttributes(e)}addHTMLAttribute(t,e){let n=Object.assign({},this.htmlAttributes,{[t]:e});return new $(this.text,this.attributes,n)}removeAttribute(t){let{listAttribute:e}=L(t),n=Ar(Ar(this.attributes,t),e);return this.copyWithAttributes(n)}removeLastAttribute(){return this.removeAttribute(this.getLastAttribute())}getLastAttribute(){return vr(this.attributes)}getAttributes(){return this.attributes.slice(0)}getAttributeLevel(){return this.attributes.length}getAttributeAtLevel(t){return this.attributes[t-1]}hasAttribute(t){return this.attributes.includes(t)}hasAttributes(){return this.getAttributeLevel()>0}getLastNestableAttribute(){return vr(this.getNestableAttributes())}getNestableAttributes(){return this.attributes.filter(t=>L(t).nestable)}getNestingLevel(){return this.getNestableAttributes().length}decreaseNestingLevel(){let t=this.getLastNestableAttribute();return t?this.removeAttribute(t):this}increaseNestingLevel(){let t=this.getLastNestableAttribute();if(t){let e=this.attributes.lastIndexOf(t),n=vi(this.attributes,e+1,0,...br(t));return this.copyWithAttributes(n)}return this}getListItemAttributes(){return this.attributes.filter(t=>L(t).listAttribute)}isListItem(){var t;return(t=L(this.getLastAttribute()))===null||t===void 0?void 0:t.listAttribute}isTerminalBlock(){var t;return(t=L(this.getLastAttribute()))===null||t===void 0?void 0:t.terminal}breaksOnReturn(){var t;return(t=L(this.getLastAttribute()))===null||t===void 0?void 0:t.breakOnReturn}findLineBreakInDirectionFromPosition(t,e){let n=this.toString(),r;switch(t){case"forward":r=n.indexOf(` `,e);break;case"backward":r=n.slice(0,e).lastIndexOf(` `)}if(r!==-1)return r}contentsForInspection(){return{text:this.text.inspect(),attributes:this.attributes}}toString(){return this.text.toString()}toJSON(){return{text:this.text,attributes:this.attributes,htmlAttributes:this.htmlAttributes}}getDirection(){return this.text.getDirection()}isRTL(){return this.text.isRTL()}getLength(){return this.text.getLength()}canBeConsolidatedWith(t){return!this.hasAttributes()&&!t.hasAttributes()&&this.getDirection()===t.getDirection()}consolidateWith(t){let e=K.textForStringWithAttributes(` `),n=this.getTextWithoutBlockBreak().appendText(e);return this.copyWithText(n.appendText(t.text))}splitAtOffset(t){let e,n;return t===0?(e=null,n=this):t===this.getLength()?(e=this,n=null):(e=this.copyWithText(this.text.getTextAtRange([0,t])),n=this.copyWithText(this.text.getTextAtRange([t,this.getLength()]))),[e,n]}getBlockBreakPosition(){return this.text.getLength()-1}getTextWithoutBlockBreak(){return Kr(this.text)?this.text.getTextAtRange([0,this.getBlockBreakPosition()]):this.text.copy()}canBeGrouped(t){return this.attributes[t]}canBeGroupedWith(t,e){let n=t.getAttributes(),r=n[e],o=this.attributes[e];return o===r&&!(L(o).group===!1&&!(()=>{if(!De){De=[];for(let s in W){let{listAttribute:l}=W[s];l!=null&&De.push(l)}}return De})().includes(n[e+1]))&&(this.getDirection()===t.getDirection()||t.isEmpty())}},bs=function(i){return i=vs(i),i=ys(i)},vs=function(i){let t=!1,e=i.getPieces(),n=e.slice(0,e.length-1),r=e[e.length-1];return r?(n=n.map(o=>o.isBlockBreak()?(t=!0,xs(o)):o),t?new K([...n,r]):i):i},As=K.textForStringWithAttributes(` -`,{blockBreak:!0}),ys=function(i){return Kr(i)?i:i.appendText(As)},Kr=function(i){let t=i.getLength();return t===0?!1:i.getTextAtRange([t-1,t]).isBlockBreak()},xs=i=>i.copyWithoutAttribute("blockBreak"),br=function(i){let{listAttribute:t}=L(i);return t?[t,i]:[i]},vr=i=>i.slice(-1)[0],Ar=function(i,t){let e=i.lastIndexOf(t);return e===-1?i:vi(i,e,1)},z=class extends dt{static fromJSON(t){return new this(Array.from(t).map(e=>$.fromJSON(e)))}static fromString(t,e){let n=K.textForStringWithAttributes(t,e);return new this([new $(n)])}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),t.length===0&&(t=[new $]),this.blockList=$t.box(t)}isEmpty(){let t=this.getBlockAtIndex(0);return this.blockList.length===1&&t.isEmpty()&&!t.hasAttributes()}copy(){let t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).consolidateBlocks?this.blockList.consolidate().toArray():this.blockList.toArray();return new this.constructor(t)}copyUsingObjectsFromDocument(t){let e=new ei(t.getObjects());return this.copyUsingObjectMap(e)}copyUsingObjectMap(t){let e=this.getBlocks().map(n=>t.find(n)||n.copyUsingObjectMap(t));return new this.constructor(e)}copyWithBaseBlockAttributes(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=this.getBlocks().map(n=>{let r=t.concat(n.getAttributes());return n.copyWithAttributes(r)});return new this.constructor(e)}replaceBlock(t,e){let n=this.blockList.indexOf(t);return n===-1?this:new this.constructor(this.blockList.replaceObjectAtIndex(e,n))}insertDocumentAtRange(t,e){let{blockList:n}=t;e=y(e);let[r]=e,{index:o,offset:s}=this.locationFromPosition(r),l=this,c=this.getBlockAtPosition(r);return ht(e)&&c.isEmpty()&&!c.hasAttributes()?l=new this.constructor(l.blockList.removeObjectAtIndex(o)):c.getBlockBreakPosition()===s&&r++,l=l.removeTextAtRange(e),new this.constructor(l.blockList.insertSplittableListAtPosition(n,r))}mergeDocumentAtRange(t,e){let n,r;e=y(e);let[o]=e,s=this.locationFromPosition(o),l=this.getBlockAtIndex(s.index).getAttributes(),c=t.getBaseBlockAttributes(),u=l.slice(-c.length);if(Ft(c,u)){let T=l.slice(0,-c.length);n=t.copyWithBaseBlockAttributes(T)}else n=t.copy({consolidateBlocks:!0}).copyWithBaseBlockAttributes(l);let d=n.getBlockCount(),C=n.getBlockAtIndex(0);if(Ft(l,C.getAttributes())){let T=C.getTextWithoutBlockBreak();if(r=this.insertTextAtRange(T,e),d>1){n=new this.constructor(n.getBlocks().slice(1));let H=o+T.getLength();r=r.insertDocumentAtRange(n,H)}}else r=this.insertDocumentAtRange(n,e);return r}insertTextAtRange(t,e){e=y(e);let[n]=e,{index:r,offset:o}=this.locationFromPosition(n),s=this.removeTextAtRange(e);return new this.constructor(s.blockList.editObjectAtIndex(r,l=>l.copyWithText(l.text.insertTextAtPosition(t,o))))}removeTextAtRange(t){let e;t=y(t);let[n,r]=t;if(ht(t))return this;let[o,s]=Array.from(this.locationRangeFromRange(t)),l=o.index,c=o.offset,u=this.getBlockAtIndex(l),d=s.index,C=s.offset,T=this.getBlockAtIndex(d);if(r-n==1&&u.getBlockBreakPosition()===c&&T.getBlockBreakPosition()!==C&&T.text.getStringAtPosition(C)===` +`,{blockBreak:!0}),ys=function(i){return Kr(i)?i:i.appendText(As)},Kr=function(i){let t=i.getLength();return t===0?!1:i.getTextAtRange([t-1,t]).isBlockBreak()},xs=i=>i.copyWithoutAttribute("blockBreak"),br=function(i){let{listAttribute:t}=L(i);return t?[t,i]:[i]},vr=i=>i.slice(-1)[0],Ar=function(i,t){let e=i.lastIndexOf(t);return e===-1?i:vi(i,e,1)},z=class extends dt{static fromJSON(t){return new this(Array.from(t).map(e=>$.fromJSON(e)))}static fromString(t,e){let n=K.textForStringWithAttributes(t,e);return new this([new $(n)])}constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),t.length===0&&(t=[new $]),this.blockList=$t.box(t)}isEmpty(){let t=this.getBlockAtIndex(0);return this.blockList.length===1&&t.isEmpty()&&!t.hasAttributes()}copy(){let t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).consolidateBlocks?this.blockList.consolidate().toArray():this.blockList.toArray();return new this.constructor(t)}copyUsingObjectsFromDocument(t){let e=new ni(t.getObjects());return this.copyUsingObjectMap(e)}copyUsingObjectMap(t){let e=this.getBlocks().map(n=>t.find(n)||n.copyUsingObjectMap(t));return new this.constructor(e)}copyWithBaseBlockAttributes(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=this.getBlocks().map(n=>{let r=t.concat(n.getAttributes());return n.copyWithAttributes(r)});return new this.constructor(e)}replaceBlock(t,e){let n=this.blockList.indexOf(t);return n===-1?this:new this.constructor(this.blockList.replaceObjectAtIndex(e,n))}insertDocumentAtRange(t,e){let{blockList:n}=t;e=y(e);let[r]=e,{index:o,offset:s}=this.locationFromPosition(r),l=this,c=this.getBlockAtPosition(r);return ht(e)&&c.isEmpty()&&!c.hasAttributes()?l=new this.constructor(l.blockList.removeObjectAtIndex(o)):c.getBlockBreakPosition()===s&&r++,l=l.removeTextAtRange(e),new this.constructor(l.blockList.insertSplittableListAtPosition(n,r))}mergeDocumentAtRange(t,e){let n,r;e=y(e);let[o]=e,s=this.locationFromPosition(o),l=this.getBlockAtIndex(s.index).getAttributes(),c=t.getBaseBlockAttributes(),u=l.slice(-c.length);if(Ft(c,u)){let T=l.slice(0,-c.length);n=t.copyWithBaseBlockAttributes(T)}else n=t.copy({consolidateBlocks:!0}).copyWithBaseBlockAttributes(l);let d=n.getBlockCount(),C=n.getBlockAtIndex(0);if(Ft(l,C.getAttributes())){let T=C.getTextWithoutBlockBreak();if(r=this.insertTextAtRange(T,e),d>1){n=new this.constructor(n.getBlocks().slice(1));let H=o+T.getLength();r=r.insertDocumentAtRange(n,H)}}else r=this.insertDocumentAtRange(n,e);return r}insertTextAtRange(t,e){e=y(e);let[n]=e,{index:r,offset:o}=this.locationFromPosition(n),s=this.removeTextAtRange(e);return new this.constructor(s.blockList.editObjectAtIndex(r,l=>l.copyWithText(l.text.insertTextAtPosition(t,o))))}removeTextAtRange(t){let e;t=y(t);let[n,r]=t;if(ht(t))return this;let[o,s]=Array.from(this.locationRangeFromRange(t)),l=o.index,c=o.offset,u=this.getBlockAtIndex(l),d=s.index,C=s.offset,T=this.getBlockAtIndex(d);if(r-n==1&&u.getBlockBreakPosition()===c&&T.getBlockBreakPosition()!==C&&T.text.getStringAtPosition(C)===` `)e=this.blockList.editObjectAtIndex(d,H=>H.copyWithText(H.text.removeTextAtRange([C,C+1])));else{let H,tt=u.text.getTextAtRange([0,c]),M=T.text.getTextAtRange([C,T.getLength()]),pt=tt.appendText(M);H=l!==d&&c===0&&u.getAttributeLevel()>=T.getAttributeLevel()?T.copyWithText(pt):u.copyWithText(pt);let Ct=d+1-l;e=this.blockList.splice(l,Ct,H)}return new this.constructor(e)}moveTextFromRangeToPosition(t,e){let n;t=y(t);let[r,o]=t;if(r<=e&&e<=o)return this;let s=this.getDocumentAtRange(t),l=this.removeTextAtRange(t),c=rr=r.editObjectAtIndex(l,function(){return L(t)?o.addAttribute(t,e):s[0]===s[1]?o:o.copyWithText(o.text.addAttributeAtRange(t,e,s))})),new this.constructor(r)}addAttribute(t,e){let{blockList:n}=this;return this.eachBlock((r,o)=>n=n.editObjectAtIndex(o,()=>r.addAttribute(t,e))),new this.constructor(n)}removeAttributeAtRange(t,e){let{blockList:n}=this;return this.eachBlockAtRange(e,function(r,o,s){L(t)?n=n.editObjectAtIndex(s,()=>r.removeAttribute(t)):o[0]!==o[1]&&(n=n.editObjectAtIndex(s,()=>r.copyWithText(r.text.removeAttributeAtRange(t,o))))}),new this.constructor(n)}updateAttributesForAttachment(t,e){let n=this.getRangeOfAttachment(e),[r]=Array.from(n),{index:o}=this.locationFromPosition(r),s=this.getTextAtIndex(o);return new this.constructor(this.blockList.editObjectAtIndex(o,l=>l.copyWithText(s.updateAttributesForAttachment(t,e))))}removeAttributeForAttachment(t,e){let n=this.getRangeOfAttachment(e);return this.removeAttributeAtRange(t,n)}setHTMLAttributeAtPosition(t,e,n){let r=this.getBlockAtPosition(t),o=r.addHTMLAttribute(e,n);return this.replaceBlock(r,o)}insertBlockBreakAtRange(t){let e;t=y(t);let[n]=t,{offset:r}=this.locationFromPosition(n),o=this.removeTextAtRange(t);return r===0&&(e=[new $]),new this.constructor(o.blockList.insertSplittableListAtPosition(new $t(e),n))}applyBlockAttributeAtRange(t,e,n){let r=this.expandRangeToLineBreaksAndSplitBlocks(n),o=r.document;n=r.range;let s=L(t);if(s.listAttribute){o=o.removeLastListAttributeAtRange(n,{exceptAttributeName:t});let l=o.convertLineBreaksToBlockBreaksInRange(n);o=l.document,n=l.range}else o=s.exclusive?o.removeBlockAttributesAtRange(n):s.terminal?o.removeLastTerminalAttributeAtRange(n):o.consolidateBlocksAtRange(n);return o.addAttributeAtRange(t,e,n)}removeLastListAttributeAtRange(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{blockList:n}=this;return this.eachBlockAtRange(t,function(r,o,s){let l=r.getLastAttribute();l&&L(l).listAttribute&&l!==e.exceptAttributeName&&(n=n.editObjectAtIndex(s,()=>r.removeAttribute(l)))}),new this.constructor(n)}removeLastTerminalAttributeAtRange(t){let{blockList:e}=this;return this.eachBlockAtRange(t,function(n,r,o){let s=n.getLastAttribute();s&&L(s).terminal&&(e=e.editObjectAtIndex(o,()=>n.removeAttribute(s)))}),new this.constructor(e)}removeBlockAttributesAtRange(t){let{blockList:e}=this;return this.eachBlockAtRange(t,function(n,r,o){n.hasAttributes()&&(e=e.editObjectAtIndex(o,()=>n.copyWithoutAttributes()))}),new this.constructor(e)}expandRangeToLineBreaksAndSplitBlocks(t){let e;t=y(t);let[n,r]=t,o=this.locationFromPosition(n),s=this.locationFromPosition(r),l=this,c=l.getBlockAtIndex(o.index);if(o.offset=c.findLineBreakInDirectionFromPosition("backward",o.offset),o.offset!=null&&(e=l.positionFromLocation(o),l=l.insertBlockBreakAtRange([e,e+1]),s.index+=1,s.offset-=l.getBlockAtIndex(o.index).getLength(),o.index+=1),o.offset=0,s.offset===0&&s.index>o.index)s.index-=1,s.offset=l.getBlockAtIndex(s.index).getBlockBreakPosition();else{let u=l.getBlockAtIndex(s.index);u.text.getStringAtRange([s.offset-1,s.offset])===` -`?s.offset-=1:s.offset=u.findLineBreakInDirectionFromPosition("forward",s.offset),s.offset!==u.getBlockBreakPosition()&&(e=l.positionFromLocation(s),l=l.insertBlockBreakAtRange([e,e+1]))}return n=l.positionFromLocation(o),r=l.positionFromLocation(s),{document:l,range:t=y([n,r])}}convertLineBreaksToBlockBreaksInRange(t){t=y(t);let[e]=t,n=this.getStringAtRange(t).slice(0,-1),r=this;return n.replace(/.*?\n/g,function(o){e+=o.length,r=r.insertBlockBreakAtRange([e-1,e])}),{document:r,range:t}}consolidateBlocksAtRange(t){t=y(t);let[e,n]=t,r=this.locationFromPosition(e).index,o=this.locationFromPosition(n).index;return new this.constructor(this.blockList.consolidateFromIndexToIndex(r,o))}getDocumentAtRange(t){t=y(t);let e=this.blockList.getSplittableListInRange(t).toArray();return new this.constructor(e)}getStringAtRange(t){let e,n=t=y(t);return n[n.length-1]!==this.getLength()&&(e=-1),this.getDocumentAtRange(t).toString().slice(0,e)}getBlockAtIndex(t){return this.blockList.getObjectAtIndex(t)}getBlockAtPosition(t){let{index:e}=this.locationFromPosition(t);return this.getBlockAtIndex(e)}getTextAtIndex(t){var e;return(e=this.getBlockAtIndex(t))===null||e===void 0?void 0:e.text}getTextAtPosition(t){let{index:e}=this.locationFromPosition(t);return this.getTextAtIndex(e)}getPieceAtPosition(t){let{index:e,offset:n}=this.locationFromPosition(t);return this.getTextAtIndex(e).getPieceAtPosition(n)}getCharacterAtPosition(t){let{index:e,offset:n}=this.locationFromPosition(t);return this.getTextAtIndex(e).getStringAtRange([n,n+1])}getLength(){return this.blockList.getEndPosition()}getBlocks(){return this.blockList.toArray()}getBlockCount(){return this.blockList.length}getEditCount(){return this.editCount}eachBlock(t){return this.blockList.eachObject(t)}eachBlockAtRange(t,e){let n,r;t=y(t);let[o,s]=t,l=this.locationFromPosition(o),c=this.locationFromPosition(s);if(l.index===c.index)return n=this.getBlockAtIndex(l.index),r=[l.offset,c.offset],e(n,r,l.index);for(let u=l.index;u<=c.index;u++)if(n=this.getBlockAtIndex(u),n){switch(u){case l.index:r=[l.offset,n.text.getLength()];break;case c.index:r=[0,c.offset];break;default:r=[0,n.text.getLength()]}e(n,r,u)}}getCommonAttributesAtRange(t){t=y(t);let[e]=t;if(ht(t))return this.getCommonAttributesAtPosition(e);{let n=[],r=[];return this.eachBlockAtRange(t,function(o,s){if(s[0]!==s[1])return n.push(o.text.getCommonAttributesAtRange(s)),r.push(yr(o))}),U.fromCommonAttributesOfObjects(n).merge(U.fromCommonAttributesOfObjects(r)).toObject()}}getCommonAttributesAtPosition(t){let e,n,{index:r,offset:o}=this.locationFromPosition(t),s=this.getBlockAtIndex(r);if(!s)return{};let l=yr(s),c=s.text.getAttributesAtPosition(o),u=s.text.getAttributesAtPosition(o-1),d=Object.keys(It).filter(C=>It[C].inheritable);for(e in u)n=u[e],(n===c[e]||d.includes(e))&&(l[e]=n);return l}getRangeOfCommonAttributeAtPosition(t,e){let{index:n,offset:r}=this.locationFromPosition(e),o=this.getTextAtIndex(n),[s,l]=Array.from(o.getExpandedRangeForAttributeAtOffset(t,r)),c=this.positionFromLocation({index:n,offset:s}),u=this.positionFromLocation({index:n,offset:l});return y([c,u])}getBaseBlockAttributes(){let t=this.getBlockAtIndex(0).getAttributes();for(let e=1;e{let o=[];for(let s=0;s{let{text:n}=e;return t=t.concat(n.getAttachmentPieces())}),t}getAttachments(){return this.getAttachmentPieces().map(t=>t.attachment)}getRangeOfAttachment(t){let e=0,n=this.blockList.toArray();for(let r=0;r{let o=r.getLength();r.hasAttribute(t)&&n.push([e,e+o]),e+=o}),n}findRangesForTextAttribute(t){let{withValue:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=0,r=[],o=[];return this.getPieces().forEach(s=>{let l=s.getLength();(function(c){return e?c.getAttribute(t)===e:c.hasAttribute(t)})(s)&&(r[1]===n?r[1]=n+l:o.push(r=[n,n+l])),n+=l}),o}locationFromPosition(t){let e=this.blockList.findIndexAndOffsetAtPosition(Math.max(0,t));if(e.index!=null)return e;{let n=this.getBlocks();return{index:n.length-1,offset:n[n.length-1].getLength()}}}positionFromLocation(t){return this.blockList.findPositionAtIndexAndOffset(t.index,t.offset)}locationRangeFromPosition(t){return y(this.locationFromPosition(t))}locationRangeFromRange(t){if(!(t=y(t)))return;let[e,n]=Array.from(t),r=this.locationFromPosition(e),o=this.locationFromPosition(n);return y([r,o])}rangeFromLocationRange(t){let e;t=y(t);let n=this.positionFromLocation(t[0]);return ht(t)||(e=this.positionFromLocation(t[1])),y([n,e])}isEqualTo(t){return this.blockList.isEqualTo(t?.blockList)}getTexts(){return this.getBlocks().map(t=>t.text)}getPieces(){let t=[];return Array.from(this.getTexts()).forEach(e=>{t.push(...Array.from(e.getPieces()||[]))}),t}getObjects(){return this.getBlocks().concat(this.getTexts()).concat(this.getPieces())}toSerializableDocument(){let t=[];return this.blockList.eachObject(e=>t.push(e.copyWithText(e.text.toSerializableText()))),new this.constructor(t)}toString(){return this.blockList.toString()}toJSON(){return this.blockList.toJSON()}toConsole(){return JSON.stringify(this.blockList.toArray().map(t=>JSON.parse(t.text.toConsole())))}},yr=function(i){let t={},e=i.getLastAttribute();return e&&(t[e]=!0),t},_n=function(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return{string:i=ue(i),attributes:t,type:"string"}},xr=(i,t)=>{try{return JSON.parse(i.getAttribute("data-trix-".concat(t)))}catch{return{}}},Mt=class extends R{static parse(t,e){let n=new this(t,e);return n.parse(),n}constructor(t){let{referenceElement:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.html=t,this.referenceElement=e,this.blocks=[],this.blockElements=[],this.processedElements=[]}getDocument(){return z.fromJSON(this.blocks)}parse(){try{this.createHiddenContainer(),Kt.setHTML(this.containerElement,this.html);let t=je(this.containerElement,{usingFilter:Es});for(;t.nextNode();)this.processNode(t.currentNode);return this.translateBlockElementMarginsToNewlines()}finally{this.removeHiddenContainer()}}createHiddenContainer(){return this.referenceElement?(this.containerElement=this.referenceElement.cloneNode(!1),this.containerElement.removeAttribute("id"),this.containerElement.setAttribute("data-trix-internal",""),this.containerElement.style.display="none",this.referenceElement.parentNode.insertBefore(this.containerElement,this.referenceElement.nextSibling)):(this.containerElement=p({tagName:"div",style:{display:"none"}}),document.body.appendChild(this.containerElement))}removeHiddenContainer(){return At(this.containerElement)}processNode(t){switch(t.nodeType){case Node.TEXT_NODE:if(!this.isInsignificantTextNode(t))return this.appendBlockForTextNode(t),this.processTextNode(t);break;case Node.ELEMENT_NODE:return this.appendBlockForElement(t),this.processElement(t)}}appendBlockForTextNode(t){let e=t.parentNode;if(e===this.currentBlockElement&&this.isBlockElement(t.previousSibling))return this.appendStringWithAttributes(` +`?s.offset-=1:s.offset=u.findLineBreakInDirectionFromPosition("forward",s.offset),s.offset!==u.getBlockBreakPosition()&&(e=l.positionFromLocation(s),l=l.insertBlockBreakAtRange([e,e+1]))}return n=l.positionFromLocation(o),r=l.positionFromLocation(s),{document:l,range:t=y([n,r])}}convertLineBreaksToBlockBreaksInRange(t){t=y(t);let[e]=t,n=this.getStringAtRange(t).slice(0,-1),r=this;return n.replace(/.*?\n/g,function(o){e+=o.length,r=r.insertBlockBreakAtRange([e-1,e])}),{document:r,range:t}}consolidateBlocksAtRange(t){t=y(t);let[e,n]=t,r=this.locationFromPosition(e).index,o=this.locationFromPosition(n).index;return new this.constructor(this.blockList.consolidateFromIndexToIndex(r,o))}getDocumentAtRange(t){t=y(t);let e=this.blockList.getSplittableListInRange(t).toArray();return new this.constructor(e)}getStringAtRange(t){let e,n=t=y(t);return n[n.length-1]!==this.getLength()&&(e=-1),this.getDocumentAtRange(t).toString().slice(0,e)}getBlockAtIndex(t){return this.blockList.getObjectAtIndex(t)}getBlockAtPosition(t){let{index:e}=this.locationFromPosition(t);return this.getBlockAtIndex(e)}getTextAtIndex(t){var e;return(e=this.getBlockAtIndex(t))===null||e===void 0?void 0:e.text}getTextAtPosition(t){let{index:e}=this.locationFromPosition(t);return this.getTextAtIndex(e)}getPieceAtPosition(t){let{index:e,offset:n}=this.locationFromPosition(t);return this.getTextAtIndex(e).getPieceAtPosition(n)}getCharacterAtPosition(t){let{index:e,offset:n}=this.locationFromPosition(t);return this.getTextAtIndex(e).getStringAtRange([n,n+1])}getLength(){return this.blockList.getEndPosition()}getBlocks(){return this.blockList.toArray()}getBlockCount(){return this.blockList.length}getEditCount(){return this.editCount}eachBlock(t){return this.blockList.eachObject(t)}eachBlockAtRange(t,e){let n,r;t=y(t);let[o,s]=t,l=this.locationFromPosition(o),c=this.locationFromPosition(s);if(l.index===c.index)return n=this.getBlockAtIndex(l.index),r=[l.offset,c.offset],e(n,r,l.index);for(let u=l.index;u<=c.index;u++)if(n=this.getBlockAtIndex(u),n){switch(u){case l.index:r=[l.offset,n.text.getLength()];break;case c.index:r=[0,c.offset];break;default:r=[0,n.text.getLength()]}e(n,r,u)}}getCommonAttributesAtRange(t){t=y(t);let[e]=t;if(ht(t))return this.getCommonAttributesAtPosition(e);{let n=[],r=[];return this.eachBlockAtRange(t,function(o,s){if(s[0]!==s[1])return n.push(o.text.getCommonAttributesAtRange(s)),r.push(yr(o))}),U.fromCommonAttributesOfObjects(n).merge(U.fromCommonAttributesOfObjects(r)).toObject()}}getCommonAttributesAtPosition(t){let e,n,{index:r,offset:o}=this.locationFromPosition(t),s=this.getBlockAtIndex(r);if(!s)return{};let l=yr(s),c=s.text.getAttributesAtPosition(o),u=s.text.getAttributesAtPosition(o-1),d=Object.keys(It).filter(C=>It[C].inheritable);for(e in u)n=u[e],(n===c[e]||d.includes(e))&&(l[e]=n);return l}getRangeOfCommonAttributeAtPosition(t,e){let{index:n,offset:r}=this.locationFromPosition(e),o=this.getTextAtIndex(n),[s,l]=Array.from(o.getExpandedRangeForAttributeAtOffset(t,r)),c=this.positionFromLocation({index:n,offset:s}),u=this.positionFromLocation({index:n,offset:l});return y([c,u])}getBaseBlockAttributes(){let t=this.getBlockAtIndex(0).getAttributes();for(let e=1;e{let o=[];for(let s=0;s{let{text:n}=e;return t=t.concat(n.getAttachmentPieces())}),t}getAttachments(){return this.getAttachmentPieces().map(t=>t.attachment)}getRangeOfAttachment(t){let e=0,n=this.blockList.toArray();for(let r=0;r{let o=r.getLength();r.hasAttribute(t)&&n.push([e,e+o]),e+=o}),n}findRangesForTextAttribute(t){let{withValue:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=0,r=[],o=[];return this.getPieces().forEach(s=>{let l=s.getLength();(function(c){return e?c.getAttribute(t)===e:c.hasAttribute(t)})(s)&&(r[1]===n?r[1]=n+l:o.push(r=[n,n+l])),n+=l}),o}locationFromPosition(t){let e=this.blockList.findIndexAndOffsetAtPosition(Math.max(0,t));if(e.index!=null)return e;{let n=this.getBlocks();return{index:n.length-1,offset:n[n.length-1].getLength()}}}positionFromLocation(t){return this.blockList.findPositionAtIndexAndOffset(t.index,t.offset)}locationRangeFromPosition(t){return y(this.locationFromPosition(t))}locationRangeFromRange(t){if(!(t=y(t)))return;let[e,n]=Array.from(t),r=this.locationFromPosition(e),o=this.locationFromPosition(n);return y([r,o])}rangeFromLocationRange(t){let e;t=y(t);let n=this.positionFromLocation(t[0]);return ht(t)||(e=this.positionFromLocation(t[1])),y([n,e])}isEqualTo(t){return this.blockList.isEqualTo(t?.blockList)}getTexts(){return this.getBlocks().map(t=>t.text)}getPieces(){let t=[];return Array.from(this.getTexts()).forEach(e=>{t.push(...Array.from(e.getPieces()||[]))}),t}getObjects(){return this.getBlocks().concat(this.getTexts()).concat(this.getPieces())}toSerializableDocument(){let t=[];return this.blockList.eachObject(e=>t.push(e.copyWithText(e.text.toSerializableText()))),new this.constructor(t)}toString(){return this.blockList.toString()}toJSON(){return this.blockList.toJSON()}toConsole(){return JSON.stringify(this.blockList.toArray().map(t=>JSON.parse(t.text.toConsole())))}},yr=function(i){let t={},e=i.getLastAttribute();return e&&(t[e]=!0),t},jn=function(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return{string:i=ue(i),attributes:t,type:"string"}},xr=(i,t)=>{try{return JSON.parse(i.getAttribute("data-trix-".concat(t)))}catch{return{}}},Mt=class extends R{static parse(t,e){let n=new this(t,e);return n.parse(),n}constructor(t){let{referenceElement:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.html=t,this.referenceElement=e,this.blocks=[],this.blockElements=[],this.processedElements=[]}getDocument(){return z.fromJSON(this.blocks)}parse(){try{this.createHiddenContainer(),Kt.setHTML(this.containerElement,this.html);let t=je(this.containerElement,{usingFilter:Es});for(;t.nextNode();)this.processNode(t.currentNode);return this.translateBlockElementMarginsToNewlines()}finally{this.removeHiddenContainer()}}createHiddenContainer(){return this.referenceElement?(this.containerElement=this.referenceElement.cloneNode(!1),this.containerElement.removeAttribute("id"),this.containerElement.setAttribute("data-trix-internal",""),this.containerElement.style.display="none",this.referenceElement.parentNode.insertBefore(this.containerElement,this.referenceElement.nextSibling)):(this.containerElement=p({tagName:"div",style:{display:"none"}}),document.body.appendChild(this.containerElement))}removeHiddenContainer(){return At(this.containerElement)}processNode(t){switch(t.nodeType){case Node.TEXT_NODE:if(!this.isInsignificantTextNode(t))return this.appendBlockForTextNode(t),this.processTextNode(t);break;case Node.ELEMENT_NODE:return this.appendBlockForElement(t),this.processElement(t)}}appendBlockForTextNode(t){let e=t.parentNode;if(e===this.currentBlockElement&&this.isBlockElement(t.previousSibling))return this.appendStringWithAttributes(` `);if(e===this.containerElement||this.isBlockElement(e)){var n;let r=this.getBlockAttributes(e),o=this.getBlockHTMLAttributes(e);Ft(r,(n=this.currentBlock)===null||n===void 0?void 0:n.attributes)||(this.currentBlock=this.appendBlockForAttributesWithElement(r,e,o),this.currentBlockElement=e)}}appendBlockForElement(t){let e=this.isBlockElement(t),n=Tt(this.currentBlockElement,t);if(e&&!this.isBlockElement(t.firstChild)){if(!this.isInsignificantTextNode(t.firstChild)||!this.isBlockElement(t.firstElementChild)){let r=this.getBlockAttributes(t),o=this.getBlockHTMLAttributes(t);if(t.firstChild){if(n&&Ft(r,this.currentBlock.attributes))return this.appendStringWithAttributes(` `);this.currentBlock=this.appendBlockForAttributesWithElement(r,t,o),this.currentBlockElement=t}}}else if(this.currentBlockElement&&!n&&!e){let r=this.findParentBlockElement(t);if(r)return this.appendBlockForElement(r);this.currentBlock=this.appendEmptyBlock(),this.currentBlockElement=null}}findParentBlockElement(t){let{parentElement:e}=t;for(;e&&e!==this.containerElement;){if(this.isBlockElement(e)&&this.blockElements.includes(e))return e;e=e.parentElement}return null}processTextNode(t){let e=t.data;var n;return Cr(t.parentNode)||(e=xi(e),Gr((n=t.previousSibling)===null||n===void 0?void 0:n.textContent)&&(e=Ss(e))),this.appendStringWithAttributes(e,this.getTextAttributes(t.parentNode))}processElement(t){let e;if(Lt(t)){if(e=xr(t,"attachment"),Object.keys(e).length){let n=this.getTextAttributes(t);this.appendAttachmentWithAttributes(e,n),t.innerHTML=""}return this.processedElements.push(t)}switch(j(t)){case"br":return this.isExtraBR(t)||this.isBlockElement(t.nextSibling)||this.appendStringWithAttributes(` -`,this.getTextAttributes(t)),this.processedElements.push(t);case"img":e={url:t.getAttribute("src"),contentType:"image"};let n=(r=>{let o=r.getAttribute("width"),s=r.getAttribute("height"),l={};return o&&(l.width=parseInt(o,10)),s&&(l.height=parseInt(s,10)),l})(t);for(let r in n){let o=n[r];e[r]=o}return this.appendAttachmentWithAttributes(e,this.getTextAttributes(t)),this.processedElements.push(t);case"tr":if(this.needsTableSeparator(t))return this.appendStringWithAttributes(Me.tableRowSeparator);break;case"td":if(this.needsTableSeparator(t))return this.appendStringWithAttributes(Me.tableCellSeparator)}}appendBlockForAttributesWithElement(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.blockElements.push(e);let r=function(){return{text:[],attributes:arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},htmlAttributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}}}(t,n);return this.blocks.push(r),r}appendEmptyBlock(){return this.appendBlockForAttributesWithElement([],null)}appendStringWithAttributes(t,e){return this.appendPiece(_n(t,e))}appendAttachmentWithAttributes(t,e){return this.appendPiece(function(n){return{attachment:n,attributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},type:"attachment"}}(t,e))}appendPiece(t){return this.blocks.length===0&&this.appendEmptyBlock(),this.blocks[this.blocks.length-1].text.push(t)}appendStringToTextAtIndex(t,e){let{text:n}=this.blocks[e],r=n[n.length-1];if(r?.type!=="string")return n.push(_n(t));r.string+=t}prependStringToTextAtIndex(t,e){let{text:n}=this.blocks[e],r=n[0];if(r?.type!=="string")return n.unshift(_n(t));r.string=t+r.string}getTextAttributes(t){let e,n={};for(let r in It){let o=It[r];if(o.tagName&&vt(t,{matchingSelector:o.tagName,untilNode:this.containerElement}))n[r]=!0;else if(o.parser){if(e=o.parser(t),e){let s=!1;for(let l of this.findBlockElementAncestors(t))if(o.parser(l)===e){s=!0;break}s||(n[r]=e)}}else o.styleProperty&&(e=t.style[o.styleProperty],e&&(n[r]=e))}if(Lt(t)){let r=xr(t,"attributes");for(let o in r)e=r[o],n[o]=e}return n}getBlockAttributes(t){let e=[];for(;t&&t!==this.containerElement;){for(let r in W){let o=W[r];var n;o.parse!==!1&&j(t)===o.tagName&&((n=o.test)!==null&&n!==void 0&&n.call(o,t)||!o.test)&&(e.push(r),o.listAttribute&&e.push(o.listAttribute))}t=t.parentNode}return e.reverse()}getBlockHTMLAttributes(t){let e={},n=Object.values(W).find(r=>r.tagName===j(t));return(n?.htmlAttributes||[]).forEach(r=>{t.hasAttribute(r)&&(e[r]=t.getAttribute(r))}),e}findBlockElementAncestors(t){let e=[];for(;t&&t!==this.containerElement;){let n=j(t);de().includes(n)&&e.push(t),t=t.parentNode}return e}isBlockElement(t){if(t?.nodeType===Node.ELEMENT_NODE&&!Lt(t)&&!vt(t,{matchingSelector:"td",untilNode:this.containerElement}))return de().includes(j(t))||window.getComputedStyle(t).display==="block"}isInsignificantTextNode(t){if(t?.nodeType!==Node.TEXT_NODE||!ks(t.data))return;let{parentNode:e,previousSibling:n,nextSibling:r}=t;return Cs(e.previousSibling)&&!this.isBlockElement(e.previousSibling)||Cr(e)?void 0:!n||this.isBlockElement(n)||!r||this.isBlockElement(r)}isExtraBR(t){return j(t)==="br"&&this.isBlockElement(t.parentNode)&&t.parentNode.lastChild===t}needsTableSeparator(t){if(Me.removeBlankTableCells){var e;let n=(e=t.previousSibling)===null||e===void 0?void 0:e.textContent;return n&&/\S/.test(n)}return t.previousSibling}translateBlockElementMarginsToNewlines(){let t=this.getMarginOfDefaultBlockElement();for(let e=0;e2*t.top&&this.prependStringToTextAtIndex(` +`,this.getTextAttributes(t)),this.processedElements.push(t);case"img":e={url:t.getAttribute("src"),contentType:"image"};let n=(r=>{let o=r.getAttribute("width"),s=r.getAttribute("height"),l={};return o&&(l.width=parseInt(o,10)),s&&(l.height=parseInt(s,10)),l})(t);for(let r in n){let o=n[r];e[r]=o}return this.appendAttachmentWithAttributes(e,this.getTextAttributes(t)),this.processedElements.push(t);case"tr":if(this.needsTableSeparator(t))return this.appendStringWithAttributes(Me.tableRowSeparator);break;case"td":if(this.needsTableSeparator(t))return this.appendStringWithAttributes(Me.tableCellSeparator)}}appendBlockForAttributesWithElement(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.blockElements.push(e);let r=function(){return{text:[],attributes:arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},htmlAttributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}}}(t,n);return this.blocks.push(r),r}appendEmptyBlock(){return this.appendBlockForAttributesWithElement([],null)}appendStringWithAttributes(t,e){return this.appendPiece(jn(t,e))}appendAttachmentWithAttributes(t,e){return this.appendPiece(function(n){return{attachment:n,attributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},type:"attachment"}}(t,e))}appendPiece(t){return this.blocks.length===0&&this.appendEmptyBlock(),this.blocks[this.blocks.length-1].text.push(t)}appendStringToTextAtIndex(t,e){let{text:n}=this.blocks[e],r=n[n.length-1];if(r?.type!=="string")return n.push(jn(t));r.string+=t}prependStringToTextAtIndex(t,e){let{text:n}=this.blocks[e],r=n[0];if(r?.type!=="string")return n.unshift(jn(t));r.string=t+r.string}getTextAttributes(t){let e,n={};for(let r in It){let o=It[r];if(o.tagName&&vt(t,{matchingSelector:o.tagName,untilNode:this.containerElement}))n[r]=!0;else if(o.parser){if(e=o.parser(t),e){let s=!1;for(let l of this.findBlockElementAncestors(t))if(o.parser(l)===e){s=!0;break}s||(n[r]=e)}}else o.styleProperty&&(e=t.style[o.styleProperty],e&&(n[r]=e))}if(Lt(t)){let r=xr(t,"attributes");for(let o in r)e=r[o],n[o]=e}return n}getBlockAttributes(t){let e=[];for(;t&&t!==this.containerElement;){for(let r in W){let o=W[r];var n;o.parse!==!1&&j(t)===o.tagName&&((n=o.test)!==null&&n!==void 0&&n.call(o,t)||!o.test)&&(e.push(r),o.listAttribute&&e.push(o.listAttribute))}t=t.parentNode}return e.reverse()}getBlockHTMLAttributes(t){let e={},n=Object.values(W).find(r=>r.tagName===j(t));return(n?.htmlAttributes||[]).forEach(r=>{t.hasAttribute(r)&&(e[r]=t.getAttribute(r))}),e}findBlockElementAncestors(t){let e=[];for(;t&&t!==this.containerElement;){let n=j(t);de().includes(n)&&e.push(t),t=t.parentNode}return e}isBlockElement(t){if(t?.nodeType===Node.ELEMENT_NODE&&!Lt(t)&&!vt(t,{matchingSelector:"td",untilNode:this.containerElement}))return de().includes(j(t))||window.getComputedStyle(t).display==="block"}isInsignificantTextNode(t){if(t?.nodeType!==Node.TEXT_NODE||!ks(t.data))return;let{parentNode:e,previousSibling:n,nextSibling:r}=t;return Cs(e.previousSibling)&&!this.isBlockElement(e.previousSibling)||Cr(e)?void 0:!n||this.isBlockElement(n)||!r||this.isBlockElement(r)}isExtraBR(t){return j(t)==="br"&&this.isBlockElement(t.parentNode)&&t.parentNode.lastChild===t}needsTableSeparator(t){if(Me.removeBlankTableCells){var e;let n=(e=t.previousSibling)===null||e===void 0?void 0:e.textContent;return n&&/\S/.test(n)}return t.previousSibling}translateBlockElementMarginsToNewlines(){let t=this.getMarginOfDefaultBlockElement();for(let e=0;e2*t.top&&this.prependStringToTextAtIndex(` `,e),n.bottom>2*t.bottom&&this.appendStringToTextAtIndex(` -`,e))}}getMarginOfBlockElementAtIndex(t){let e=this.blockElements[t];if(e&&e.textContent&&!de().includes(j(e))&&!this.processedElements.includes(e))return Er(e)}getMarginOfDefaultBlockElement(){let t=p(W.default.tagName);return this.containerElement.appendChild(t),Er(t)}},Cr=function(i){let{whiteSpace:t}=window.getComputedStyle(i);return["pre","pre-wrap","pre-line"].includes(t)},Cs=i=>i&&!Gr(i.textContent),Er=function(i){let t=window.getComputedStyle(i);if(t.display==="block")return{top:parseInt(t.marginTop),bottom:parseInt(t.marginBottom)}},Es=function(i){return j(i)==="style"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},Ss=i=>i.replace(new RegExp("^".concat(yi.source,"+")),""),ks=i=>new RegExp("^".concat(yi.source,"*$")).test(i),Gr=i=>/\s$/.test(i),Rs=["contenteditable","data-trix-id","data-trix-store-key","data-trix-mutable","data-trix-placeholder","tabindex"],ai="data-trix-serialized-attributes",Ts="[".concat(ai,"]"),ws=new RegExp("","g"),Ls={"application/json":function(i){let t;if(i instanceof z)t=i;else{if(!(i instanceof HTMLElement))throw new Error("unserializable object");t=Mt.parse(i.innerHTML).getDocument()}return t.toSerializableDocument().toJSONString()},"text/html":function(i){let t;if(i instanceof z)t=Gt.render(i);else{if(!(i instanceof HTMLElement))throw new Error("unserializable object");t=i.cloneNode(!0)}return Array.from(t.querySelectorAll("[data-trix-serialize=false]")).forEach(e=>{At(e)}),Rs.forEach(e=>{Array.from(t.querySelectorAll("[".concat(e,"]"))).forEach(n=>{n.removeAttribute(e)})}),Array.from(t.querySelectorAll(Ts)).forEach(e=>{try{let n=JSON.parse(e.getAttribute(ai));e.removeAttribute(ai);for(let r in n){let o=n[r];e.setAttribute(r,o)}}catch{}}),t.innerHTML.replace(ws,"")}},Ds=Object.freeze({__proto__:null}),E=class extends R{constructor(t,e){super(...arguments),this.attachmentManager=t,this.attachment=e,this.id=this.attachment.id,this.file=this.attachment.file}remove(){return this.attachmentManager.requestRemovalOfAttachment(this.attachment)}};E.proxyMethod("attachment.getAttribute"),E.proxyMethod("attachment.hasAttribute"),E.proxyMethod("attachment.setAttribute"),E.proxyMethod("attachment.getAttributes"),E.proxyMethod("attachment.setAttributes"),E.proxyMethod("attachment.isPending"),E.proxyMethod("attachment.isPreviewable"),E.proxyMethod("attachment.getURL"),E.proxyMethod("attachment.getHref"),E.proxyMethod("attachment.getFilename"),E.proxyMethod("attachment.getFilesize"),E.proxyMethod("attachment.getFormattedFilesize"),E.proxyMethod("attachment.getExtension"),E.proxyMethod("attachment.getContentType"),E.proxyMethod("attachment.getFile"),E.proxyMethod("attachment.setFile"),E.proxyMethod("attachment.releaseFile"),E.proxyMethod("attachment.getUploadProgress"),E.proxyMethod("attachment.setUploadProgress");var Ke=class extends R{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.managedAttachments={},Array.from(t).forEach(e=>{this.manageAttachment(e)})}getAttachments(){let t=[];for(let e in this.managedAttachments){let n=this.managedAttachments[e];t.push(n)}return t}manageAttachment(t){return this.managedAttachments[t.id]||(this.managedAttachments[t.id]=new E(this,t)),this.managedAttachments[t.id]}attachmentIsManaged(t){return t.id in this.managedAttachments}requestRemovalOfAttachment(t){var e,n;if(this.attachmentIsManaged(t))return(e=this.delegate)===null||e===void 0||(n=e.attachmentManagerDidRequestRemovalOfAttachment)===null||n===void 0?void 0:n.call(e,t)}unmanageAttachment(t){let e=this.managedAttachments[t.id];return delete this.managedAttachments[t.id],e}},Ge=class{constructor(t){this.composition=t,this.document=this.composition.document;let e=this.composition.getSelectedRange();this.startPosition=e[0],this.endPosition=e[1],this.startLocation=this.document.locationFromPosition(this.startPosition),this.endLocation=this.document.locationFromPosition(this.endPosition),this.block=this.document.getBlockAtIndex(this.endLocation.index),this.breaksOnReturn=this.block.breaksOnReturn(),this.previousCharacter=this.block.text.getStringAtPosition(this.endLocation.offset-1),this.nextCharacter=this.block.text.getStringAtPosition(this.endLocation.offset)}shouldInsertBlockBreak(){return this.block.hasAttributes()&&this.block.isListItem()&&!this.block.isEmpty()?this.startLocation.offset!==0:this.breaksOnReturn&&this.nextCharacter!==` +`,e))}}getMarginOfBlockElementAtIndex(t){let e=this.blockElements[t];if(e&&e.textContent&&!de().includes(j(e))&&!this.processedElements.includes(e))return Er(e)}getMarginOfDefaultBlockElement(){let t=p(W.default.tagName);return this.containerElement.appendChild(t),Er(t)}},Cr=function(i){let{whiteSpace:t}=window.getComputedStyle(i);return["pre","pre-wrap","pre-line"].includes(t)},Cs=i=>i&&!Gr(i.textContent),Er=function(i){let t=window.getComputedStyle(i);if(t.display==="block")return{top:parseInt(t.marginTop),bottom:parseInt(t.marginBottom)}},Es=function(i){return j(i)==="style"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},Ss=i=>i.replace(new RegExp("^".concat(yi.source,"+")),""),ks=i=>new RegExp("^".concat(yi.source,"*$")).test(i),Gr=i=>/\s$/.test(i),Rs=["contenteditable","data-trix-id","data-trix-store-key","data-trix-mutable","data-trix-placeholder","tabindex"],ai="data-trix-serialized-attributes",Ts="[".concat(ai,"]"),ws=new RegExp("","g"),Ls={"application/json":function(i){let t;if(i instanceof z)t=i;else{if(!(i instanceof HTMLElement))throw new Error("unserializable object");t=Mt.parse(i.innerHTML).getDocument()}return t.toSerializableDocument().toJSONString()},"text/html":function(i){let t;if(i instanceof z)t=Gt.render(i);else{if(!(i instanceof HTMLElement))throw new Error("unserializable object");t=i.cloneNode(!0)}return Array.from(t.querySelectorAll("[data-trix-serialize=false]")).forEach(e=>{At(e)}),Rs.forEach(e=>{Array.from(t.querySelectorAll("[".concat(e,"]"))).forEach(n=>{n.removeAttribute(e)})}),Array.from(t.querySelectorAll(Ts)).forEach(e=>{try{let n=JSON.parse(e.getAttribute(ai));e.removeAttribute(ai);for(let r in n){let o=n[r];e.setAttribute(r,o)}}catch{}}),t.innerHTML.replace(ws,"")}},Ds=Object.freeze({__proto__:null}),E=class extends R{constructor(t,e){super(...arguments),this.attachmentManager=t,this.attachment=e,this.id=this.attachment.id,this.file=this.attachment.file}remove(){return this.attachmentManager.requestRemovalOfAttachment(this.attachment)}};E.proxyMethod("attachment.getAttribute"),E.proxyMethod("attachment.hasAttribute"),E.proxyMethod("attachment.setAttribute"),E.proxyMethod("attachment.getAttributes"),E.proxyMethod("attachment.setAttributes"),E.proxyMethod("attachment.isPending"),E.proxyMethod("attachment.isPreviewable"),E.proxyMethod("attachment.getURL"),E.proxyMethod("attachment.getHref"),E.proxyMethod("attachment.getFilename"),E.proxyMethod("attachment.getFilesize"),E.proxyMethod("attachment.getFormattedFilesize"),E.proxyMethod("attachment.getExtension"),E.proxyMethod("attachment.getContentType"),E.proxyMethod("attachment.getFile"),E.proxyMethod("attachment.setFile"),E.proxyMethod("attachment.releaseFile"),E.proxyMethod("attachment.getUploadProgress"),E.proxyMethod("attachment.setUploadProgress");var Ge=class extends R{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.managedAttachments={},Array.from(t).forEach(e=>{this.manageAttachment(e)})}getAttachments(){let t=[];for(let e in this.managedAttachments){let n=this.managedAttachments[e];t.push(n)}return t}manageAttachment(t){return this.managedAttachments[t.id]||(this.managedAttachments[t.id]=new E(this,t)),this.managedAttachments[t.id]}attachmentIsManaged(t){return t.id in this.managedAttachments}requestRemovalOfAttachment(t){var e,n;if(this.attachmentIsManaged(t))return(e=this.delegate)===null||e===void 0||(n=e.attachmentManagerDidRequestRemovalOfAttachment)===null||n===void 0?void 0:n.call(e,t)}unmanageAttachment(t){let e=this.managedAttachments[t.id];return delete this.managedAttachments[t.id],e}},$e=class{constructor(t){this.composition=t,this.document=this.composition.document;let e=this.composition.getSelectedRange();this.startPosition=e[0],this.endPosition=e[1],this.startLocation=this.document.locationFromPosition(this.startPosition),this.endLocation=this.document.locationFromPosition(this.endPosition),this.block=this.document.getBlockAtIndex(this.endLocation.index),this.breaksOnReturn=this.block.breaksOnReturn(),this.previousCharacter=this.block.text.getStringAtPosition(this.endLocation.offset-1),this.nextCharacter=this.block.text.getStringAtPosition(this.endLocation.offset)}shouldInsertBlockBreak(){return this.block.hasAttributes()&&this.block.isListItem()&&!this.block.isEmpty()?this.startLocation.offset!==0:this.breaksOnReturn&&this.nextCharacter!==` `}shouldBreakFormattedBlock(){return this.block.hasAttributes()&&!this.block.isListItem()&&(this.breaksOnReturn&&this.nextCharacter===` `||this.previousCharacter===` -`)}shouldDecreaseListLevel(){return this.block.hasAttributes()&&this.block.isListItem()&&this.block.isEmpty()}shouldPrependListItem(){return this.block.isListItem()&&this.startLocation.offset===0&&!this.block.isEmpty()}shouldRemoveLastBlockAttribute(){return this.block.hasAttributes()&&!this.block.isListItem()&&this.block.isEmpty()}},rt=class extends R{constructor(){super(...arguments),this.document=new z,this.attachments=[],this.currentAttributes={},this.revision=0}setDocument(t){var e,n;if(!t.isEqualTo(this.document))return this.document=t,this.refreshAttachments(),this.revision++,(e=this.delegate)===null||e===void 0||(n=e.compositionDidChangeDocument)===null||n===void 0?void 0:n.call(e,t)}getSnapshot(){return{document:this.document,selectedRange:this.getSelectedRange()}}loadSnapshot(t){var e,n,r,o;let{document:s,selectedRange:l}=t;return(e=this.delegate)===null||e===void 0||(n=e.compositionWillLoadSnapshot)===null||n===void 0||n.call(e),this.setDocument(s??new z),this.setSelection(l??[0,0]),(r=this.delegate)===null||r===void 0||(o=r.compositionDidLoadSnapshot)===null||o===void 0?void 0:o.call(r)}insertText(t){let{updatePosition:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{updatePosition:!0},n=this.getSelectedRange();this.setDocument(this.document.insertTextAtRange(t,n));let r=n[0],o=r+t.getLength();return e&&this.setSelection(o),this.notifyDelegateOfInsertionAtRange([r,o])}insertBlock(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new $,e=new z([t]);return this.insertDocument(e)}insertDocument(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new z,e=this.getSelectedRange();this.setDocument(this.document.insertDocumentAtRange(t,e));let n=e[0],r=n+t.getLength();return this.setSelection(r),this.notifyDelegateOfInsertionAtRange([n,r])}insertString(t,e){let n=this.getCurrentTextAttributes(),r=K.textForStringWithAttributes(t,n);return this.insertText(r,e)}insertBlockBreak(){let t=this.getSelectedRange();this.setDocument(this.document.insertBlockBreakAtRange(t));let e=t[0],n=e+1;return this.setSelection(n),this.notifyDelegateOfInsertionAtRange([e,n])}insertLineBreak(){let t=new Ge(this);if(t.shouldDecreaseListLevel())return this.decreaseListLevel(),this.setSelection(t.startPosition);if(t.shouldPrependListItem()){let e=new z([t.block.copyWithoutText()]);return this.insertDocument(e)}return t.shouldInsertBlockBreak()?this.insertBlockBreak():t.shouldRemoveLastBlockAttribute()?this.removeLastBlockAttribute():t.shouldBreakFormattedBlock()?this.breakFormattedBlock(t):this.insertString(` -`)}insertHTML(t){let e=Mt.parse(t).getDocument(),n=this.getSelectedRange();this.setDocument(this.document.mergeDocumentAtRange(e,n));let r=n[0],o=r+e.getLength()-1;return this.setSelection(o),this.notifyDelegateOfInsertionAtRange([r,o])}replaceHTML(t){let e=Mt.parse(t).getDocument().copyUsingObjectsFromDocument(this.document),n=this.getLocationRange({strict:!1}),r=this.document.rangeFromLocationRange(n);return this.setDocument(e),this.setSelection(r)}insertFile(t){return this.insertFiles([t])}insertFiles(t){let e=[];return Array.from(t).forEach(n=>{var r;if((r=this.delegate)!==null&&r!==void 0&&r.compositionShouldAcceptFile(n)){let o=yt.attachmentForFile(n);e.push(o)}}),this.insertAttachments(e)}insertAttachment(t){return this.insertAttachments([t])}insertAttachments(t){let e=new K;return Array.from(t).forEach(n=>{var r;let o=n.getType(),s=(r=mi[o])===null||r===void 0?void 0:r.presentation,l=this.getCurrentTextAttributes();s&&(l.presentation=s);let c=K.textForAttachmentWithAttributes(n,l);e=e.appendText(c)}),this.insertText(e)}shouldManageDeletingInDirection(t){let e=this.getLocationRange();if(ht(e)){if(t==="backward"&&e[0].offset===0||this.shouldManageMovingCursorInDirection(t))return!0}else if(e[0].index!==e[1].index)return!0;return!1}deleteInDirection(t){let e,n,r,{length:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=this.getLocationRange(),l=this.getSelectedRange(),c=ht(l);if(c?n=t==="backward"&&s[0].offset===0:r=s[0].index!==s[1].index,n&&this.canDecreaseBlockAttributeLevel()){let u=this.getBlock();if(u.isListItem()?this.decreaseListLevel():this.decreaseBlockAttributeLevel(),this.setSelection(l[0]),u.isEmpty())return!1}return c&&(l=this.getExpandedRangeInDirection(t,{length:o}),t==="backward"&&(e=this.getAttachmentAtRange(l))),e?(this.editAttachment(e),!1):(this.setDocument(this.document.removeTextAtRange(l)),this.setSelection(l[0]),!n&&!r&&void 0)}moveTextFromRange(t){let[e]=Array.from(this.getSelectedRange());return this.setDocument(this.document.moveTextFromRangeToPosition(t,e)),this.setSelection(e)}removeAttachment(t){let e=this.document.getRangeOfAttachment(t);if(e)return this.stopEditingAttachment(),this.setDocument(this.document.removeTextAtRange(e)),this.setSelection(e[0])}removeLastBlockAttribute(){let[t,e]=Array.from(this.getSelectedRange()),n=this.document.getBlockAtPosition(e);return this.removeCurrentAttribute(n.getLastAttribute()),this.setSelection(t)}insertPlaceholder(){return this.placeholderPosition=this.getPosition(),this.insertString(" ")}selectPlaceholder(){if(this.placeholderPosition!=null)return this.setSelectedRange([this.placeholderPosition,this.placeholderPosition+1]),this.getSelectedRange()}forgetPlaceholder(){this.placeholderPosition=null}hasCurrentAttribute(t){let e=this.currentAttributes[t];return e!=null&&e!==!1}toggleCurrentAttribute(t){let e=!this.currentAttributes[t];return e?this.setCurrentAttribute(t,e):this.removeCurrentAttribute(t)}canSetCurrentAttribute(t){return L(t)?this.canSetCurrentBlockAttribute(t):this.canSetCurrentTextAttribute(t)}canSetCurrentTextAttribute(t){let e=this.getSelectedDocument();if(e){for(let n of Array.from(e.getAttachments()))if(!n.hasContent())return!1;return!0}}canSetCurrentBlockAttribute(t){let e=this.getBlock();if(e)return!e.isTerminalBlock()}setCurrentAttribute(t,e){return L(t)?this.setBlockAttribute(t,e):(this.setTextAttribute(t,e),this.currentAttributes[t]=e,this.notifyDelegateOfCurrentAttributesChange())}setHTMLAtributeAtPosition(t,e,n){var r;let o=this.document.getBlockAtPosition(t),s=(r=L(o.getLastAttribute()))===null||r===void 0?void 0:r.htmlAttributes;if(o&&s!=null&&s.includes(e)){let l=this.document.setHTMLAttributeAtPosition(t,e,n);this.setDocument(l)}}setTextAttribute(t,e){let n=this.getSelectedRange();if(!n)return;let[r,o]=Array.from(n);if(r!==o)return this.setDocument(this.document.addAttributeAtRange(t,e,n));if(t==="href"){let s=K.textForStringWithAttributes(e,{href:e});return this.insertText(s)}}setBlockAttribute(t,e){let n=this.getSelectedRange();if(this.canSetCurrentAttribute(t))return this.setDocument(this.document.applyBlockAttributeAtRange(t,e,n)),this.setSelection(n)}removeCurrentAttribute(t){return L(t)?(this.removeBlockAttribute(t),this.updateCurrentAttributes()):(this.removeTextAttribute(t),delete this.currentAttributes[t],this.notifyDelegateOfCurrentAttributesChange())}removeTextAttribute(t){let e=this.getSelectedRange();if(e)return this.setDocument(this.document.removeAttributeAtRange(t,e))}removeBlockAttribute(t){let e=this.getSelectedRange();if(e)return this.setDocument(this.document.removeAttributeAtRange(t,e))}canDecreaseNestingLevel(){var t;return((t=this.getBlock())===null||t===void 0?void 0:t.getNestingLevel())>0}canIncreaseNestingLevel(){var t;let e=this.getBlock();if(e){if((t=L(e.getLastNestableAttribute()))===null||t===void 0||!t.listAttribute)return e.getNestingLevel()>0;{let n=this.getPreviousBlock();if(n)return function(){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return Ft((arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).slice(0,r.length),r)}(n.getListItemAttributes(),e.getListItemAttributes())}}}decreaseNestingLevel(){let t=this.getBlock();if(t)return this.setDocument(this.document.replaceBlock(t,t.decreaseNestingLevel()))}increaseNestingLevel(){let t=this.getBlock();if(t)return this.setDocument(this.document.replaceBlock(t,t.increaseNestingLevel()))}canDecreaseBlockAttributeLevel(){var t;return((t=this.getBlock())===null||t===void 0?void 0:t.getAttributeLevel())>0}decreaseBlockAttributeLevel(){var t;let e=(t=this.getBlock())===null||t===void 0?void 0:t.getLastAttribute();if(e)return this.removeCurrentAttribute(e)}decreaseListLevel(){let[t]=Array.from(this.getSelectedRange()),{index:e}=this.document.locationFromPosition(t),n=e,r=this.getBlock().getAttributeLevel(),o=this.document.getBlockAtIndex(n+1);for(;o&&o.isListItem()&&!(o.getAttributeLevel()<=r);)n++,o=this.document.getBlockAtIndex(n+1);t=this.document.positionFromLocation({index:e,offset:0});let s=this.document.positionFromLocation({index:n,offset:0});return this.setDocument(this.document.removeLastListAttributeAtRange([t,s]))}updateCurrentAttributes(){let t=this.getSelectedRange({ignoreLock:!0});if(t){let e=this.document.getCommonAttributesAtRange(t);if(Array.from(Zn()).forEach(n=>{e[n]||this.canSetCurrentAttribute(n)||(e[n]=!1)}),!Xt(e,this.currentAttributes))return this.currentAttributes=e,this.notifyDelegateOfCurrentAttributesChange()}}getCurrentAttributes(){return Nr.call({},this.currentAttributes)}getCurrentTextAttributes(){let t={};for(let e in this.currentAttributes){let n=this.currentAttributes[e];n!==!1&&Qn(e)&&(t[e]=n)}return t}freezeSelection(){return this.setCurrentAttribute("frozen",!0)}thawSelection(){return this.removeCurrentAttribute("frozen")}hasFrozenSelection(){return this.hasCurrentAttribute("frozen")}setSelection(t){var e;let n=this.document.locationRangeFromRange(t);return(e=this.delegate)===null||e===void 0?void 0:e.compositionDidRequestChangingSelectionToLocationRange(n)}getSelectedRange(){let t=this.getLocationRange();if(t)return this.document.rangeFromLocationRange(t)}setSelectedRange(t){let e=this.document.locationRangeFromRange(t);return this.getSelectionManager().setLocationRange(e)}getPosition(){let t=this.getLocationRange();if(t)return this.document.positionFromLocation(t[0])}getLocationRange(t){return this.targetLocationRange?this.targetLocationRange:this.getSelectionManager().getLocationRange(t)||y({index:0,offset:0})}withTargetLocationRange(t,e){let n;this.targetLocationRange=t;try{n=e()}finally{this.targetLocationRange=null}return n}withTargetRange(t,e){let n=this.document.locationRangeFromRange(t);return this.withTargetLocationRange(n,e)}withTargetDOMRange(t,e){let n=this.createLocationRangeFromDOMRange(t,{strict:!1});return this.withTargetLocationRange(n,e)}getExpandedRangeInDirection(t){let{length:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},[n,r]=Array.from(this.getSelectedRange());return t==="backward"?e?n-=e:n=this.translateUTF16PositionFromOffset(n,-1):e?r+=e:r=this.translateUTF16PositionFromOffset(r,1),y([n,r])}shouldManageMovingCursorInDirection(t){if(this.editingAttachment)return!0;let e=this.getExpandedRangeInDirection(t);return this.getAttachmentAtRange(e)!=null}moveCursorInDirection(t){let e,n;if(this.editingAttachment)n=this.document.getRangeOfAttachment(this.editingAttachment);else{let r=this.getSelectedRange();n=this.getExpandedRangeInDirection(t),e=!We(r,n)}if(t==="backward"?this.setSelectedRange(n[0]):this.setSelectedRange(n[1]),e){let r=this.getAttachmentAtRange(n);if(r)return this.editAttachment(r)}}expandSelectionInDirection(t){let{length:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getExpandedRangeInDirection(t,{length:e});return this.setSelectedRange(n)}expandSelectionForEditing(){if(this.hasCurrentAttribute("href"))return this.expandSelectionAroundCommonAttribute("href")}expandSelectionAroundCommonAttribute(t){let e=this.getPosition(),n=this.document.getRangeOfCommonAttributeAtPosition(t,e);return this.setSelectedRange(n)}selectionContainsAttachments(){var t;return((t=this.getSelectedAttachments())===null||t===void 0?void 0:t.length)>0}selectionIsInCursorTarget(){return this.editingAttachment||this.positionIsCursorTarget(this.getPosition())}positionIsCursorTarget(t){let e=this.document.locationFromPosition(t);if(e)return this.locationIsCursorTarget(e)}positionIsBlockBreak(t){var e;return(e=this.document.getPieceAtPosition(t))===null||e===void 0?void 0:e.isBlockBreak()}getSelectedDocument(){let t=this.getSelectedRange();if(t)return this.document.getDocumentAtRange(t)}getSelectedAttachments(){var t;return(t=this.getSelectedDocument())===null||t===void 0?void 0:t.getAttachments()}getAttachments(){return this.attachments.slice(0)}refreshAttachments(){let t=this.document.getAttachments(),{added:e,removed:n}=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=[],l=[],c=new Set;r.forEach(d=>{c.add(d)});let u=new Set;return o.forEach(d=>{u.add(d),c.has(d)||s.push(d)}),r.forEach(d=>{u.has(d)||l.push(d)}),{added:s,removed:l}}(this.attachments,t);return this.attachments=t,Array.from(n).forEach(r=>{var o,s;r.delegate=null,(o=this.delegate)===null||o===void 0||(s=o.compositionDidRemoveAttachment)===null||s===void 0||s.call(o,r)}),(()=>{let r=[];return Array.from(e).forEach(o=>{var s,l;o.delegate=this,r.push((s=this.delegate)===null||s===void 0||(l=s.compositionDidAddAttachment)===null||l===void 0?void 0:l.call(s,o))}),r})()}attachmentDidChangeAttributes(t){var e,n;return this.revision++,(e=this.delegate)===null||e===void 0||(n=e.compositionDidEditAttachment)===null||n===void 0?void 0:n.call(e,t)}attachmentDidChangePreviewURL(t){var e,n;return this.revision++,(e=this.delegate)===null||e===void 0||(n=e.compositionDidChangeAttachmentPreviewURL)===null||n===void 0?void 0:n.call(e,t)}editAttachment(t,e){var n,r;if(t!==this.editingAttachment)return this.stopEditingAttachment(),this.editingAttachment=t,(n=this.delegate)===null||n===void 0||(r=n.compositionDidStartEditingAttachment)===null||r===void 0?void 0:r.call(n,this.editingAttachment,e)}stopEditingAttachment(){var t,e;this.editingAttachment&&((t=this.delegate)===null||t===void 0||(e=t.compositionDidStopEditingAttachment)===null||e===void 0||e.call(t,this.editingAttachment),this.editingAttachment=null)}updateAttributesForAttachment(t,e){return this.setDocument(this.document.updateAttributesForAttachment(t,e))}removeAttributeForAttachment(t,e){return this.setDocument(this.document.removeAttributeForAttachment(t,e))}breakFormattedBlock(t){let{document:e}=t,{block:n}=t,r=t.startPosition,o=[r-1,r];n.getBlockBreakPosition()===t.startLocation.offset?(n.breaksOnReturn()&&t.nextCharacter===` +`)}shouldDecreaseListLevel(){return this.block.hasAttributes()&&this.block.isListItem()&&this.block.isEmpty()}shouldPrependListItem(){return this.block.isListItem()&&this.startLocation.offset===0&&!this.block.isEmpty()}shouldRemoveLastBlockAttribute(){return this.block.hasAttributes()&&!this.block.isListItem()&&this.block.isEmpty()}},rt=class extends R{constructor(){super(...arguments),this.document=new z,this.attachments=[],this.currentAttributes={},this.revision=0}setDocument(t){var e,n;if(!t.isEqualTo(this.document))return this.document=t,this.refreshAttachments(),this.revision++,(e=this.delegate)===null||e===void 0||(n=e.compositionDidChangeDocument)===null||n===void 0?void 0:n.call(e,t)}getSnapshot(){return{document:this.document,selectedRange:this.getSelectedRange()}}loadSnapshot(t){var e,n,r,o;let{document:s,selectedRange:l}=t;return(e=this.delegate)===null||e===void 0||(n=e.compositionWillLoadSnapshot)===null||n===void 0||n.call(e),this.setDocument(s??new z),this.setSelection(l??[0,0]),(r=this.delegate)===null||r===void 0||(o=r.compositionDidLoadSnapshot)===null||o===void 0?void 0:o.call(r)}insertText(t){let{updatePosition:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{updatePosition:!0},n=this.getSelectedRange();this.setDocument(this.document.insertTextAtRange(t,n));let r=n[0],o=r+t.getLength();return e&&this.setSelection(o),this.notifyDelegateOfInsertionAtRange([r,o])}insertBlock(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new $,e=new z([t]);return this.insertDocument(e)}insertDocument(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new z,e=this.getSelectedRange();this.setDocument(this.document.insertDocumentAtRange(t,e));let n=e[0],r=n+t.getLength();return this.setSelection(r),this.notifyDelegateOfInsertionAtRange([n,r])}insertString(t,e){let n=this.getCurrentTextAttributes(),r=K.textForStringWithAttributes(t,n);return this.insertText(r,e)}insertBlockBreak(){let t=this.getSelectedRange();this.setDocument(this.document.insertBlockBreakAtRange(t));let e=t[0],n=e+1;return this.setSelection(n),this.notifyDelegateOfInsertionAtRange([e,n])}insertLineBreak(){let t=new $e(this);if(t.shouldDecreaseListLevel())return this.decreaseListLevel(),this.setSelection(t.startPosition);if(t.shouldPrependListItem()){let e=new z([t.block.copyWithoutText()]);return this.insertDocument(e)}return t.shouldInsertBlockBreak()?this.insertBlockBreak():t.shouldRemoveLastBlockAttribute()?this.removeLastBlockAttribute():t.shouldBreakFormattedBlock()?this.breakFormattedBlock(t):this.insertString(` +`)}insertHTML(t){let e=Mt.parse(t).getDocument(),n=this.getSelectedRange();this.setDocument(this.document.mergeDocumentAtRange(e,n));let r=n[0],o=r+e.getLength()-1;return this.setSelection(o),this.notifyDelegateOfInsertionAtRange([r,o])}replaceHTML(t){let e=Mt.parse(t).getDocument().copyUsingObjectsFromDocument(this.document),n=this.getLocationRange({strict:!1}),r=this.document.rangeFromLocationRange(n);return this.setDocument(e),this.setSelection(r)}insertFile(t){return this.insertFiles([t])}insertFiles(t){let e=[];return Array.from(t).forEach(n=>{var r;if((r=this.delegate)!==null&&r!==void 0&&r.compositionShouldAcceptFile(n)){let o=yt.attachmentForFile(n);e.push(o)}}),this.insertAttachments(e)}insertAttachment(t){return this.insertAttachments([t])}insertAttachments(t){let e=new K;return Array.from(t).forEach(n=>{var r;let o=n.getType(),s=(r=mi[o])===null||r===void 0?void 0:r.presentation,l=this.getCurrentTextAttributes();s&&(l.presentation=s);let c=K.textForAttachmentWithAttributes(n,l);e=e.appendText(c)}),this.insertText(e)}shouldManageDeletingInDirection(t){let e=this.getLocationRange();if(ht(e)){if(t==="backward"&&e[0].offset===0||this.shouldManageMovingCursorInDirection(t))return!0}else if(e[0].index!==e[1].index)return!0;return!1}deleteInDirection(t){let e,n,r,{length:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=this.getLocationRange(),l=this.getSelectedRange(),c=ht(l);if(c?n=t==="backward"&&s[0].offset===0:r=s[0].index!==s[1].index,n&&this.canDecreaseBlockAttributeLevel()){let u=this.getBlock();if(u.isListItem()?this.decreaseListLevel():this.decreaseBlockAttributeLevel(),this.setSelection(l[0]),u.isEmpty())return!1}return c&&(l=this.getExpandedRangeInDirection(t,{length:o}),t==="backward"&&(e=this.getAttachmentAtRange(l))),e?(this.editAttachment(e),!1):(this.setDocument(this.document.removeTextAtRange(l)),this.setSelection(l[0]),!n&&!r&&void 0)}moveTextFromRange(t){let[e]=Array.from(this.getSelectedRange());return this.setDocument(this.document.moveTextFromRangeToPosition(t,e)),this.setSelection(e)}removeAttachment(t){let e=this.document.getRangeOfAttachment(t);if(e)return this.stopEditingAttachment(),this.setDocument(this.document.removeTextAtRange(e)),this.setSelection(e[0])}removeLastBlockAttribute(){let[t,e]=Array.from(this.getSelectedRange()),n=this.document.getBlockAtPosition(e);return this.removeCurrentAttribute(n.getLastAttribute()),this.setSelection(t)}insertPlaceholder(){return this.placeholderPosition=this.getPosition(),this.insertString(" ")}selectPlaceholder(){if(this.placeholderPosition!=null)return this.setSelectedRange([this.placeholderPosition,this.placeholderPosition+1]),this.getSelectedRange()}forgetPlaceholder(){this.placeholderPosition=null}hasCurrentAttribute(t){let e=this.currentAttributes[t];return e!=null&&e!==!1}toggleCurrentAttribute(t){let e=!this.currentAttributes[t];return e?this.setCurrentAttribute(t,e):this.removeCurrentAttribute(t)}canSetCurrentAttribute(t){return L(t)?this.canSetCurrentBlockAttribute(t):this.canSetCurrentTextAttribute(t)}canSetCurrentTextAttribute(t){let e=this.getSelectedDocument();if(e){for(let n of Array.from(e.getAttachments()))if(!n.hasContent())return!1;return!0}}canSetCurrentBlockAttribute(t){let e=this.getBlock();if(e)return!e.isTerminalBlock()}setCurrentAttribute(t,e){return L(t)?this.setBlockAttribute(t,e):(this.setTextAttribute(t,e),this.currentAttributes[t]=e,this.notifyDelegateOfCurrentAttributesChange())}setHTMLAtributeAtPosition(t,e,n){var r;let o=this.document.getBlockAtPosition(t),s=(r=L(o.getLastAttribute()))===null||r===void 0?void 0:r.htmlAttributes;if(o&&s!=null&&s.includes(e)){let l=this.document.setHTMLAttributeAtPosition(t,e,n);this.setDocument(l)}}setTextAttribute(t,e){let n=this.getSelectedRange();if(!n)return;let[r,o]=Array.from(n);if(r!==o)return this.setDocument(this.document.addAttributeAtRange(t,e,n));if(t==="href"){let s=K.textForStringWithAttributes(e,{href:e});return this.insertText(s)}}setBlockAttribute(t,e){let n=this.getSelectedRange();if(this.canSetCurrentAttribute(t))return this.setDocument(this.document.applyBlockAttributeAtRange(t,e,n)),this.setSelection(n)}removeCurrentAttribute(t){return L(t)?(this.removeBlockAttribute(t),this.updateCurrentAttributes()):(this.removeTextAttribute(t),delete this.currentAttributes[t],this.notifyDelegateOfCurrentAttributesChange())}removeTextAttribute(t){let e=this.getSelectedRange();if(e)return this.setDocument(this.document.removeAttributeAtRange(t,e))}removeBlockAttribute(t){let e=this.getSelectedRange();if(e)return this.setDocument(this.document.removeAttributeAtRange(t,e))}canDecreaseNestingLevel(){var t;return((t=this.getBlock())===null||t===void 0?void 0:t.getNestingLevel())>0}canIncreaseNestingLevel(){var t;let e=this.getBlock();if(e){if((t=L(e.getLastNestableAttribute()))===null||t===void 0||!t.listAttribute)return e.getNestingLevel()>0;{let n=this.getPreviousBlock();if(n)return function(){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return Ft((arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).slice(0,r.length),r)}(n.getListItemAttributes(),e.getListItemAttributes())}}}decreaseNestingLevel(){let t=this.getBlock();if(t)return this.setDocument(this.document.replaceBlock(t,t.decreaseNestingLevel()))}increaseNestingLevel(){let t=this.getBlock();if(t)return this.setDocument(this.document.replaceBlock(t,t.increaseNestingLevel()))}canDecreaseBlockAttributeLevel(){var t;return((t=this.getBlock())===null||t===void 0?void 0:t.getAttributeLevel())>0}decreaseBlockAttributeLevel(){var t;let e=(t=this.getBlock())===null||t===void 0?void 0:t.getLastAttribute();if(e)return this.removeCurrentAttribute(e)}decreaseListLevel(){let[t]=Array.from(this.getSelectedRange()),{index:e}=this.document.locationFromPosition(t),n=e,r=this.getBlock().getAttributeLevel(),o=this.document.getBlockAtIndex(n+1);for(;o&&o.isListItem()&&!(o.getAttributeLevel()<=r);)n++,o=this.document.getBlockAtIndex(n+1);t=this.document.positionFromLocation({index:e,offset:0});let s=this.document.positionFromLocation({index:n,offset:0});return this.setDocument(this.document.removeLastListAttributeAtRange([t,s]))}updateCurrentAttributes(){let t=this.getSelectedRange({ignoreLock:!0});if(t){let e=this.document.getCommonAttributesAtRange(t);if(Array.from(Qn()).forEach(n=>{e[n]||this.canSetCurrentAttribute(n)||(e[n]=!1)}),!Xt(e,this.currentAttributes))return this.currentAttributes=e,this.notifyDelegateOfCurrentAttributesChange()}}getCurrentAttributes(){return Nr.call({},this.currentAttributes)}getCurrentTextAttributes(){let t={};for(let e in this.currentAttributes){let n=this.currentAttributes[e];n!==!1&&ti(e)&&(t[e]=n)}return t}freezeSelection(){return this.setCurrentAttribute("frozen",!0)}thawSelection(){return this.removeCurrentAttribute("frozen")}hasFrozenSelection(){return this.hasCurrentAttribute("frozen")}setSelection(t){var e;let n=this.document.locationRangeFromRange(t);return(e=this.delegate)===null||e===void 0?void 0:e.compositionDidRequestChangingSelectionToLocationRange(n)}getSelectedRange(){let t=this.getLocationRange();if(t)return this.document.rangeFromLocationRange(t)}setSelectedRange(t){let e=this.document.locationRangeFromRange(t);return this.getSelectionManager().setLocationRange(e)}getPosition(){let t=this.getLocationRange();if(t)return this.document.positionFromLocation(t[0])}getLocationRange(t){return this.targetLocationRange?this.targetLocationRange:this.getSelectionManager().getLocationRange(t)||y({index:0,offset:0})}withTargetLocationRange(t,e){let n;this.targetLocationRange=t;try{n=e()}finally{this.targetLocationRange=null}return n}withTargetRange(t,e){let n=this.document.locationRangeFromRange(t);return this.withTargetLocationRange(n,e)}withTargetDOMRange(t,e){let n=this.createLocationRangeFromDOMRange(t,{strict:!1});return this.withTargetLocationRange(n,e)}getExpandedRangeInDirection(t){let{length:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},[n,r]=Array.from(this.getSelectedRange());return t==="backward"?e?n-=e:n=this.translateUTF16PositionFromOffset(n,-1):e?r+=e:r=this.translateUTF16PositionFromOffset(r,1),y([n,r])}shouldManageMovingCursorInDirection(t){if(this.editingAttachment)return!0;let e=this.getExpandedRangeInDirection(t);return this.getAttachmentAtRange(e)!=null}moveCursorInDirection(t){let e,n;if(this.editingAttachment)n=this.document.getRangeOfAttachment(this.editingAttachment);else{let r=this.getSelectedRange();n=this.getExpandedRangeInDirection(t),e=!We(r,n)}if(t==="backward"?this.setSelectedRange(n[0]):this.setSelectedRange(n[1]),e){let r=this.getAttachmentAtRange(n);if(r)return this.editAttachment(r)}}expandSelectionInDirection(t){let{length:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getExpandedRangeInDirection(t,{length:e});return this.setSelectedRange(n)}expandSelectionForEditing(){if(this.hasCurrentAttribute("href"))return this.expandSelectionAroundCommonAttribute("href")}expandSelectionAroundCommonAttribute(t){let e=this.getPosition(),n=this.document.getRangeOfCommonAttributeAtPosition(t,e);return this.setSelectedRange(n)}selectionContainsAttachments(){var t;return((t=this.getSelectedAttachments())===null||t===void 0?void 0:t.length)>0}selectionIsInCursorTarget(){return this.editingAttachment||this.positionIsCursorTarget(this.getPosition())}positionIsCursorTarget(t){let e=this.document.locationFromPosition(t);if(e)return this.locationIsCursorTarget(e)}positionIsBlockBreak(t){var e;return(e=this.document.getPieceAtPosition(t))===null||e===void 0?void 0:e.isBlockBreak()}getSelectedDocument(){let t=this.getSelectedRange();if(t)return this.document.getDocumentAtRange(t)}getSelectedAttachments(){var t;return(t=this.getSelectedDocument())===null||t===void 0?void 0:t.getAttachments()}getAttachments(){return this.attachments.slice(0)}refreshAttachments(){let t=this.document.getAttachments(),{added:e,removed:n}=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=[],l=[],c=new Set;r.forEach(d=>{c.add(d)});let u=new Set;return o.forEach(d=>{u.add(d),c.has(d)||s.push(d)}),r.forEach(d=>{u.has(d)||l.push(d)}),{added:s,removed:l}}(this.attachments,t);return this.attachments=t,Array.from(n).forEach(r=>{var o,s;r.delegate=null,(o=this.delegate)===null||o===void 0||(s=o.compositionDidRemoveAttachment)===null||s===void 0||s.call(o,r)}),(()=>{let r=[];return Array.from(e).forEach(o=>{var s,l;o.delegate=this,r.push((s=this.delegate)===null||s===void 0||(l=s.compositionDidAddAttachment)===null||l===void 0?void 0:l.call(s,o))}),r})()}attachmentDidChangeAttributes(t){var e,n;return this.revision++,(e=this.delegate)===null||e===void 0||(n=e.compositionDidEditAttachment)===null||n===void 0?void 0:n.call(e,t)}attachmentDidChangePreviewURL(t){var e,n;return this.revision++,(e=this.delegate)===null||e===void 0||(n=e.compositionDidChangeAttachmentPreviewURL)===null||n===void 0?void 0:n.call(e,t)}editAttachment(t,e){var n,r;if(t!==this.editingAttachment)return this.stopEditingAttachment(),this.editingAttachment=t,(n=this.delegate)===null||n===void 0||(r=n.compositionDidStartEditingAttachment)===null||r===void 0?void 0:r.call(n,this.editingAttachment,e)}stopEditingAttachment(){var t,e;this.editingAttachment&&((t=this.delegate)===null||t===void 0||(e=t.compositionDidStopEditingAttachment)===null||e===void 0||e.call(t,this.editingAttachment),this.editingAttachment=null)}updateAttributesForAttachment(t,e){return this.setDocument(this.document.updateAttributesForAttachment(t,e))}removeAttributeForAttachment(t,e){return this.setDocument(this.document.removeAttributeForAttachment(t,e))}breakFormattedBlock(t){let{document:e}=t,{block:n}=t,r=t.startPosition,o=[r-1,r];n.getBlockBreakPosition()===t.startLocation.offset?(n.breaksOnReturn()&&t.nextCharacter===` `?r+=1:e=e.removeTextAtRange(o),o=[r,r]):t.nextCharacter===` `?t.previousCharacter===` `?o=[r-1,r+1]:(o=[r,r+1],r+=1):t.startLocation.offset-1!=0&&(r+=1);let s=new z([n.removeLastAttribute().copyWithoutText()]);return this.setDocument(e.insertDocumentAtRange(s,o)),this.setSelection(r)}getPreviousBlock(){let t=this.getLocationRange();if(t){let{index:e}=t[0];if(e>0)return this.document.getBlockAtIndex(e-1)}}getBlock(){let t=this.getLocationRange();if(t)return this.document.getBlockAtIndex(t[0].index)}getAttachmentAtRange(t){let e=this.document.getDocumentAtRange(t);if(e.toString()==="".concat("\uFFFC",` -`))return e.getAttachments()[0]}notifyDelegateOfCurrentAttributesChange(){var t,e;return(t=this.delegate)===null||t===void 0||(e=t.compositionDidChangeCurrentAttributes)===null||e===void 0?void 0:e.call(t,this.currentAttributes)}notifyDelegateOfInsertionAtRange(t){var e,n;return(e=this.delegate)===null||e===void 0||(n=e.compositionDidPerformInsertionAtRange)===null||n===void 0?void 0:n.call(e,t)}translateUTF16PositionFromOffset(t,e){let n=this.document.toUTF16String(),r=n.offsetFromUCS2Offset(t);return n.offsetToUCS2Offset(r+e)}};rt.proxyMethod("getSelectionManager().getPointRange"),rt.proxyMethod("getSelectionManager().setLocationRangeFromPointRange"),rt.proxyMethod("getSelectionManager().createLocationRangeFromDOMRange"),rt.proxyMethod("getSelectionManager().locationIsCursorTarget"),rt.proxyMethod("getSelectionManager().selectionIsExpanded"),rt.proxyMethod("delegate?.getSelectionManager");var Ae=class extends R{constructor(t){super(...arguments),this.composition=t,this.undoEntries=[],this.redoEntries=[]}recordUndoEntry(t){let{context:e,consolidatable:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.undoEntries.slice(-1)[0];if(!n||!Ns(r,t,e)){let o=this.createEntry({description:t,context:e});this.undoEntries.push(o),this.redoEntries=[]}}undo(){let t=this.undoEntries.pop();if(t){let e=this.createEntry(t);return this.redoEntries.push(e),this.composition.loadSnapshot(t.snapshot)}}redo(){let t=this.redoEntries.pop();if(t){let e=this.createEntry(t);return this.undoEntries.push(e),this.composition.loadSnapshot(t.snapshot)}}canUndo(){return this.undoEntries.length>0}canRedo(){return this.redoEntries.length>0}createEntry(){let{description:t,context:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{description:t?.toString(),context:JSON.stringify(e),snapshot:this.composition.getSnapshot()}}},Ns=(i,t,e)=>i?.description===t?.toString()&&i?.context===JSON.stringify(e),jn="attachmentGallery",$e=class{constructor(t){this.document=t.document,this.selectedRange=t.selectedRange}perform(){return this.removeBlockAttribute(),this.applyBlockAttribute()}getSnapshot(){return{document:this.document,selectedRange:this.selectedRange}}removeBlockAttribute(){return this.findRangesOfBlocks().map(t=>this.document=this.document.removeAttributeAtRange(jn,t))}applyBlockAttribute(){let t=0;this.findRangesOfPieces().forEach(e=>{e[1]-e[0]>1&&(e[0]+=t,e[1]+=t,this.document.getCharacterAtPosition(e[1])!==` +`))return e.getAttachments()[0]}notifyDelegateOfCurrentAttributesChange(){var t,e;return(t=this.delegate)===null||t===void 0||(e=t.compositionDidChangeCurrentAttributes)===null||e===void 0?void 0:e.call(t,this.currentAttributes)}notifyDelegateOfInsertionAtRange(t){var e,n;return(e=this.delegate)===null||e===void 0||(n=e.compositionDidPerformInsertionAtRange)===null||n===void 0?void 0:n.call(e,t)}translateUTF16PositionFromOffset(t,e){let n=this.document.toUTF16String(),r=n.offsetFromUCS2Offset(t);return n.offsetToUCS2Offset(r+e)}};rt.proxyMethod("getSelectionManager().getPointRange"),rt.proxyMethod("getSelectionManager().setLocationRangeFromPointRange"),rt.proxyMethod("getSelectionManager().createLocationRangeFromDOMRange"),rt.proxyMethod("getSelectionManager().locationIsCursorTarget"),rt.proxyMethod("getSelectionManager().selectionIsExpanded"),rt.proxyMethod("delegate?.getSelectionManager");var Ae=class extends R{constructor(t){super(...arguments),this.composition=t,this.undoEntries=[],this.redoEntries=[]}recordUndoEntry(t){let{context:e,consolidatable:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.undoEntries.slice(-1)[0];if(!n||!Ns(r,t,e)){let o=this.createEntry({description:t,context:e});this.undoEntries.push(o),this.redoEntries=[]}}undo(){let t=this.undoEntries.pop();if(t){let e=this.createEntry(t);return this.redoEntries.push(e),this.composition.loadSnapshot(t.snapshot)}}redo(){let t=this.redoEntries.pop();if(t){let e=this.createEntry(t);return this.undoEntries.push(e),this.composition.loadSnapshot(t.snapshot)}}canUndo(){return this.undoEntries.length>0}canRedo(){return this.redoEntries.length>0}createEntry(){let{description:t,context:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{description:t?.toString(),context:JSON.stringify(e),snapshot:this.composition.getSnapshot()}}},Ns=(i,t,e)=>i?.description===t?.toString()&&i?.context===JSON.stringify(e),Wn="attachmentGallery",Ye=class{constructor(t){this.document=t.document,this.selectedRange=t.selectedRange}perform(){return this.removeBlockAttribute(),this.applyBlockAttribute()}getSnapshot(){return{document:this.document,selectedRange:this.selectedRange}}removeBlockAttribute(){return this.findRangesOfBlocks().map(t=>this.document=this.document.removeAttributeAtRange(Wn,t))}applyBlockAttribute(){let t=0;this.findRangesOfPieces().forEach(e=>{e[1]-e[0]>1&&(e[0]+=t,e[1]+=t,this.document.getCharacterAtPosition(e[1])!==` `&&(this.document=this.document.insertBlockBreakAtRange(e[1]),e[1]0&&arguments[0]!==void 0?arguments[0]:"",e=Mt.parse(t,{referenceElement:this.element}).getDocument();return this.loadDocument(e)}loadJSON(t){let{document:e,selectedRange:n}=t;return e=z.fromJSON(e),this.loadSnapshot({document:e,selectedRange:n})}loadSnapshot(t){return this.undoManager=new Ae(this.composition),this.composition.loadSnapshot(t)}getDocument(){return this.composition.document}getSelectedDocument(){return this.composition.getSelectedDocument()}getSnapshot(){return this.composition.getSnapshot()}toJSON(){return this.getSnapshot()}deleteInDirection(t){return this.composition.deleteInDirection(t)}insertAttachment(t){return this.composition.insertAttachment(t)}insertAttachments(t){return this.composition.insertAttachments(t)}insertDocument(t){return this.composition.insertDocument(t)}insertFile(t){return this.composition.insertFile(t)}insertFiles(t){return this.composition.insertFiles(t)}insertHTML(t){return this.composition.insertHTML(t)}insertString(t){return this.composition.insertString(t)}insertText(t){return this.composition.insertText(t)}insertLineBreak(){return this.composition.insertLineBreak()}getSelectedRange(){return this.composition.getSelectedRange()}getPosition(){return this.composition.getPosition()}getClientRectAtPosition(t){let e=this.getDocument().locationRangeFromRange([t,t+1]);return this.selectionManager.getClientRectAtLocationRange(e)}expandSelectionInDirection(t){return this.composition.expandSelectionInDirection(t)}moveCursorInDirection(t){return this.composition.moveCursorInDirection(t)}setSelectedRange(t){return this.composition.setSelectedRange(t)}activateAttribute(t){let e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this.composition.setCurrentAttribute(t,e)}attributeIsActive(t){return this.composition.hasCurrentAttribute(t)}canActivateAttribute(t){return this.composition.canSetCurrentAttribute(t)}deactivateAttribute(t){return this.composition.removeCurrentAttribute(t)}setHTMLAtributeAtPosition(t,e,n){this.composition.setHTMLAtributeAtPosition(t,e,n)}canDecreaseNestingLevel(){return this.composition.canDecreaseNestingLevel()}canIncreaseNestingLevel(){return this.composition.canIncreaseNestingLevel()}decreaseNestingLevel(){if(this.canDecreaseNestingLevel())return this.composition.decreaseNestingLevel()}increaseNestingLevel(){if(this.canIncreaseNestingLevel())return this.composition.increaseNestingLevel()}canRedo(){return this.undoManager.canRedo()}canUndo(){return this.undoManager.canUndo()}recordUndoEntry(t){let{context:e,consolidatable:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.undoManager.recordUndoEntry(t,{context:e,consolidatable:n})}redo(){if(this.canRedo())return this.undoManager.redo()}undo(){if(this.canUndo())return this.undoManager.undo()}},Xe=class{constructor(t){this.element=t}findLocationFromContainerAndOffset(t,e){let{strict:n}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{strict:!0},r=0,o=!1,s={index:0,offset:0},l=this.findAttachmentElementParentForNode(t);l&&(t=l.parentNode,e=Sn(l));let c=je(this.element,{usingFilter:Yr});for(;c.nextNode();){let u=c.currentNode;if(u===t&&ge(t)){Ht(u)||(s.offset+=e);break}if(u.parentNode===t){if(r++===e)break}else if(!Tt(t,u)&&r>0)break;Yi(u,{strict:n})?(o&&s.index++,s.offset=0,o=!0):s.offset+=Wn(u)}return s}findContainerAndOffsetFromLocation(t){let e,n;if(t.index===0&&t.offset===0){for(e=this.element,n=0;e.firstChild;)if(e=e.firstChild,kn(e)){n=1;break}return[e,n]}let[r,o]=this.findNodeAndOffsetFromLocation(t);if(r){if(ge(r))Wn(r)===0?(e=r.parentNode.parentNode,n=Sn(r.parentNode),Ht(r,{name:"right"})&&n++):(e=r,n=t.offset-o);else{if(e=r.parentNode,!Yi(r.previousSibling)&&!kn(e))for(;r===e.lastChild&&(r=e,e=e.parentNode,!kn(e)););n=Sn(r),t.offset!==0&&n++}return[e,n]}}findNodeAndOffsetFromLocation(t){let e,n,r=0;for(let o of this.getSignificantNodesForIndex(t.index)){let s=Wn(o);if(t.offset<=r+s)if(ge(o)){if(e=o,n=r,t.offset===n&&Ht(e))break}else e||(e=o,n=r);if(r+=s,r>t.offset)break}return[e,n]}findAttachmentElementParentForNode(t){for(;t&&t!==this.element;){if(Lt(t))return t;t=t.parentNode}}getSignificantNodesForIndex(t){let e=[],n=je(this.element,{usingFilter:Os}),r=!1;for(;n.nextNode();){let s=n.currentNode;var o;if(qt(s)){if(o!=null?o++:o=0,o===t)r=!0;else if(r)break}else r&&e.push(s)}return e}},Wn=function(i){return i.nodeType===Node.TEXT_NODE?Ht(i)?0:i.textContent.length:j(i)==="br"||Lt(i)?1:0},Os=function(i){return Fs(i)===NodeFilter.FILTER_ACCEPT?Yr(i):NodeFilter.FILTER_REJECT},Fs=function(i){return Or(i)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},Yr=function(i){return Lt(i.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},Ze=class{createDOMRangeFromPoint(t){let e,{x:n,y:r}=t;if(document.caretPositionFromPoint){let{offsetNode:o,offset:s}=document.caretPositionFromPoint(n,r);return e=document.createRange(),e.setStart(o,s),e}if(document.caretRangeFromPoint)return document.caretRangeFromPoint(n,r);if(document.body.createTextRange){let o=me();try{let s=document.body.createTextRange();s.moveToPoint(n,r),s.select()}catch{}return e=me(),Wr(o),e}}getClientRectsForDOMRange(t){let e=Array.from(t.getClientRects());return[e[0],e[e.length-1]]}},ut=class extends R{constructor(t){super(...arguments),this.didMouseDown=this.didMouseDown.bind(this),this.selectionDidChange=this.selectionDidChange.bind(this),this.element=t,this.locationMapper=new Xe(this.element),this.pointMapper=new Ze,this.lockCount=0,S("mousedown",{onElement:this.element,withCallback:this.didMouseDown})}getLocationRange(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return t.strict===!1?this.createLocationRangeFromDOMRange(me()):t.ignoreLock?this.currentLocationRange:this.lockedLocationRange?this.lockedLocationRange:this.currentLocationRange}setLocationRange(t){if(this.lockedLocationRange)return;t=y(t);let e=this.createDOMRangeFromLocationRange(t);e&&(Wr(e),this.updateCurrentLocationRange(t))}setLocationRangeFromPointRange(t){t=y(t);let e=this.getLocationAtPoint(t[0]),n=this.getLocationAtPoint(t[1]);this.setLocationRange([e,n])}getClientRectAtLocationRange(t){let e=this.createDOMRangeFromLocationRange(t);if(e)return this.getClientRectsForDOMRange(e)[1]}locationIsCursorTarget(t){let e=Array.from(this.findNodeAndOffsetFromLocation(t))[0];return Ht(e)}lock(){this.lockCount++==0&&(this.updateCurrentLocationRange(),this.lockedLocationRange=this.getLocationRange())}unlock(){if(--this.lockCount==0){let{lockedLocationRange:t}=this;if(this.lockedLocationRange=null,t!=null)return this.setLocationRange(t)}}clearSelection(){var t;return(t=jr())===null||t===void 0?void 0:t.removeAllRanges()}selectionIsCollapsed(){var t;return((t=me())===null||t===void 0?void 0:t.collapsed)===!0}selectionIsExpanded(){return!this.selectionIsCollapsed()}createLocationRangeFromDOMRange(t,e){if(t==null||!this.domRangeWithinElement(t))return;let n=this.findLocationFromContainerAndOffset(t.startContainer,t.startOffset,e);if(!n)return;let r=t.collapsed?void 0:this.findLocationFromContainerAndOffset(t.endContainer,t.endOffset,e);return y([n,r])}didMouseDown(){return this.pauseTemporarily()}pauseTemporarily(){let t;this.paused=!0;let e=()=>{if(this.paused=!1,clearTimeout(n),Array.from(t).forEach(r=>{r.destroy()}),Tt(document,this.element))return this.selectionDidChange()},n=setTimeout(e,200);t=["mousemove","keydown"].map(r=>S(r,{onElement:document,withCallback:e}))}selectionDidChange(){if(!this.paused&&!fi(this.element))return this.updateCurrentLocationRange()}updateCurrentLocationRange(t){var e,n;if((t??(t=this.createLocationRangeFromDOMRange(me())))&&!We(t,this.currentLocationRange))return this.currentLocationRange=t,(e=this.delegate)===null||e===void 0||(n=e.locationRangeDidChange)===null||n===void 0?void 0:n.call(e,this.currentLocationRange.slice(0))}createDOMRangeFromLocationRange(t){let e=this.findContainerAndOffsetFromLocation(t[0]),n=ht(t)?e:this.findContainerAndOffsetFromLocation(t[1])||e;if(e!=null&&n!=null){let r=document.createRange();return r.setStart(...Array.from(e||[])),r.setEnd(...Array.from(n||[])),r}}getLocationAtPoint(t){let e=this.createDOMRangeFromPoint(t);var n;if(e)return(n=this.createLocationRangeFromDOMRange(e))===null||n===void 0?void 0:n[0]}domRangeWithinElement(t){return t.collapsed?Tt(this.element,t.startContainer):Tt(this.element,t.startContainer)&&Tt(this.element,t.endContainer)}};ut.proxyMethod("locationMapper.findLocationFromContainerAndOffset"),ut.proxyMethod("locationMapper.findContainerAndOffsetFromLocation"),ut.proxyMethod("locationMapper.findNodeAndOffsetFromLocation"),ut.proxyMethod("pointMapper.createDOMRangeFromPoint"),ut.proxyMethod("pointMapper.getClientRectsForDOMRange");var Xr=Object.freeze({__proto__:null,Attachment:yt,AttachmentManager:Ke,AttachmentPiece:xt,Block:$,Composition:rt,Document:z,Editor:Ye,HTMLParser:Mt,HTMLSanitizer:Kt,LineBreakInsertion:Ge,LocationMapper:Xe,ManagedAttachment:E,Piece:mt,PointMapper:Ze,SelectionManager:ut,SplittableList:$t,StringPiece:ve,Text:K,UndoManager:Ae}),Ps=Object.freeze({__proto__:null,ObjectView:gt,AttachmentView:be,BlockView:He,DocumentView:Gt,PieceView:ze,PreviewableAttachmentView:Ve,TextView:qe}),{lang:Un,css:kt,keyNames:Ms}=Ce,Vn=function(i){return function(){let t=i.apply(this,arguments);t.do(),this.undos||(this.undos=[]),this.undos.push(t.undo)}},Qe=class extends R{constructor(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(...arguments),q(this,"makeElementMutable",Vn(()=>({do:()=>{this.element.dataset.trixMutable=!0},undo:()=>delete this.element.dataset.trixMutable}))),q(this,"addToolbar",Vn(()=>{let o=p({tagName:"div",className:kt.attachmentToolbar,data:{trixMutable:!0},childNodes:p({tagName:"div",className:"trix-button-row",childNodes:p({tagName:"span",className:"trix-button-group trix-button-group--actions",childNodes:p({tagName:"button",className:"trix-button trix-button--remove",textContent:Un.remove,attributes:{title:Un.remove},data:{trixAction:"remove"}})})})});return this.attachment.isPreviewable()&&o.appendChild(p({tagName:"div",className:kt.attachmentMetadataContainer,childNodes:p({tagName:"span",className:kt.attachmentMetadata,childNodes:[p({tagName:"span",className:kt.attachmentName,textContent:this.attachment.getFilename(),attributes:{title:this.attachment.getFilename()}}),p({tagName:"span",className:kt.attachmentSize,textContent:this.attachment.getFormattedFilesize()})]})})),S("click",{onElement:o,withCallback:this.didClickToolbar}),S("click",{onElement:o,matchingSelector:"[data-trix-action]",withCallback:this.didClickActionButton}),he("trix-attachment-before-toolbar",{onElement:this.element,attributes:{toolbar:o,attachment:this.attachment}}),{do:()=>this.element.appendChild(o),undo:()=>At(o)}})),q(this,"installCaptionEditor",Vn(()=>{let o=p({tagName:"textarea",className:kt.attachmentCaptionEditor,attributes:{placeholder:Un.captionPlaceholder},data:{trixMutable:!0}});o.value=this.attachmentPiece.getCaption();let s=o.cloneNode();s.classList.add("trix-autoresize-clone"),s.tabIndex=-1;let l=function(){s.value=o.value,o.style.height=s.scrollHeight+"px"};S("input",{onElement:o,withCallback:l}),S("input",{onElement:o,withCallback:this.didInputCaption}),S("keydown",{onElement:o,withCallback:this.didKeyDownCaption}),S("change",{onElement:o,withCallback:this.didChangeCaption}),S("blur",{onElement:o,withCallback:this.didBlurCaption});let c=this.element.querySelector("figcaption"),u=c.cloneNode();return{do:()=>{if(c.style.display="none",u.appendChild(o),u.appendChild(s),u.classList.add("".concat(kt.attachmentCaption,"--editing")),c.parentElement.insertBefore(u,c),l(),this.options.editCaption)return Ai(()=>o.focus())},undo(){At(u),c.style.display=null}}})),this.didClickToolbar=this.didClickToolbar.bind(this),this.didClickActionButton=this.didClickActionButton.bind(this),this.didKeyDownCaption=this.didKeyDownCaption.bind(this),this.didInputCaption=this.didInputCaption.bind(this),this.didChangeCaption=this.didChangeCaption.bind(this),this.didBlurCaption=this.didBlurCaption.bind(this),this.attachmentPiece=t,this.element=e,this.container=n,this.options=r,this.attachment=this.attachmentPiece.attachment,j(this.element)==="a"&&(this.element=this.element.firstChild),this.install()}install(){this.makeElementMutable(),this.addToolbar(),this.attachment.isPreviewable()&&this.installCaptionEditor()}uninstall(){var t;let e=this.undos.pop();for(this.savePendingCaption();e;)e(),e=this.undos.pop();(t=this.delegate)===null||t===void 0||t.didUninstallAttachmentEditor(this)}savePendingCaption(){if(this.pendingCaption!=null){let o=this.pendingCaption;var t,e,n,r;this.pendingCaption=null,o?(t=this.delegate)===null||t===void 0||(e=t.attachmentEditorDidRequestUpdatingAttributesForAttachment)===null||e===void 0||e.call(t,{caption:o},this.attachment):(n=this.delegate)===null||n===void 0||(r=n.attachmentEditorDidRequestRemovingAttributeForAttachment)===null||r===void 0||r.call(n,"caption",this.attachment)}}didClickToolbar(t){return t.preventDefault(),t.stopPropagation()}didClickActionButton(t){var e;if(t.target.getAttribute("data-trix-action")==="remove")return(e=this.delegate)===null||e===void 0?void 0:e.attachmentEditorDidRequestRemovalOfAttachment(this.attachment)}didKeyDownCaption(t){var e,n;if(Ms[t.keyCode]==="return")return t.preventDefault(),this.savePendingCaption(),(e=this.delegate)===null||e===void 0||(n=e.attachmentEditorDidRequestDeselectingAttachment)===null||n===void 0?void 0:n.call(e,this.attachment)}didInputCaption(t){this.pendingCaption=t.target.value.replace(/\s/g," ").trim()}didChangeCaption(t){return this.savePendingCaption()}didBlurCaption(t){return this.savePendingCaption()}},tn=class extends R{constructor(t,e){super(...arguments),this.didFocus=this.didFocus.bind(this),this.didBlur=this.didBlur.bind(this),this.didClickAttachment=this.didClickAttachment.bind(this),this.element=t,this.composition=e,this.documentView=new Gt(this.composition.document,{element:this.element}),S("focus",{onElement:this.element,withCallback:this.didFocus}),S("blur",{onElement:this.element,withCallback:this.didBlur}),S("click",{onElement:this.element,matchingSelector:"a[contenteditable=false]",preventDefault:!0}),S("mousedown",{onElement:this.element,matchingSelector:wt,withCallback:this.didClickAttachment}),S("click",{onElement:this.element,matchingSelector:"a".concat(wt),preventDefault:!0})}didFocus(t){var e;let n=()=>{var r,o;if(!this.focused)return this.focused=!0,(r=this.delegate)===null||r===void 0||(o=r.compositionControllerDidFocus)===null||o===void 0?void 0:o.call(r)};return((e=this.blurPromise)===null||e===void 0?void 0:e.then(n))||n()}didBlur(t){this.blurPromise=new Promise(e=>Ai(()=>{var n,r;return fi(this.element)||(this.focused=null,(n=this.delegate)===null||n===void 0||(r=n.compositionControllerDidBlur)===null||r===void 0||r.call(n)),this.blurPromise=null,e()}))}didClickAttachment(t,e){var n,r;let o=this.findAttachmentForElement(e),s=!!vt(t.target,{matchingSelector:"figcaption"});return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerDidSelectAttachment)===null||r===void 0?void 0:r.call(n,o,{editCaption:s})}getSerializableElement(){return this.isEditingAttachment()?this.documentView.shadowElement:this.element}render(){var t,e,n,r,o,s;return this.revision!==this.composition.revision&&(this.documentView.setDocument(this.composition.document),this.documentView.render(),this.revision=this.composition.revision),this.canSyncDocumentView()&&!this.documentView.isSynced()&&((n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillSyncDocumentView)===null||r===void 0||r.call(n),this.documentView.sync(),(o=this.delegate)===null||o===void 0||(s=o.compositionControllerDidSyncDocumentView)===null||s===void 0||s.call(o)),(t=this.delegate)===null||t===void 0||(e=t.compositionControllerDidRender)===null||e===void 0?void 0:e.call(t)}rerenderViewForObject(t){return this.invalidateViewForObject(t),this.render()}invalidateViewForObject(t){return this.documentView.invalidateViewForObject(t)}isViewCachingEnabled(){return this.documentView.isViewCachingEnabled()}enableViewCaching(){return this.documentView.enableViewCaching()}disableViewCaching(){return this.documentView.disableViewCaching()}refreshViewCache(){return this.documentView.garbageCollectCachedViews()}isEditingAttachment(){return!!this.attachmentEditor}installAttachmentEditorForAttachment(t,e){var n;if(((n=this.attachmentEditor)===null||n===void 0?void 0:n.attachment)===t)return;let r=this.documentView.findElementForObject(t);if(!r)return;this.uninstallAttachmentEditor();let o=this.composition.document.getAttachmentPieceForAttachment(t);this.attachmentEditor=new Qe(o,r,this.element,e),this.attachmentEditor.delegate=this}uninstallAttachmentEditor(){var t;return(t=this.attachmentEditor)===null||t===void 0?void 0:t.uninstall()}didUninstallAttachmentEditor(){return this.attachmentEditor=null,this.render()}attachmentEditorDidRequestUpdatingAttributesForAttachment(t,e){var n,r;return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillUpdateAttachment)===null||r===void 0||r.call(n,e),this.composition.updateAttributesForAttachment(t,e)}attachmentEditorDidRequestRemovingAttributeForAttachment(t,e){var n,r;return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillUpdateAttachment)===null||r===void 0||r.call(n,e),this.composition.removeAttributeForAttachment(t,e)}attachmentEditorDidRequestRemovalOfAttachment(t){var e,n;return(e=this.delegate)===null||e===void 0||(n=e.compositionControllerDidRequestRemovalOfAttachment)===null||n===void 0?void 0:n.call(e,t)}attachmentEditorDidRequestDeselectingAttachment(t){var e,n;return(e=this.delegate)===null||e===void 0||(n=e.compositionControllerDidRequestDeselectingAttachment)===null||n===void 0?void 0:n.call(e,t)}canSyncDocumentView(){return!this.isEditingAttachment()}findAttachmentForElement(t){return this.composition.document.getAttachmentById(parseInt(t.dataset.trixId,10))}},en=class extends R{},Zr="data-trix-mutable",Bs="[".concat(Zr,"]"),_s={attributes:!0,childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},nn=class extends R{constructor(t){super(t),this.didMutate=this.didMutate.bind(this),this.element=t,this.observer=new window.MutationObserver(this.didMutate),this.start()}start(){return this.reset(),this.observer.observe(this.element,_s)}stop(){return this.observer.disconnect()}didMutate(t){var e,n;if(this.mutations.push(...Array.from(this.findSignificantMutations(t)||[])),this.mutations.length)return(e=this.delegate)===null||e===void 0||(n=e.elementDidMutate)===null||n===void 0||n.call(e,this.getMutationSummary()),this.reset()}reset(){this.mutations=[]}findSignificantMutations(t){return t.filter(e=>this.mutationIsSignificant(e))}mutationIsSignificant(t){if(this.nodeIsMutable(t.target))return!1;for(let e of Array.from(this.nodesModifiedByMutation(t)))if(this.nodeIsSignificant(e))return!0;return!1}nodeIsSignificant(t){return t!==this.element&&!this.nodeIsMutable(t)&&!Or(t)}nodeIsMutable(t){return vt(t,{matchingSelector:Bs})}nodesModifiedByMutation(t){let e=[];switch(t.type){case"attributes":t.attributeName!==Zr&&e.push(t.target);break;case"characterData":e.push(t.target.parentNode),e.push(t.target);break;case"childList":e.push(...Array.from(t.addedNodes||[])),e.push(...Array.from(t.removedNodes||[]))}return e}getMutationSummary(){return this.getTextMutationSummary()}getTextMutationSummary(){let{additions:t,deletions:e}=this.getTextChangesFromCharacterData(),n=this.getTextChangesFromChildList();Array.from(n.additions).forEach(l=>{Array.from(t).includes(l)||t.push(l)}),e.push(...Array.from(n.deletions||[]));let r={},o=t.join("");o&&(r.textAdded=o);let s=e.join("");return s&&(r.textDeleted=s),r}getMutationsByType(t){return Array.from(this.mutations).filter(e=>e.type===t)}getTextChangesFromChildList(){let t,e,n=[],r=[];Array.from(this.getMutationsByType("childList")).forEach(l=>{n.push(...Array.from(l.addedNodes||[])),r.push(...Array.from(l.removedNodes||[]))}),n.length===0&&r.length===1&&qt(r[0])?(t=[],e=[` +`&&(this.document=this.document.insertBlockBreakAtRange(e[0]),e[0]0&&arguments[0]!==void 0?arguments[0]:"",e=Mt.parse(t,{referenceElement:this.element}).getDocument();return this.loadDocument(e)}loadJSON(t){let{document:e,selectedRange:n}=t;return e=z.fromJSON(e),this.loadSnapshot({document:e,selectedRange:n})}loadSnapshot(t){return this.undoManager=new Ae(this.composition),this.composition.loadSnapshot(t)}getDocument(){return this.composition.document}getSelectedDocument(){return this.composition.getSelectedDocument()}getSnapshot(){return this.composition.getSnapshot()}toJSON(){return this.getSnapshot()}deleteInDirection(t){return this.composition.deleteInDirection(t)}insertAttachment(t){return this.composition.insertAttachment(t)}insertAttachments(t){return this.composition.insertAttachments(t)}insertDocument(t){return this.composition.insertDocument(t)}insertFile(t){return this.composition.insertFile(t)}insertFiles(t){return this.composition.insertFiles(t)}insertHTML(t){return this.composition.insertHTML(t)}insertString(t){return this.composition.insertString(t)}insertText(t){return this.composition.insertText(t)}insertLineBreak(){return this.composition.insertLineBreak()}getSelectedRange(){return this.composition.getSelectedRange()}getPosition(){return this.composition.getPosition()}getClientRectAtPosition(t){let e=this.getDocument().locationRangeFromRange([t,t+1]);return this.selectionManager.getClientRectAtLocationRange(e)}expandSelectionInDirection(t){return this.composition.expandSelectionInDirection(t)}moveCursorInDirection(t){return this.composition.moveCursorInDirection(t)}setSelectedRange(t){return this.composition.setSelectedRange(t)}activateAttribute(t){let e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this.composition.setCurrentAttribute(t,e)}attributeIsActive(t){return this.composition.hasCurrentAttribute(t)}canActivateAttribute(t){return this.composition.canSetCurrentAttribute(t)}deactivateAttribute(t){return this.composition.removeCurrentAttribute(t)}setHTMLAtributeAtPosition(t,e,n){this.composition.setHTMLAtributeAtPosition(t,e,n)}canDecreaseNestingLevel(){return this.composition.canDecreaseNestingLevel()}canIncreaseNestingLevel(){return this.composition.canIncreaseNestingLevel()}decreaseNestingLevel(){if(this.canDecreaseNestingLevel())return this.composition.decreaseNestingLevel()}increaseNestingLevel(){if(this.canIncreaseNestingLevel())return this.composition.increaseNestingLevel()}canRedo(){return this.undoManager.canRedo()}canUndo(){return this.undoManager.canUndo()}recordUndoEntry(t){let{context:e,consolidatable:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.undoManager.recordUndoEntry(t,{context:e,consolidatable:n})}redo(){if(this.canRedo())return this.undoManager.redo()}undo(){if(this.canUndo())return this.undoManager.undo()}},Ze=class{constructor(t){this.element=t}findLocationFromContainerAndOffset(t,e){let{strict:n}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{strict:!0},r=0,o=!1,s={index:0,offset:0},l=this.findAttachmentElementParentForNode(t);l&&(t=l.parentNode,e=kn(l));let c=je(this.element,{usingFilter:Yr});for(;c.nextNode();){let u=c.currentNode;if(u===t&&ge(t)){Ht(u)||(s.offset+=e);break}if(u.parentNode===t){if(r++===e)break}else if(!Tt(t,u)&&r>0)break;Yi(u,{strict:n})?(o&&s.index++,s.offset=0,o=!0):s.offset+=Un(u)}return s}findContainerAndOffsetFromLocation(t){let e,n;if(t.index===0&&t.offset===0){for(e=this.element,n=0;e.firstChild;)if(e=e.firstChild,Rn(e)){n=1;break}return[e,n]}let[r,o]=this.findNodeAndOffsetFromLocation(t);if(r){if(ge(r))Un(r)===0?(e=r.parentNode.parentNode,n=kn(r.parentNode),Ht(r,{name:"right"})&&n++):(e=r,n=t.offset-o);else{if(e=r.parentNode,!Yi(r.previousSibling)&&!Rn(e))for(;r===e.lastChild&&(r=e,e=e.parentNode,!Rn(e)););n=kn(r),t.offset!==0&&n++}return[e,n]}}findNodeAndOffsetFromLocation(t){let e,n,r=0;for(let o of this.getSignificantNodesForIndex(t.index)){let s=Un(o);if(t.offset<=r+s)if(ge(o)){if(e=o,n=r,t.offset===n&&Ht(e))break}else e||(e=o,n=r);if(r+=s,r>t.offset)break}return[e,n]}findAttachmentElementParentForNode(t){for(;t&&t!==this.element;){if(Lt(t))return t;t=t.parentNode}}getSignificantNodesForIndex(t){let e=[],n=je(this.element,{usingFilter:Os}),r=!1;for(;n.nextNode();){let s=n.currentNode;var o;if(qt(s)){if(o!=null?o++:o=0,o===t)r=!0;else if(r)break}else r&&e.push(s)}return e}},Un=function(i){return i.nodeType===Node.TEXT_NODE?Ht(i)?0:i.textContent.length:j(i)==="br"||Lt(i)?1:0},Os=function(i){return Fs(i)===NodeFilter.FILTER_ACCEPT?Yr(i):NodeFilter.FILTER_REJECT},Fs=function(i){return Or(i)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},Yr=function(i){return Lt(i.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},Qe=class{createDOMRangeFromPoint(t){let e,{x:n,y:r}=t;if(document.caretPositionFromPoint){let{offsetNode:o,offset:s}=document.caretPositionFromPoint(n,r);return e=document.createRange(),e.setStart(o,s),e}if(document.caretRangeFromPoint)return document.caretRangeFromPoint(n,r);if(document.body.createTextRange){let o=me();try{let s=document.body.createTextRange();s.moveToPoint(n,r),s.select()}catch{}return e=me(),Wr(o),e}}getClientRectsForDOMRange(t){let e=Array.from(t.getClientRects());return[e[0],e[e.length-1]]}},ut=class extends R{constructor(t){super(...arguments),this.didMouseDown=this.didMouseDown.bind(this),this.selectionDidChange=this.selectionDidChange.bind(this),this.element=t,this.locationMapper=new Ze(this.element),this.pointMapper=new Qe,this.lockCount=0,S("mousedown",{onElement:this.element,withCallback:this.didMouseDown})}getLocationRange(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return t.strict===!1?this.createLocationRangeFromDOMRange(me()):t.ignoreLock?this.currentLocationRange:this.lockedLocationRange?this.lockedLocationRange:this.currentLocationRange}setLocationRange(t){if(this.lockedLocationRange)return;t=y(t);let e=this.createDOMRangeFromLocationRange(t);e&&(Wr(e),this.updateCurrentLocationRange(t))}setLocationRangeFromPointRange(t){t=y(t);let e=this.getLocationAtPoint(t[0]),n=this.getLocationAtPoint(t[1]);this.setLocationRange([e,n])}getClientRectAtLocationRange(t){let e=this.createDOMRangeFromLocationRange(t);if(e)return this.getClientRectsForDOMRange(e)[1]}locationIsCursorTarget(t){let e=Array.from(this.findNodeAndOffsetFromLocation(t))[0];return Ht(e)}lock(){this.lockCount++==0&&(this.updateCurrentLocationRange(),this.lockedLocationRange=this.getLocationRange())}unlock(){if(--this.lockCount==0){let{lockedLocationRange:t}=this;if(this.lockedLocationRange=null,t!=null)return this.setLocationRange(t)}}clearSelection(){var t;return(t=jr())===null||t===void 0?void 0:t.removeAllRanges()}selectionIsCollapsed(){var t;return((t=me())===null||t===void 0?void 0:t.collapsed)===!0}selectionIsExpanded(){return!this.selectionIsCollapsed()}createLocationRangeFromDOMRange(t,e){if(t==null||!this.domRangeWithinElement(t))return;let n=this.findLocationFromContainerAndOffset(t.startContainer,t.startOffset,e);if(!n)return;let r=t.collapsed?void 0:this.findLocationFromContainerAndOffset(t.endContainer,t.endOffset,e);return y([n,r])}didMouseDown(){return this.pauseTemporarily()}pauseTemporarily(){let t;this.paused=!0;let e=()=>{if(this.paused=!1,clearTimeout(n),Array.from(t).forEach(r=>{r.destroy()}),Tt(document,this.element))return this.selectionDidChange()},n=setTimeout(e,200);t=["mousemove","keydown"].map(r=>S(r,{onElement:document,withCallback:e}))}selectionDidChange(){if(!this.paused&&!fi(this.element))return this.updateCurrentLocationRange()}updateCurrentLocationRange(t){var e,n;if((t??(t=this.createLocationRangeFromDOMRange(me())))&&!We(t,this.currentLocationRange))return this.currentLocationRange=t,(e=this.delegate)===null||e===void 0||(n=e.locationRangeDidChange)===null||n===void 0?void 0:n.call(e,this.currentLocationRange.slice(0))}createDOMRangeFromLocationRange(t){let e=this.findContainerAndOffsetFromLocation(t[0]),n=ht(t)?e:this.findContainerAndOffsetFromLocation(t[1])||e;if(e!=null&&n!=null){let r=document.createRange();return r.setStart(...Array.from(e||[])),r.setEnd(...Array.from(n||[])),r}}getLocationAtPoint(t){let e=this.createDOMRangeFromPoint(t);var n;if(e)return(n=this.createLocationRangeFromDOMRange(e))===null||n===void 0?void 0:n[0]}domRangeWithinElement(t){return t.collapsed?Tt(this.element,t.startContainer):Tt(this.element,t.startContainer)&&Tt(this.element,t.endContainer)}};ut.proxyMethod("locationMapper.findLocationFromContainerAndOffset"),ut.proxyMethod("locationMapper.findContainerAndOffsetFromLocation"),ut.proxyMethod("locationMapper.findNodeAndOffsetFromLocation"),ut.proxyMethod("pointMapper.createDOMRangeFromPoint"),ut.proxyMethod("pointMapper.getClientRectsForDOMRange");var Xr=Object.freeze({__proto__:null,Attachment:yt,AttachmentManager:Ge,AttachmentPiece:xt,Block:$,Composition:rt,Document:z,Editor:Xe,HTMLParser:Mt,HTMLSanitizer:Kt,LineBreakInsertion:$e,LocationMapper:Ze,ManagedAttachment:E,Piece:mt,PointMapper:Qe,SelectionManager:ut,SplittableList:$t,StringPiece:ve,Text:K,UndoManager:Ae}),Ps=Object.freeze({__proto__:null,ObjectView:gt,AttachmentView:be,BlockView:Je,DocumentView:Gt,PieceView:qe,PreviewableAttachmentView:ze,TextView:He}),{lang:Vn,css:kt,keyNames:Ms}=Ce,zn=function(i){return function(){let t=i.apply(this,arguments);t.do(),this.undos||(this.undos=[]),this.undos.push(t.undo)}},tn=class extends R{constructor(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(...arguments),q(this,"makeElementMutable",zn(()=>({do:()=>{this.element.dataset.trixMutable=!0},undo:()=>delete this.element.dataset.trixMutable}))),q(this,"addToolbar",zn(()=>{let o=p({tagName:"div",className:kt.attachmentToolbar,data:{trixMutable:!0},childNodes:p({tagName:"div",className:"trix-button-row",childNodes:p({tagName:"span",className:"trix-button-group trix-button-group--actions",childNodes:p({tagName:"button",className:"trix-button trix-button--remove",textContent:Vn.remove,attributes:{title:Vn.remove},data:{trixAction:"remove"}})})})});return this.attachment.isPreviewable()&&o.appendChild(p({tagName:"div",className:kt.attachmentMetadataContainer,childNodes:p({tagName:"span",className:kt.attachmentMetadata,childNodes:[p({tagName:"span",className:kt.attachmentName,textContent:this.attachment.getFilename(),attributes:{title:this.attachment.getFilename()}}),p({tagName:"span",className:kt.attachmentSize,textContent:this.attachment.getFormattedFilesize()})]})})),S("click",{onElement:o,withCallback:this.didClickToolbar}),S("click",{onElement:o,matchingSelector:"[data-trix-action]",withCallback:this.didClickActionButton}),he("trix-attachment-before-toolbar",{onElement:this.element,attributes:{toolbar:o,attachment:this.attachment}}),{do:()=>this.element.appendChild(o),undo:()=>At(o)}})),q(this,"installCaptionEditor",zn(()=>{let o=p({tagName:"textarea",className:kt.attachmentCaptionEditor,attributes:{placeholder:Vn.captionPlaceholder},data:{trixMutable:!0}});o.value=this.attachmentPiece.getCaption();let s=o.cloneNode();s.classList.add("trix-autoresize-clone"),s.tabIndex=-1;let l=function(){s.value=o.value,o.style.height=s.scrollHeight+"px"};S("input",{onElement:o,withCallback:l}),S("input",{onElement:o,withCallback:this.didInputCaption}),S("keydown",{onElement:o,withCallback:this.didKeyDownCaption}),S("change",{onElement:o,withCallback:this.didChangeCaption}),S("blur",{onElement:o,withCallback:this.didBlurCaption});let c=this.element.querySelector("figcaption"),u=c.cloneNode();return{do:()=>{if(c.style.display="none",u.appendChild(o),u.appendChild(s),u.classList.add("".concat(kt.attachmentCaption,"--editing")),c.parentElement.insertBefore(u,c),l(),this.options.editCaption)return Ai(()=>o.focus())},undo(){At(u),c.style.display=null}}})),this.didClickToolbar=this.didClickToolbar.bind(this),this.didClickActionButton=this.didClickActionButton.bind(this),this.didKeyDownCaption=this.didKeyDownCaption.bind(this),this.didInputCaption=this.didInputCaption.bind(this),this.didChangeCaption=this.didChangeCaption.bind(this),this.didBlurCaption=this.didBlurCaption.bind(this),this.attachmentPiece=t,this.element=e,this.container=n,this.options=r,this.attachment=this.attachmentPiece.attachment,j(this.element)==="a"&&(this.element=this.element.firstChild),this.install()}install(){this.makeElementMutable(),this.addToolbar(),this.attachment.isPreviewable()&&this.installCaptionEditor()}uninstall(){var t;let e=this.undos.pop();for(this.savePendingCaption();e;)e(),e=this.undos.pop();(t=this.delegate)===null||t===void 0||t.didUninstallAttachmentEditor(this)}savePendingCaption(){if(this.pendingCaption!=null){let o=this.pendingCaption;var t,e,n,r;this.pendingCaption=null,o?(t=this.delegate)===null||t===void 0||(e=t.attachmentEditorDidRequestUpdatingAttributesForAttachment)===null||e===void 0||e.call(t,{caption:o},this.attachment):(n=this.delegate)===null||n===void 0||(r=n.attachmentEditorDidRequestRemovingAttributeForAttachment)===null||r===void 0||r.call(n,"caption",this.attachment)}}didClickToolbar(t){return t.preventDefault(),t.stopPropagation()}didClickActionButton(t){var e;if(t.target.getAttribute("data-trix-action")==="remove")return(e=this.delegate)===null||e===void 0?void 0:e.attachmentEditorDidRequestRemovalOfAttachment(this.attachment)}didKeyDownCaption(t){var e,n;if(Ms[t.keyCode]==="return")return t.preventDefault(),this.savePendingCaption(),(e=this.delegate)===null||e===void 0||(n=e.attachmentEditorDidRequestDeselectingAttachment)===null||n===void 0?void 0:n.call(e,this.attachment)}didInputCaption(t){this.pendingCaption=t.target.value.replace(/\s/g," ").trim()}didChangeCaption(t){return this.savePendingCaption()}didBlurCaption(t){return this.savePendingCaption()}},en=class extends R{constructor(t,e){super(...arguments),this.didFocus=this.didFocus.bind(this),this.didBlur=this.didBlur.bind(this),this.didClickAttachment=this.didClickAttachment.bind(this),this.element=t,this.composition=e,this.documentView=new Gt(this.composition.document,{element:this.element}),S("focus",{onElement:this.element,withCallback:this.didFocus}),S("blur",{onElement:this.element,withCallback:this.didBlur}),S("click",{onElement:this.element,matchingSelector:"a[contenteditable=false]",preventDefault:!0}),S("mousedown",{onElement:this.element,matchingSelector:wt,withCallback:this.didClickAttachment}),S("click",{onElement:this.element,matchingSelector:"a".concat(wt),preventDefault:!0})}didFocus(t){var e;let n=()=>{var r,o;if(!this.focused)return this.focused=!0,(r=this.delegate)===null||r===void 0||(o=r.compositionControllerDidFocus)===null||o===void 0?void 0:o.call(r)};return((e=this.blurPromise)===null||e===void 0?void 0:e.then(n))||n()}didBlur(t){this.blurPromise=new Promise(e=>Ai(()=>{var n,r;return fi(this.element)||(this.focused=null,(n=this.delegate)===null||n===void 0||(r=n.compositionControllerDidBlur)===null||r===void 0||r.call(n)),this.blurPromise=null,e()}))}didClickAttachment(t,e){var n,r;let o=this.findAttachmentForElement(e),s=!!vt(t.target,{matchingSelector:"figcaption"});return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerDidSelectAttachment)===null||r===void 0?void 0:r.call(n,o,{editCaption:s})}getSerializableElement(){return this.isEditingAttachment()?this.documentView.shadowElement:this.element}render(){var t,e,n,r,o,s;return this.revision!==this.composition.revision&&(this.documentView.setDocument(this.composition.document),this.documentView.render(),this.revision=this.composition.revision),this.canSyncDocumentView()&&!this.documentView.isSynced()&&((n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillSyncDocumentView)===null||r===void 0||r.call(n),this.documentView.sync(),(o=this.delegate)===null||o===void 0||(s=o.compositionControllerDidSyncDocumentView)===null||s===void 0||s.call(o)),(t=this.delegate)===null||t===void 0||(e=t.compositionControllerDidRender)===null||e===void 0?void 0:e.call(t)}rerenderViewForObject(t){return this.invalidateViewForObject(t),this.render()}invalidateViewForObject(t){return this.documentView.invalidateViewForObject(t)}isViewCachingEnabled(){return this.documentView.isViewCachingEnabled()}enableViewCaching(){return this.documentView.enableViewCaching()}disableViewCaching(){return this.documentView.disableViewCaching()}refreshViewCache(){return this.documentView.garbageCollectCachedViews()}isEditingAttachment(){return!!this.attachmentEditor}installAttachmentEditorForAttachment(t,e){var n;if(((n=this.attachmentEditor)===null||n===void 0?void 0:n.attachment)===t)return;let r=this.documentView.findElementForObject(t);if(!r)return;this.uninstallAttachmentEditor();let o=this.composition.document.getAttachmentPieceForAttachment(t);this.attachmentEditor=new tn(o,r,this.element,e),this.attachmentEditor.delegate=this}uninstallAttachmentEditor(){var t;return(t=this.attachmentEditor)===null||t===void 0?void 0:t.uninstall()}didUninstallAttachmentEditor(){return this.attachmentEditor=null,this.render()}attachmentEditorDidRequestUpdatingAttributesForAttachment(t,e){var n,r;return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillUpdateAttachment)===null||r===void 0||r.call(n,e),this.composition.updateAttributesForAttachment(t,e)}attachmentEditorDidRequestRemovingAttributeForAttachment(t,e){var n,r;return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillUpdateAttachment)===null||r===void 0||r.call(n,e),this.composition.removeAttributeForAttachment(t,e)}attachmentEditorDidRequestRemovalOfAttachment(t){var e,n;return(e=this.delegate)===null||e===void 0||(n=e.compositionControllerDidRequestRemovalOfAttachment)===null||n===void 0?void 0:n.call(e,t)}attachmentEditorDidRequestDeselectingAttachment(t){var e,n;return(e=this.delegate)===null||e===void 0||(n=e.compositionControllerDidRequestDeselectingAttachment)===null||n===void 0?void 0:n.call(e,t)}canSyncDocumentView(){return!this.isEditingAttachment()}findAttachmentForElement(t){return this.composition.document.getAttachmentById(parseInt(t.dataset.trixId,10))}},nn=class extends R{},Zr="data-trix-mutable",Bs="[".concat(Zr,"]"),_s={attributes:!0,childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},rn=class extends R{constructor(t){super(t),this.didMutate=this.didMutate.bind(this),this.element=t,this.observer=new window.MutationObserver(this.didMutate),this.start()}start(){return this.reset(),this.observer.observe(this.element,_s)}stop(){return this.observer.disconnect()}didMutate(t){var e,n;if(this.mutations.push(...Array.from(this.findSignificantMutations(t)||[])),this.mutations.length)return(e=this.delegate)===null||e===void 0||(n=e.elementDidMutate)===null||n===void 0||n.call(e,this.getMutationSummary()),this.reset()}reset(){this.mutations=[]}findSignificantMutations(t){return t.filter(e=>this.mutationIsSignificant(e))}mutationIsSignificant(t){if(this.nodeIsMutable(t.target))return!1;for(let e of Array.from(this.nodesModifiedByMutation(t)))if(this.nodeIsSignificant(e))return!0;return!1}nodeIsSignificant(t){return t!==this.element&&!this.nodeIsMutable(t)&&!Or(t)}nodeIsMutable(t){return vt(t,{matchingSelector:Bs})}nodesModifiedByMutation(t){let e=[];switch(t.type){case"attributes":t.attributeName!==Zr&&e.push(t.target);break;case"characterData":e.push(t.target.parentNode),e.push(t.target);break;case"childList":e.push(...Array.from(t.addedNodes||[])),e.push(...Array.from(t.removedNodes||[]))}return e}getMutationSummary(){return this.getTextMutationSummary()}getTextMutationSummary(){let{additions:t,deletions:e}=this.getTextChangesFromCharacterData(),n=this.getTextChangesFromChildList();Array.from(n.additions).forEach(l=>{Array.from(t).includes(l)||t.push(l)}),e.push(...Array.from(n.deletions||[]));let r={},o=t.join("");o&&(r.textAdded=o);let s=e.join("");return s&&(r.textDeleted=s),r}getMutationsByType(t){return Array.from(this.mutations).filter(e=>e.type===t)}getTextChangesFromChildList(){let t,e,n=[],r=[];Array.from(this.getMutationsByType("childList")).forEach(l=>{n.push(...Array.from(l.addedNodes||[])),r.push(...Array.from(l.removedNodes||[]))}),n.length===0&&r.length===1&&qt(r[0])?(t=[],e=[` `]):(t=li(n),e=li(r));let o=t.filter((l,c)=>l!==e[c]).map(ue),s=e.filter((l,c)=>l!==t[c]).map(ue);return{additions:o,deletions:s}}getTextChangesFromCharacterData(){let t,e,n=this.getMutationsByType("characterData");if(n.length){let r=n[0],o=n[n.length-1],s=function(l,c){let u,d;return l=Ot.box(l),(c=Ot.box(c)).length0&&arguments[0]!==void 0?arguments[0]:[],t=[];for(let e of Array.from(i))switch(e.nodeType){case Node.TEXT_NODE:t.push(e.data);break;case Node.ELEMENT_NODE:j(e)==="br"?t.push(` -`):t.push(...Array.from(li(e.childNodes)||[]))}return t},rn=class extends Jt{constructor(t){super(...arguments),this.file=t}perform(t){let e=new FileReader;return e.onerror=()=>t(!1),e.onload=()=>{e.onerror=null;try{e.abort()}catch{}return t(!0,this.file)},e.readAsArrayBuffer(this.file)}},ci=class{constructor(t){this.element=t}shouldIgnore(t){return!!xe.samsungAndroid&&(this.previousEvent=this.event,this.event=t,this.checkSamsungKeyboardBuggyModeStart(),this.checkSamsungKeyboardBuggyModeEnd(),this.buggyMode)}checkSamsungKeyboardBuggyModeStart(){this.insertingLongTextAfterUnidentifiedChar()&&js(this.element.innerText,this.event.data)&&(this.buggyMode=!0,this.event.preventDefault())}checkSamsungKeyboardBuggyModeEnd(){this.buggyMode&&this.event.inputType!=="insertText"&&(this.buggyMode=!1)}insertingLongTextAfterUnidentifiedChar(){var t;return this.isBeforeInputInsertText()&&this.previousEventWasUnidentifiedKeydown()&&((t=this.event.data)===null||t===void 0?void 0:t.length)>50}isBeforeInputInsertText(){return this.event.type==="beforeinput"&&this.event.inputType==="insertText"}previousEventWasUnidentifiedKeydown(){var t,e;return((t=this.previousEvent)===null||t===void 0?void 0:t.type)==="keydown"&&((e=this.previousEvent)===null||e===void 0?void 0:e.key)==="Unidentified"}},js=(i,t)=>Sr(i)===Sr(t),Ws=new RegExp("(".concat("\uFFFC","|").concat(an,"|").concat(bt,"|\\s)+"),"g"),Sr=i=>i.replace(Ws," ").trim(),Yt=class extends R{constructor(t){super(...arguments),this.element=t,this.mutationObserver=new nn(this.element),this.mutationObserver.delegate=this,this.flakyKeyboardDetector=new ci(this.element);for(let e in this.constructor.events)S(e,{onElement:this.element,withCallback:this.handlerFor(e)})}elementDidMutate(t){}editorWillSyncDocumentView(){return this.mutationObserver.stop()}editorDidSyncDocumentView(){return this.mutationObserver.start()}requestRender(){var t,e;return(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidRequestRender)===null||e===void 0?void 0:e.call(t)}requestReparse(){var t,e;return(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidRequestReparse)===null||e===void 0||e.call(t),this.requestRender()}attachFiles(t){let e=Array.from(t).map(n=>new rn(n));return Promise.all(e).then(n=>{this.handleInput(function(){var r,o;return(r=this.delegate)===null||r===void 0||r.inputControllerWillAttachFiles(),(o=this.responder)===null||o===void 0||o.insertFiles(n),this.requestRender()})})}handlerFor(t){return e=>{e.defaultPrevented||this.handleInput(()=>{if(!fi(this.element)){if(this.flakyKeyboardDetector.shouldIgnore(e))return;this.eventName=t,this.constructor.events[t].call(this,e)}})}}handleInput(t){try{var e;(e=this.delegate)===null||e===void 0||e.inputControllerWillHandleInput(),t.call(this)}finally{var n;(n=this.delegate)===null||n===void 0||n.inputControllerDidHandleInput()}}createLinkHTML(t,e){let n=document.createElement("a");return n.href=t,n.textContent=e||t,n.outerHTML}},zn;q(Yt,"events",{});var{browser:Us,keyNames:Qr}=Ce,Vs=0,Z=class extends Yt{constructor(){super(...arguments),this.resetInputSummary()}setInputSummary(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.inputSummary.eventName=this.eventName;for(let e in t){let n=t[e];this.inputSummary[e]=n}return this.inputSummary}resetInputSummary(){this.inputSummary={}}reset(){return this.resetInputSummary(),Pt.reset()}elementDidMutate(t){var e,n;return this.isComposing()?(e=this.delegate)===null||e===void 0||(n=e.inputControllerDidAllowUnhandledInput)===null||n===void 0?void 0:n.call(e):this.handleInput(function(){return this.mutationIsSignificant(t)&&(this.mutationIsExpected(t)?this.requestRender():this.requestReparse()),this.reset()})}mutationIsExpected(t){let{textAdded:e,textDeleted:n}=t;if(this.inputSummary.preferDocument)return!0;let r=e!=null?e===this.inputSummary.textAdded:!this.inputSummary.textAdded,o=n!=null?this.inputSummary.didDelete:!this.inputSummary.didDelete,s=[` +`):t.push(...Array.from(li(e.childNodes)||[]))}return t},on=class extends Jt{constructor(t){super(...arguments),this.file=t}perform(t){let e=new FileReader;return e.onerror=()=>t(!1),e.onload=()=>{e.onerror=null;try{e.abort()}catch{}return t(!0,this.file)},e.readAsArrayBuffer(this.file)}},ci=class{constructor(t){this.element=t}shouldIgnore(t){return!!xe.samsungAndroid&&(this.previousEvent=this.event,this.event=t,this.checkSamsungKeyboardBuggyModeStart(),this.checkSamsungKeyboardBuggyModeEnd(),this.buggyMode)}checkSamsungKeyboardBuggyModeStart(){this.insertingLongTextAfterUnidentifiedChar()&&js(this.element.innerText,this.event.data)&&(this.buggyMode=!0,this.event.preventDefault())}checkSamsungKeyboardBuggyModeEnd(){this.buggyMode&&this.event.inputType!=="insertText"&&(this.buggyMode=!1)}insertingLongTextAfterUnidentifiedChar(){var t;return this.isBeforeInputInsertText()&&this.previousEventWasUnidentifiedKeydown()&&((t=this.event.data)===null||t===void 0?void 0:t.length)>50}isBeforeInputInsertText(){return this.event.type==="beforeinput"&&this.event.inputType==="insertText"}previousEventWasUnidentifiedKeydown(){var t,e;return((t=this.previousEvent)===null||t===void 0?void 0:t.type)==="keydown"&&((e=this.previousEvent)===null||e===void 0?void 0:e.key)==="Unidentified"}},js=(i,t)=>Sr(i)===Sr(t),Ws=new RegExp("(".concat("\uFFFC","|").concat(ln,"|").concat(bt,"|\\s)+"),"g"),Sr=i=>i.replace(Ws," ").trim(),Yt=class extends R{constructor(t){super(...arguments),this.element=t,this.mutationObserver=new rn(this.element),this.mutationObserver.delegate=this,this.flakyKeyboardDetector=new ci(this.element);for(let e in this.constructor.events)S(e,{onElement:this.element,withCallback:this.handlerFor(e)})}elementDidMutate(t){}editorWillSyncDocumentView(){return this.mutationObserver.stop()}editorDidSyncDocumentView(){return this.mutationObserver.start()}requestRender(){var t,e;return(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidRequestRender)===null||e===void 0?void 0:e.call(t)}requestReparse(){var t,e;return(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidRequestReparse)===null||e===void 0||e.call(t),this.requestRender()}attachFiles(t){let e=Array.from(t).map(n=>new on(n));return Promise.all(e).then(n=>{this.handleInput(function(){var r,o;return(r=this.delegate)===null||r===void 0||r.inputControllerWillAttachFiles(),(o=this.responder)===null||o===void 0||o.insertFiles(n),this.requestRender()})})}handlerFor(t){return e=>{e.defaultPrevented||this.handleInput(()=>{if(!fi(this.element)){if(this.flakyKeyboardDetector.shouldIgnore(e))return;this.eventName=t,this.constructor.events[t].call(this,e)}})}}handleInput(t){try{var e;(e=this.delegate)===null||e===void 0||e.inputControllerWillHandleInput(),t.call(this)}finally{var n;(n=this.delegate)===null||n===void 0||n.inputControllerDidHandleInput()}}createLinkHTML(t,e){let n=document.createElement("a");return n.href=t,n.textContent=e||t,n.outerHTML}},qn;q(Yt,"events",{});var{browser:Us,keyNames:Qr}=Ce,Vs=0,Z=class extends Yt{constructor(){super(...arguments),this.resetInputSummary()}setInputSummary(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.inputSummary.eventName=this.eventName;for(let e in t){let n=t[e];this.inputSummary[e]=n}return this.inputSummary}resetInputSummary(){this.inputSummary={}}reset(){return this.resetInputSummary(),Pt.reset()}elementDidMutate(t){var e,n;return this.isComposing()?(e=this.delegate)===null||e===void 0||(n=e.inputControllerDidAllowUnhandledInput)===null||n===void 0?void 0:n.call(e):this.handleInput(function(){return this.mutationIsSignificant(t)&&(this.mutationIsExpected(t)?this.requestRender():this.requestReparse()),this.reset()})}mutationIsExpected(t){let{textAdded:e,textDeleted:n}=t;if(this.inputSummary.preferDocument)return!0;let r=e!=null?e===this.inputSummary.textAdded:!this.inputSummary.textAdded,o=n!=null?this.inputSummary.didDelete:!this.inputSummary.didDelete,s=[` `,` `].includes(e)&&!r,l=n===` `&&!o;if(s&&!l||l&&!s){let u=this.getSelectedRange();if(u){var c;let d=s?e.replace(/\n$/,"").length||-1:e?.length||1;if((c=this.responder)!==null&&c!==void 0&&c.positionIsBlockBreak(u[1]+d))return!0}}return r&&o}mutationIsSignificant(t){var e;let n=Object.keys(t).length>0,r=((e=this.compositionInput)===null||e===void 0?void 0:e.getEndData())==="";return n||!r}getCompositionInput(){if(this.isComposing())return this.compositionInput;this.compositionInput=new it(this)}isComposing(){return this.compositionInput&&!this.compositionInput.isEnded()}deleteInDirection(t,e){var n;return((n=this.responder)===null||n===void 0?void 0:n.deleteInDirection(t))!==!1?this.setInputSummary({didDelete:!0}):e?(e.preventDefault(),this.requestRender()):void 0}serializeSelectionToDataTransfer(t){var e;if(!function(r){if(r==null||!r.setData)return!1;for(let o in Qi){let s=Qi[o];try{if(r.setData(o,s),!r.getData(o)===s)return!1}catch{return!1}}return!0}(t))return;let n=(e=this.responder)===null||e===void 0?void 0:e.getSelectedDocument().toSerializableDocument();return t.setData("application/x-trix-document",JSON.stringify(n)),t.setData("text/html",Gt.render(n).innerHTML),t.setData("text/plain",n.toString().replace(/\n$/,"")),!0}canAcceptDataTransfer(t){let e={};return Array.from(t?.types||[]).forEach(n=>{e[n]=!0}),e.Files||e["application/x-trix-document"]||e["text/html"]||e["text/plain"]}getPastedHTMLUsingHiddenElement(t){let e=this.getSelectedRange(),n={position:"absolute",left:"".concat(window.pageXOffset,"px"),top:"".concat(window.pageYOffset,"px"),opacity:0},r=p({style:n,tagName:"div",editable:!0});return document.body.appendChild(r),r.focus(),requestAnimationFrame(()=>{let o=r.innerHTML;return At(r),this.setSelectedRange(e),t(o)})}};q(Z,"events",{keydown(i){this.isComposing()||this.resetInputSummary(),this.inputSummary.didInput=!0;let t=Qr[i.keyCode];if(t){var e;let r=this.keys;["ctrl","alt","shift","meta"].forEach(o=>{var s;i["".concat(o,"Key")]&&(o==="ctrl"&&(o="control"),r=(s=r)===null||s===void 0?void 0:s[o])}),((e=r)===null||e===void 0?void 0:e[t])!=null&&(this.setInputSummary({keyName:t}),Pt.reset(),r[t].call(this,i))}if(Br(i)){let r=String.fromCharCode(i.keyCode).toLowerCase();if(r){var n;let o=["alt","shift"].map(s=>{if(i["".concat(s,"Key")])return s}).filter(s=>s);o.push(r),(n=this.delegate)!==null&&n!==void 0&&n.inputControllerDidReceiveKeyboardCommand(o)&&i.preventDefault()}}},keypress(i){if(this.inputSummary.eventName!=null||i.metaKey||i.ctrlKey&&!i.altKey)return;let t=Hs(i);var e,n;return t?((e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.insertString(t),this.setInputSummary({textAdded:t,didDelete:this.selectionIsExpanded()})):void 0},textInput(i){let{data:t}=i,{textAdded:e}=this.inputSummary;if(e&&e!==t&&e.toUpperCase()===t){var n;let r=this.getSelectedRange();return this.setSelectedRange([r[0],r[1]+e.length]),(n=this.responder)===null||n===void 0||n.insertString(t),this.setInputSummary({textAdded:t}),this.setSelectedRange(r)}},dragenter(i){i.preventDefault()},dragstart(i){var t,e;return this.serializeSelectionToDataTransfer(i.dataTransfer),this.draggedRange=this.getSelectedRange(),(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidStartDrag)===null||e===void 0?void 0:e.call(t)},dragover(i){if(this.draggedRange||this.canAcceptDataTransfer(i.dataTransfer)){i.preventDefault();let n={x:i.clientX,y:i.clientY};var t,e;if(!Xt(n,this.draggingPoint))return this.draggingPoint=n,(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidReceiveDragOverPoint)===null||e===void 0?void 0:e.call(t,this.draggingPoint)}},dragend(i){var t,e;(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidCancelDrag)===null||e===void 0||e.call(t),this.draggedRange=null,this.draggingPoint=null},drop(i){var t,e;i.preventDefault();let n=(t=i.dataTransfer)===null||t===void 0?void 0:t.files,r=i.dataTransfer.getData("application/x-trix-document"),o={x:i.clientX,y:i.clientY};if((e=this.responder)===null||e===void 0||e.setLocationRangeFromPointRange(o),n!=null&&n.length)this.attachFiles(n);else if(this.draggedRange){var s,l;(s=this.delegate)===null||s===void 0||s.inputControllerWillMoveText(),(l=this.responder)===null||l===void 0||l.moveTextFromRange(this.draggedRange),this.draggedRange=null,this.requestRender()}else if(r){var c;let u=z.fromJSONString(r);(c=this.responder)===null||c===void 0||c.insertDocument(u),this.requestRender()}this.draggedRange=null,this.draggingPoint=null},cut(i){var t,e;if((t=this.responder)!==null&&t!==void 0&&t.selectionIsExpanded()&&(this.serializeSelectionToDataTransfer(i.clipboardData)&&i.preventDefault(),(e=this.delegate)===null||e===void 0||e.inputControllerWillCutText(),this.deleteInDirection("backward"),i.defaultPrevented))return this.requestRender()},copy(i){var t;(t=this.responder)!==null&&t!==void 0&&t.selectionIsExpanded()&&this.serializeSelectionToDataTransfer(i.clipboardData)&&i.preventDefault()},paste(i){let t=i.clipboardData||i.testClipboardData,e={clipboard:t};if(!t||Js(i))return void this.getPastedHTMLUsingHiddenElement(F=>{var k,ot,Et;return e.type="text/html",e.html=F,(k=this.delegate)===null||k===void 0||k.inputControllerWillPaste(e),(ot=this.responder)===null||ot===void 0||ot.insertHTML(e.html),this.requestRender(),(Et=this.delegate)===null||Et===void 0?void 0:Et.inputControllerDidPaste(e)});let n=t.getData("URL"),r=t.getData("text/html"),o=t.getData("public.url-name");if(n){var s,l,c;let F;e.type="text/html",F=o?xi(o).trim():n,e.html=this.createLinkHTML(n,F),(s=this.delegate)===null||s===void 0||s.inputControllerWillPaste(e),this.setInputSummary({textAdded:F,didDelete:this.selectionIsExpanded()}),(l=this.responder)===null||l===void 0||l.insertHTML(e.html),this.requestRender(),(c=this.delegate)===null||c===void 0||c.inputControllerDidPaste(e)}else if(Mr(t)){var u,d,C;e.type="text/plain",e.string=t.getData("text/plain"),(u=this.delegate)===null||u===void 0||u.inputControllerWillPaste(e),this.setInputSummary({textAdded:e.string,didDelete:this.selectionIsExpanded()}),(d=this.responder)===null||d===void 0||d.insertString(e.string),this.requestRender(),(C=this.delegate)===null||C===void 0||C.inputControllerDidPaste(e)}else if(r){var T,H,tt;e.type="text/html",e.html=r,(T=this.delegate)===null||T===void 0||T.inputControllerWillPaste(e),(H=this.responder)===null||H===void 0||H.insertHTML(e.html),this.requestRender(),(tt=this.delegate)===null||tt===void 0||tt.inputControllerDidPaste(e)}else if(Array.from(t.types).includes("Files")){var M,pt;let F=(M=t.items)===null||M===void 0||(M=M[0])===null||M===void 0||(pt=M.getAsFile)===null||pt===void 0?void 0:pt.call(M);if(F){var Ct,Zt,Qt;let k=zs(F);!F.name&&k&&(F.name="pasted-file-".concat(++Vs,".").concat(k)),e.type="File",e.file=F,(Ct=this.delegate)===null||Ct===void 0||Ct.inputControllerWillAttachFiles(),(Zt=this.responder)===null||Zt===void 0||Zt.insertFile(e.file),this.requestRender(),(Qt=this.delegate)===null||Qt===void 0||Qt.inputControllerDidPaste(e)}}i.preventDefault()},compositionstart(i){return this.getCompositionInput().start(i.data)},compositionupdate(i){return this.getCompositionInput().update(i.data)},compositionend(i){return this.getCompositionInput().end(i.data)},beforeinput(i){this.inputSummary.didInput=!0},input(i){return this.inputSummary.didInput=!0,i.stopPropagation()}}),q(Z,"keys",{backspace(i){var t;return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),this.deleteInDirection("backward",i)},delete(i){var t;return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),this.deleteInDirection("forward",i)},return(i){var t,e;return this.setInputSummary({preferDocument:!0}),(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(e=this.responder)===null||e===void 0?void 0:e.insertLineBreak()},tab(i){var t,e;(t=this.responder)!==null&&t!==void 0&&t.canIncreaseNestingLevel()&&((e=this.responder)===null||e===void 0||e.increaseNestingLevel(),this.requestRender(),i.preventDefault())},left(i){var t;if(this.selectionIsInCursorTarget())return i.preventDefault(),(t=this.responder)===null||t===void 0?void 0:t.moveCursorInDirection("backward")},right(i){var t;if(this.selectionIsInCursorTarget())return i.preventDefault(),(t=this.responder)===null||t===void 0?void 0:t.moveCursorInDirection("forward")},control:{d(i){var t;return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),this.deleteInDirection("forward",i)},h(i){var t;return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),this.deleteInDirection("backward",i)},o(i){var t,e;return i.preventDefault(),(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(e=this.responder)===null||e===void 0||e.insertString(` `,{updatePosition:!1}),this.requestRender()}},shift:{return(i){var t,e;(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(e=this.responder)===null||e===void 0||e.insertString(` -`),this.requestRender(),i.preventDefault()},tab(i){var t,e;(t=this.responder)!==null&&t!==void 0&&t.canDecreaseNestingLevel()&&((e=this.responder)===null||e===void 0||e.decreaseNestingLevel(),this.requestRender(),i.preventDefault())},left(i){if(this.selectionIsInCursorTarget())return i.preventDefault(),this.expandSelectionInDirection("backward")},right(i){if(this.selectionIsInCursorTarget())return i.preventDefault(),this.expandSelectionInDirection("forward")}},alt:{backspace(i){var t;return this.setInputSummary({preferDocument:!1}),(t=this.delegate)===null||t===void 0?void 0:t.inputControllerWillPerformTyping()}},meta:{backspace(i){var t;return this.setInputSummary({preferDocument:!1}),(t=this.delegate)===null||t===void 0?void 0:t.inputControllerWillPerformTyping()}}}),Z.proxyMethod("responder?.getSelectedRange"),Z.proxyMethod("responder?.setSelectedRange"),Z.proxyMethod("responder?.expandSelectionInDirection"),Z.proxyMethod("responder?.selectionIsInCursorTarget"),Z.proxyMethod("responder?.selectionIsExpanded");var zs=i=>{var t;return(t=i.type)===null||t===void 0||(t=t.match(/\/(\w+)$/))===null||t===void 0?void 0:t[1]},qs=!((zn=" ".codePointAt)===null||zn===void 0||!zn.call(" ",0)),Hs=function(i){if(i.key&&qs&&i.key.codePointAt(0)===i.keyCode)return i.key;{let t;if(i.which===null?t=i.keyCode:i.which!==0&&i.charCode!==0&&(t=i.charCode),t!=null&&Qr[t]!=="escape")return Ot.fromCodepoints([t]).toString()}},Js=function(i){let t=i.clipboardData;if(t){if(t.types.includes("text/html")){for(let e of t.types){let n=/^CorePasteboardFlavorType/.test(e),r=/^dyn\./.test(e)&&t.getData(e);if(n||r)return!0}return!1}{let e=t.types.includes("com.apple.webarchive"),n=t.types.includes("com.apple.flat-rtfd");return e||n}}},it=class extends R{constructor(t){super(...arguments),this.inputController=t,this.responder=this.inputController.responder,this.delegate=this.inputController.delegate,this.inputSummary=this.inputController.inputSummary,this.data={}}start(t){if(this.data.start=t,this.isSignificant()){var e,n;this.inputSummary.eventName==="keypress"&&this.inputSummary.textAdded&&((n=this.responder)===null||n===void 0||n.deleteInDirection("left")),this.selectionIsExpanded()||(this.insertPlaceholder(),this.requestRender()),this.range=(e=this.responder)===null||e===void 0?void 0:e.getSelectedRange()}}update(t){if(this.data.update=t,this.isSignificant()){let e=this.selectPlaceholder();e&&(this.forgetPlaceholder(),this.range=e)}}end(t){return this.data.end=t,this.isSignificant()?(this.forgetPlaceholder(),this.canApplyToDocument()?(this.setInputSummary({preferDocument:!0,didInput:!1}),(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.setSelectedRange(this.range),(r=this.responder)===null||r===void 0||r.insertString(this.data.end),(o=this.responder)===null||o===void 0?void 0:o.setSelectedRange(this.range[0]+this.data.end.length)):this.data.start!=null||this.data.update!=null?(this.requestReparse(),this.inputController.reset()):void 0):this.inputController.reset();var e,n,r,o}getEndData(){return this.data.end}isEnded(){return this.getEndData()!=null}isSignificant(){return!Us.composesExistingText||this.inputSummary.didInput}canApplyToDocument(){var t,e;return((t=this.data.start)===null||t===void 0?void 0:t.length)===0&&((e=this.data.end)===null||e===void 0?void 0:e.length)>0&&this.range}};it.proxyMethod("inputController.setInputSummary"),it.proxyMethod("inputController.requestRender"),it.proxyMethod("inputController.requestReparse"),it.proxyMethod("responder?.selectionIsExpanded"),it.proxyMethod("responder?.insertPlaceholder"),it.proxyMethod("responder?.selectPlaceholder"),it.proxyMethod("responder?.forgetPlaceholder");var Dt=class extends Yt{constructor(){super(...arguments),this.render=this.render.bind(this)}elementDidMutate(){return this.scheduledRender?this.composing?(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidAllowUnhandledInput)===null||e===void 0?void 0:e.call(t):void 0:this.reparse();var t,e}scheduleRender(){return this.scheduledRender?this.scheduledRender:this.scheduledRender=requestAnimationFrame(this.render)}render(){var t,e;cancelAnimationFrame(this.scheduledRender),this.scheduledRender=null,this.composing||(e=this.delegate)===null||e===void 0||e.render(),(t=this.afterRender)===null||t===void 0||t.call(this),this.afterRender=null}reparse(){var t;return(t=this.delegate)===null||t===void 0?void 0:t.reparse()}insertString(){var t;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var r;return(r=this.responder)===null||r===void 0?void 0:r.insertString(e,n)})}toggleAttributeIfSupported(t){var e;if(Zn().includes(t))return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformFormatting(t),this.withTargetDOMRange(function(){var n;return(n=this.responder)===null||n===void 0?void 0:n.toggleCurrentAttribute(t)})}activateAttributeIfSupported(t,e){var n;if(Zn().includes(t))return(n=this.delegate)===null||n===void 0||n.inputControllerWillPerformFormatting(t),this.withTargetDOMRange(function(){var r;return(r=this.responder)===null||r===void 0?void 0:r.setCurrentAttribute(t,e)})}deleteInDirection(t){let{recordUndoEntry:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{recordUndoEntry:!0};var n;e&&((n=this.delegate)===null||n===void 0||n.inputControllerWillPerformTyping());let r=()=>{var s;return(s=this.responder)===null||s===void 0?void 0:s.deleteInDirection(t)},o=this.getTargetDOMRange({minLength:this.composing?1:2});return o?this.withTargetDOMRange(o,r):r()}withTargetDOMRange(t,e){var n;return typeof t=="function"&&(e=t,t=this.getTargetDOMRange()),t?(n=this.responder)===null||n===void 0?void 0:n.withTargetDOMRange(t,e.bind(this)):(Pt.reset(),e.call(this))}getTargetDOMRange(){var t,e;let{minLength:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{minLength:0},r=(t=(e=this.event).getTargetRanges)===null||t===void 0?void 0:t.call(e);if(r&&r.length){let o=Ks(r[0]);if(n===0||o.toString().length>=n)return o}}withEvent(t,e){let n;this.event=t;try{n=e.call(this)}finally{this.event=null}return n}};q(Dt,"events",{keydown(i){if(Br(i)){var t;let e=Ys(i);(t=this.delegate)!==null&&t!==void 0&&t.inputControllerDidReceiveKeyboardCommand(e)&&i.preventDefault()}else{let e=i.key;i.altKey&&(e+="+Alt"),i.shiftKey&&(e+="+Shift");let n=this.constructor.keys[e];if(n)return this.withEvent(i,n)}},paste(i){var t;let e,n=(t=i.clipboardData)===null||t===void 0?void 0:t.getData("URL");return to(i)?(i.preventDefault(),this.attachFiles(i.clipboardData.files)):$s(i)?(i.preventDefault(),e={type:"text/plain",string:i.clipboardData.getData("text/plain")},(r=this.delegate)===null||r===void 0||r.inputControllerWillPaste(e),(o=this.responder)===null||o===void 0||o.insertString(e.string),this.render(),(s=this.delegate)===null||s===void 0?void 0:s.inputControllerDidPaste(e)):n?(i.preventDefault(),e={type:"text/html",html:this.createLinkHTML(n)},(l=this.delegate)===null||l===void 0||l.inputControllerWillPaste(e),(c=this.responder)===null||c===void 0||c.insertHTML(e.html),this.render(),(u=this.delegate)===null||u===void 0?void 0:u.inputControllerDidPaste(e)):void 0;var r,o,s,l,c,u},beforeinput(i){let t=this.constructor.inputTypes[i.inputType],e=(n=i,!(!/iPhone|iPad/.test(navigator.userAgent)||n.inputType&&n.inputType!=="insertParagraph"));var n;t&&(this.withEvent(i,t),e||this.scheduleRender()),e&&this.render()},input(i){Pt.reset()},dragstart(i){var t,e;(t=this.responder)!==null&&t!==void 0&&t.selectionContainsAttachments()&&(i.dataTransfer.setData("application/x-trix-dragging",!0),this.dragging={range:(e=this.responder)===null||e===void 0?void 0:e.getSelectedRange(),point:Hn(i)})},dragenter(i){qn(i)&&i.preventDefault()},dragover(i){if(this.dragging){i.preventDefault();let e=Hn(i);var t;if(!Xt(e,this.dragging.point))return this.dragging.point=e,(t=this.responder)===null||t===void 0?void 0:t.setLocationRangeFromPointRange(e)}else qn(i)&&i.preventDefault()},drop(i){var t,e;if(this.dragging)return i.preventDefault(),(t=this.delegate)===null||t===void 0||t.inputControllerWillMoveText(),(e=this.responder)===null||e===void 0||e.moveTextFromRange(this.dragging.range),this.dragging=null,this.scheduleRender();if(qn(i)){var n;i.preventDefault();let r=Hn(i);return(n=this.responder)===null||n===void 0||n.setLocationRangeFromPointRange(r),this.attachFiles(i.dataTransfer.files)}},dragend(){var i;this.dragging&&((i=this.responder)===null||i===void 0||i.setSelectedRange(this.dragging.range),this.dragging=null)},compositionend(i){this.composing&&(this.composing=!1,xe.recentAndroid||this.scheduleRender())}}),q(Dt,"keys",{ArrowLeft(){var i,t;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageMovingCursorInDirection("backward"))return this.event.preventDefault(),(t=this.responder)===null||t===void 0?void 0:t.moveCursorInDirection("backward")},ArrowRight(){var i,t;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageMovingCursorInDirection("forward"))return this.event.preventDefault(),(t=this.responder)===null||t===void 0?void 0:t.moveCursorInDirection("forward")},Backspace(){var i,t,e;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageDeletingInDirection("backward"))return this.event.preventDefault(),(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(e=this.responder)===null||e===void 0||e.deleteInDirection("backward"),this.render()},Tab(){var i,t;if((i=this.responder)!==null&&i!==void 0&&i.canIncreaseNestingLevel())return this.event.preventDefault(),(t=this.responder)===null||t===void 0||t.increaseNestingLevel(),this.render()},"Tab+Shift"(){var i,t;if((i=this.responder)!==null&&i!==void 0&&i.canDecreaseNestingLevel())return this.event.preventDefault(),(t=this.responder)===null||t===void 0||t.decreaseNestingLevel(),this.render()}}),q(Dt,"inputTypes",{deleteByComposition(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteByCut(){return this.deleteInDirection("backward")},deleteByDrag(){return this.event.preventDefault(),this.withTargetDOMRange(function(){var i;this.deleteByDragRange=(i=this.responder)===null||i===void 0?void 0:i.getSelectedRange()})},deleteCompositionText(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteContent(){return this.deleteInDirection("backward")},deleteContentBackward(){return this.deleteInDirection("backward")},deleteContentForward(){return this.deleteInDirection("forward")},deleteEntireSoftLine(){return this.deleteInDirection("forward")},deleteHardLineBackward(){return this.deleteInDirection("backward")},deleteHardLineForward(){return this.deleteInDirection("forward")},deleteSoftLineBackward(){return this.deleteInDirection("backward")},deleteSoftLineForward(){return this.deleteInDirection("forward")},deleteWordBackward(){return this.deleteInDirection("backward")},deleteWordForward(){return this.deleteInDirection("forward")},formatBackColor(){return this.activateAttributeIfSupported("backgroundColor",this.event.data)},formatBold(){return this.toggleAttributeIfSupported("bold")},formatFontColor(){return this.activateAttributeIfSupported("color",this.event.data)},formatFontName(){return this.activateAttributeIfSupported("font",this.event.data)},formatIndent(){var i;if((i=this.responder)!==null&&i!==void 0&&i.canIncreaseNestingLevel())return this.withTargetDOMRange(function(){var t;return(t=this.responder)===null||t===void 0?void 0:t.increaseNestingLevel()})},formatItalic(){return this.toggleAttributeIfSupported("italic")},formatJustifyCenter(){return this.toggleAttributeIfSupported("justifyCenter")},formatJustifyFull(){return this.toggleAttributeIfSupported("justifyFull")},formatJustifyLeft(){return this.toggleAttributeIfSupported("justifyLeft")},formatJustifyRight(){return this.toggleAttributeIfSupported("justifyRight")},formatOutdent(){var i;if((i=this.responder)!==null&&i!==void 0&&i.canDecreaseNestingLevel())return this.withTargetDOMRange(function(){var t;return(t=this.responder)===null||t===void 0?void 0:t.decreaseNestingLevel()})},formatRemove(){this.withTargetDOMRange(function(){for(let e in(i=this.responder)===null||i===void 0?void 0:i.getCurrentAttributes()){var i,t;(t=this.responder)===null||t===void 0||t.removeCurrentAttribute(e)}})},formatSetBlockTextDirection(){return this.activateAttributeIfSupported("blockDir",this.event.data)},formatSetInlineTextDirection(){return this.activateAttributeIfSupported("textDir",this.event.data)},formatStrikeThrough(){return this.toggleAttributeIfSupported("strike")},formatSubscript(){return this.toggleAttributeIfSupported("sub")},formatSuperscript(){return this.toggleAttributeIfSupported("sup")},formatUnderline(){return this.toggleAttributeIfSupported("underline")},historyRedo(){var i;return(i=this.delegate)===null||i===void 0?void 0:i.inputControllerWillPerformRedo()},historyUndo(){var i;return(i=this.delegate)===null||i===void 0?void 0:i.inputControllerWillPerformUndo()},insertCompositionText(){return this.composing=!0,this.insertString(this.event.data)},insertFromComposition(){return this.composing=!1,this.insertString(this.event.data)},insertFromDrop(){let i=this.deleteByDragRange;var t;if(i)return this.deleteByDragRange=null,(t=this.delegate)===null||t===void 0||t.inputControllerWillMoveText(),this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.moveTextFromRange(i)})},insertFromPaste(){let{dataTransfer:i}=this.event,t={dataTransfer:i},e=i.getData("URL"),n=i.getData("text/html");if(e){var r;let c;this.event.preventDefault(),t.type="text/html";let u=i.getData("public.url-name");c=u?xi(u).trim():e,t.html=this.createLinkHTML(e,c),(r=this.delegate)===null||r===void 0||r.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var d;return(d=this.responder)===null||d===void 0?void 0:d.insertHTML(t.html)}),this.afterRender=()=>{var d;return(d=this.delegate)===null||d===void 0?void 0:d.inputControllerDidPaste(t)}}else if(Mr(i)){var o;t.type="text/plain",t.string=i.getData("text/plain"),(o=this.delegate)===null||o===void 0||o.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var c;return(c=this.responder)===null||c===void 0?void 0:c.insertString(t.string)}),this.afterRender=()=>{var c;return(c=this.delegate)===null||c===void 0?void 0:c.inputControllerDidPaste(t)}}else if(Gs(this.event)){var s;t.type="File",t.file=i.files[0],(s=this.delegate)===null||s===void 0||s.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var c;return(c=this.responder)===null||c===void 0?void 0:c.insertFile(t.file)}),this.afterRender=()=>{var c;return(c=this.delegate)===null||c===void 0?void 0:c.inputControllerDidPaste(t)}}else if(n){var l;this.event.preventDefault(),t.type="text/html",t.html=n,(l=this.delegate)===null||l===void 0||l.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var c;return(c=this.responder)===null||c===void 0?void 0:c.insertHTML(t.html)}),this.afterRender=()=>{var c;return(c=this.delegate)===null||c===void 0?void 0:c.inputControllerDidPaste(t)}}},insertFromYank(){return this.insertString(this.event.data)},insertLineBreak(){return this.insertString(` -`)},insertLink(){return this.activateAttributeIfSupported("href",this.event.data)},insertOrderedList(){return this.toggleAttributeIfSupported("number")},insertParagraph(){var i;return(i=this.delegate)===null||i===void 0||i.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var t;return(t=this.responder)===null||t===void 0?void 0:t.insertLineBreak()})},insertReplacementText(){let i=this.event.dataTransfer.getData("text/plain"),t=this.event.getTargetRanges()[0];this.withTargetDOMRange(t,()=>{this.insertString(i,{updatePosition:!1})})},insertText(){var i;return this.insertString(this.event.data||((i=this.event.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain")))},insertTranspose(){return this.insertString(this.event.data)},insertUnorderedList(){return this.toggleAttributeIfSupported("bullet")}});var Ks=function(i){let t=document.createRange();return t.setStart(i.startContainer,i.startOffset),t.setEnd(i.endContainer,i.endOffset),t},qn=i=>{var t;return Array.from(((t=i.dataTransfer)===null||t===void 0?void 0:t.types)||[]).includes("Files")},Gs=i=>{var t;return((t=i.dataTransfer.files)===null||t===void 0?void 0:t[0])&&!to(i)&&!(e=>{let{dataTransfer:n}=e;return n.types.includes("Files")&&n.types.includes("text/html")&&n.getData("text/html").includes("urn:schemas-microsoft-com:office:office")})(i)},to=function(i){let t=i.clipboardData;if(t)return Array.from(t.types).filter(e=>e.match(/file/i)).length===t.types.length&&t.files.length>=1},$s=function(i){let t=i.clipboardData;if(t)return t.types.includes("text/plain")&&t.types.length===1},Ys=function(i){let t=[];return i.altKey&&t.push("alt"),i.shiftKey&&t.push("shift"),t.push(i.key),t},Hn=i=>({x:i.clientX,y:i.clientY}),ui="[data-trix-attribute]",hi="[data-trix-action]",Xs="".concat(ui,", ").concat(hi),ln="[data-trix-dialog]",Zs="".concat(ln,"[data-trix-active]"),Qs="".concat(ln," [data-trix-method]"),kr="".concat(ln," [data-trix-input]"),Rr=(i,t)=>(t||(t=zt(i)),i.querySelector("[data-trix-input][name='".concat(t,"']"))),Tr=i=>i.getAttribute("data-trix-action"),zt=i=>i.getAttribute("data-trix-attribute")||i.getAttribute("data-trix-dialog-attribute"),on=class extends R{constructor(t){super(t),this.didClickActionButton=this.didClickActionButton.bind(this),this.didClickAttributeButton=this.didClickAttributeButton.bind(this),this.didClickDialogButton=this.didClickDialogButton.bind(this),this.didKeyDownDialogInput=this.didKeyDownDialogInput.bind(this),this.element=t,this.attributes={},this.actions={},this.resetDialogInputs(),S("mousedown",{onElement:this.element,matchingSelector:hi,withCallback:this.didClickActionButton}),S("mousedown",{onElement:this.element,matchingSelector:ui,withCallback:this.didClickAttributeButton}),S("click",{onElement:this.element,matchingSelector:Xs,preventDefault:!0}),S("click",{onElement:this.element,matchingSelector:Qs,withCallback:this.didClickDialogButton}),S("keydown",{onElement:this.element,matchingSelector:kr,withCallback:this.didKeyDownDialogInput})}didClickActionButton(t,e){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),t.preventDefault();let r=Tr(e);return this.getDialog(r)?this.toggleDialog(r):(o=this.delegate)===null||o===void 0?void 0:o.toolbarDidInvokeAction(r,e);var o}didClickAttributeButton(t,e){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),t.preventDefault();let r=zt(e);var o;return this.getDialog(r)?this.toggleDialog(r):(o=this.delegate)===null||o===void 0||o.toolbarDidToggleAttribute(r),this.refreshAttributeButtons()}didClickDialogButton(t,e){let n=vt(e,{matchingSelector:ln});return this[e.getAttribute("data-trix-method")].call(this,n)}didKeyDownDialogInput(t,e){if(t.keyCode===13){t.preventDefault();let n=e.getAttribute("name"),r=this.getDialog(n);this.setAttribute(r)}if(t.keyCode===27)return t.preventDefault(),this.hideDialog()}updateActions(t){return this.actions=t,this.refreshActionButtons()}refreshActionButtons(){return this.eachActionButton((t,e)=>{t.disabled=this.actions[e]===!1})}eachActionButton(t){return Array.from(this.element.querySelectorAll(hi)).map(e=>t(e,Tr(e)))}updateAttributes(t){return this.attributes=t,this.refreshAttributeButtons()}refreshAttributeButtons(){return this.eachAttributeButton((t,e)=>(t.disabled=this.attributes[e]===!1,this.attributes[e]||this.dialogIsVisible(e)?(t.setAttribute("data-trix-active",""),t.classList.add("trix-active")):(t.removeAttribute("data-trix-active"),t.classList.remove("trix-active"))))}eachAttributeButton(t){return Array.from(this.element.querySelectorAll(ui)).map(e=>t(e,zt(e)))}applyKeyboardCommand(t){let e=JSON.stringify(t.sort());for(let n of Array.from(this.element.querySelectorAll("[data-trix-key]"))){let r=n.getAttribute("data-trix-key").split("+");if(JSON.stringify(r.sort())===e)return he("mousedown",{onElement:n}),!0}return!1}dialogIsVisible(t){let e=this.getDialog(t);if(e)return e.hasAttribute("data-trix-active")}toggleDialog(t){return this.dialogIsVisible(t)?this.hideDialog():this.showDialog(t)}showDialog(t){var e,n;this.hideDialog(),(e=this.delegate)===null||e===void 0||e.toolbarWillShowDialog();let r=this.getDialog(t);r.setAttribute("data-trix-active",""),r.classList.add("trix-active"),Array.from(r.querySelectorAll("input[disabled]")).forEach(s=>{s.removeAttribute("disabled")});let o=zt(r);if(o){let s=Rr(r,t);s&&(s.value=this.attributes[o]||"",s.select())}return(n=this.delegate)===null||n===void 0?void 0:n.toolbarDidShowDialog(t)}setAttribute(t){let e=zt(t),n=Rr(t,e);return n.willValidate&&!n.checkValidity()?(n.setAttribute("data-trix-validate",""),n.classList.add("trix-validate"),n.focus()):((r=this.delegate)===null||r===void 0||r.toolbarDidUpdateAttribute(e,n.value),this.hideDialog());var r}removeAttribute(t){var e;let n=zt(t);return(e=this.delegate)===null||e===void 0||e.toolbarDidRemoveAttribute(n),this.hideDialog()}hideDialog(){let t=this.element.querySelector(Zs);var e;if(t)return t.removeAttribute("data-trix-active"),t.classList.remove("trix-active"),this.resetDialogInputs(),(e=this.delegate)===null||e===void 0?void 0:e.toolbarDidHideDialog((n=>n.getAttribute("data-trix-dialog"))(t))}resetDialogInputs(){Array.from(this.element.querySelectorAll(kr)).forEach(t=>{t.setAttribute("disabled","disabled"),t.removeAttribute("data-trix-validate"),t.classList.remove("trix-validate")})}getDialog(t){return this.element.querySelector("[data-trix-dialog=".concat(t,"]"))}},Nt=class extends en{constructor(t){let{editorElement:e,document:n,html:r}=t;super(...arguments),this.editorElement=e,this.selectionManager=new ut(this.editorElement),this.selectionManager.delegate=this,this.composition=new rt,this.composition.delegate=this,this.attachmentManager=new Ke(this.composition.getAttachments()),this.attachmentManager.delegate=this,this.inputController=bi.getLevel()===2?new Dt(this.editorElement):new Z(this.editorElement),this.inputController.delegate=this,this.inputController.responder=this.composition,this.compositionController=new tn(this.editorElement,this.composition),this.compositionController.delegate=this,this.toolbarController=new on(this.editorElement.toolbarElement),this.toolbarController.delegate=this,this.editor=new Ye(this.composition,this.selectionManager,this.editorElement),n?this.editor.loadDocument(n):this.editor.loadHTML(r)}registerSelectionManager(){return Pt.registerSelectionManager(this.selectionManager)}unregisterSelectionManager(){return Pt.unregisterSelectionManager(this.selectionManager)}render(){return this.compositionController.render()}reparse(){return this.composition.replaceHTML(this.editorElement.innerHTML)}compositionDidChangeDocument(t){if(this.notifyEditorElement("document-change"),!this.handlingInput)return this.render()}compositionDidChangeCurrentAttributes(t){return this.currentAttributes=t,this.toolbarController.updateAttributes(this.currentAttributes),this.updateCurrentActions(),this.notifyEditorElement("attributes-change",{attributes:this.currentAttributes})}compositionDidPerformInsertionAtRange(t){this.pasting&&(this.pastedRange=t)}compositionShouldAcceptFile(t){return this.notifyEditorElement("file-accept",{file:t})}compositionDidAddAttachment(t){let e=this.attachmentManager.manageAttachment(t);return this.notifyEditorElement("attachment-add",{attachment:e})}compositionDidEditAttachment(t){this.compositionController.rerenderViewForObject(t);let e=this.attachmentManager.manageAttachment(t);return this.notifyEditorElement("attachment-edit",{attachment:e}),this.notifyEditorElement("change")}compositionDidChangeAttachmentPreviewURL(t){return this.compositionController.invalidateViewForObject(t),this.notifyEditorElement("change")}compositionDidRemoveAttachment(t){let e=this.attachmentManager.unmanageAttachment(t);return this.notifyEditorElement("attachment-remove",{attachment:e})}compositionDidStartEditingAttachment(t,e){return this.attachmentLocationRange=this.composition.document.getLocationRangeOfAttachment(t),this.compositionController.installAttachmentEditorForAttachment(t,e),this.selectionManager.setLocationRange(this.attachmentLocationRange)}compositionDidStopEditingAttachment(t){this.compositionController.uninstallAttachmentEditor(),this.attachmentLocationRange=null}compositionDidRequestChangingSelectionToLocationRange(t){if(!this.loadingSnapshot||this.isFocused())return this.requestedLocationRange=t,this.compositionRevisionWhenLocationRangeRequested=this.composition.revision,this.handlingInput?void 0:this.render()}compositionWillLoadSnapshot(){this.loadingSnapshot=!0}compositionDidLoadSnapshot(){this.compositionController.refreshViewCache(),this.render(),this.loadingSnapshot=!1}getSelectionManager(){return this.selectionManager}attachmentManagerDidRequestRemovalOfAttachment(t){return this.removeAttachment(t)}compositionControllerWillSyncDocumentView(){return this.inputController.editorWillSyncDocumentView(),this.selectionManager.lock(),this.selectionManager.clearSelection()}compositionControllerDidSyncDocumentView(){return this.inputController.editorDidSyncDocumentView(),this.selectionManager.unlock(),this.updateCurrentActions(),this.notifyEditorElement("sync")}compositionControllerDidRender(){this.requestedLocationRange&&(this.compositionRevisionWhenLocationRangeRequested===this.composition.revision&&this.selectionManager.setLocationRange(this.requestedLocationRange),this.requestedLocationRange=null,this.compositionRevisionWhenLocationRangeRequested=null),this.renderedCompositionRevision!==this.composition.revision&&(this.runEditorFilters(),this.composition.updateCurrentAttributes(),this.notifyEditorElement("render")),this.renderedCompositionRevision=this.composition.revision}compositionControllerDidFocus(){return this.isFocusedInvisibly()&&this.setLocationRange({index:0,offset:0}),this.toolbarController.hideDialog(),this.notifyEditorElement("focus")}compositionControllerDidBlur(){return this.notifyEditorElement("blur")}compositionControllerDidSelectAttachment(t,e){return this.toolbarController.hideDialog(),this.composition.editAttachment(t,e)}compositionControllerDidRequestDeselectingAttachment(t){let e=this.attachmentLocationRange||this.composition.document.getLocationRangeOfAttachment(t);return this.selectionManager.setLocationRange(e[1])}compositionControllerWillUpdateAttachment(t){return this.editor.recordUndoEntry("Edit Attachment",{context:t.id,consolidatable:!0})}compositionControllerDidRequestRemovalOfAttachment(t){return this.removeAttachment(t)}inputControllerWillHandleInput(){this.handlingInput=!0,this.requestedRender=!1}inputControllerDidRequestRender(){this.requestedRender=!0}inputControllerDidHandleInput(){if(this.handlingInput=!1,this.requestedRender)return this.requestedRender=!1,this.render()}inputControllerDidAllowUnhandledInput(){return this.notifyEditorElement("change")}inputControllerDidRequestReparse(){return this.reparse()}inputControllerWillPerformTyping(){return this.recordTypingUndoEntry()}inputControllerWillPerformFormatting(t){return this.recordFormattingUndoEntry(t)}inputControllerWillCutText(){return this.editor.recordUndoEntry("Cut")}inputControllerWillPaste(t){return this.editor.recordUndoEntry("Paste"),this.pasting=!0,this.notifyEditorElement("before-paste",{paste:t})}inputControllerDidPaste(t){return t.range=this.pastedRange,this.pastedRange=null,this.pasting=null,this.notifyEditorElement("paste",{paste:t})}inputControllerWillMoveText(){return this.editor.recordUndoEntry("Move")}inputControllerWillAttachFiles(){return this.editor.recordUndoEntry("Drop Files")}inputControllerWillPerformUndo(){return this.editor.undo()}inputControllerWillPerformRedo(){return this.editor.redo()}inputControllerDidReceiveKeyboardCommand(t){return this.toolbarController.applyKeyboardCommand(t)}inputControllerDidStartDrag(){this.locationRangeBeforeDrag=this.selectionManager.getLocationRange()}inputControllerDidReceiveDragOverPoint(t){return this.selectionManager.setLocationRangeFromPointRange(t)}inputControllerDidCancelDrag(){this.selectionManager.setLocationRange(this.locationRangeBeforeDrag),this.locationRangeBeforeDrag=null}locationRangeDidChange(t){return this.composition.updateCurrentAttributes(),this.updateCurrentActions(),this.attachmentLocationRange&&!We(this.attachmentLocationRange,t)&&this.composition.stopEditingAttachment(),this.notifyEditorElement("selection-change")}toolbarDidClickButton(){if(!this.getLocationRange())return this.setLocationRange({index:0,offset:0})}toolbarDidInvokeAction(t,e){return this.invokeAction(t,e)}toolbarDidToggleAttribute(t){if(this.recordFormattingUndoEntry(t),this.composition.toggleCurrentAttribute(t),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidUpdateAttribute(t,e){if(this.recordFormattingUndoEntry(t),this.composition.setCurrentAttribute(t,e),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidRemoveAttribute(t){if(this.recordFormattingUndoEntry(t),this.composition.removeCurrentAttribute(t),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarWillShowDialog(t){return this.composition.expandSelectionForEditing(),this.freezeSelection()}toolbarDidShowDialog(t){return this.notifyEditorElement("toolbar-dialog-show",{dialogName:t})}toolbarDidHideDialog(t){return this.thawSelection(),this.editorElement.focus(),this.notifyEditorElement("toolbar-dialog-hide",{dialogName:t})}freezeSelection(){if(!this.selectionFrozen)return this.selectionManager.lock(),this.composition.freezeSelection(),this.selectionFrozen=!0,this.render()}thawSelection(){if(this.selectionFrozen)return this.composition.thawSelection(),this.selectionManager.unlock(),this.selectionFrozen=!1,this.render()}canInvokeAction(t){return!!this.actionIsExternal(t)||!((e=this.actions[t])===null||e===void 0||(e=e.test)===null||e===void 0||!e.call(this));var e}invokeAction(t,e){return this.actionIsExternal(t)?this.notifyEditorElement("action-invoke",{actionName:t,invokingElement:e}):(n=this.actions[t])===null||n===void 0||(n=n.perform)===null||n===void 0?void 0:n.call(this);var n}actionIsExternal(t){return/^x-./.test(t)}getCurrentActions(){let t={};for(let e in this.actions)t[e]=this.canInvokeAction(e);return t}updateCurrentActions(){let t=this.getCurrentActions();if(!Xt(t,this.currentActions))return this.currentActions=t,this.toolbarController.updateActions(this.currentActions),this.notifyEditorElement("actions-change",{actions:this.currentActions})}runEditorFilters(){let t=this.composition.getSnapshot();if(Array.from(this.editor.filters).forEach(r=>{let{document:o,selectedRange:s}=t;t=r.call(this.editor,t)||{},t.document||(t.document=o),t.selectedRange||(t.selectedRange=s)}),e=t,n=this.composition.getSnapshot(),!We(e.selectedRange,n.selectedRange)||!e.document.isEqualTo(n.document))return this.composition.loadSnapshot(t);var e,n}updateInputElement(){let t=function(e,n){let r=Ls[n];if(r)return r(e);throw new Error("unknown content type: ".concat(n))}(this.compositionController.getSerializableElement(),"text/html");return this.editorElement.setFormValue(t)}notifyEditorElement(t,e){switch(t){case"document-change":this.documentChangedSinceLastRender=!0;break;case"render":this.documentChangedSinceLastRender&&(this.documentChangedSinceLastRender=!1,this.notifyEditorElement("change"));break;case"change":case"attachment-add":case"attachment-edit":case"attachment-remove":this.updateInputElement()}return this.editorElement.notify(t,e)}removeAttachment(t){return this.editor.recordUndoEntry("Delete Attachment"),this.composition.removeAttachment(t),this.render()}recordFormattingUndoEntry(t){let e=L(t),n=this.selectionManager.getLocationRange();if(e||!ht(n))return this.editor.recordUndoEntry("Formatting",{context:this.getUndoContext(),consolidatable:!0})}recordTypingUndoEntry(){return this.editor.recordUndoEntry("Typing",{context:this.getUndoContext(this.currentAttributes),consolidatable:!0})}getUndoContext(){for(var t=arguments.length,e=new Array(t),n=0;n0?Math.floor(new Date().getTime()/$n.interval):0}isFocused(){var t;return this.editorElement===((t=this.editorElement.ownerDocument)===null||t===void 0?void 0:t.activeElement)}isFocusedInvisibly(){return this.isFocused()&&!this.getLocationRange()}get actions(){return this.constructor.actions}};q(Nt,"actions",{undo:{test(){return this.editor.canUndo()},perform(){return this.editor.undo()}},redo:{test(){return this.editor.canRedo()},perform(){return this.editor.redo()}},link:{test(){return this.editor.canActivateAttribute("href")}},increaseNestingLevel:{test(){return this.editor.canIncreaseNestingLevel()},perform(){return this.editor.increaseNestingLevel()&&this.render()}},decreaseNestingLevel:{test(){return this.editor.canDecreaseNestingLevel()},perform(){return this.editor.decreaseNestingLevel()&&this.render()}},attachFiles:{test:()=>!0,perform(){return bi.pickFiles(this.editor.insertFiles)}}}),Nt.proxyMethod("getSelectionManager().setLocationRange"),Nt.proxyMethod("getSelectionManager().getLocationRange");var ta=Object.freeze({__proto__:null,AttachmentEditorController:Qe,CompositionController:tn,Controller:en,EditorController:Nt,InputController:Yt,Level0InputController:Z,Level2InputController:Dt,ToolbarController:on}),ea=Object.freeze({__proto__:null,MutationObserver:nn,SelectionChangeObserver:Ue}),na=Object.freeze({__proto__:null,FileVerificationOperation:rn,ImagePreloadOperation:Je});Pr("trix-toolbar",`%t { +`),this.requestRender(),i.preventDefault()},tab(i){var t,e;(t=this.responder)!==null&&t!==void 0&&t.canDecreaseNestingLevel()&&((e=this.responder)===null||e===void 0||e.decreaseNestingLevel(),this.requestRender(),i.preventDefault())},left(i){if(this.selectionIsInCursorTarget())return i.preventDefault(),this.expandSelectionInDirection("backward")},right(i){if(this.selectionIsInCursorTarget())return i.preventDefault(),this.expandSelectionInDirection("forward")}},alt:{backspace(i){var t;return this.setInputSummary({preferDocument:!1}),(t=this.delegate)===null||t===void 0?void 0:t.inputControllerWillPerformTyping()}},meta:{backspace(i){var t;return this.setInputSummary({preferDocument:!1}),(t=this.delegate)===null||t===void 0?void 0:t.inputControllerWillPerformTyping()}}}),Z.proxyMethod("responder?.getSelectedRange"),Z.proxyMethod("responder?.setSelectedRange"),Z.proxyMethod("responder?.expandSelectionInDirection"),Z.proxyMethod("responder?.selectionIsInCursorTarget"),Z.proxyMethod("responder?.selectionIsExpanded");var zs=i=>{var t;return(t=i.type)===null||t===void 0||(t=t.match(/\/(\w+)$/))===null||t===void 0?void 0:t[1]},qs=!((qn=" ".codePointAt)===null||qn===void 0||!qn.call(" ",0)),Hs=function(i){if(i.key&&qs&&i.key.codePointAt(0)===i.keyCode)return i.key;{let t;if(i.which===null?t=i.keyCode:i.which!==0&&i.charCode!==0&&(t=i.charCode),t!=null&&Qr[t]!=="escape")return Ot.fromCodepoints([t]).toString()}},Js=function(i){let t=i.clipboardData;if(t){if(t.types.includes("text/html")){for(let e of t.types){let n=/^CorePasteboardFlavorType/.test(e),r=/^dyn\./.test(e)&&t.getData(e);if(n||r)return!0}return!1}{let e=t.types.includes("com.apple.webarchive"),n=t.types.includes("com.apple.flat-rtfd");return e||n}}},it=class extends R{constructor(t){super(...arguments),this.inputController=t,this.responder=this.inputController.responder,this.delegate=this.inputController.delegate,this.inputSummary=this.inputController.inputSummary,this.data={}}start(t){if(this.data.start=t,this.isSignificant()){var e,n;this.inputSummary.eventName==="keypress"&&this.inputSummary.textAdded&&((n=this.responder)===null||n===void 0||n.deleteInDirection("left")),this.selectionIsExpanded()||(this.insertPlaceholder(),this.requestRender()),this.range=(e=this.responder)===null||e===void 0?void 0:e.getSelectedRange()}}update(t){if(this.data.update=t,this.isSignificant()){let e=this.selectPlaceholder();e&&(this.forgetPlaceholder(),this.range=e)}}end(t){return this.data.end=t,this.isSignificant()?(this.forgetPlaceholder(),this.canApplyToDocument()?(this.setInputSummary({preferDocument:!0,didInput:!1}),(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.setSelectedRange(this.range),(r=this.responder)===null||r===void 0||r.insertString(this.data.end),(o=this.responder)===null||o===void 0?void 0:o.setSelectedRange(this.range[0]+this.data.end.length)):this.data.start!=null||this.data.update!=null?(this.requestReparse(),this.inputController.reset()):void 0):this.inputController.reset();var e,n,r,o}getEndData(){return this.data.end}isEnded(){return this.getEndData()!=null}isSignificant(){return!Us.composesExistingText||this.inputSummary.didInput}canApplyToDocument(){var t,e;return((t=this.data.start)===null||t===void 0?void 0:t.length)===0&&((e=this.data.end)===null||e===void 0?void 0:e.length)>0&&this.range}};it.proxyMethod("inputController.setInputSummary"),it.proxyMethod("inputController.requestRender"),it.proxyMethod("inputController.requestReparse"),it.proxyMethod("responder?.selectionIsExpanded"),it.proxyMethod("responder?.insertPlaceholder"),it.proxyMethod("responder?.selectPlaceholder"),it.proxyMethod("responder?.forgetPlaceholder");var Dt=class extends Yt{constructor(){super(...arguments),this.render=this.render.bind(this)}elementDidMutate(){return this.scheduledRender?this.composing?(t=this.delegate)===null||t===void 0||(e=t.inputControllerDidAllowUnhandledInput)===null||e===void 0?void 0:e.call(t):void 0:this.reparse();var t,e}scheduleRender(){return this.scheduledRender?this.scheduledRender:this.scheduledRender=requestAnimationFrame(this.render)}render(){var t,e;cancelAnimationFrame(this.scheduledRender),this.scheduledRender=null,this.composing||(e=this.delegate)===null||e===void 0||e.render(),(t=this.afterRender)===null||t===void 0||t.call(this),this.afterRender=null}reparse(){var t;return(t=this.delegate)===null||t===void 0?void 0:t.reparse()}insertString(){var t;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var r;return(r=this.responder)===null||r===void 0?void 0:r.insertString(e,n)})}toggleAttributeIfSupported(t){var e;if(Qn().includes(t))return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformFormatting(t),this.withTargetDOMRange(function(){var n;return(n=this.responder)===null||n===void 0?void 0:n.toggleCurrentAttribute(t)})}activateAttributeIfSupported(t,e){var n;if(Qn().includes(t))return(n=this.delegate)===null||n===void 0||n.inputControllerWillPerformFormatting(t),this.withTargetDOMRange(function(){var r;return(r=this.responder)===null||r===void 0?void 0:r.setCurrentAttribute(t,e)})}deleteInDirection(t){let{recordUndoEntry:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{recordUndoEntry:!0};var n;e&&((n=this.delegate)===null||n===void 0||n.inputControllerWillPerformTyping());let r=()=>{var s;return(s=this.responder)===null||s===void 0?void 0:s.deleteInDirection(t)},o=this.getTargetDOMRange({minLength:this.composing?1:2});return o?this.withTargetDOMRange(o,r):r()}withTargetDOMRange(t,e){var n;return typeof t=="function"&&(e=t,t=this.getTargetDOMRange()),t?(n=this.responder)===null||n===void 0?void 0:n.withTargetDOMRange(t,e.bind(this)):(Pt.reset(),e.call(this))}getTargetDOMRange(){var t,e;let{minLength:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{minLength:0},r=(t=(e=this.event).getTargetRanges)===null||t===void 0?void 0:t.call(e);if(r&&r.length){let o=Ks(r[0]);if(n===0||o.toString().length>=n)return o}}withEvent(t,e){let n;this.event=t;try{n=e.call(this)}finally{this.event=null}return n}};q(Dt,"events",{keydown(i){if(Br(i)){var t;let e=Ys(i);(t=this.delegate)!==null&&t!==void 0&&t.inputControllerDidReceiveKeyboardCommand(e)&&i.preventDefault()}else{let e=i.key;i.altKey&&(e+="+Alt"),i.shiftKey&&(e+="+Shift");let n=this.constructor.keys[e];if(n)return this.withEvent(i,n)}},paste(i){var t;let e,n=(t=i.clipboardData)===null||t===void 0?void 0:t.getData("URL");return to(i)?(i.preventDefault(),this.attachFiles(i.clipboardData.files)):$s(i)?(i.preventDefault(),e={type:"text/plain",string:i.clipboardData.getData("text/plain")},(r=this.delegate)===null||r===void 0||r.inputControllerWillPaste(e),(o=this.responder)===null||o===void 0||o.insertString(e.string),this.render(),(s=this.delegate)===null||s===void 0?void 0:s.inputControllerDidPaste(e)):n?(i.preventDefault(),e={type:"text/html",html:this.createLinkHTML(n)},(l=this.delegate)===null||l===void 0||l.inputControllerWillPaste(e),(c=this.responder)===null||c===void 0||c.insertHTML(e.html),this.render(),(u=this.delegate)===null||u===void 0?void 0:u.inputControllerDidPaste(e)):void 0;var r,o,s,l,c,u},beforeinput(i){let t=this.constructor.inputTypes[i.inputType],e=(n=i,!(!/iPhone|iPad/.test(navigator.userAgent)||n.inputType&&n.inputType!=="insertParagraph"));var n;t&&(this.withEvent(i,t),e||this.scheduleRender()),e&&this.render()},input(i){Pt.reset()},dragstart(i){var t,e;(t=this.responder)!==null&&t!==void 0&&t.selectionContainsAttachments()&&(i.dataTransfer.setData("application/x-trix-dragging",!0),this.dragging={range:(e=this.responder)===null||e===void 0?void 0:e.getSelectedRange(),point:Jn(i)})},dragenter(i){Hn(i)&&i.preventDefault()},dragover(i){if(this.dragging){i.preventDefault();let e=Jn(i);var t;if(!Xt(e,this.dragging.point))return this.dragging.point=e,(t=this.responder)===null||t===void 0?void 0:t.setLocationRangeFromPointRange(e)}else Hn(i)&&i.preventDefault()},drop(i){var t,e;if(this.dragging)return i.preventDefault(),(t=this.delegate)===null||t===void 0||t.inputControllerWillMoveText(),(e=this.responder)===null||e===void 0||e.moveTextFromRange(this.dragging.range),this.dragging=null,this.scheduleRender();if(Hn(i)){var n;i.preventDefault();let r=Jn(i);return(n=this.responder)===null||n===void 0||n.setLocationRangeFromPointRange(r),this.attachFiles(i.dataTransfer.files)}},dragend(){var i;this.dragging&&((i=this.responder)===null||i===void 0||i.setSelectedRange(this.dragging.range),this.dragging=null)},compositionend(i){this.composing&&(this.composing=!1,xe.recentAndroid||this.scheduleRender())}}),q(Dt,"keys",{ArrowLeft(){var i,t;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageMovingCursorInDirection("backward"))return this.event.preventDefault(),(t=this.responder)===null||t===void 0?void 0:t.moveCursorInDirection("backward")},ArrowRight(){var i,t;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageMovingCursorInDirection("forward"))return this.event.preventDefault(),(t=this.responder)===null||t===void 0?void 0:t.moveCursorInDirection("forward")},Backspace(){var i,t,e;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageDeletingInDirection("backward"))return this.event.preventDefault(),(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(e=this.responder)===null||e===void 0||e.deleteInDirection("backward"),this.render()},Tab(){var i,t;if((i=this.responder)!==null&&i!==void 0&&i.canIncreaseNestingLevel())return this.event.preventDefault(),(t=this.responder)===null||t===void 0||t.increaseNestingLevel(),this.render()},"Tab+Shift"(){var i,t;if((i=this.responder)!==null&&i!==void 0&&i.canDecreaseNestingLevel())return this.event.preventDefault(),(t=this.responder)===null||t===void 0||t.decreaseNestingLevel(),this.render()}}),q(Dt,"inputTypes",{deleteByComposition(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteByCut(){return this.deleteInDirection("backward")},deleteByDrag(){return this.event.preventDefault(),this.withTargetDOMRange(function(){var i;this.deleteByDragRange=(i=this.responder)===null||i===void 0?void 0:i.getSelectedRange()})},deleteCompositionText(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteContent(){return this.deleteInDirection("backward")},deleteContentBackward(){return this.deleteInDirection("backward")},deleteContentForward(){return this.deleteInDirection("forward")},deleteEntireSoftLine(){return this.deleteInDirection("forward")},deleteHardLineBackward(){return this.deleteInDirection("backward")},deleteHardLineForward(){return this.deleteInDirection("forward")},deleteSoftLineBackward(){return this.deleteInDirection("backward")},deleteSoftLineForward(){return this.deleteInDirection("forward")},deleteWordBackward(){return this.deleteInDirection("backward")},deleteWordForward(){return this.deleteInDirection("forward")},formatBackColor(){return this.activateAttributeIfSupported("backgroundColor",this.event.data)},formatBold(){return this.toggleAttributeIfSupported("bold")},formatFontColor(){return this.activateAttributeIfSupported("color",this.event.data)},formatFontName(){return this.activateAttributeIfSupported("font",this.event.data)},formatIndent(){var i;if((i=this.responder)!==null&&i!==void 0&&i.canIncreaseNestingLevel())return this.withTargetDOMRange(function(){var t;return(t=this.responder)===null||t===void 0?void 0:t.increaseNestingLevel()})},formatItalic(){return this.toggleAttributeIfSupported("italic")},formatJustifyCenter(){return this.toggleAttributeIfSupported("justifyCenter")},formatJustifyFull(){return this.toggleAttributeIfSupported("justifyFull")},formatJustifyLeft(){return this.toggleAttributeIfSupported("justifyLeft")},formatJustifyRight(){return this.toggleAttributeIfSupported("justifyRight")},formatOutdent(){var i;if((i=this.responder)!==null&&i!==void 0&&i.canDecreaseNestingLevel())return this.withTargetDOMRange(function(){var t;return(t=this.responder)===null||t===void 0?void 0:t.decreaseNestingLevel()})},formatRemove(){this.withTargetDOMRange(function(){for(let e in(i=this.responder)===null||i===void 0?void 0:i.getCurrentAttributes()){var i,t;(t=this.responder)===null||t===void 0||t.removeCurrentAttribute(e)}})},formatSetBlockTextDirection(){return this.activateAttributeIfSupported("blockDir",this.event.data)},formatSetInlineTextDirection(){return this.activateAttributeIfSupported("textDir",this.event.data)},formatStrikeThrough(){return this.toggleAttributeIfSupported("strike")},formatSubscript(){return this.toggleAttributeIfSupported("sub")},formatSuperscript(){return this.toggleAttributeIfSupported("sup")},formatUnderline(){return this.toggleAttributeIfSupported("underline")},historyRedo(){var i;return(i=this.delegate)===null||i===void 0?void 0:i.inputControllerWillPerformRedo()},historyUndo(){var i;return(i=this.delegate)===null||i===void 0?void 0:i.inputControllerWillPerformUndo()},insertCompositionText(){return this.composing=!0,this.insertString(this.event.data)},insertFromComposition(){return this.composing=!1,this.insertString(this.event.data)},insertFromDrop(){let i=this.deleteByDragRange;var t;if(i)return this.deleteByDragRange=null,(t=this.delegate)===null||t===void 0||t.inputControllerWillMoveText(),this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.moveTextFromRange(i)})},insertFromPaste(){let{dataTransfer:i}=this.event,t={dataTransfer:i},e=i.getData("URL"),n=i.getData("text/html");if(e){var r;let c;this.event.preventDefault(),t.type="text/html";let u=i.getData("public.url-name");c=u?xi(u).trim():e,t.html=this.createLinkHTML(e,c),(r=this.delegate)===null||r===void 0||r.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var d;return(d=this.responder)===null||d===void 0?void 0:d.insertHTML(t.html)}),this.afterRender=()=>{var d;return(d=this.delegate)===null||d===void 0?void 0:d.inputControllerDidPaste(t)}}else if(Mr(i)){var o;t.type="text/plain",t.string=i.getData("text/plain"),(o=this.delegate)===null||o===void 0||o.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var c;return(c=this.responder)===null||c===void 0?void 0:c.insertString(t.string)}),this.afterRender=()=>{var c;return(c=this.delegate)===null||c===void 0?void 0:c.inputControllerDidPaste(t)}}else if(Gs(this.event)){var s;t.type="File",t.file=i.files[0],(s=this.delegate)===null||s===void 0||s.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var c;return(c=this.responder)===null||c===void 0?void 0:c.insertFile(t.file)}),this.afterRender=()=>{var c;return(c=this.delegate)===null||c===void 0?void 0:c.inputControllerDidPaste(t)}}else if(n){var l;this.event.preventDefault(),t.type="text/html",t.html=n,(l=this.delegate)===null||l===void 0||l.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var c;return(c=this.responder)===null||c===void 0?void 0:c.insertHTML(t.html)}),this.afterRender=()=>{var c;return(c=this.delegate)===null||c===void 0?void 0:c.inputControllerDidPaste(t)}}},insertFromYank(){return this.insertString(this.event.data)},insertLineBreak(){return this.insertString(` +`)},insertLink(){return this.activateAttributeIfSupported("href",this.event.data)},insertOrderedList(){return this.toggleAttributeIfSupported("number")},insertParagraph(){var i;return(i=this.delegate)===null||i===void 0||i.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var t;return(t=this.responder)===null||t===void 0?void 0:t.insertLineBreak()})},insertReplacementText(){let i=this.event.dataTransfer.getData("text/plain"),t=this.event.getTargetRanges()[0];this.withTargetDOMRange(t,()=>{this.insertString(i,{updatePosition:!1})})},insertText(){var i;return this.insertString(this.event.data||((i=this.event.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain")))},insertTranspose(){return this.insertString(this.event.data)},insertUnorderedList(){return this.toggleAttributeIfSupported("bullet")}});var Ks=function(i){let t=document.createRange();return t.setStart(i.startContainer,i.startOffset),t.setEnd(i.endContainer,i.endOffset),t},Hn=i=>{var t;return Array.from(((t=i.dataTransfer)===null||t===void 0?void 0:t.types)||[]).includes("Files")},Gs=i=>{var t;return((t=i.dataTransfer.files)===null||t===void 0?void 0:t[0])&&!to(i)&&!(e=>{let{dataTransfer:n}=e;return n.types.includes("Files")&&n.types.includes("text/html")&&n.getData("text/html").includes("urn:schemas-microsoft-com:office:office")})(i)},to=function(i){let t=i.clipboardData;if(t)return Array.from(t.types).filter(e=>e.match(/file/i)).length===t.types.length&&t.files.length>=1},$s=function(i){let t=i.clipboardData;if(t)return t.types.includes("text/plain")&&t.types.length===1},Ys=function(i){let t=[];return i.altKey&&t.push("alt"),i.shiftKey&&t.push("shift"),t.push(i.key),t},Jn=i=>({x:i.clientX,y:i.clientY}),ui="[data-trix-attribute]",hi="[data-trix-action]",Xs="".concat(ui,", ").concat(hi),cn="[data-trix-dialog]",Zs="".concat(cn,"[data-trix-active]"),Qs="".concat(cn," [data-trix-method]"),kr="".concat(cn," [data-trix-input]"),Rr=(i,t)=>(t||(t=zt(i)),i.querySelector("[data-trix-input][name='".concat(t,"']"))),Tr=i=>i.getAttribute("data-trix-action"),zt=i=>i.getAttribute("data-trix-attribute")||i.getAttribute("data-trix-dialog-attribute"),sn=class extends R{constructor(t){super(t),this.didClickActionButton=this.didClickActionButton.bind(this),this.didClickAttributeButton=this.didClickAttributeButton.bind(this),this.didClickDialogButton=this.didClickDialogButton.bind(this),this.didKeyDownDialogInput=this.didKeyDownDialogInput.bind(this),this.element=t,this.attributes={},this.actions={},this.resetDialogInputs(),S("mousedown",{onElement:this.element,matchingSelector:hi,withCallback:this.didClickActionButton}),S("mousedown",{onElement:this.element,matchingSelector:ui,withCallback:this.didClickAttributeButton}),S("click",{onElement:this.element,matchingSelector:Xs,preventDefault:!0}),S("click",{onElement:this.element,matchingSelector:Qs,withCallback:this.didClickDialogButton}),S("keydown",{onElement:this.element,matchingSelector:kr,withCallback:this.didKeyDownDialogInput})}didClickActionButton(t,e){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),t.preventDefault();let r=Tr(e);return this.getDialog(r)?this.toggleDialog(r):(o=this.delegate)===null||o===void 0?void 0:o.toolbarDidInvokeAction(r,e);var o}didClickAttributeButton(t,e){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),t.preventDefault();let r=zt(e);var o;return this.getDialog(r)?this.toggleDialog(r):(o=this.delegate)===null||o===void 0||o.toolbarDidToggleAttribute(r),this.refreshAttributeButtons()}didClickDialogButton(t,e){let n=vt(e,{matchingSelector:cn});return this[e.getAttribute("data-trix-method")].call(this,n)}didKeyDownDialogInput(t,e){if(t.keyCode===13){t.preventDefault();let n=e.getAttribute("name"),r=this.getDialog(n);this.setAttribute(r)}if(t.keyCode===27)return t.preventDefault(),this.hideDialog()}updateActions(t){return this.actions=t,this.refreshActionButtons()}refreshActionButtons(){return this.eachActionButton((t,e)=>{t.disabled=this.actions[e]===!1})}eachActionButton(t){return Array.from(this.element.querySelectorAll(hi)).map(e=>t(e,Tr(e)))}updateAttributes(t){return this.attributes=t,this.refreshAttributeButtons()}refreshAttributeButtons(){return this.eachAttributeButton((t,e)=>(t.disabled=this.attributes[e]===!1,this.attributes[e]||this.dialogIsVisible(e)?(t.setAttribute("data-trix-active",""),t.classList.add("trix-active")):(t.removeAttribute("data-trix-active"),t.classList.remove("trix-active"))))}eachAttributeButton(t){return Array.from(this.element.querySelectorAll(ui)).map(e=>t(e,zt(e)))}applyKeyboardCommand(t){let e=JSON.stringify(t.sort());for(let n of Array.from(this.element.querySelectorAll("[data-trix-key]"))){let r=n.getAttribute("data-trix-key").split("+");if(JSON.stringify(r.sort())===e)return he("mousedown",{onElement:n}),!0}return!1}dialogIsVisible(t){let e=this.getDialog(t);if(e)return e.hasAttribute("data-trix-active")}toggleDialog(t){return this.dialogIsVisible(t)?this.hideDialog():this.showDialog(t)}showDialog(t){var e,n;this.hideDialog(),(e=this.delegate)===null||e===void 0||e.toolbarWillShowDialog();let r=this.getDialog(t);r.setAttribute("data-trix-active",""),r.classList.add("trix-active"),Array.from(r.querySelectorAll("input[disabled]")).forEach(s=>{s.removeAttribute("disabled")});let o=zt(r);if(o){let s=Rr(r,t);s&&(s.value=this.attributes[o]||"",s.select())}return(n=this.delegate)===null||n===void 0?void 0:n.toolbarDidShowDialog(t)}setAttribute(t){var e;let n=zt(t),r=Rr(t,n);return!r.willValidate||(r.setCustomValidity(""),r.checkValidity()&&this.isSafeAttribute(r))?((e=this.delegate)===null||e===void 0||e.toolbarDidUpdateAttribute(n,r.value),this.hideDialog()):(r.setCustomValidity("Invalid value"),r.setAttribute("data-trix-validate",""),r.classList.add("trix-validate"),r.focus())}isSafeAttribute(t){return!t.hasAttribute("data-trix-validate-href")||Ve.isValidAttribute("a","href",t.value)}removeAttribute(t){var e;let n=zt(t);return(e=this.delegate)===null||e===void 0||e.toolbarDidRemoveAttribute(n),this.hideDialog()}hideDialog(){let t=this.element.querySelector(Zs);var e;if(t)return t.removeAttribute("data-trix-active"),t.classList.remove("trix-active"),this.resetDialogInputs(),(e=this.delegate)===null||e===void 0?void 0:e.toolbarDidHideDialog((n=>n.getAttribute("data-trix-dialog"))(t))}resetDialogInputs(){Array.from(this.element.querySelectorAll(kr)).forEach(t=>{t.setAttribute("disabled","disabled"),t.removeAttribute("data-trix-validate"),t.classList.remove("trix-validate")})}getDialog(t){return this.element.querySelector("[data-trix-dialog=".concat(t,"]"))}},Nt=class extends nn{constructor(t){let{editorElement:e,document:n,html:r}=t;super(...arguments),this.editorElement=e,this.selectionManager=new ut(this.editorElement),this.selectionManager.delegate=this,this.composition=new rt,this.composition.delegate=this,this.attachmentManager=new Ge(this.composition.getAttachments()),this.attachmentManager.delegate=this,this.inputController=bi.getLevel()===2?new Dt(this.editorElement):new Z(this.editorElement),this.inputController.delegate=this,this.inputController.responder=this.composition,this.compositionController=new en(this.editorElement,this.composition),this.compositionController.delegate=this,this.toolbarController=new sn(this.editorElement.toolbarElement),this.toolbarController.delegate=this,this.editor=new Xe(this.composition,this.selectionManager,this.editorElement),n?this.editor.loadDocument(n):this.editor.loadHTML(r)}registerSelectionManager(){return Pt.registerSelectionManager(this.selectionManager)}unregisterSelectionManager(){return Pt.unregisterSelectionManager(this.selectionManager)}render(){return this.compositionController.render()}reparse(){return this.composition.replaceHTML(this.editorElement.innerHTML)}compositionDidChangeDocument(t){if(this.notifyEditorElement("document-change"),!this.handlingInput)return this.render()}compositionDidChangeCurrentAttributes(t){return this.currentAttributes=t,this.toolbarController.updateAttributes(this.currentAttributes),this.updateCurrentActions(),this.notifyEditorElement("attributes-change",{attributes:this.currentAttributes})}compositionDidPerformInsertionAtRange(t){this.pasting&&(this.pastedRange=t)}compositionShouldAcceptFile(t){return this.notifyEditorElement("file-accept",{file:t})}compositionDidAddAttachment(t){let e=this.attachmentManager.manageAttachment(t);return this.notifyEditorElement("attachment-add",{attachment:e})}compositionDidEditAttachment(t){this.compositionController.rerenderViewForObject(t);let e=this.attachmentManager.manageAttachment(t);return this.notifyEditorElement("attachment-edit",{attachment:e}),this.notifyEditorElement("change")}compositionDidChangeAttachmentPreviewURL(t){return this.compositionController.invalidateViewForObject(t),this.notifyEditorElement("change")}compositionDidRemoveAttachment(t){let e=this.attachmentManager.unmanageAttachment(t);return this.notifyEditorElement("attachment-remove",{attachment:e})}compositionDidStartEditingAttachment(t,e){return this.attachmentLocationRange=this.composition.document.getLocationRangeOfAttachment(t),this.compositionController.installAttachmentEditorForAttachment(t,e),this.selectionManager.setLocationRange(this.attachmentLocationRange)}compositionDidStopEditingAttachment(t){this.compositionController.uninstallAttachmentEditor(),this.attachmentLocationRange=null}compositionDidRequestChangingSelectionToLocationRange(t){if(!this.loadingSnapshot||this.isFocused())return this.requestedLocationRange=t,this.compositionRevisionWhenLocationRangeRequested=this.composition.revision,this.handlingInput?void 0:this.render()}compositionWillLoadSnapshot(){this.loadingSnapshot=!0}compositionDidLoadSnapshot(){this.compositionController.refreshViewCache(),this.render(),this.loadingSnapshot=!1}getSelectionManager(){return this.selectionManager}attachmentManagerDidRequestRemovalOfAttachment(t){return this.removeAttachment(t)}compositionControllerWillSyncDocumentView(){return this.inputController.editorWillSyncDocumentView(),this.selectionManager.lock(),this.selectionManager.clearSelection()}compositionControllerDidSyncDocumentView(){return this.inputController.editorDidSyncDocumentView(),this.selectionManager.unlock(),this.updateCurrentActions(),this.notifyEditorElement("sync")}compositionControllerDidRender(){this.requestedLocationRange&&(this.compositionRevisionWhenLocationRangeRequested===this.composition.revision&&this.selectionManager.setLocationRange(this.requestedLocationRange),this.requestedLocationRange=null,this.compositionRevisionWhenLocationRangeRequested=null),this.renderedCompositionRevision!==this.composition.revision&&(this.runEditorFilters(),this.composition.updateCurrentAttributes(),this.notifyEditorElement("render")),this.renderedCompositionRevision=this.composition.revision}compositionControllerDidFocus(){return this.isFocusedInvisibly()&&this.setLocationRange({index:0,offset:0}),this.toolbarController.hideDialog(),this.notifyEditorElement("focus")}compositionControllerDidBlur(){return this.notifyEditorElement("blur")}compositionControllerDidSelectAttachment(t,e){return this.toolbarController.hideDialog(),this.composition.editAttachment(t,e)}compositionControllerDidRequestDeselectingAttachment(t){let e=this.attachmentLocationRange||this.composition.document.getLocationRangeOfAttachment(t);return this.selectionManager.setLocationRange(e[1])}compositionControllerWillUpdateAttachment(t){return this.editor.recordUndoEntry("Edit Attachment",{context:t.id,consolidatable:!0})}compositionControllerDidRequestRemovalOfAttachment(t){return this.removeAttachment(t)}inputControllerWillHandleInput(){this.handlingInput=!0,this.requestedRender=!1}inputControllerDidRequestRender(){this.requestedRender=!0}inputControllerDidHandleInput(){if(this.handlingInput=!1,this.requestedRender)return this.requestedRender=!1,this.render()}inputControllerDidAllowUnhandledInput(){return this.notifyEditorElement("change")}inputControllerDidRequestReparse(){return this.reparse()}inputControllerWillPerformTyping(){return this.recordTypingUndoEntry()}inputControllerWillPerformFormatting(t){return this.recordFormattingUndoEntry(t)}inputControllerWillCutText(){return this.editor.recordUndoEntry("Cut")}inputControllerWillPaste(t){return this.editor.recordUndoEntry("Paste"),this.pasting=!0,this.notifyEditorElement("before-paste",{paste:t})}inputControllerDidPaste(t){return t.range=this.pastedRange,this.pastedRange=null,this.pasting=null,this.notifyEditorElement("paste",{paste:t})}inputControllerWillMoveText(){return this.editor.recordUndoEntry("Move")}inputControllerWillAttachFiles(){return this.editor.recordUndoEntry("Drop Files")}inputControllerWillPerformUndo(){return this.editor.undo()}inputControllerWillPerformRedo(){return this.editor.redo()}inputControllerDidReceiveKeyboardCommand(t){return this.toolbarController.applyKeyboardCommand(t)}inputControllerDidStartDrag(){this.locationRangeBeforeDrag=this.selectionManager.getLocationRange()}inputControllerDidReceiveDragOverPoint(t){return this.selectionManager.setLocationRangeFromPointRange(t)}inputControllerDidCancelDrag(){this.selectionManager.setLocationRange(this.locationRangeBeforeDrag),this.locationRangeBeforeDrag=null}locationRangeDidChange(t){return this.composition.updateCurrentAttributes(),this.updateCurrentActions(),this.attachmentLocationRange&&!We(this.attachmentLocationRange,t)&&this.composition.stopEditingAttachment(),this.notifyEditorElement("selection-change")}toolbarDidClickButton(){if(!this.getLocationRange())return this.setLocationRange({index:0,offset:0})}toolbarDidInvokeAction(t,e){return this.invokeAction(t,e)}toolbarDidToggleAttribute(t){if(this.recordFormattingUndoEntry(t),this.composition.toggleCurrentAttribute(t),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidUpdateAttribute(t,e){if(this.recordFormattingUndoEntry(t),this.composition.setCurrentAttribute(t,e),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidRemoveAttribute(t){if(this.recordFormattingUndoEntry(t),this.composition.removeCurrentAttribute(t),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarWillShowDialog(t){return this.composition.expandSelectionForEditing(),this.freezeSelection()}toolbarDidShowDialog(t){return this.notifyEditorElement("toolbar-dialog-show",{dialogName:t})}toolbarDidHideDialog(t){return this.thawSelection(),this.editorElement.focus(),this.notifyEditorElement("toolbar-dialog-hide",{dialogName:t})}freezeSelection(){if(!this.selectionFrozen)return this.selectionManager.lock(),this.composition.freezeSelection(),this.selectionFrozen=!0,this.render()}thawSelection(){if(this.selectionFrozen)return this.composition.thawSelection(),this.selectionManager.unlock(),this.selectionFrozen=!1,this.render()}canInvokeAction(t){return!!this.actionIsExternal(t)||!((e=this.actions[t])===null||e===void 0||(e=e.test)===null||e===void 0||!e.call(this));var e}invokeAction(t,e){return this.actionIsExternal(t)?this.notifyEditorElement("action-invoke",{actionName:t,invokingElement:e}):(n=this.actions[t])===null||n===void 0||(n=n.perform)===null||n===void 0?void 0:n.call(this);var n}actionIsExternal(t){return/^x-./.test(t)}getCurrentActions(){let t={};for(let e in this.actions)t[e]=this.canInvokeAction(e);return t}updateCurrentActions(){let t=this.getCurrentActions();if(!Xt(t,this.currentActions))return this.currentActions=t,this.toolbarController.updateActions(this.currentActions),this.notifyEditorElement("actions-change",{actions:this.currentActions})}runEditorFilters(){let t=this.composition.getSnapshot();if(Array.from(this.editor.filters).forEach(r=>{let{document:o,selectedRange:s}=t;t=r.call(this.editor,t)||{},t.document||(t.document=o),t.selectedRange||(t.selectedRange=s)}),e=t,n=this.composition.getSnapshot(),!We(e.selectedRange,n.selectedRange)||!e.document.isEqualTo(n.document))return this.composition.loadSnapshot(t);var e,n}updateInputElement(){let t=function(e,n){let r=Ls[n];if(r)return r(e);throw new Error("unknown content type: ".concat(n))}(this.compositionController.getSerializableElement(),"text/html");return this.editorElement.setFormValue(t)}notifyEditorElement(t,e){switch(t){case"document-change":this.documentChangedSinceLastRender=!0;break;case"render":this.documentChangedSinceLastRender&&(this.documentChangedSinceLastRender=!1,this.notifyEditorElement("change"));break;case"change":case"attachment-add":case"attachment-edit":case"attachment-remove":this.updateInputElement()}return this.editorElement.notify(t,e)}removeAttachment(t){return this.editor.recordUndoEntry("Delete Attachment"),this.composition.removeAttachment(t),this.render()}recordFormattingUndoEntry(t){let e=L(t),n=this.selectionManager.getLocationRange();if(e||!ht(n))return this.editor.recordUndoEntry("Formatting",{context:this.getUndoContext(),consolidatable:!0})}recordTypingUndoEntry(){return this.editor.recordUndoEntry("Typing",{context:this.getUndoContext(this.currentAttributes),consolidatable:!0})}getUndoContext(){for(var t=arguments.length,e=new Array(t),n=0;n0?Math.floor(new Date().getTime()/Yn.interval):0}isFocused(){var t;return this.editorElement===((t=this.editorElement.ownerDocument)===null||t===void 0?void 0:t.activeElement)}isFocusedInvisibly(){return this.isFocused()&&!this.getLocationRange()}get actions(){return this.constructor.actions}};q(Nt,"actions",{undo:{test(){return this.editor.canUndo()},perform(){return this.editor.undo()}},redo:{test(){return this.editor.canRedo()},perform(){return this.editor.redo()}},link:{test(){return this.editor.canActivateAttribute("href")}},increaseNestingLevel:{test(){return this.editor.canIncreaseNestingLevel()},perform(){return this.editor.increaseNestingLevel()&&this.render()}},decreaseNestingLevel:{test(){return this.editor.canDecreaseNestingLevel()},perform(){return this.editor.decreaseNestingLevel()&&this.render()}},attachFiles:{test:()=>!0,perform(){return bi.pickFiles(this.editor.insertFiles)}}}),Nt.proxyMethod("getSelectionManager().setLocationRange"),Nt.proxyMethod("getSelectionManager().getLocationRange");var ta=Object.freeze({__proto__:null,AttachmentEditorController:tn,CompositionController:en,Controller:nn,EditorController:Nt,InputController:Yt,Level0InputController:Z,Level2InputController:Dt,ToolbarController:sn}),ea=Object.freeze({__proto__:null,MutationObserver:rn,SelectionChangeObserver:Ue}),na=Object.freeze({__proto__:null,FileVerificationOperation:on,ImagePreloadOperation:Ke});Pr("trix-toolbar",`%t { display: block; } @@ -90,7 +90,7 @@ var po="2.1.11",wt="[data-trix-attachment]",mi={preview:{presentation:"gallery", %t [data-trix-dialog] [data-trix-validate]:invalid { background-color: #ffdddd; -}`);var sn=class extends HTMLElement{connectedCallback(){this.innerHTML===""&&(this.innerHTML=Fr.getDefaultHTML())}},ia=0,ra=function(i){if(!i.hasAttribute("contenteditable"))return i.setAttribute("contenteditable",""),function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.times=1,S(t,e)}("focus",{onElement:i,withCallback:()=>oa(i)})},oa=function(i){return sa(i),aa(i)},sa=function(i){var t,e;if((t=(e=document).queryCommandSupported)!==null&&t!==void 0&&t.call(e,"enableObjectResizing"))return document.execCommand("enableObjectResizing",!1,!1),S("mscontrolselect",{onElement:i,preventDefault:!0})},aa=function(i){var t,e;if((t=(e=document).queryCommandSupported)!==null&&t!==void 0&&t.call(e,"DefaultParagraphSeparator")){let{tagName:n}=W.default;if(["div","p"].includes(n))return document.execCommand("DefaultParagraphSeparator",!1,n)}},wr=xe.forcesObjectResizing?{display:"inline",width:"auto"}:{display:"inline-block",width:"1px"};Pr("trix-editor",`%t { +}`);var an=class extends HTMLElement{connectedCallback(){this.innerHTML===""&&(this.innerHTML=Fr.getDefaultHTML())}},ia=0,ra=function(i){if(!i.hasAttribute("contenteditable"))return i.setAttribute("contenteditable",""),function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.times=1,S(t,e)}("focus",{onElement:i,withCallback:()=>oa(i)})},oa=function(i){return sa(i),aa(i)},sa=function(i){var t,e;if((t=(e=document).queryCommandSupported)!==null&&t!==void 0&&t.call(e,"enableObjectResizing"))return document.execCommand("enableObjectResizing",!1,!1),S("mscontrolselect",{onElement:i,preventDefault:!0})},aa=function(i){var t,e;if((t=(e=document).queryCommandSupported)!==null&&t!==void 0&&t.call(e,"DefaultParagraphSeparator")){let{tagName:n}=W.default;if(["div","p"].includes(n))return document.execCommand("DefaultParagraphSeparator",!1,n)}},wr=xe.forcesObjectResizing?{display:"inline",width:"auto"}:{display:"inline-block",width:"1px"};Pr("trix-editor",`%t { display: block; } @@ -142,7 +142,7 @@ var po="2.1.11",wt="[data-trix-attachment]",mi={preview:{presentation:"gallery", %t [data-trix-cursor-target=right] { vertical-align: bottom !important; margin-right: -1px !important; -}`));var ct=new WeakMap,ce=new WeakSet,di=class{constructor(t){var e,n;Jr(e=this,n=ce),n.add(e),pe(this,ct,{writable:!0,value:void 0}),this.element=t,Ci(this,ct,t.attachInternals())}connectedCallback(){Fe(this,ce,Pe).call(this)}disconnectedCallback(){}get labels(){return x(this,ct).labels}get disabled(){var t;return(t=this.element.inputElement)===null||t===void 0?void 0:t.disabled}set disabled(t){this.element.toggleAttribute("disabled",t)}get required(){return this.element.hasAttribute("required")}set required(t){this.element.toggleAttribute("required",t),Fe(this,ce,Pe).call(this)}get validity(){return x(this,ct).validity}get validationMessage(){return x(this,ct).validationMessage}get willValidate(){return x(this,ct).willValidate}setFormValue(t){Fe(this,ce,Pe).call(this)}checkValidity(){return x(this,ct).checkValidity()}reportValidity(){return x(this,ct).reportValidity()}setCustomValidity(t){Fe(this,ce,Pe).call(this,t)}};function Pe(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",{required:t,value:e}=this.element,n=t&&!e,r=!!i,o=p("input",{required:t}),s=i||o.validationMessage;x(this,ct).setValidity({valueMissing:n,customError:r},s)}var Jn=new WeakMap,Kn=new WeakMap,Gn=new WeakMap,gi=class{constructor(t){pe(this,Jn,{writable:!0,value:void 0}),pe(this,Kn,{writable:!0,value:e=>{e.defaultPrevented||e.target===this.element.form&&this.element.reset()}}),pe(this,Gn,{writable:!0,value:e=>{if(e.defaultPrevented||this.element.contains(e.target))return;let n=vt(e.target,{matchingSelector:"label"});n&&Array.from(this.labels).includes(n)&&this.element.focus()}}),this.element=t}connectedCallback(){Ci(this,Jn,function(t){if(t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby"))return;let e=function(){let n=Array.from(t.labels).map(o=>{if(!o.contains(t))return o.textContent}).filter(o=>o),r=n.join(" ");return r?t.setAttribute("aria-label",r):t.removeAttribute("aria-label")};return e(),S("focus",{onElement:t,withCallback:e})}(this.element)),window.addEventListener("reset",x(this,Kn),!1),window.addEventListener("click",x(this,Gn),!1)}disconnectedCallback(){var t;(t=x(this,Jn))===null||t===void 0||t.destroy(),window.removeEventListener("reset",x(this,Kn),!1),window.removeEventListener("click",x(this,Gn),!1)}get labels(){let t=[];this.element.id&&this.element.ownerDocument&&t.push(...Array.from(this.element.ownerDocument.querySelectorAll("label[for='".concat(this.element.id,"']"))||[]));let e=vt(this.element,{matchingSelector:"label"});return e&&[this.element,null].includes(e.control)&&t.push(e),t}get disabled(){return console.warn("This browser does not support the [disabled] attribute for trix-editor elements."),!1}set disabled(t){console.warn("This browser does not support the [disabled] attribute for trix-editor elements.")}get required(){return console.warn("This browser does not support the [required] attribute for trix-editor elements."),!1}set required(t){console.warn("This browser does not support the [required] attribute for trix-editor elements.")}get validity(){return console.warn("This browser does not support the validity property for trix-editor elements."),null}get validationMessage(){return console.warn("This browser does not support the validationMessage property for trix-editor elements."),""}get willValidate(){return console.warn("This browser does not support the willValidate property for trix-editor elements."),!1}setFormValue(t){}checkValidity(){return console.warn("This browser does not support checkValidity() for trix-editor elements."),!0}reportValidity(){return console.warn("This browser does not support reportValidity() for trix-editor elements."),!0}setCustomValidity(t){console.warn("This browser does not support setCustomValidity(validationMessage) for trix-editor elements.")}},P=new WeakMap,ye=class extends HTMLElement{constructor(){super(),pe(this,P,{writable:!0,value:void 0}),Ci(this,P,this.constructor.formAssociated?new di(this):new gi(this))}get trixId(){return this.hasAttribute("trix-id")?this.getAttribute("trix-id"):(this.setAttribute("trix-id",++ia),this.trixId)}get labels(){return x(this,P).labels}get disabled(){return x(this,P).disabled}set disabled(t){x(this,P).disabled=t}get required(){return x(this,P).required}set required(t){x(this,P).required=t}get validity(){return x(this,P).validity}get validationMessage(){return x(this,P).validationMessage}get willValidate(){return x(this,P).willValidate}get type(){return this.localName}get toolbarElement(){var t;if(this.hasAttribute("toolbar"))return(t=this.ownerDocument)===null||t===void 0?void 0:t.getElementById(this.getAttribute("toolbar"));if(this.parentNode){let e="trix-toolbar-".concat(this.trixId);this.setAttribute("toolbar",e);let n=p("trix-toolbar",{id:e});return this.parentNode.insertBefore(n,this),n}}get form(){var t;return(t=this.inputElement)===null||t===void 0?void 0:t.form}get inputElement(){var t;if(this.hasAttribute("input"))return(t=this.ownerDocument)===null||t===void 0?void 0:t.getElementById(this.getAttribute("input"));if(this.parentNode){let e="trix-input-".concat(this.trixId);this.setAttribute("input",e);let n=p("input",{type:"hidden",id:e});return this.parentNode.insertBefore(n,this.nextElementSibling),n}}get editor(){var t;return(t=this.editorController)===null||t===void 0?void 0:t.editor}get name(){var t;return(t=this.inputElement)===null||t===void 0?void 0:t.name}get value(){var t;return(t=this.inputElement)===null||t===void 0?void 0:t.value}set value(t){var e;this.defaultValue=t,(e=this.editor)===null||e===void 0||e.loadHTML(this.defaultValue)}notify(t,e){if(this.editorController)return he("trix-".concat(t),{onElement:this,attributes:e})}setFormValue(t){this.inputElement&&(this.inputElement.value=t,x(this,P).setFormValue(t))}connectedCallback(){this.hasAttribute("data-trix-internal")||(ra(this),function(t){t.hasAttribute("role")||t.setAttribute("role","textbox")}(this),this.editorController||(he("trix-before-initialize",{onElement:this}),this.editorController=new Nt({editorElement:this,html:this.defaultValue=this.value}),requestAnimationFrame(()=>he("trix-initialize",{onElement:this}))),this.editorController.registerSelectionManager(),x(this,P).connectedCallback(),function(t){!document.querySelector(":focus")&&t.hasAttribute("autofocus")&&document.querySelector("[autofocus]")===t&&t.focus()}(this))}disconnectedCallback(){var t;(t=this.editorController)===null||t===void 0||t.unregisterSelectionManager(),x(this,P).disconnectedCallback()}checkValidity(){return x(this,P).checkValidity()}reportValidity(){return x(this,P).reportValidity()}setCustomValidity(t){x(this,P).setCustomValidity(t)}formDisabledCallback(t){this.inputElement&&(this.inputElement.disabled=t),this.toggleAttribute("contenteditable",!t)}formResetCallback(){this.reset()}reset(){this.value=this.defaultValue}};q(ye,"formAssociated","ElementInternals"in window);var Q={VERSION:po,config:Ce,core:Ds,models:Xr,views:Ps,controllers:ta,observers:ea,operations:na,elements:Object.freeze({__proto__:null,TrixEditorElement:ye,TrixToolbarElement:sn}),filters:Object.freeze({__proto__:null,Filter:$e,attachmentGalleryFilter:$r})};Object.assign(Q,Xr),window.Trix=Q,setTimeout(function(){customElements.get("trix-toolbar")||customElements.define("trix-toolbar",sn),customElements.get("trix-editor")||customElements.define("trix-editor",ye)},0);Q.config.blockAttributes.default.tagName="p";Q.config.blockAttributes.default.breakOnReturn=!0;Q.config.blockAttributes.heading={tagName:"h2",terminal:!0,breakOnReturn:!0,group:!1};Q.config.blockAttributes.subHeading={tagName:"h3",terminal:!0,breakOnReturn:!0,group:!1};Q.config.textAttributes.underline={style:{textDecoration:"underline"},inheritable:!0,parser:i=>window.getComputedStyle(i).textDecoration.includes("underline")};Q.Block.prototype.breaksOnReturn=function(){let i=this.getLastAttribute();return Q.config.blockAttributes[i||"default"]?.breakOnReturn??!1};Q.LineBreakInsertion.prototype.shouldInsertBlockBreak=function(){return this.block.hasAttributes()&&this.block.isListItem()&&!this.block.isEmpty()?this.startLocation.offset>0:this.shouldBreakFormattedBlock()?!1:this.breaksOnReturn};function la({state:i}){return{state:i,init:function(){this.$refs.trixValue.value=this.state,this.$refs.trix.editor?.loadHTML(this.state??""),this.$watch("state",()=>{document.activeElement!==this.$refs.trix&&(this.$refs.trixValue.value=this.state,this.$refs.trix.editor?.loadHTML(this.state??""))})}}}export{la as default}; +}`));var ct=new WeakMap,ce=new WeakSet,di=class{constructor(t){var e,n;Jr(e=this,n=ce),n.add(e),pe(this,ct,{writable:!0,value:void 0}),this.element=t,Ci(this,ct,t.attachInternals())}connectedCallback(){Fe(this,ce,Pe).call(this)}disconnectedCallback(){}get labels(){return x(this,ct).labels}get disabled(){var t;return(t=this.element.inputElement)===null||t===void 0?void 0:t.disabled}set disabled(t){this.element.toggleAttribute("disabled",t)}get required(){return this.element.hasAttribute("required")}set required(t){this.element.toggleAttribute("required",t),Fe(this,ce,Pe).call(this)}get validity(){return x(this,ct).validity}get validationMessage(){return x(this,ct).validationMessage}get willValidate(){return x(this,ct).willValidate}setFormValue(t){Fe(this,ce,Pe).call(this)}checkValidity(){return x(this,ct).checkValidity()}reportValidity(){return x(this,ct).reportValidity()}setCustomValidity(t){Fe(this,ce,Pe).call(this,t)}};function Pe(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",{required:t,value:e}=this.element,n=t&&!e,r=!!i,o=p("input",{required:t}),s=i||o.validationMessage;x(this,ct).setValidity({valueMissing:n,customError:r},s)}var Kn=new WeakMap,Gn=new WeakMap,$n=new WeakMap,gi=class{constructor(t){pe(this,Kn,{writable:!0,value:void 0}),pe(this,Gn,{writable:!0,value:e=>{e.defaultPrevented||e.target===this.element.form&&this.element.reset()}}),pe(this,$n,{writable:!0,value:e=>{if(e.defaultPrevented||this.element.contains(e.target))return;let n=vt(e.target,{matchingSelector:"label"});n&&Array.from(this.labels).includes(n)&&this.element.focus()}}),this.element=t}connectedCallback(){Ci(this,Kn,function(t){if(t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby"))return;let e=function(){let n=Array.from(t.labels).map(o=>{if(!o.contains(t))return o.textContent}).filter(o=>o),r=n.join(" ");return r?t.setAttribute("aria-label",r):t.removeAttribute("aria-label")};return e(),S("focus",{onElement:t,withCallback:e})}(this.element)),window.addEventListener("reset",x(this,Gn),!1),window.addEventListener("click",x(this,$n),!1)}disconnectedCallback(){var t;(t=x(this,Kn))===null||t===void 0||t.destroy(),window.removeEventListener("reset",x(this,Gn),!1),window.removeEventListener("click",x(this,$n),!1)}get labels(){let t=[];this.element.id&&this.element.ownerDocument&&t.push(...Array.from(this.element.ownerDocument.querySelectorAll("label[for='".concat(this.element.id,"']"))||[]));let e=vt(this.element,{matchingSelector:"label"});return e&&[this.element,null].includes(e.control)&&t.push(e),t}get disabled(){return console.warn("This browser does not support the [disabled] attribute for trix-editor elements."),!1}set disabled(t){console.warn("This browser does not support the [disabled] attribute for trix-editor elements.")}get required(){return console.warn("This browser does not support the [required] attribute for trix-editor elements."),!1}set required(t){console.warn("This browser does not support the [required] attribute for trix-editor elements.")}get validity(){return console.warn("This browser does not support the validity property for trix-editor elements."),null}get validationMessage(){return console.warn("This browser does not support the validationMessage property for trix-editor elements."),""}get willValidate(){return console.warn("This browser does not support the willValidate property for trix-editor elements."),!1}setFormValue(t){}checkValidity(){return console.warn("This browser does not support checkValidity() for trix-editor elements."),!0}reportValidity(){return console.warn("This browser does not support reportValidity() for trix-editor elements."),!0}setCustomValidity(t){console.warn("This browser does not support setCustomValidity(validationMessage) for trix-editor elements.")}},P=new WeakMap,ye=class extends HTMLElement{constructor(){super(),pe(this,P,{writable:!0,value:void 0}),Ci(this,P,this.constructor.formAssociated?new di(this):new gi(this))}get trixId(){return this.hasAttribute("trix-id")?this.getAttribute("trix-id"):(this.setAttribute("trix-id",++ia),this.trixId)}get labels(){return x(this,P).labels}get disabled(){return x(this,P).disabled}set disabled(t){x(this,P).disabled=t}get required(){return x(this,P).required}set required(t){x(this,P).required=t}get validity(){return x(this,P).validity}get validationMessage(){return x(this,P).validationMessage}get willValidate(){return x(this,P).willValidate}get type(){return this.localName}get toolbarElement(){var t;if(this.hasAttribute("toolbar"))return(t=this.ownerDocument)===null||t===void 0?void 0:t.getElementById(this.getAttribute("toolbar"));if(this.parentNode){let e="trix-toolbar-".concat(this.trixId);this.setAttribute("toolbar",e);let n=p("trix-toolbar",{id:e});return this.parentNode.insertBefore(n,this),n}}get form(){var t;return(t=this.inputElement)===null||t===void 0?void 0:t.form}get inputElement(){var t;if(this.hasAttribute("input"))return(t=this.ownerDocument)===null||t===void 0?void 0:t.getElementById(this.getAttribute("input"));if(this.parentNode){let e="trix-input-".concat(this.trixId);this.setAttribute("input",e);let n=p("input",{type:"hidden",id:e});return this.parentNode.insertBefore(n,this.nextElementSibling),n}}get editor(){var t;return(t=this.editorController)===null||t===void 0?void 0:t.editor}get name(){var t;return(t=this.inputElement)===null||t===void 0?void 0:t.name}get value(){var t;return(t=this.inputElement)===null||t===void 0?void 0:t.value}set value(t){var e;this.defaultValue=t,(e=this.editor)===null||e===void 0||e.loadHTML(this.defaultValue)}notify(t,e){if(this.editorController)return he("trix-".concat(t),{onElement:this,attributes:e})}setFormValue(t){this.inputElement&&(this.inputElement.value=t,x(this,P).setFormValue(t))}connectedCallback(){this.hasAttribute("data-trix-internal")||(ra(this),function(t){t.hasAttribute("role")||t.setAttribute("role","textbox")}(this),this.editorController||(he("trix-before-initialize",{onElement:this}),this.editorController=new Nt({editorElement:this,html:this.defaultValue=this.value}),requestAnimationFrame(()=>he("trix-initialize",{onElement:this}))),this.editorController.registerSelectionManager(),x(this,P).connectedCallback(),function(t){!document.querySelector(":focus")&&t.hasAttribute("autofocus")&&document.querySelector("[autofocus]")===t&&t.focus()}(this))}disconnectedCallback(){var t;(t=this.editorController)===null||t===void 0||t.unregisterSelectionManager(),x(this,P).disconnectedCallback()}checkValidity(){return x(this,P).checkValidity()}reportValidity(){return x(this,P).reportValidity()}setCustomValidity(t){x(this,P).setCustomValidity(t)}formDisabledCallback(t){this.inputElement&&(this.inputElement.disabled=t),this.toggleAttribute("contenteditable",!t)}formResetCallback(){this.reset()}reset(){this.value=this.defaultValue}};q(ye,"formAssociated","ElementInternals"in window);var Q={VERSION:po,config:Ce,core:Ds,models:Xr,views:Ps,controllers:ta,observers:ea,operations:na,elements:Object.freeze({__proto__:null,TrixEditorElement:ye,TrixToolbarElement:an}),filters:Object.freeze({__proto__:null,Filter:Ye,attachmentGalleryFilter:$r})};Object.assign(Q,Xr),window.Trix=Q,setTimeout(function(){customElements.get("trix-toolbar")||customElements.define("trix-toolbar",an),customElements.get("trix-editor")||customElements.define("trix-editor",ye)},0);Q.config.blockAttributes.default.tagName="p";Q.config.blockAttributes.default.breakOnReturn=!0;Q.config.blockAttributes.heading={tagName:"h2",terminal:!0,breakOnReturn:!0,group:!1};Q.config.blockAttributes.subHeading={tagName:"h3",terminal:!0,breakOnReturn:!0,group:!1};Q.config.textAttributes.underline={style:{textDecoration:"underline"},inheritable:!0,parser:i=>window.getComputedStyle(i).textDecoration.includes("underline")};Q.Block.prototype.breaksOnReturn=function(){let i=this.getLastAttribute();return Q.config.blockAttributes[i||"default"]?.breakOnReturn??!1};Q.LineBreakInsertion.prototype.shouldInsertBlockBreak=function(){return this.block.hasAttributes()&&this.block.isListItem()&&!this.block.isEmpty()?this.startLocation.offset>0:this.shouldBreakFormattedBlock()?!1:this.breaksOnReturn};function la({state:i}){return{state:i,init:function(){this.$refs.trixValue.value=this.state,this.$refs.trix.editor?.loadHTML(this.state??""),this.$watch("state",()=>{document.activeElement!==this.$refs.trix&&(this.$refs.trixValue.value=this.state,this.$refs.trix.editor?.loadHTML(this.state??""))})}}}export{la as default}; /*! Bundled license information: trix/dist/trix.esm.min.js: diff --git a/packages/forms/dist/components/select.js b/packages/forms/dist/components/select.js index d1529ca786f..3480f21d34c 100644 --- a/packages/forms/dist/components/select.js +++ b/packages/forms/dist/components/select.js @@ -1,6 +1,6 @@ -var de=function(i,e){return de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,s){t.__proto__=s}||function(t,s){for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n])},de(i,e)};function Ge(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");de(i,e);function t(){this.constructor=i}i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var M=function(){return M=Object.assign||function(e){for(var t,s=1,n=arguments.length;s0?"next":"previous","ElementSibling"),n=i[s];n;){if(n.matches(e))return n;n=n[s]}return null},dt=function(i,e,t){t===void 0&&(t=1);var s;return t>0?s=e.scrollTop+e.offsetHeight>=i.offsetTop+i.offsetHeight:s=i.offsetTop>=e.scrollTop,s},oe=function(i){if(typeof i!="string"){if(i==null)return"";if(typeof i=="object"){if("raw"in i)return oe(i.raw);if("trusted"in i)return i.trusted}return i}return i.replace(/&/g,"&").replace(/>/g,">").replace(/=0&&!window.matchMedia("(min-height: ".concat(e+1,"px)")).matches:this.position==="top"&&(s=!0),s},i.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},i.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},i.prototype.open=function(e,t){g(this.element,this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(e,t)&&(g(this.element,this.classNames.flippedState),this.isFlipped=!0)},i.prototype.close=function(){R(this.element,this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(R(this.element,this.classNames.flippedState),this.isFlipped=!1)},i.prototype.addFocusState=function(){g(this.element,this.classNames.focusState)},i.prototype.removeFocusState=function(){R(this.element,this.classNames.focusState)},i.prototype.enable=function(){R(this.element,this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===B.SelectOne&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},i.prototype.disable=function(){g(this.element,this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===B.SelectOne&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},i.prototype.wrap=function(e){var t=this.element,s=e.parentNode;s&&(e.nextSibling?s.insertBefore(t,e.nextSibling):s.appendChild(t)),t.appendChild(e)},i.prototype.unwrap=function(e){var t=this.element,s=t.parentNode;s&&(s.insertBefore(e,t),s.removeChild(t))},i.prototype.addLoadingState=function(){g(this.element,this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},i.prototype.removeLoadingState=function(){R(this.element,this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},i}(),Ct=function(){function i(e){var t=e.element,s=e.type,n=e.classNames,r=e.preventPaste;this.element=t,this.type=s,this.classNames=n,this.preventPaste=r,this.isFocussed=this.element.isEqualNode(document.activeElement),this.isDisabled=t.disabled,this._onPaste=this._onPaste.bind(this),this._onInput=this._onInput.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}return Object.defineProperty(i.prototype,"placeholder",{set:function(e){this.element.placeholder=e},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.value=e},enumerable:!1,configurable:!0}),i.prototype.addEventListeners=function(){var e=this.element;e.addEventListener("paste",this._onPaste),e.addEventListener("input",this._onInput,{passive:!0}),e.addEventListener("focus",this._onFocus,{passive:!0}),e.addEventListener("blur",this._onBlur,{passive:!0})},i.prototype.removeEventListeners=function(){var e=this.element;e.removeEventListener("input",this._onInput),e.removeEventListener("paste",this._onPaste),e.removeEventListener("focus",this._onFocus),e.removeEventListener("blur",this._onBlur)},i.prototype.enable=function(){var e=this.element;e.removeAttribute("disabled"),this.isDisabled=!1},i.prototype.disable=function(){var e=this.element;e.setAttribute("disabled",""),this.isDisabled=!0},i.prototype.focus=function(){this.isFocussed||this.element.focus()},i.prototype.blur=function(){this.isFocussed&&this.element.blur()},i.prototype.clear=function(e){return e===void 0&&(e=!0),this.element.value="",e&&this.setWidth(),this},i.prototype.setWidth=function(){var e=this.element;e.style.minWidth="".concat(e.placeholder.length+1,"ch"),e.style.width="".concat(e.value.length+1,"ch")},i.prototype.setActiveDescendant=function(e){this.element.setAttribute("aria-activedescendant",e)},i.prototype.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},i.prototype._onInput=function(){this.type!==B.SelectOne&&this.setWidth()},i.prototype._onPaste=function(e){this.preventPaste&&e.preventDefault()},i.prototype._onFocus=function(){this.isFocussed=!0},i.prototype._onBlur=function(){this.isFocussed=!1},i}(),St=4,Pe=function(){function i(e){var t=e.element;this.element=t,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}return i.prototype.prepend=function(e){var t=this.element.firstElementChild;t?this.element.insertBefore(e,t):this.element.append(e)},i.prototype.scrollToTop=function(){this.element.scrollTop=0},i.prototype.scrollToChildElement=function(e,t){var s=this;if(e){var n=this.element.offsetHeight,r=this.element.scrollTop+n,o=e.offsetHeight,a=e.offsetTop+o,l=t>0?this.element.scrollTop+a-r:e.offsetTop;requestAnimationFrame(function(){s._animateScroll(l,t)})}},i.prototype._scrollDown=function(e,t,s){var n=(s-e)/t,r=n>1?n:1;this.element.scrollTop=e+r},i.prototype._scrollUp=function(e,t,s){var n=(e-s)/t,r=n>1?n:1;this.element.scrollTop=e-r},i.prototype._animateScroll=function(e,t){var s=this,n=St,r=this.element.scrollTop,o=!1;t>0?(this._scrollDown(r,n,e),re&&(o=!0)),o&&requestAnimationFrame(function(){s._animateScroll(e,t)})},i}(),We=function(){function i(e){var t=e.element,s=e.classNames;this.element=t,this.classNames=s,this.isDisabled=!1}return Object.defineProperty(i.prototype,"isActive",{get:function(){return this.element.dataset.choice==="active"},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dir",{get:function(){return this.element.dir},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"value",{get:function(){return this.element.value},set:function(e){this.element.setAttribute("value",e),this.element.value=e},enumerable:!1,configurable:!0}),i.prototype.conceal=function(){var e=this.element;g(e,this.classNames.input),e.hidden=!0,e.tabIndex=-1;var t=e.getAttribute("style");t&&e.setAttribute("data-choice-orig-style",t),e.setAttribute("data-choice","active")},i.prototype.reveal=function(){var e=this.element;R(e,this.classNames.input),e.hidden=!1,e.removeAttribute("tabindex");var t=e.getAttribute("data-choice-orig-style");t?(e.removeAttribute("data-choice-orig-style"),e.setAttribute("style",t)):e.removeAttribute("style"),e.removeAttribute("data-choice")},i.prototype.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},i.prototype.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},i.prototype.triggerEvent=function(e,t){gt(this.element,e,t||{})},i}(),It=function(i){Ge(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e}(We),Y=function(i,e){return e===void 0&&(e=!0),typeof i>"u"?e:!!i},qe=function(i){if(typeof i=="string"&&(i=i.split(" ").filter(function(e){return e.length})),Array.isArray(i)&&i.length)return i},F=function(i,e){if(typeof i=="string"){var t=F({value:i,label:i},!1);return t}var s=i;if("choices"in s){if(!e)throw new TypeError("optGroup is not allowed");var n=s,r=n.choices.map(function(h){return F(h,!1)}),o={id:0,label:G(n.label)||n.value,active:!!r.length,disabled:!!n.disabled,choices:r};return o}var a=s,l={id:0,group:null,score:0,rank:0,value:a.value,label:a.label||a.value,active:Y(a.active),selected:Y(a.selected,!1),disabled:Y(a.disabled,!1),placeholder:Y(a.placeholder,!1),highlighted:!1,labelClass:qe(a.labelClass),labelDescription:a.labelDescription,customProperties:a.customProperties};return l},wt=function(i){return i.tagName==="INPUT"},Xe=function(i){return i.tagName==="SELECT"},At=function(i){return i.tagName==="OPTION"},Ot=function(i){return i.tagName==="OPTGROUP"},Tt=function(i){Ge(e,i);function e(t){var s=t.element,n=t.classNames,r=t.template,o=t.extractPlaceholder,a=i.call(this,{element:s,classNames:n})||this;return a.template=r,a.extractPlaceholder=o,a}return Object.defineProperty(e.prototype,"placeholderOption",{get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")},enumerable:!1,configurable:!0}),e.prototype.addOptions=function(t){var s=this,n=document.createDocumentFragment();t.forEach(function(r){var o=r;if(!o.element){var a=s.template(o);n.appendChild(a),o.element=a}}),this.element.appendChild(n)},e.prototype.optionsAsChoices=function(){var t=this,s=[];return this.element.querySelectorAll(":scope > option, :scope > optgroup").forEach(function(n){At(n)?s.push(t._optionToChoice(n)):Ot(n)&&s.push(t._optgroupToChoice(n))}),s},e.prototype._optionToChoice=function(t){return!t.hasAttribute("value")&&t.hasAttribute("placeholder")&&(t.setAttribute("value",""),t.value=""),{id:0,group:null,score:0,rank:0,value:t.value,label:t.innerHTML,element:t,active:!0,selected:this.extractPlaceholder?t.selected:t.hasAttribute("selected"),disabled:t.disabled,highlighted:!1,placeholder:this.extractPlaceholder&&(!t.value||t.hasAttribute("placeholder")),labelClass:typeof t.dataset.labelClass<"u"?qe(t.dataset.labelClass):void 0,labelDescription:typeof t.dataset.labelDescription<"u"?t.dataset.labelDescription:void 0,customProperties:yt(t.dataset.customProperties)}},e.prototype._optgroupToChoice=function(t){var s=this,n=t.querySelectorAll("option"),r=Array.from(n).map(function(o){return s._optionToChoice(o)});return{id:0,label:t.label||"",element:t,active:!!r.length,disabled:t.disabled,choices:r}},e}(We),Lt={containerOuter:["choices"],containerInner:["choices__inner"],input:["choices__input"],inputCloned:["choices__input--cloned"],list:["choices__list"],listItems:["choices__list--multiple"],listSingle:["choices__list--single"],listDropdown:["choices__list--dropdown"],item:["choices__item"],itemSelectable:["choices__item--selectable"],itemDisabled:["choices__item--disabled"],itemChoice:["choices__item--choice"],description:["choices__description"],placeholder:["choices__placeholder"],group:["choices__group"],groupHeading:["choices__heading"],button:["choices__button"],activeState:["is-active"],focusState:["is-focused"],openState:["is-open"],disabledState:["is-disabled"],highlightedState:["is-highlighted"],selectedState:["is-selected"],flippedState:["is-flipped"],loadingState:["is-loading"],notice:["choices__notice"],addChoice:["choices__item--selectable","add-choice"],noResults:["has-no-results"],noChoices:["has-no-choices"]},Fe={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,closeDropdownOnSelect:"auto",singleModeForMultiSelect:!1,addChoices:!1,addItems:!0,addItemFilter:function(i){return!!i&&i!==""},removeItems:!0,removeItemButton:!1,removeItemButtonAlignLeft:!1,editItems:!1,allowHTML:!1,allowHtmlUserInput:!1,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:mt,shadowRoot:null,placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(i){return'Press Enter to add "'.concat(i,'"')},removeItemIconText:function(){return"Remove item"},removeItemLabelText:function(i){return"Remove item: ".concat(i)},maxItemText:function(i){return"Only ".concat(i," values can be added")},valueComparer:function(i,e){return i===e},fuseOptions:{includeScore:!0},labelId:"",callbackOnInit:null,callbackOnCreateTemplates:null,classNames:Lt,appendGroupInSearch:!1},Re=function(i){var e=i.itemEl;e&&(e.remove(),i.itemEl=void 0)};function xt(i,e,t){var s=i,n=!0;switch(e.type){case C.ADD_ITEM:{e.item.selected=!0;var r=e.item.element;r&&(r.selected=!0,r.setAttribute("selected","")),s.push(e.item);break}case C.REMOVE_ITEM:{e.item.selected=!1;var r=e.item.element;if(r){r.selected=!1,r.removeAttribute("selected");var o=r.parentElement;o&&Xe(o)&&o.type===B.SelectOne&&(o.value="")}Re(e.item),s=s.filter(function(c){return c.id!==e.item.id});break}case C.REMOVE_CHOICE:{Re(e.choice),s=s.filter(function(h){return h.id!==e.choice.id});break}case C.HIGHLIGHT_ITEM:{var a=e.highlighted,l=s.find(function(h){return h.id===e.item.id});l&&l.highlighted!==a&&(l.highlighted=a,t&&bt(l,a?t.classNames.highlightedState:t.classNames.selectedState,a?t.classNames.selectedState:t.classNames.highlightedState));break}default:{n=!1;break}}return{state:s,update:n}}function Mt(i,e){var t=i,s=!0;switch(e.type){case C.ADD_GROUP:{t.push(e.group);break}case C.CLEAR_CHOICES:{t=[];break}default:{s=!1;break}}return{state:t,update:s}}function Dt(i,e,t){var s=i,n=!0;switch(e.type){case C.ADD_CHOICE:{s.push(e.choice);break}case C.REMOVE_CHOICE:{e.choice.choiceEl=void 0,e.choice.group&&(e.choice.group.choices=e.choice.group.choices.filter(function(o){return o.id!==e.choice.id})),s=s.filter(function(o){return o.id!==e.choice.id});break}case C.ADD_ITEM:case C.REMOVE_ITEM:{e.item.choiceEl=void 0;break}case C.FILTER_CHOICES:{var r=[];e.results.forEach(function(o){r[o.item.id]=o}),s.forEach(function(o){var a=r[o.id];a!==void 0?(o.score=a.score,o.rank=a.rank,o.active=!0):(o.score=0,o.rank=0,o.active=!1),t&&t.appendGroupInSearch&&(o.choiceEl=void 0)});break}case C.ACTIVATE_CHOICES:{s.forEach(function(o){o.active=e.active,t&&t.appendGroupInSearch&&(o.choiceEl=void 0)});break}case C.CLEAR_CHOICES:{s=[];break}default:{n=!1;break}}return{state:s,update:n}}var ke={groups:Mt,items:xt,choices:Dt},Nt=function(){function i(e){this._state=this.defaultState,this._listeners=[],this._txn=0,this._context=e}return Object.defineProperty(i.prototype,"defaultState",{get:function(){return{groups:[],items:[],choices:[]}},enumerable:!1,configurable:!0}),i.prototype.changeSet=function(e){return{groups:e,items:e,choices:e}},i.prototype.reset=function(){this._state=this.defaultState;var e=this.changeSet(!0);this._txn?this._changeSet=e:this._listeners.forEach(function(t){return t(e)})},i.prototype.subscribe=function(e){return this._listeners.push(e),this},i.prototype.dispatch=function(e){var t=this,s=this._state,n=!1,r=this._changeSet||this.changeSet(!1);Object.keys(ke).forEach(function(o){var a=ke[o](s[o],e,t._context);a.update&&(n=!0,r[o]=!0,s[o]=a.state)}),n&&(this._txn?this._changeSet=r:this._listeners.forEach(function(o){return o(r)}))},i.prototype.withTxn=function(e){this._txn++;try{e()}finally{if(this._txn=Math.max(0,this._txn-1),!this._txn){var t=this._changeSet;t&&(this._changeSet=void 0,this._listeners.forEach(function(s){return s(t)}))}}},Object.defineProperty(i.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"items",{get:function(){return this.state.items},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"highlightedActiveItems",{get:function(){return this.items.filter(function(e){return!e.disabled&&e.active&&e.highlighted})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"choices",{get:function(){return this.state.choices},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"activeChoices",{get:function(){return this.choices.filter(function(e){return e.active})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"searchableChoices",{get:function(){return this.choices.filter(function(e){return!e.disabled&&!e.placeholder})},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"groups",{get:function(){return this.state.groups},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"activeGroups",{get:function(){var e=this;return this.state.groups.filter(function(t){var s=t.active&&!t.disabled,n=e.state.choices.some(function(r){return r.active&&!r.disabled});return s&&n},[])},enumerable:!1,configurable:!0}),i.prototype.inTxn=function(){return this._txn>0},i.prototype.getChoiceById=function(e){return this.activeChoices.find(function(t){return t.id===e})},i.prototype.getGroupById=function(e){return this.groups.find(function(t){return t.id===e})},i}(),T={noChoices:"no-choices",noResults:"no-results",addChoice:"add-choice",generic:""};function Pt(i,e,t){return(e=Rt(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function He(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);e&&(s=s.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,s)}return t}function q(i){for(var e=1;e`Invalid value for key ${i}`,Ut=i=>`Pattern length exceeds max of ${i}.`,Gt=i=>`Missing ${i} property in key`,Wt=i=>`Property 'weight' in key '${i}' must be a positive integer`,je=Object.prototype.hasOwnProperty,fe=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(s=>{let n=Qe(s);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(s=>{s.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function Qe(i){let e=null,t=null,s=null,n=1,r=null;if(k(i)||K(i))s=i,e=Ve(i),t=pe(i);else{if(!je.call(i,"name"))throw new Error(Gt("name"));let o=i.name;if(s=o,je.call(i,"weight")&&(n=i.weight,n<=0))throw new Error(Wt(o));e=Ve(o),t=pe(o),r=i.getFn}return{path:e,id:t,weight:n,src:s,getFn:r}}function Ve(i){return K(i)?i:i.split(".")}function pe(i){return K(i)?i.join("."):i}function qt(i,e){let t=[],s=!1,n=(r,o,a)=>{if(D(r))if(!o[a])t.push(r);else{let l=o[a],h=r[l];if(!D(h))return;if(a===o.length-1&&(k(h)||ze(h)||Vt(h)))t.push(jt(h));else if(K(h)){s=!0;for(let c=0,u=h.length;ci.score===e.score?i.idx{this._keysMap[t.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,k(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();k(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,s=this.size();t{let o=n.getFn?n.getFn(e):this.getFn(e,n.path);if(D(o)){if(K(o)){let a=[],l=[{nestedArrIndex:-1,value:o}];for(;l.length;){let{nestedArrIndex:h,value:c}=l.pop();if(D(c))if(k(c)&&!ce(c)){let u={v:c,i:h,n:this.norm.get(c)};a.push(u)}else K(c)&&c.forEach((u,d)=>{l.push({nestedArrIndex:d,value:u})})}s.$[r]=a}else if(k(o)&&!ce(o)){let a={v:o,n:this.norm.get(o)};s.$[r]=a}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}};function Ze(i,e,{getFn:t=m.getFn,fieldNormWeight:s=m.fieldNormWeight}={}){let n=new Q({getFn:t,fieldNormWeight:s});return n.setKeys(i.map(Qe)),n.setSources(e),n.create(),n}function ei(i,{getFn:e=m.getFn,fieldNormWeight:t=m.fieldNormWeight}={}){let{keys:s,records:n}=i,r=new Q({getFn:e,fieldNormWeight:t});return r.setKeys(s),r.setIndexRecords(n),r}function te(i,{errors:e=0,currentLocation:t=0,expectedLocation:s=0,distance:n=m.distance,ignoreLocation:r=m.ignoreLocation}={}){let o=e/i.length;if(r)return o;let a=Math.abs(s-t);return n?o+a/n:a?1:o}function ti(i=[],e=m.minMatchCharLength){let t=[],s=-1,n=-1,r=0;for(let o=i.length;r=e&&t.push([s,n]),s=-1)}return i[r-1]&&r-s>=e&&t.push([s,r-1]),t}var U=32;function ii(i,e,t,{location:s=m.location,distance:n=m.distance,threshold:r=m.threshold,findAllMatches:o=m.findAllMatches,minMatchCharLength:a=m.minMatchCharLength,includeMatches:l=m.includeMatches,ignoreLocation:h=m.ignoreLocation}={}){if(e.length>U)throw new Error(Ut(U));let c=e.length,u=i.length,d=Math.max(0,Math.min(s,u)),v=r,f=d,p=a>1||l,y=p?Array(u):[],_;for(;(_=i.indexOf(e,f))>-1;){let L=te(e,{currentLocation:_,expectedLocation:d,distance:n,ignoreLocation:h});if(v=Math.min(L,v),f=_+c,p){let N=0;for(;N=b;w-=1){let Z=w-1,Te=t[i.charAt(Z)];if(p&&(y[Z]=+!!Te),A[w]=(A[w+1]<<1|1)&Te,L&&(A[w]|=(I[w+1]|I[w])<<1|1|I[w+1]),A[w]&le&&(O=te(e,{errors:L,currentLocation:Z,expectedLocation:d,distance:n,ignoreLocation:h}),O<=v)){if(v=O,f=Z,f<=d)break;b=Math.max(1,2*d-f)}}if(te(e,{errors:L+1,currentLocation:d,expectedLocation:d,distance:n,ignoreLocation:h})>v)break;I=A}let W={isMatch:f>=0,score:Math.max(.001,O)};if(p){let L=ti(y,a);L.length?l&&(W.indices=L):W.isMatch=!1}return W}function si(i){let e={};for(let t=0,s=i.length;t{this.chunks.push({pattern:d,alphabet:si(d),startIndex:v})},u=this.pattern.length;if(u>U){let d=0,v=u%U,f=u-v;for(;d{let{isMatch:_,score:I,indices:O}=ii(e,f,p,{location:n+y,distance:r,threshold:o,findAllMatches:a,minMatchCharLength:l,includeMatches:s,ignoreLocation:h});_&&(d=!0),u+=I,_&&O&&(c=[...c,...O])});let v={isMatch:d,score:d?u/this.chunks.length:1};return d&&s&&(v.indices=c),v}},H=class{constructor(e){this.pattern=e}static isMultiMatch(e){return Ke(e,this.multiRegex)}static isSingleMatch(e){return Ke(e,this.singleRegex)}search(){}};function Ke(i,e){let t=i.match(e);return t?t[1]:null}var me=class extends H{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},ve=class extends H{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let s=e.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}},ge=class extends H{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},_e=class extends H{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},ye=class extends H{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},be=class extends H{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},se=class extends H{constructor(e,{location:t=m.location,threshold:s=m.threshold,distance:n=m.distance,includeMatches:r=m.includeMatches,findAllMatches:o=m.findAllMatches,minMatchCharLength:a=m.minMatchCharLength,isCaseSensitive:l=m.isCaseSensitive,ignoreLocation:h=m.ignoreLocation}={}){super(e),this._bitapSearch=new ie(e,{location:t,threshold:s,distance:n,includeMatches:r,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}},ne=class extends H{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t=0,s,n=[],r=this.pattern.length;for(;(s=e.indexOf(this.pattern,t))>-1;)t=s+r,n.push([s,t-1]);let o=!!n.length;return{isMatch:o,score:o?0:1,indices:n}}},Ee=[me,ne,ge,_e,be,ye,ve,se],Be=Ee.length,ni=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,ri="|";function oi(i,e={}){return i.split(ri).map(t=>{let s=t.trim().split(ni).filter(r=>r&&!!r.trim()),n=[];for(let r=0,o=s.length;r!!(i[re.AND]||i[re.OR]),ci=i=>!!i[we.PATH],hi=i=>!K(i)&&Ye(i)&&!Ae(i),$e=i=>({[re.AND]:Object.keys(i).map(e=>({[e]:i[e]}))});function et(i,e,{auto:t=!0}={}){let s=n=>{let r=Object.keys(n),o=ci(n);if(!o&&r.length>1&&!Ae(n))return s($e(n));if(hi(n)){let l=o?n[we.PATH]:r[0],h=o?n[we.PATTERN]:n[l];if(!k(h))throw new Error($t(l));let c={keyId:pe(l),pattern:h};return t&&(c.searcher=Ie(h,e)),c}let a={children:[],operator:r[0]};return r.forEach(l=>{let h=n[l];K(h)&&h.forEach(c=>{a.children.push(s(c))})}),a};return Ae(i)||(i=$e(i)),s(i)}function ui(i,{ignoreFieldNorm:e=m.ignoreFieldNorm}){i.forEach(t=>{let s=1;t.matches.forEach(({key:n,norm:r,score:o})=>{let a=n?n.weight:null;s*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:r))}),t.score=s})}function di(i,e){let t=i.matches;e.matches=[],D(t)&&t.forEach(s=>{if(!D(s.indices)||!s.indices.length)return;let{indices:n,value:r}=s,o={indices:n,value:r};s.key&&(o.key=s.key.src),s.idx>-1&&(o.refIndex=s.idx),e.matches.push(o)})}function fi(i,e){e.score=i.score}function pi(i,e,{includeMatches:t=m.includeMatches,includeScore:s=m.includeScore}={}){let n=[];return t&&n.push(di),s&&n.push(fi),i.map(r=>{let{idx:o}=r,a={item:e[o],refIndex:o};return n.length&&n.forEach(l=>{l(r,a)}),a})}var $=class{constructor(e,t={},s){this.options=q(q({},m),t),this.options.useExtendedSearch,this._keyStore=new fe(this.options.keys),this.setCollection(e,s)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Q))throw new Error(Bt);this._myIndex=t||Ze(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){D(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let t=[];for(let s=0,n=this._docs.length;s-1&&(l=l.slice(0,t)),pi(l,this._docs,{includeMatches:s,includeScore:n})}_searchStringList(e){let t=Ie(e,this.options),{records:s}=this._myIndex,n=[];return s.forEach(({v:r,i:o,n:a})=>{if(!D(r))return;let{isMatch:l,score:h,indices:c}=t.searchIn(r);l&&n.push({item:r,idx:o,matches:[{score:h,value:r,norm:a,indices:c}]})}),n}_searchLogical(e){let t=et(e,this.options),s=(a,l,h)=>{if(!a.children){let{keyId:u,searcher:d}=a,v=this._findMatches({key:this._keyStore.get(u),value:this._myIndex.getValueForItemAtKeyId(l,u),searcher:d});return v&&v.length?[{idx:h,item:l,matches:v}]:[]}let c=[];for(let u=0,d=a.children.length;u{if(D(a)){let h=s(t,a,l);h.length&&(r[l]||(r[l]={idx:l,item:a,matches:[]},o.push(r[l])),h.forEach(({matches:c})=>{r[l].matches.push(...c)}))}}),o}_searchObjectList(e){let t=Ie(e,this.options),{keys:s,records:n}=this._myIndex,r=[];return n.forEach(({$:o,i:a})=>{if(!D(o))return;let l=[];s.forEach((h,c)=>{l.push(...this._findMatches({key:h,value:o[c],searcher:t}))}),l.length&&r.push({idx:a,item:o,matches:l})}),r}_findMatches({key:e,value:t,searcher:s}){if(!D(t))return[];let n=[];if(K(t))t.forEach(({v:r,i:o,n:a})=>{if(!D(r))return;let{isMatch:l,score:h,indices:c}=s.searchIn(r);l&&n.push({score:h,key:e,value:r,idx:o,norm:a,indices:c})});else{let{v:r,n:o}=t,{isMatch:a,score:l,indices:h}=s.searchIn(r);a&&n.push({score:l,key:e,value:r,norm:o,indices:h})}return n}};$.version="7.0.0";$.createIndex=Ze;$.parseIndex=ei;$.config=m;$.parseQuery=et;li(Ce);var mi=function(){function i(e){this._haystack=[],this._fuseOptions=M(M({},e.fuseOptions),{keys:it([],e.searchFields,!0),includeMatches:!0})}return i.prototype.index=function(e){this._haystack=e,this._fuse&&this._fuse.setCollection(e)},i.prototype.reset=function(){this._haystack=[],this._fuse=void 0},i.prototype.isEmptyIndex=function(){return!this._haystack.length},i.prototype.search=function(e){this._fuse||(this._fuse=new $(this._haystack,this._fuseOptions));var t=this._fuse.search(e);return t.map(function(s,n){return{item:s.item,score:s.score||0,rank:n+1}})},i}();function vi(i){return new mi(i)}var gi=function(i){for(var e in i)if(Object.prototype.hasOwnProperty.call(i,e))return!1;return!0},he=function(i,e,t){var s=i.dataset,n=e.customProperties,r=e.labelClass,o=e.labelDescription;r&&(s.labelClass=ae(r).join(" ")),o&&(s.labelDescription=o),t&&n&&(typeof n=="string"?s.customProperties=n:typeof n=="object"&&!gi(n)&&(s.customProperties=JSON.stringify(n)))},Ue=function(i,e,t){var s=e&&i.querySelector("label[for='".concat(e,"']")),n=s&&s.innerText;n&&t.setAttribute("aria-label",n)},_i={containerOuter:function(i,e,t,s,n,r,o){var a=i.classNames.containerOuter,l=document.createElement("div");return g(l,a),l.dataset.type=r,e&&(l.dir=e),s&&(l.tabIndex=0),t&&(l.setAttribute("role",n?"combobox":"listbox"),n?l.setAttribute("aria-autocomplete","list"):o||Ue(this._docRoot,this.passedElement.element.id,l),l.setAttribute("aria-haspopup","true"),l.setAttribute("aria-expanded","false")),o&&l.setAttribute("aria-labelledby",o),l},containerInner:function(i){var e=i.classNames.containerInner,t=document.createElement("div");return g(t,e),t},itemList:function(i,e){var t=i.searchEnabled,s=i.classNames,n=s.list,r=s.listSingle,o=s.listItems,a=document.createElement("div");return g(a,n),g(a,e?r:o),this._isSelectElement&&t&&a.setAttribute("role","listbox"),a},placeholder:function(i,e){var t=i.allowHTML,s=i.classNames.placeholder,n=document.createElement("div");return g(n,s),V(n,t,e),n},item:function(i,e,t){var s=i.allowHTML,n=i.removeItemButtonAlignLeft,r=i.removeItemIconText,o=i.removeItemLabelText,a=i.classNames,l=a.item,h=a.button,c=a.highlightedState,u=a.itemSelectable,d=a.placeholder,v=G(e.value),f=document.createElement("div");if(g(f,l),e.labelClass){var p=document.createElement("span");V(p,s,e.label),g(p,e.labelClass),f.appendChild(p)}else V(f,s,e.label);if(f.dataset.item="",f.dataset.id=e.id,f.dataset.value=v,he(f,e,!0),(e.disabled||this.containerOuter.isDisabled)&&f.setAttribute("aria-disabled","true"),this._isSelectElement&&(f.setAttribute("aria-selected","true"),f.setAttribute("role","option")),e.placeholder&&(g(f,d),f.dataset.placeholder=""),g(f,e.highlighted?c:u),t){e.disabled&&R(f,u),f.dataset.deletable="";var y=document.createElement("button");y.type="button",g(y,h),V(y,!0,J(r,e.value));var _=J(o,e.value);_&&y.setAttribute("aria-label",_),y.dataset.button="",n?f.insertAdjacentElement("afterbegin",y):f.appendChild(y)}return f},choiceList:function(i,e){var t=i.classNames.list,s=document.createElement("div");return g(s,t),e||s.setAttribute("aria-multiselectable","true"),s.setAttribute("role","listbox"),s},choiceGroup:function(i,e){var t=i.allowHTML,s=i.classNames,n=s.group,r=s.groupHeading,o=s.itemDisabled,a=e.id,l=e.label,h=e.disabled,c=G(l),u=document.createElement("div");g(u,n),h&&g(u,o),u.setAttribute("role","group"),u.dataset.group="",u.dataset.id=a,u.dataset.value=c,h&&u.setAttribute("aria-disabled","true");var d=document.createElement("div");return g(d,r),V(d,t,l||""),u.appendChild(d),u},choice:function(i,e,t,s){var n=i.allowHTML,r=i.classNames,o=r.item,a=r.itemChoice,l=r.itemSelectable,h=r.selectedState,c=r.itemDisabled,u=r.description,d=r.placeholder,v=e.label,f=G(e.value),p=document.createElement("div");p.id=e.elementId,g(p,o),g(p,a),s&&typeof v=="string"&&(v=Oe(n,v),v+=" (".concat(s,")"),v={trusted:v});var y=p;if(e.labelClass){var _=document.createElement("span");V(_,n,v),g(_,e.labelClass),y=_,p.appendChild(_)}else V(p,n,v);if(e.labelDescription){var I="".concat(e.elementId,"-description");y.setAttribute("aria-describedby",I);var O=document.createElement("span");V(O,n,e.labelDescription),O.id=I,g(O,u),p.appendChild(O)}return e.selected&&g(p,h),e.placeholder&&g(p,d),p.setAttribute("role",e.group?"treeitem":"option"),p.dataset.choice="",p.dataset.id=e.id,p.dataset.value=f,t&&(p.dataset.selectText=t),e.group&&(p.dataset.groupId="".concat(e.group.id)),he(p,e,!1),e.disabled?(g(p,c),p.dataset.choiceDisabled="",p.setAttribute("aria-disabled","true")):(g(p,l),p.dataset.choiceSelectable=""),p},input:function(i,e){var t=i.classNames,s=t.input,n=t.inputCloned,r=i.labelId,o=document.createElement("input");return o.type="search",g(o,s),g(o,n),o.autocomplete="off",o.autocapitalize="off",o.spellcheck=!1,o.setAttribute("role","textbox"),o.setAttribute("aria-autocomplete","list"),e?o.setAttribute("aria-label",e):r||Ue(this._docRoot,this.passedElement.element.id,o),o},dropdown:function(i){var e=i.classNames,t=e.list,s=e.listDropdown,n=document.createElement("div");return g(n,t),g(n,s),n.setAttribute("aria-expanded","false"),n},notice:function(i,e,t){var s=i.classNames,n=s.item,r=s.itemChoice,o=s.addChoice,a=s.noResults,l=s.noChoices,h=s.notice;t===void 0&&(t=T.generic);var c=document.createElement("div");switch(V(c,!0,e),g(c,n),g(c,r),g(c,h),t){case T.addChoice:g(c,o);break;case T.noResults:g(c,a);break;case T.noChoices:g(c,l);break}return t===T.addChoice&&(c.dataset.choiceSelectable="",c.dataset.choice=""),c},option:function(i){var e=G(i.label),t=new Option(e,i.value,!1,i.selected);return he(t,i,!0),t.disabled=i.disabled,i.selected&&t.setAttribute("selected",""),t}},yi="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,bi={},ue=function(i){if(i)return i.dataset.id?parseInt(i.dataset.id,10):void 0},z="[data-choice-selectable]",tt=function(){function i(e,t){e===void 0&&(e="[data-choice]"),t===void 0&&(t={});var s=this;this.initialisedOK=void 0,this._hasNonChoicePlaceholder=!1,this._lastAddedChoiceId=0,this._lastAddedGroupId=0;var n=i.defaults;this.config=M(M(M({},n.allOptions),n.options),t),st.forEach(function(_){s.config[_]=M(M(M({},n.allOptions[_]),n.options[_]),t[_])});var r=this.config;r.silent||this._validateConfig();var o=r.shadowRoot||document.documentElement;this._docRoot=o;var a=typeof e=="string"?o.querySelector(e):e;if(!a||typeof a!="object"||!(wt(a)||Xe(a)))throw TypeError(!a&&typeof e=="string"?"Selector ".concat(e," failed to find an element"):"Expected one of the following types text|select-one|select-multiple");var l=a.type,h=l===B.Text;(h||r.maxItemCount!==1)&&(r.singleModeForMultiSelect=!1),r.singleModeForMultiSelect&&(l=B.SelectMultiple);var c=l===B.SelectOne,u=l===B.SelectMultiple,d=c||u;if(this._elementType=l,this._isTextElement=h,this._isSelectOneElement=c,this._isSelectMultipleElement=u,this._isSelectElement=c||u,this._canAddUserChoices=h&&r.addItems||d&&r.addChoices,typeof r.renderSelectedChoices!="boolean"&&(r.renderSelectedChoices=r.renderSelectedChoices==="always"||c),r.closeDropdownOnSelect==="auto"?r.closeDropdownOnSelect=h||c||r.singleModeForMultiSelect:r.closeDropdownOnSelect=Y(r.closeDropdownOnSelect),r.placeholder&&(r.placeholderValue?this._hasNonChoicePlaceholder=!0:a.dataset.placeholder&&(this._hasNonChoicePlaceholder=!0,r.placeholderValue=a.dataset.placeholder)),t.addItemFilter&&typeof t.addItemFilter!="function"){var v=t.addItemFilter instanceof RegExp?t.addItemFilter:new RegExp(t.addItemFilter);r.addItemFilter=v.test.bind(v)}if(this._isTextElement)this.passedElement=new It({element:a,classNames:r.classNames});else{var f=a;this.passedElement=new Tt({element:f,classNames:r.classNames,template:function(_){return s._templates.option(_)},extractPlaceholder:r.placeholder&&!this._hasNonChoicePlaceholder})}if(this.initialised=!1,this._store=new Nt(r),this._currentValue="",r.searchEnabled=!h&&r.searchEnabled||u,this._canSearch=r.searchEnabled,this._isScrollingOnIe=!1,this._highlightPosition=0,this._wasTap=!0,this._placeholderValue=this._generatePlaceholderValue(),this._baseId=ht(a,"choices-"),this._direction=a.dir,!this._direction){var p=window.getComputedStyle(a).direction,y=window.getComputedStyle(document.documentElement).direction;p!==y&&(this._direction=p)}if(this._idNames={itemChoice:"item-choice"},this._templates=n.templates,this._render=this._render.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onInput=this._onInput.bind(this),this._onClick=this._onClick.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onMouseDown=this._onMouseDown.bind(this),this._onMouseOver=this._onMouseOver.bind(this),this._onFormReset=this._onFormReset.bind(this),this._onSelectKey=this._onSelectKey.bind(this),this._onEnterKey=this._onEnterKey.bind(this),this._onEscapeKey=this._onEscapeKey.bind(this),this._onDirectionKey=this._onDirectionKey.bind(this),this._onDeleteKey=this._onDeleteKey.bind(this),this.passedElement.isActive){r.silent||console.warn("Trying to initialise Choices on element already initialised",{element:e}),this.initialised=!0,this.initialisedOK=!1;return}this.init(),this._initialItems=this._store.items.map(function(_){return _.value})}return Object.defineProperty(i,"defaults",{get:function(){return Object.preventExtensions({get options(){return bi},get allOptions(){return Fe},get templates(){return _i}})},enumerable:!1,configurable:!0}),i.prototype.init=function(){if(!(this.initialised||this.initialisedOK!==void 0)){this._searcher=vi(this.config),this._loadChoices(),this._createTemplates(),this._createElements(),this._createStructure(),this._isTextElement&&!this.config.addItems||this.passedElement.element.hasAttribute("disabled")||this.passedElement.element.closest("fieldset:disabled")?this.disable():(this.enable(),this._addEventListeners()),this._initStore(),this.initialised=!0,this.initialisedOK=!0;var e=this.config.callbackOnInit;typeof e=="function"&&e.call(this)}},i.prototype.destroy=function(){this.initialised&&(this._removeEventListeners(),this.passedElement.reveal(),this.containerOuter.unwrap(this.passedElement.element),this._store._listeners=[],this.clearStore(!1),this._stopSearch(),this._templates=i.defaults.templates,this.initialised=!1,this.initialisedOK=void 0)},i.prototype.enable=function(){return this.passedElement.isDisabled&&this.passedElement.enable(),this.containerOuter.isDisabled&&(this._addEventListeners(),this.input.enable(),this.containerOuter.enable()),this},i.prototype.disable=function(){return this.passedElement.isDisabled||this.passedElement.disable(),this.containerOuter.isDisabled||(this._removeEventListeners(),this.input.disable(),this.containerOuter.disable()),this},i.prototype.highlightItem=function(e,t){if(t===void 0&&(t=!0),!e||!e.id)return this;var s=this._store.items.find(function(n){return n.id===e.id});return!s||s.highlighted?this:(this._store.dispatch(ee(s,!0)),t&&this.passedElement.triggerEvent(x.highlightItem,this._getChoiceForOutput(s)),this)},i.prototype.unhighlightItem=function(e,t){if(t===void 0&&(t=!0),!e||!e.id)return this;var s=this._store.items.find(function(n){return n.id===e.id});return!s||!s.highlighted?this:(this._store.dispatch(ee(s,!1)),t&&this.passedElement.triggerEvent(x.unhighlightItem,this._getChoiceForOutput(s)),this)},i.prototype.highlightAll=function(){var e=this;return this._store.withTxn(function(){e._store.items.forEach(function(t){t.highlighted||(e._store.dispatch(ee(t,!0)),e.passedElement.triggerEvent(x.highlightItem,e._getChoiceForOutput(t)))})}),this},i.prototype.unhighlightAll=function(){var e=this;return this._store.withTxn(function(){e._store.items.forEach(function(t){t.highlighted&&(e._store.dispatch(ee(t,!1)),e.passedElement.triggerEvent(x.highlightItem,e._getChoiceForOutput(t)))})}),this},i.prototype.removeActiveItemsByValue=function(e){var t=this;return this._store.withTxn(function(){t._store.items.filter(function(s){return s.value===e}).forEach(function(s){return t._removeItem(s)})}),this},i.prototype.removeActiveItems=function(e){var t=this;return this._store.withTxn(function(){t._store.items.filter(function(s){var n=s.id;return n!==e}).forEach(function(s){return t._removeItem(s)})}),this},i.prototype.removeHighlightedItems=function(e){var t=this;return e===void 0&&(e=!1),this._store.withTxn(function(){t._store.highlightedActiveItems.forEach(function(s){t._removeItem(s),e&&t._triggerChange(s.value)})}),this},i.prototype.showDropdown=function(e){var t=this;return this.dropdown.isActive?this:(requestAnimationFrame(function(){t.dropdown.show();var s=t.dropdown.element.getBoundingClientRect();t.containerOuter.open(s.bottom,s.height),!e&&t._canSearch&&t.input.focus(),t.passedElement.triggerEvent(x.showDropdown)}),this)},i.prototype.hideDropdown=function(e){var t=this;return this.dropdown.isActive?(requestAnimationFrame(function(){t.dropdown.hide(),t.containerOuter.close(),!e&&t._canSearch&&(t.input.removeActiveDescendant(),t.input.blur()),t.passedElement.triggerEvent(x.hideDropdown)}),this):this},i.prototype.getValue=function(e){var t=this,s=this._store.items.map(function(n){return e?n.value:t._getChoiceForOutput(n)});return this._isSelectOneElement||this.config.singleModeForMultiSelect?s[0]:s},i.prototype.setValue=function(e){var t=this;return this.initialisedOK?(this._store.withTxn(function(){e.forEach(function(s){s&&t._addChoice(F(s,!1))})}),this._searcher.reset(),this):(this._warnChoicesInitFailed("setValue"),this)},i.prototype.setChoiceByValue=function(e){var t=this;return this.initialisedOK?this._isTextElement?this:(this._store.withTxn(function(){var s=Array.isArray(e)?e:[e];s.forEach(function(n){return t._findAndSelectChoiceByValue(n)}),t.unhighlightAll()}),this._searcher.reset(),this):(this._warnChoicesInitFailed("setChoiceByValue"),this)},i.prototype.setChoices=function(e,t,s,n,r){var o=this;if(e===void 0&&(e=[]),t===void 0&&(t="value"),s===void 0&&(s="label"),n===void 0&&(n=!1),r===void 0&&(r=!0),!this.initialisedOK)return this._warnChoicesInitFailed("setChoices"),this;if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if(typeof t!="string"||!t)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(n&&this.clearChoices(),typeof e=="function"){var a=e(this);if(typeof Promise=="function"&&a instanceof Promise)return new Promise(function(l){return requestAnimationFrame(l)}).then(function(){return o._handleLoadingState(!0)}).then(function(){return a}).then(function(l){return o.setChoices(l,t,s,n)}).catch(function(l){o.config.silent||console.error(l)}).then(function(){return o._handleLoadingState(!1)}).then(function(){return o});if(!Array.isArray(a))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: ".concat(typeof a));return this.setChoices(a,t,s,!1)}if(!Array.isArray(e))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._store.withTxn(function(){r&&(o._isSearching=!1);var l=t==="value",h=s==="label";e.forEach(function(c){if("choices"in c){var u=c;h||(u=M(M({},u),{label:u[s]})),o._addGroup(F(u,!0))}else{var d=c;(!h||!l)&&(d=M(M({},d),{value:d[t],label:d[s]})),o._addChoice(F(d,!1))}}),o.unhighlightAll()}),this._searcher.reset(),this},i.prototype.refresh=function(e,t,s){var n=this;return e===void 0&&(e=!1),t===void 0&&(t=!1),s===void 0&&(s=!1),this._isSelectElement?(this._store.withTxn(function(){var r=n.passedElement.optionsAsChoices(),o={};s||n._store.items.forEach(function(l){l.id&&l.active&&l.selected&&!l.disabled&&(o[l.value]=!0)}),n.clearStore(!1);var a=function(l){s?n._store.dispatch(xe(l)):o[l.value]&&(l.selected=!0)};r.forEach(function(l){if("choices"in l){l.choices.forEach(a);return}a(l)}),n._addPredefinedChoices(r,t,e),n._isSearching&&n._searchChoices(n.input.value)}),this):(this.config.silent||console.warn("refresh method can only be used on choices backed by a element"),this)},i.prototype.removeChoice=function(e){var t=this._store.choices.find(function(s){return s.value===e});return t?(this._clearNotice(),this._store.dispatch(xe(t)),this._searcher.reset(),t.selected&&this.passedElement.triggerEvent(N.removeItem,this._getChoiceForOutput(t)),this):this},i.prototype.clearChoices=function(){var e=this;return this._store.withTxn(function(){e._store.choices.forEach(function(t){t.selected||e._store.dispatch(xe(t))})}),this._searcher.reset(),this},i.prototype.clearStore=function(e){return e===void 0&&(e=!0),this._stopSearch(),e&&this.passedElement.element.replaceChildren(""),this.itemList.element.replaceChildren(""),this.choiceList.element.replaceChildren(""),this._clearNotice(),this._store.reset(),this._lastAddedChoiceId=0,this._lastAddedGroupId=0,this._searcher.reset(),this},i.prototype.clearInput=function(){var e=!this._isSelectOneElement;return this.input.clear(e),this._stopSearch(),this},i.prototype._validateConfig=function(){var e=this.config,t=yt(e,Re);t.length&&console.warn("Unknown config option(s) passed",t.join(", ")),e.allowHTML&&e.allowHtmlUserInput&&(e.addItems&&console.warn("Warning: allowHTML/allowHtmlUserInput/addItems all being true is strongly not recommended and may lead to XSS attacks"),e.addChoices&&console.warn("Warning: allowHTML/allowHtmlUserInput/addChoices all being true is strongly not recommended and may lead to XSS attacks"))},i.prototype._render=function(e){e===void 0&&(e={choices:!0,groups:!0,items:!0}),!this._store.inTxn()&&(this._isSelectElement&&(e.choices||e.groups)&&this._renderChoices(),e.items&&this._renderItems())},i.prototype._renderChoices=function(){var e=this;if(this._canAddItems()){var t=this,s=t.config,n=t._isSearching,r=this._store,o=r.activeGroups,a=r.activeChoices,l=0;if(n&&s.searchResultLimit>0?l=s.searchResultLimit:s.renderChoiceLimit>0&&(l=s.renderChoiceLimit),this._isSelectElement){var h=a.filter(function(f){return!f.element});h.length&&this.passedElement.addOptions(h)}var c=document.createDocumentFragment(),u=function(f){return f.filter(function(p){return!p.placeholder&&(n?!!p.rank:s.renderSelectedChoices||!p.selected)})},d=!1,v=function(f,p,y){n?f.sort(_t):s.shouldSort&&f.sort(s.sorter);var g=f.length;g=!p&&l&&g>l?l:g,g--,f.every(function(I,O){var j=I.choiceEl||e._templates.choice(s,I,s.itemSelectText,y);return I.choiceEl=j,c.appendChild(j),!I.disabled&&(n||!I.selected)&&(d=!0),O1){var c=s.querySelector(X(n.classNames.placeholder));c&&c.remove()}else h||(l=!0,a(R({selected:!0,value:"",label:n.placeholderValue||"",placeholder:!0},!1)))}l&&(s.append(r),n.shouldSortItems&&!this._isSelectOneElement&&(t.sort(n.sorter),t.forEach(function(u){var d=o(u);d&&(d.remove(),r.append(d))}),s.append(r))),this._isTextElement&&(this.passedElement.value=t.map(function(u){var d=u.value;return d}).join(n.delimiter))},i.prototype._displayNotice=function(e,t,s){s===void 0&&(s=!0);var n=this._notice;if(n&&(n.type===t&&n.text===e||n.type===L.addChoice&&(t===L.noResults||t===L.noChoices))){s&&this.showDropdown(!0);return}this._clearNotice(),this._notice=e?{text:e,type:t}:void 0,this._renderNotice(),s&&e&&this.showDropdown(!0)},i.prototype._clearNotice=function(){if(this._notice){var e=this.choiceList.element.querySelector(X(this.config.classNames.notice));e&&e.remove(),this._notice=void 0}},i.prototype._renderNotice=function(e){var t=this._notice;if(t){var s=this._templates.notice(this.config,t.text,t.type);e?e.append(s):this.choiceList.prepend(s)}},i.prototype._getChoiceForOutput=function(e,t){return{id:e.id,highlighted:e.highlighted,labelClass:e.labelClass,labelDescription:e.labelDescription,customProperties:e.customProperties,disabled:e.disabled,active:e.active,label:e.label,placeholder:e.placeholder,value:e.value,groupValue:e.group?e.group.label:void 0,element:e.element,keyCode:t}},i.prototype._triggerChange=function(e){e!=null&&this.passedElement.triggerEvent(N.change,{value:e})},i.prototype._handleButtonAction=function(e){var t=this,s=this._store.items;if(!(!s.length||!this.config.removeItems||!this.config.removeItemButton)){var n=e&&de(e.parentElement),r=n&&s.find(function(o){return o.id===n});r&&this._store.withTxn(function(){if(t._removeItem(r),t._triggerChange(r.value),t._isSelectOneElement&&!t._hasNonChoicePlaceholder){var o=t._store.choices.reverse().find(function(a){return!a.disabled&&a.placeholder});o&&(t._addItem(o),t.unhighlightAll(),o.value&&t._triggerChange(o.value))}})}},i.prototype._handleItemAction=function(e,t){var s=this;t===void 0&&(t=!1);var n=this._store.items;if(!(!n.length||!this.config.removeItems||this._isSelectOneElement)){var r=de(e);r&&(n.forEach(function(o){o.id===r&&!o.highlighted?s.highlightItem(o):!t&&o.highlighted&&s.unhighlightItem(o)}),this.input.focus())}},i.prototype._handleChoiceAction=function(e){var t=this,s=de(e),n=s&&this._store.getChoiceById(s);if(!n||n.disabled)return!1;var r=this.dropdown.isActive;if(!n.selected){if(!this._canAddItems())return!0;this._store.withTxn(function(){t._addItem(n,!0,!0),t.clearInput(),t.unhighlightAll()}),this._triggerChange(n.value)}return r&&this.config.closeDropdownOnSelect&&(this.hideDropdown(!0),this.containerOuter.element.focus()),!0},i.prototype._handleBackspace=function(e){var t=this.config;if(!(!t.removeItems||!e.length)){var s=e[e.length-1],n=e.some(function(r){return r.highlighted});t.editItems&&!n&&s?(this.input.value=s.value,this.input.setWidth(),this._removeItem(s),this._triggerChange(s.value)):(n||this.highlightItem(s,!1),this.removeHighlightedItems(!0))}},i.prototype._loadChoices=function(){var e,t=this,s=this.config;if(this._isTextElement){if(this._presetChoices=s.items.map(function(o){return R(o,!1)}),this.passedElement.value){var n=this.passedElement.value.split(s.delimiter).map(function(o){return R(o,!1,t.config.allowHtmlUserInput)});this._presetChoices=this._presetChoices.concat(n)}this._presetChoices.forEach(function(o){o.selected=!0})}else if(this._isSelectElement){this._presetChoices=s.choices.map(function(o){return R(o,!0)});var r=this.passedElement.optionsAsChoices();r&&(e=this._presetChoices).push.apply(e,r)}},i.prototype._handleLoadingState=function(e){e===void 0&&(e=!0);var t=this.itemList.element;e?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?t.replaceChildren(this._templates.placeholder(this.config,this.config.loadingText)):this.input.placeholder=this.config.loadingText):(this.enable(),this.containerOuter.removeLoadingState(),this._isSelectOneElement?(t.replaceChildren(""),this._render()):this.input.placeholder=this._placeholderValue||"")},i.prototype._handleSearch=function(e){if(this.input.isFocussed)if(e!==null&&typeof e<"u"&&e.length>=this.config.searchFloor){var t=this.config.searchChoices?this._searchChoices(e):0;t!==null&&this.passedElement.triggerEvent(N.search,{value:e,resultCount:t})}else this._store.choices.some(function(s){return!s.active})&&this._stopSearch()},i.prototype._canAddItems=function(){var e=this.config,t=e.maxItemCount,s=e.maxItemText;return!e.singleModeForMultiSelect&&t>0&&t<=this._store.items.length?(this.choiceList.element.replaceChildren(""),this._notice=void 0,this._displayNotice(typeof s=="function"?s(t):s,L.addChoice),!1):!0},i.prototype._canCreateItem=function(e){var t=this.config,s=!0,n="";if(s&&typeof t.addItemFilter=="function"&&!t.addItemFilter(e)&&(s=!1,n=Q(t.customAddItemText,e)),s){var r=this._store.choices.find(function(o){return t.valueComparer(o.value,e)});if(this._isSelectElement){if(r)return this._displayNotice("",L.addChoice),!1}else this._isTextElement&&!t.duplicateItemsAllowed&&r&&(s=!1,n=Q(t.uniqueItemText,e))}return s&&(n=Q(t.addItemText,e)),n&&this._displayNotice(n,L.addChoice),s},i.prototype._searchChoices=function(e){var t=e.trim().replace(/\s{2,}/," ");if(!t.length||t===this._currentValue)return null;var s=this._searcher;s.isEmptyIndex()&&s.index(this._store.searchableChoices);var n=s.search(t);this._currentValue=t,this._highlightPosition=0,this._isSearching=!0;var r=this._notice,o=r&&r.type;return o!==L.addChoice&&(n.length?this._clearNotice():this._displayNotice(Me(this.config.noResultsText),L.noResults)),this._store.dispatch(ot(n)),n.length},i.prototype._stopSearch=function(){this._isSearching&&(this._currentValue="",this._isSearching=!1,this._clearNotice(),this._store.dispatch(at(!0)),this.passedElement.triggerEvent(N.search,{value:"",resultCount:0}))},i.prototype._addEventListeners=function(){var e=this._docRoot,t=this.containerOuter.element,s=this.input.element;e.addEventListener("touchend",this._onTouchEnd,!0),t.addEventListener("keydown",this._onKeyDown,!0),t.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("click",this._onClick,{passive:!0}),e.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(t.addEventListener("focus",this._onFocus,{passive:!0}),t.addEventListener("blur",this._onBlur,{passive:!0})),s.addEventListener("keyup",this._onKeyUp,{passive:!0}),s.addEventListener("input",this._onInput,{passive:!0}),s.addEventListener("focus",this._onFocus,{passive:!0}),s.addEventListener("blur",this._onBlur,{passive:!0}),s.form&&s.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},i.prototype._removeEventListeners=function(){var e=this._docRoot,t=this.containerOuter.element,s=this.input.element;e.removeEventListener("touchend",this._onTouchEnd,!0),t.removeEventListener("keydown",this._onKeyDown,!0),t.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("click",this._onClick),e.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(t.removeEventListener("focus",this._onFocus),t.removeEventListener("blur",this._onBlur)),s.removeEventListener("keyup",this._onKeyUp),s.removeEventListener("input",this._onInput),s.removeEventListener("focus",this._onFocus),s.removeEventListener("blur",this._onBlur),s.form&&s.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},i.prototype._onKeyDown=function(e){var t=e.keyCode,s=this.dropdown.isActive,n=e.key.length===1||e.key.length===2&&e.key.charCodeAt(0)>=55296||e.key==="Unidentified";switch(!this._isTextElement&&!s&&t!==T.ESC_KEY&&t!==T.TAB_KEY&&t!==T.SHIFT_KEY&&(this.showDropdown(),!this.input.isFocussed&&n&&(this.input.value+=e.key,e.key===" "&&e.preventDefault())),t){case T.A_KEY:return this._onSelectKey(e,this.itemList.element.hasChildNodes());case T.ENTER_KEY:return this._onEnterKey(e,s);case T.ESC_KEY:return this._onEscapeKey(e,s);case T.UP_KEY:case T.PAGE_UP_KEY:case T.DOWN_KEY:case T.PAGE_DOWN_KEY:return this._onDirectionKey(e,s);case T.DELETE_KEY:case T.BACK_KEY:return this._onDeleteKey(e,this._store.items,this.input.isFocussed)}},i.prototype._onKeyUp=function(){this._canSearch=this.config.searchEnabled},i.prototype._onInput=function(){var e=this.input.value;if(!e){this._isTextElement?this.hideDropdown(!0):this._stopSearch();return}this._canAddItems()&&(this._canSearch&&this._handleSearch(e),this._canAddUserChoices&&(this._canCreateItem(e),this._isSelectElement&&(this._highlightPosition=0,this._highlightChoice())))},i.prototype._onSelectKey=function(e,t){if((e.ctrlKey||e.metaKey)&&t){this._canSearch=!1;var s=this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement;s&&this.highlightAll()}},i.prototype._onEnterKey=function(e,t){var s=this,n=this.input.value,r=e.target;if(e.preventDefault(),r&&r.hasAttribute("data-button")){this._handleButtonAction(r);return}if(!t){(this._isSelectElement||this._notice)&&this.showDropdown();return}var o=this.dropdown.element.querySelector(X(this.config.classNames.highlightedState));if(!(o&&this._handleChoiceAction(o))){if(!r||!n){this.hideDropdown(!0);return}if(this._canAddItems()){var a=!1;this._store.withTxn(function(){if(a=s._findAndSelectChoiceByValue(n,!0),!a){if(!s._canAddUserChoices||!s._canCreateItem(n))return;s._addChoice(R(n,!1,s.config.allowHtmlUserInput),!0,!0),a=!0}s.clearInput(),s.unhighlightAll()}),a&&(this._triggerChange(n),this.config.closeDropdownOnSelect&&this.hideDropdown(!0))}}},i.prototype._onEscapeKey=function(e,t){t&&(e.stopPropagation(),this.hideDropdown(!0),this._stopSearch(),this.containerOuter.element.focus())},i.prototype._onDirectionKey=function(e,t){var s=e.keyCode;if(t||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var n=s===T.DOWN_KEY||s===T.PAGE_DOWN_KEY?1:-1,r=e.metaKey||s===T.PAGE_DOWN_KEY||s===T.PAGE_UP_KEY,o=void 0;if(r)n>0?o=this.dropdown.element.querySelector("".concat(z,":last-of-type")):o=this.dropdown.element.querySelector(z);else{var a=this.dropdown.element.querySelector(X(this.config.classNames.highlightedState));a?o=dt(a,z,n):o=this.dropdown.element.querySelector(z)}o&&(ft(o,this.choiceList.element,n)||this.choiceList.scrollToChildElement(o,n),this._highlightChoice(o)),e.preventDefault()}},i.prototype._onDeleteKey=function(e,t,s){!this._isSelectOneElement&&!e.target.value&&s&&(this._handleBackspace(t),e.preventDefault())},i.prototype._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},i.prototype._onTouchEnd=function(e){var t=(e||e.touches[0]).target,s=this._wasTap&&this.containerOuter.element.contains(t);if(s){var n=t===this.containerOuter.element||t===this.containerInner.element;n&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),e.stopPropagation()}this._wasTap=!0},i.prototype._onMouseDown=function(e){var t=e.target;if(t instanceof HTMLElement){if(bi&&this.choiceList.element.contains(t)){var s=this.choiceList.element.firstElementChild;this._isScrollingOnIe=this._direction==="ltr"?e.offsetX>=s.offsetWidth:e.offsetXthis._highlightPosition?s=t[this._highlightPosition]:s=t[t.length-1],s||(s=t[0])),_(s,n),s.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(N.highlightChoice,{el:s}),this.dropdown.isActive&&(this.input.setActiveDescendant(s.id),this.containerOuter.setActiveDescendant(s.id))}},i.prototype._addItem=function(e,t,s){if(t===void 0&&(t=!0),s===void 0&&(s=!1),!e.id)throw new TypeError("item.id must be set before _addItem is called for a choice/item");(this.config.singleModeForMultiSelect||this._isSelectOneElement)&&this.removeActiveItems(e.id),this._store.dispatch(ct(e)),t&&(this.passedElement.triggerEvent(N.addItem,this._getChoiceForOutput(e)),s&&this.passedElement.triggerEvent(N.choice,this._getChoiceForOutput(e)))},i.prototype._removeItem=function(e){if(e.id){this._store.dispatch(Ne(e));var t=this._notice;t&&t.type===L.noChoices&&this._clearNotice(),this.passedElement.triggerEvent(N.removeItem,this._getChoiceForOutput(e))}},i.prototype._addChoice=function(e,t,s){if(t===void 0&&(t=!0),s===void 0&&(s=!1),e.id)throw new TypeError("Can not re-add a choice which has already been added");var n=this.config;if(!((this._isSelectElement||!n.duplicateItemsAllowed)&&this._store.choices.find(function(a){return n.valueComparer(a.value,e.value)}))){this._lastAddedChoiceId++,e.id=this._lastAddedChoiceId,e.elementId="".concat(this._baseId,"-").concat(this._idNames.itemChoice,"-").concat(e.id);var r=n.prependValue,o=n.appendValue;r&&(e.value=r+e.value),o&&(e.value+=o.toString()),(r||o)&&e.element&&(e.element.value=e.value),this._clearNotice(),this._store.dispatch(rt(e)),e.selected&&this._addItem(e,t,s)}},i.prototype._addGroup=function(e,t){var s=this;if(t===void 0&&(t=!0),e.id)throw new TypeError("Can not re-add a group which has already been added");this._store.dispatch(lt(e)),e.choices&&(this._lastAddedGroupId++,e.id=this._lastAddedGroupId,e.choices.forEach(function(n){n.group=e,e.disabled&&(n.disabled=!0),s._addChoice(n,t)}))},i.prototype._createTemplates=function(){var e=this,t=this.config.callbackOnCreateTemplates,s={};typeof t=="function"&&(s=t.call(this,pt,Te,le));var n={};Object.keys(this._templates).forEach(function(r){r in s?n[r]=s[r].bind(e):n[r]=e._templates[r].bind(e)}),this._templates=n},i.prototype._createElements=function(){var e=this._templates,t=this,s=t.config,n=t._isSelectOneElement,r=s.position,o=s.classNames,a=this._elementType;this.containerOuter=new Pe({element:e.containerOuter(s,this._direction,this._isSelectElement,n,s.searchEnabled,a,s.labelId),classNames:o,type:a,position:r}),this.containerInner=new Pe({element:e.containerInner(s),classNames:o,type:a,position:r}),this.input=new St({element:e.input(s,this._placeholderValue),classNames:o,type:a,preventPaste:!s.paste}),this.choiceList=new Fe({element:e.choiceList(s,n)}),this.itemList=new Fe({element:e.itemList(s,n)}),this.dropdown=new Ct({element:e.dropdown(s),classNames:o,type:a})},i.prototype._createStructure=function(){var e=this,t=e.containerInner,s=e.containerOuter,n=e.passedElement,r=this.dropdown.element;n.conceal(),t.wrap(n.element),s.wrap(t.element),this._isSelectOneElement?this.input.placeholder=this.config.searchPlaceholderValue||"":(this._placeholderValue&&(this.input.placeholder=this._placeholderValue),this.input.setWidth()),s.element.appendChild(t.element),s.element.appendChild(r),t.element.appendChild(this.itemList.element),r.appendChild(this.choiceList.element),this._isSelectOneElement?this.config.searchEnabled&&r.insertBefore(this.input.element,r.firstChild):t.element.appendChild(this.input.element),this._highlightPosition=0,this._isSearching=!1},i.prototype._initStore=function(){var e=this;this._store.subscribe(this._render).withTxn(function(){e._addPredefinedChoices(e._presetChoices,e._isSelectOneElement&&!e._hasNonChoicePlaceholder,!1)}),(!this._store.choices.length||this._isSelectOneElement&&this._hasNonChoicePlaceholder)&&this._render()},i.prototype._addPredefinedChoices=function(e,t,s){var n=this;if(t===void 0&&(t=!1),s===void 0&&(s=!0),t){var r=e.findIndex(function(o){return o.selected})===-1;r&&e.some(function(o){return o.disabled||"choices"in o?!1:(o.selected=!0,!0)})}e.forEach(function(o){"choices"in o?n._isSelectElement&&n._addGroup(o,s):n._addChoice(o,s)})},i.prototype._findAndSelectChoiceByValue=function(e,t){var s=this;t===void 0&&(t=!1);var n=this._store.choices.find(function(r){return s.config.valueComparer(r.value,e)});return n&&!n.disabled&&!n.selected?(this._addItem(n,!0,t),!0):!1},i.prototype._generatePlaceholderValue=function(){var e=this.config;if(!e.placeholder)return null;if(this._hasNonChoicePlaceholder)return e.placeholderValue;if(this._isSelectElement){var t=this.passedElement.placeholderOption;return t?t.text:null}return null},i.prototype._warnChoicesInitFailed=function(e){if(!this.config.silent)if(this.initialised){if(!this.initialisedOK)throw new TypeError("".concat(e," called for an element which has multiple instances of Choices initialised on it"))}else throw new TypeError("".concat(e," called on a non-initialised instance of Choices"))},i.version="11.0.3",i}();function Ci({canSelectPlaceholder:i,isHtmlAllowed:e,getOptionLabelUsing:t,getOptionLabelsUsing:s,getOptionsUsing:n,getSearchResultsUsing:r,isAutofocused:o,isMultiple:a,isSearchable:l,hasDynamicOptions:h,hasDynamicSearchResults:c,livewireId:u,loadingMessage:d,maxItems:v,maxItemsMessage:f,noSearchResultsMessage:p,options:y,optionsLimit:g,placeholder:I,position:O,searchDebounce:j,searchingMessage:ce,searchPrompt:Y,searchableOptionFields:x,state:P,statePath:F}){return{select:null,selectedOptions:[],isStateBeingUpdated:!1,isEmpty:!0,state:P,init:async function(){this.select=new it(this.$refs.input,{allowHTML:e,duplicateItemsAllowed:!1,itemSelectText:"",loadingText:d,maxItemCount:v??-1,maxItemText:b=>window.pluralize(f,b,{count:b}),noChoicesText:Y,noResultsText:p,placeholderValue:I,position:O??"auto",removeItemButton:i,renderChoiceLimit:g,searchEnabled:l,searchFields:x??["label"],searchPlaceholderValue:Y,searchResultLimit:g,shouldSort:!1,searchFloor:c?0:1}),await this.refreshChoices({withInitialOptions:!0}),[null,void 0,""].includes(this.state)||this.select.setChoiceByValue(this.formatState(this.state)),this.refreshPlaceholder(),o&&this.select.showDropdown(),this.$refs.input.addEventListener("change",()=>{this.refreshPlaceholder(),!this.isStateBeingUpdated&&(this.isStateBeingUpdated=!0,this.state=this.select.getValue(!0)??null,this.$nextTick(()=>this.isStateBeingUpdated=!1))}),h&&this.$refs.input.addEventListener("showDropdown",async()=>{this.select._displayNotice(d),await this.refreshChoices()}),c&&(this.$refs.input.addEventListener("search",b=>{if(!this.select._isSearching)return;let E=b.detail.value?.trim();this.select._displayNotice([null,void 0,""].includes(E)?d:ce)}),this.$refs.input.addEventListener("search",Alpine.debounce(async b=>{if(!this.select._isSearching)return;let E=b.detail.value?.trim();await this.refreshChoices({search:E})},j))),a||window.addEventListener("filament-forms::select.refreshSelectedOptionLabel",async b=>{b.detail.livewireId===u&&b.detail.statePath===F&&await this.refreshChoices({withInitialOptions:!1})}),this.$watch("state",async()=>{this.select&&(this.refreshPlaceholder(),!this.isStateBeingUpdated&&await this.refreshChoices({withInitialOptions:!h}))})},destroy:function(){this.select.destroy(),this.select=null},refreshChoices:async function(b={}){let E=await this.getChoices(b);this.select&&(this.isEmpty||this.select._clearNotice(),this.select.clearStore(),this.refreshPlaceholder(),this.setChoices(E),[null,void 0,""].includes(this.state)||this.select.setChoiceByValue(this.formatState(this.state)),this.isEmpty&&![null,void 0,""].includes(b.search)&&this.select._displayNotice(p))},setChoices:function(b){this.select.setChoices(b,"value","label",!0)},getChoices:async function(b={}){let E=await this.getExistingOptions(b);return this.isEmpty=E.length===0,E.concat(await this.getMissingOptions(E))},getExistingOptions:async function({search:b,withInitialOptions:E}){if(E)return y;let A=[];return[null,void 0,""].includes(b)?A=await n():A=await r(b),A.map(S=>S.choices?(S.choices=S.choices.map(w=>(w.selected=Array.isArray(this.state)?this.state.includes(w.value):this.state===w.value,w)),S):(S.selected=Array.isArray(this.state)?this.state.includes(S.value):this.state===S.value,S))},refreshPlaceholder:function(){a||(this.select._renderItems(),[null,void 0,""].includes(this.state)&&(this.$el.querySelector(".choices__list--single").innerHTML=`
${I??""}
`))},formatState:function(b){return a?(b??[]).map(E=>E?.toString()):b?.toString()},getMissingOptions:async function(b){let E=this.formatState(this.state);if([null,void 0,"",[],{}].includes(E))return[];let A=new Set;return b.forEach(S=>{if(S.choices){S.choices.forEach(w=>A.add(w.value));return}A.add(S.value)}),a?E.every(S=>A.has(S))?[]:(await s()).filter(S=>!A.has(S.value)).map(S=>(S.selected=!0,S)):A.has(E)?A:[{label:await t(),value:E,selected:!0}]}}}export{Ci as default}; /*! Bundled license information: choices.js/public/assets/scripts/choices.mjs: - (*! choices.js v11.0.2 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme *) + (*! choices.js v11.0.3 | © 2024 Josh Johnson | https://github.com/jshjohnson/Choices#readme *) */ diff --git a/packages/panels/dist/fonts/inter/index.css b/packages/panels/dist/fonts/inter/index.css index 4ab42f34495..c95f20c6234 100644 --- a/packages/panels/dist/fonts/inter/index.css +++ b/packages/panels/dist/fonts/inter/index.css @@ -1 +1 @@ -@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-cyrillic-ext-wght-normal-ASVAGXXE.woff2) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-cyrillic-wght-normal-EWLSKVKN.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-greek-ext-wght-normal-7GGTF7EK.woff2) format("woff2-variations");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-greek-wght-normal-N43DBLU2.woff2) format("woff2-variations");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-vietnamese-wght-normal-CE5GGD3W.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-latin-ext-wght-normal-5SRY4DMZ.woff2) format("woff2-variations");unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-latin-wght-normal-O25CN4JL.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} +@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-cyrillic-ext-wght-normal-ASVAGXXE.woff2) format("woff2-variations");unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-cyrillic-wght-normal-EWLSKVKN.woff2) format("woff2-variations");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-greek-ext-wght-normal-7GGTF7EK.woff2) format("woff2-variations");unicode-range:U+1F00-1FFF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-greek-wght-normal-N43DBLU2.woff2) format("woff2-variations");unicode-range:U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-vietnamese-wght-normal-CE5GGD3W.woff2) format("woff2-variations");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-latin-ext-wght-normal-5SRY4DMZ.woff2) format("woff2-variations");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-latin-wght-normal-O25CN4JL.woff2) format("woff2-variations");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} diff --git a/packages/support/dist/index.js b/packages/support/dist/index.js index cd8568137b1..6eedb13da8f 100644 --- a/packages/support/dist/index.js +++ b/packages/support/dist/index.js @@ -1,28 +1,28 @@ -(()=>{var Yo=Object.create;var Ti=Object.defineProperty;var Xo=Object.getOwnPropertyDescriptor;var qo=Object.getOwnPropertyNames;var Go=Object.getPrototypeOf,Ko=Object.prototype.hasOwnProperty;var Kr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Jo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of qo(t))!Ko.call(e,i)&&i!==r&&Ti(e,i,{get:()=>t[i],enumerable:!(n=Xo(t,i))||n.enumerable});return e};var Qo=(e,t,r)=>(r=e!=null?Yo(Go(e)):{},Jo(t||!e||!e.__esModule?Ti(r,"default",{value:e,enumerable:!0}):r,e));var uo=Kr(()=>{});var po=Kr(()=>{});var ho=Kr((Bs,yr)=>{(function(){"use strict";var e="input is invalid type",t="finalize already called",r=typeof window=="object",n=r?window:{};n.JS_MD5_NO_WINDOW&&(r=!1);var i=!r&&typeof self=="object",o=!n.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?n=global:i&&(n=self);var a=!n.JS_MD5_NO_COMMON_JS&&typeof yr=="object"&&yr.exports,d=typeof define=="function"&&define.amd,c=!n.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),y=[128,32768,8388608,-2147483648],m=[0,8,16,24],E=["hex","array","digest","buffer","arrayBuffer","base64"],O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),S=[],T;if(c){var I=new ArrayBuffer(68);T=new Uint8Array(I),S=new Uint32Array(I)}var $=Array.isArray;(n.JS_MD5_NO_NODE_JS||!$)&&($=function(l){return Object.prototype.toString.call(l)==="[object Array]"});var A=ArrayBuffer.isView;c&&(n.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!A)&&(A=function(l){return typeof l=="object"&&l.buffer&&l.buffer.constructor===ArrayBuffer});var k=function(l){var h=typeof l;if(h==="string")return[l,!0];if(h!=="object"||l===null)throw new Error(e);if(c&&l.constructor===ArrayBuffer)return[new Uint8Array(l),!1];if(!$(l)&&!A(l))throw new Error(e);return[l,!1]},Y=function(l){return function(h){return new X(!0).update(h)[l]()}},ne=function(){var l=Y("hex");o&&(l=J(l)),l.create=function(){return new X},l.update=function(p){return l.create().update(p)};for(var h=0;h>>6,ze[M++]=128|p&63):p<55296||p>=57344?(ze[M++]=224|p>>>12,ze[M++]=128|p>>>6&63,ze[M++]=128|p&63):(p=65536+((p&1023)<<10|l.charCodeAt(++j)&1023),ze[M++]=240|p>>>18,ze[M++]=128|p>>>12&63,ze[M++]=128|p>>>6&63,ze[M++]=128|p&63);else for(M=this.start;j>>2]|=p<>>2]|=(192|p>>>6)<>>2]|=(128|p&63)<=57344?(Z[M>>>2]|=(224|p>>>12)<>>2]|=(128|p>>>6&63)<>>2]|=(128|p&63)<>>2]|=(240|p>>>18)<>>2]|=(128|p>>>12&63)<>>2]|=(128|p>>>6&63)<>>2]|=(128|p&63)<>>2]|=l[j]<=64?(this.start=M-64,this.hash(),this.hashed=!0):this.start=M}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},X.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var l=this.blocks,h=this.lastByteIndex;l[h>>>2]|=y[h&3],h>=56&&(this.hashed||this.hash(),l[0]=l[16],l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),l[14]=this.bytes<<3,l[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},X.prototype.hash=function(){var l,h,v,p,j,M,R=this.blocks;this.first?(l=R[0]-680876937,l=(l<<7|l>>>25)-271733879<<0,p=(-1732584194^l&2004318071)+R[1]-117830708,p=(p<<12|p>>>20)+l<<0,v=(-271733879^p&(l^-271733879))+R[2]-1126478375,v=(v<<17|v>>>15)+p<<0,h=(l^v&(p^l))+R[3]-1316259209,h=(h<<22|h>>>10)+v<<0):(l=this.h0,h=this.h1,v=this.h2,p=this.h3,l+=(p^h&(v^p))+R[0]-680876936,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[1]-389564586,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[2]+606105819,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[3]-1044525330,h=(h<<22|h>>>10)+v<<0),l+=(p^h&(v^p))+R[4]-176418897,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[5]+1200080426,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[6]-1473231341,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[7]-45705983,h=(h<<22|h>>>10)+v<<0,l+=(p^h&(v^p))+R[8]+1770035416,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[9]-1958414417,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[10]-42063,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[11]-1990404162,h=(h<<22|h>>>10)+v<<0,l+=(p^h&(v^p))+R[12]+1804603682,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[13]-40341101,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[14]-1502002290,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[15]+1236535329,h=(h<<22|h>>>10)+v<<0,l+=(v^p&(h^v))+R[1]-165796510,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[6]-1069501632,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[11]+643717713,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[0]-373897302,h=(h<<20|h>>>12)+v<<0,l+=(v^p&(h^v))+R[5]-701558691,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[10]+38016083,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[15]-660478335,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[4]-405537848,h=(h<<20|h>>>12)+v<<0,l+=(v^p&(h^v))+R[9]+568446438,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[14]-1019803690,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[3]-187363961,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[8]+1163531501,h=(h<<20|h>>>12)+v<<0,l+=(v^p&(h^v))+R[13]-1444681467,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[2]-51403784,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[7]+1735328473,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[12]-1926607734,h=(h<<20|h>>>12)+v<<0,j=h^v,l+=(j^p)+R[5]-378558,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[8]-2022574463,p=(p<<11|p>>>21)+l<<0,M=p^l,v+=(M^h)+R[11]+1839030562,v=(v<<16|v>>>16)+p<<0,h+=(M^v)+R[14]-35309556,h=(h<<23|h>>>9)+v<<0,j=h^v,l+=(j^p)+R[1]-1530992060,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[4]+1272893353,p=(p<<11|p>>>21)+l<<0,M=p^l,v+=(M^h)+R[7]-155497632,v=(v<<16|v>>>16)+p<<0,h+=(M^v)+R[10]-1094730640,h=(h<<23|h>>>9)+v<<0,j=h^v,l+=(j^p)+R[13]+681279174,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[0]-358537222,p=(p<<11|p>>>21)+l<<0,M=p^l,v+=(M^h)+R[3]-722521979,v=(v<<16|v>>>16)+p<<0,h+=(M^v)+R[6]+76029189,h=(h<<23|h>>>9)+v<<0,j=h^v,l+=(j^p)+R[9]-640364487,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[12]-421815835,p=(p<<11|p>>>21)+l<<0,M=p^l,v+=(M^h)+R[15]+530742520,v=(v<<16|v>>>16)+p<<0,h+=(M^v)+R[2]-995338651,h=(h<<23|h>>>9)+v<<0,l+=(v^(h|~p))+R[0]-198630844,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[7]+1126891415,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[14]-1416354905,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[5]-57434055,h=(h<<21|h>>>11)+v<<0,l+=(v^(h|~p))+R[12]+1700485571,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[3]-1894986606,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[10]-1051523,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[1]-2054922799,h=(h<<21|h>>>11)+v<<0,l+=(v^(h|~p))+R[8]+1873313359,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[15]-30611744,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[6]-1560198380,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[13]+1309151649,h=(h<<21|h>>>11)+v<<0,l+=(v^(h|~p))+R[4]-145523070,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[11]-1120210379,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[2]+718787259,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[9]-343485551,h=(h<<21|h>>>11)+v<<0,this.first?(this.h0=l+1732584193<<0,this.h1=h-271733879<<0,this.h2=v-1732584194<<0,this.h3=p+271733878<<0,this.first=!1):(this.h0=this.h0+l<<0,this.h1=this.h1+h<<0,this.h2=this.h2+v<<0,this.h3=this.h3+p<<0)},X.prototype.hex=function(){this.finalize();var l=this.h0,h=this.h1,v=this.h2,p=this.h3;return u[l>>>4&15]+u[l&15]+u[l>>>12&15]+u[l>>>8&15]+u[l>>>20&15]+u[l>>>16&15]+u[l>>>28&15]+u[l>>>24&15]+u[h>>>4&15]+u[h&15]+u[h>>>12&15]+u[h>>>8&15]+u[h>>>20&15]+u[h>>>16&15]+u[h>>>28&15]+u[h>>>24&15]+u[v>>>4&15]+u[v&15]+u[v>>>12&15]+u[v>>>8&15]+u[v>>>20&15]+u[v>>>16&15]+u[v>>>28&15]+u[v>>>24&15]+u[p>>>4&15]+u[p&15]+u[p>>>12&15]+u[p>>>8&15]+u[p>>>20&15]+u[p>>>16&15]+u[p>>>28&15]+u[p>>>24&15]},X.prototype.toString=X.prototype.hex,X.prototype.digest=function(){this.finalize();var l=this.h0,h=this.h1,v=this.h2,p=this.h3;return[l&255,l>>>8&255,l>>>16&255,l>>>24&255,h&255,h>>>8&255,h>>>16&255,h>>>24&255,v&255,v>>>8&255,v>>>16&255,v>>>24&255,p&255,p>>>8&255,p>>>16&255,p>>>24&255]},X.prototype.array=X.prototype.digest,X.prototype.arrayBuffer=function(){this.finalize();var l=new ArrayBuffer(16),h=new Uint32Array(l);return h[0]=this.h0,h[1]=this.h1,h[2]=this.h2,h[3]=this.h3,l},X.prototype.buffer=X.prototype.arrayBuffer,X.prototype.base64=function(){for(var l,h,v,p="",j=this.array(),M=0;M<15;)l=j[M++],h=j[M++],v=j[M++],p+=O[l>>>2]+O[(l<<4|h>>>4)&63]+O[(h<<2|v>>>6)&63]+O[v&63];return l=j[M],p+=O[l>>>2]+O[l<<4&63]+"==",p};function Q(l,h){var v,p=k(l);if(l=p[0],p[1]){var j=[],M=l.length,R=0,Z;for(v=0;v>>6,j[R++]=128|Z&63):Z<55296||Z>=57344?(j[R++]=224|Z>>>12,j[R++]=128|Z>>>6&63,j[R++]=128|Z&63):(Z=65536+((Z&1023)<<10|l.charCodeAt(++v)&1023),j[R++]=240|Z>>>18,j[R++]=128|Z>>>12&63,j[R++]=128|Z>>>6&63,j[R++]=128|Z&63);l=j}l.length>64&&(l=new X(!0).update(l).array());var ze=[],Rt=[];for(v=0;v<64;++v){var Ut=l[v]||0;ze[v]=92^Ut,Rt[v]=54^Ut}X.call(this,h),this.update(Rt),this.oKeyPad=ze,this.inner=!0,this.sharedMemory=h}Q.prototype=new X,Q.prototype.finalize=function(){if(X.prototype.finalize.call(this),this.inner){this.inner=!1;var l=this.array();X.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(l),X.prototype.finalize.call(this)}};var me=ne();me.md5=me,me.md5.hmac=de(),a?yr.exports=me:(n.md5=me,d&&define(function(){return me}))})()});var Hi=["top","right","bottom","left"],Pi=["start","end"],Mi=Hi.reduce((e,t)=>e.concat(t,t+"-"+Pi[0],t+"-"+Pi[1]),[]),Et=Math.min,tt=Math.max,hr=Math.round,pr=Math.floor,nn=e=>({x:e,y:e}),Zo={left:"right",right:"left",bottom:"top",top:"bottom"},ea={start:"end",end:"start"};function Jr(e,t,r){return tt(e,Et(t,r))}function jt(e,t){return typeof e=="function"?e(t):e}function pt(e){return e.split("-")[0]}function xt(e){return e.split("-")[1]}function $i(e){return e==="x"?"y":"x"}function Qr(e){return e==="y"?"height":"width"}function Pn(e){return["top","bottom"].includes(pt(e))?"y":"x"}function Zr(e){return $i(Pn(e))}function Wi(e,t,r){r===void 0&&(r=!1);let n=xt(e),i=Zr(e),o=Qr(i),a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=mr(a)),[a,mr(a)]}function ta(e){let t=mr(e);return[vr(e),t,vr(t)]}function vr(e){return e.replace(/start|end/g,t=>ea[t])}function na(e,t,r){let n=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?i:n:t?n:i;case"left":case"right":return t?o:a;default:return[]}}function ra(e,t,r,n){let i=xt(e),o=na(pt(e),r==="start",n);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(vr)))),o}function mr(e){return e.replace(/left|right|bottom|top/g,t=>Zo[t])}function ia(e){return{top:0,right:0,bottom:0,left:0,...e}}function ei(e){return typeof e!="number"?ia(e):{top:e,right:e,bottom:e,left:e}}function Cn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Ri(e,t,r){let{reference:n,floating:i}=e,o=Pn(t),a=Zr(t),d=Qr(a),c=pt(t),u=o==="y",y=n.x+n.width/2-i.width/2,m=n.y+n.height/2-i.height/2,E=n[d]/2-i[d]/2,O;switch(c){case"top":O={x:y,y:n.y-i.height};break;case"bottom":O={x:y,y:n.y+n.height};break;case"right":O={x:n.x+n.width,y:m};break;case"left":O={x:n.x-i.width,y:m};break;default:O={x:n.x,y:n.y}}switch(xt(t)){case"start":O[a]-=E*(r&&u?-1:1);break;case"end":O[a]+=E*(r&&u?-1:1);break}return O}var oa=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,d=o.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t)),u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:y,y:m}=Ri(u,n,c),E=n,O={},S=0;for(let T=0;T({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:i,rects:o,platform:a,elements:d,middlewareData:c}=t,{element:u,padding:y=0}=jt(e,t)||{};if(u==null)return{};let m=ei(y),E={x:r,y:n},O=Zr(i),S=Qr(O),T=await a.getDimensions(u),I=O==="y",$=I?"top":"left",A=I?"bottom":"right",k=I?"clientHeight":"clientWidth",Y=o.reference[S]+o.reference[O]-E[O]-o.floating[S],ne=E[O]-o.reference[O],J=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u)),V=J?J[k]:0;(!V||!await(a.isElement==null?void 0:a.isElement(J)))&&(V=d.floating[k]||o.floating[S]);let de=Y/2-ne/2,X=V/2-T[S]/2-1,Q=Et(m[$],X),me=Et(m[A],X),l=Q,h=V-T[S]-me,v=V/2-T[S]/2+de,p=Jr(l,v,h),j=!c.arrow&&xt(i)!=null&&v!==p&&o.reference[S]/2-(vxt(i)===e),...r.filter(i=>xt(i)!==e)]:r.filter(i=>pt(i)===i)).filter(i=>e?xt(i)===e||(t?vr(i)!==i:!1):!0)}var la=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,n,i;let{rects:o,middlewareData:a,placement:d,platform:c,elements:u}=t,{crossAxis:y=!1,alignment:m,allowedPlacements:E=Mi,autoAlignment:O=!0,...S}=jt(e,t),T=m!==void 0||E===Mi?sa(m||null,O,E):E,I=await _n(t,S),$=((r=a.autoPlacement)==null?void 0:r.index)||0,A=T[$];if(A==null)return{};let k=Wi(A,o,await(c.isRTL==null?void 0:c.isRTL(u.floating)));if(d!==A)return{reset:{placement:T[0]}};let Y=[I[pt(A)],I[k[0]],I[k[1]]],ne=[...((n=a.autoPlacement)==null?void 0:n.overflows)||[],{placement:A,overflows:Y}],J=T[$+1];if(J)return{data:{index:$+1,overflows:ne},reset:{placement:J}};let V=ne.map(Q=>{let me=xt(Q.placement);return[Q.placement,me&&y?Q.overflows.slice(0,2).reduce((l,h)=>l+h,0):Q.overflows[0],Q.overflows]}).sort((Q,me)=>Q[1]-me[1]),X=((i=V.filter(Q=>Q[2].slice(0,xt(Q[0])?2:3).every(me=>me<=0))[0])==null?void 0:i[0])||V[0][0];return X!==d?{data:{index:$+1,overflows:ne},reset:{placement:X}}:{}}}},ca=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;let{placement:i,middlewareData:o,rects:a,initialPlacement:d,platform:c,elements:u}=t,{mainAxis:y=!0,crossAxis:m=!0,fallbackPlacements:E,fallbackStrategy:O="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:T=!0,...I}=jt(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};let $=pt(i),A=pt(d)===d,k=await(c.isRTL==null?void 0:c.isRTL(u.floating)),Y=E||(A||!T?[mr(d)]:ta(d));!E&&S!=="none"&&Y.push(...ra(d,T,S,k));let ne=[d,...Y],J=await _n(t,I),V=[],de=((n=o.flip)==null?void 0:n.overflows)||[];if(y&&V.push(J[$]),m){let l=Wi(i,a,k);V.push(J[l[0]],J[l[1]])}if(de=[...de,{placement:i,overflows:V}],!V.every(l=>l<=0)){var X,Q;let l=(((X=o.flip)==null?void 0:X.index)||0)+1,h=ne[l];if(h)return{data:{index:l,overflows:de},reset:{placement:h}};let v=(Q=de.filter(p=>p.overflows[0]<=0).sort((p,j)=>p.overflows[1]-j.overflows[1])[0])==null?void 0:Q.placement;if(!v)switch(O){case"bestFit":{var me;let p=(me=de.map(j=>[j.placement,j.overflows.filter(M=>M>0).reduce((M,R)=>M+R,0)]).sort((j,M)=>j[1]-M[1])[0])==null?void 0:me[0];p&&(v=p);break}case"initialPlacement":v=d;break}if(i!==v)return{reset:{placement:v}}}return{}}}};function Ii(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Fi(e){return Hi.some(t=>e[t]>=0)}var fa=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:n="referenceHidden",...i}=jt(e,t);switch(n){case"referenceHidden":{let o=await _n(t,{...i,elementContext:"reference"}),a=Ii(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Fi(a)}}}case"escaped":{let o=await _n(t,{...i,altBoundary:!0}),a=Ii(o,r.floating);return{data:{escapedOffsets:a,escaped:Fi(a)}}}default:return{}}}}};function Ui(e){let t=Et(...e.map(o=>o.left)),r=Et(...e.map(o=>o.top)),n=tt(...e.map(o=>o.right)),i=tt(...e.map(o=>o.bottom));return{x:t,y:r,width:n-t,height:i-r}}function ua(e){let t=e.slice().sort((i,o)=>i.y-o.y),r=[],n=null;for(let i=0;in.height/2?r.push([o]):r[r.length-1].push(o),n=o}return r.map(i=>Cn(Ui(i)))}var da=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){let{placement:r,elements:n,rects:i,platform:o,strategy:a}=t,{padding:d=2,x:c,y:u}=jt(e,t),y=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(n.reference))||[]),m=ua(y),E=Cn(Ui(y)),O=ei(d);function S(){if(m.length===2&&m[0].left>m[1].right&&c!=null&&u!=null)return m.find(I=>c>I.left-O.left&&cI.top-O.top&&u=2){if(Pn(r)==="y"){let Q=m[0],me=m[m.length-1],l=pt(r)==="top",h=Q.top,v=me.bottom,p=l?Q.left:me.left,j=l?Q.right:me.right,M=j-p,R=v-h;return{top:h,bottom:v,left:p,right:j,width:M,height:R,x:p,y:h}}let I=pt(r)==="left",$=tt(...m.map(Q=>Q.right)),A=Et(...m.map(Q=>Q.left)),k=m.filter(Q=>I?Q.left===A:Q.right===$),Y=k[0].top,ne=k[k.length-1].bottom,J=A,V=$,de=V-J,X=ne-Y;return{top:Y,bottom:ne,left:J,right:V,width:de,height:X,x:J,y:Y}}return E}let T=await o.getElementRects({reference:{getBoundingClientRect:S},floating:n.floating,strategy:a});return i.reference.x!==T.reference.x||i.reference.y!==T.reference.y||i.reference.width!==T.reference.width||i.reference.height!==T.reference.height?{reset:{rects:T}}:{}}}};async function pa(e,t){let{placement:r,platform:n,elements:i}=e,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),a=pt(r),d=xt(r),c=Pn(r)==="y",u=["left","top"].includes(a)?-1:1,y=o&&c?-1:1,m=jt(t,e),{mainAxis:E,crossAxis:O,alignmentAxis:S}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return d&&typeof S=="number"&&(O=d==="end"?S*-1:S),c?{x:O*y,y:E*u}:{x:E*u,y:O*y}}var Vi=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:i,y:o,placement:a,middlewareData:d}=t,c=await pa(t,e);return a===((r=d.offset)==null?void 0:r.placement)&&(n=d.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:a}}}}},ha=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:d={fn:I=>{let{x:$,y:A}=I;return{x:$,y:A}}},...c}=jt(e,t),u={x:r,y:n},y=await _n(t,c),m=Pn(pt(i)),E=$i(m),O=u[E],S=u[m];if(o){let I=E==="y"?"top":"left",$=E==="y"?"bottom":"right",A=O+y[I],k=O-y[$];O=Jr(A,O,k)}if(a){let I=m==="y"?"top":"left",$=m==="y"?"bottom":"right",A=S+y[I],k=S-y[$];S=Jr(A,S,k)}let T=d.fn({...t,[E]:O,[m]:S});return{...T,data:{x:T.x-r,y:T.y-n}}}}},va=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){let{placement:r,rects:n,platform:i,elements:o}=t,{apply:a=()=>{},...d}=jt(e,t),c=await _n(t,d),u=pt(r),y=xt(r),m=Pn(r)==="y",{width:E,height:O}=n.floating,S,T;u==="top"||u==="bottom"?(S=u,T=y===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(T=u,S=y==="end"?"top":"bottom");let I=O-c[S],$=E-c[T],A=!t.middlewareData.shift,k=I,Y=$;if(m){let J=E-c.left-c.right;Y=y||A?Et($,J):J}else{let J=O-c.top-c.bottom;k=y||A?Et(I,J):J}if(A&&!y){let J=tt(c.left,0),V=tt(c.right,0),de=tt(c.top,0),X=tt(c.bottom,0);m?Y=E-2*(J!==0||V!==0?J+V:tt(c.left,c.right)):k=O-2*(de!==0||X!==0?de+X:tt(c.top,c.bottom))}await a({...t,availableWidth:Y,availableHeight:k});let ne=await i.getDimensions(o.floating);return E!==ne.width||O!==ne.height?{reset:{rects:!0}}:{}}}};function rn(e){return zi(e)?(e.nodeName||"").toLowerCase():"#document"}function ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bt(e){var t;return(t=(zi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zi(e){return e instanceof Node||e instanceof ct(e).Node}function kt(e){return e instanceof Element||e instanceof ct(e).Element}function Tt(e){return e instanceof HTMLElement||e instanceof ct(e).HTMLElement}function Li(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ct(e).ShadowRoot}function zn(e){let{overflow:t,overflowX:r,overflowY:n,display:i}=ht(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function ma(e){return["table","td","th"].includes(rn(e))}function ti(e){let t=ni(),r=ht(e);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function ga(e){let t=Tn(e);for(;Tt(t)&&!gr(t);){if(ti(t))return t;t=Tn(t)}return null}function ni(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function gr(e){return["html","body","#document"].includes(rn(e))}function ht(e){return ct(e).getComputedStyle(e)}function br(e){return kt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Tn(e){if(rn(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Li(e)&&e.host||Bt(e);return Li(t)?t.host:t}function Yi(e){let t=Tn(e);return gr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tt(t)&&zn(t)?t:Yi(t)}function Vn(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);let i=Yi(e),o=i===((n=e.ownerDocument)==null?void 0:n.body),a=ct(i);return o?t.concat(a,a.visualViewport||[],zn(i)?i:[],a.frameElement&&r?Vn(a.frameElement):[]):t.concat(i,Vn(i,[],r))}function Xi(e){let t=ht(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=Tt(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,d=hr(r)!==o||hr(n)!==a;return d&&(r=o,n=a),{width:r,height:n,$:d}}function ri(e){return kt(e)?e:e.contextElement}function Dn(e){let t=ri(e);if(!Tt(t))return nn(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:o}=Xi(t),a=(o?hr(r.width):r.width)/n,d=(o?hr(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!d||!Number.isFinite(d))&&(d=1),{x:a,y:d}}var ba=nn(0);function qi(e){let t=ct(e);return!ni()||!t.visualViewport?ba:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ya(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==ct(e)?!1:t}function vn(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);let i=e.getBoundingClientRect(),o=ri(e),a=nn(1);t&&(n?kt(n)&&(a=Dn(n)):a=Dn(e));let d=ya(o,r,n)?qi(o):nn(0),c=(i.left+d.x)/a.x,u=(i.top+d.y)/a.y,y=i.width/a.x,m=i.height/a.y;if(o){let E=ct(o),O=n&&kt(n)?ct(n):n,S=E,T=S.frameElement;for(;T&&n&&O!==S;){let I=Dn(T),$=T.getBoundingClientRect(),A=ht(T),k=$.left+(T.clientLeft+parseFloat(A.paddingLeft))*I.x,Y=$.top+(T.clientTop+parseFloat(A.paddingTop))*I.y;c*=I.x,u*=I.y,y*=I.x,m*=I.y,c+=k,u+=Y,S=ct(T),T=S.frameElement}}return Cn({width:y,height:m,x:c,y:u})}var wa=[":popover-open",":modal"];function Gi(e){return wa.some(t=>{try{return e.matches(t)}catch{return!1}})}function xa(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,o=i==="fixed",a=Bt(n),d=t?Gi(t.floating):!1;if(n===a||d&&o)return r;let c={scrollLeft:0,scrollTop:0},u=nn(1),y=nn(0),m=Tt(n);if((m||!m&&!o)&&((rn(n)!=="body"||zn(a))&&(c=br(n)),Tt(n))){let E=vn(n);u=Dn(n),y.x=E.x+n.clientLeft,y.y=E.y+n.clientTop}return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+y.x,y:r.y*u.y-c.scrollTop*u.y+y.y}}function Ea(e){return Array.from(e.getClientRects())}function Ki(e){return vn(Bt(e)).left+br(e).scrollLeft}function Oa(e){let t=Bt(e),r=br(e),n=e.ownerDocument.body,i=tt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=tt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),a=-r.scrollLeft+Ki(e),d=-r.scrollTop;return ht(n).direction==="rtl"&&(a+=tt(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:a,y:d}}function Sa(e,t){let r=ct(e),n=Bt(e),i=r.visualViewport,o=n.clientWidth,a=n.clientHeight,d=0,c=0;if(i){o=i.width,a=i.height;let u=ni();(!u||u&&t==="fixed")&&(d=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:d,y:c}}function Aa(e,t){let r=vn(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=Tt(e)?Dn(e):nn(1),a=e.clientWidth*o.x,d=e.clientHeight*o.y,c=i*o.x,u=n*o.y;return{width:a,height:d,x:c,y:u}}function Ni(e,t,r){let n;if(t==="viewport")n=Sa(e,r);else if(t==="document")n=Oa(Bt(e));else if(kt(t))n=Aa(t,r);else{let i=qi(e);n={...t,x:t.x-i.x,y:t.y-i.y}}return Cn(n)}function Ji(e,t){let r=Tn(e);return r===t||!kt(r)||gr(r)?!1:ht(r).position==="fixed"||Ji(r,t)}function Da(e,t){let r=t.get(e);if(r)return r;let n=Vn(e,[],!1).filter(d=>kt(d)&&rn(d)!=="body"),i=null,o=ht(e).position==="fixed",a=o?Tn(e):e;for(;kt(a)&&!gr(a);){let d=ht(a),c=ti(a);!c&&d.position==="fixed"&&(i=null),(o?!c&&!i:!c&&d.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||zn(a)&&!c&&Ji(e,a))?n=n.filter(y=>y!==a):i=d,a=Tn(a)}return t.set(e,n),n}function Ca(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,a=[...r==="clippingAncestors"?Da(t,this._c):[].concat(r),n],d=a[0],c=a.reduce((u,y)=>{let m=Ni(t,y,i);return u.top=tt(m.top,u.top),u.right=Et(m.right,u.right),u.bottom=Et(m.bottom,u.bottom),u.left=tt(m.left,u.left),u},Ni(t,d,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _a(e){let{width:t,height:r}=Xi(e);return{width:t,height:r}}function Ta(e,t,r){let n=Tt(t),i=Bt(t),o=r==="fixed",a=vn(e,!0,o,t),d={scrollLeft:0,scrollTop:0},c=nn(0);if(n||!n&&!o)if((rn(t)!=="body"||zn(i))&&(d=br(t)),n){let m=vn(t,!0,o,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else i&&(c.x=Ki(i));let u=a.left+d.scrollLeft-c.x,y=a.top+d.scrollTop-c.y;return{x:u,y,width:a.width,height:a.height}}function ki(e,t){return!Tt(e)||ht(e).position==="fixed"?null:t?t(e):e.offsetParent}function Qi(e,t){let r=ct(e);if(!Tt(e)||Gi(e))return r;let n=ki(e,t);for(;n&&ma(n)&&ht(n).position==="static";)n=ki(n,t);return n&&(rn(n)==="html"||rn(n)==="body"&&ht(n).position==="static"&&!ti(n))?r:n||ga(e)||r}var Pa=async function(e){let t=this.getOffsetParent||Qi,r=this.getDimensions;return{reference:Ta(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await r(e.floating)}}};function Ma(e){return ht(e).direction==="rtl"}var Ra={convertOffsetParentRelativeRectToViewportRelativeRect:xa,getDocumentElement:Bt,getClippingRect:Ca,getOffsetParent:Qi,getElementRects:Pa,getClientRects:Ea,getDimensions:_a,getScale:Dn,isElement:kt,isRTL:Ma};function Ia(e,t){let r=null,n,i=Bt(e);function o(){var d;clearTimeout(n),(d=r)==null||d.disconnect(),r=null}function a(d,c){d===void 0&&(d=!1),c===void 0&&(c=1),o();let{left:u,top:y,width:m,height:E}=e.getBoundingClientRect();if(d||t(),!m||!E)return;let O=pr(y),S=pr(i.clientWidth-(u+m)),T=pr(i.clientHeight-(y+E)),I=pr(u),A={rootMargin:-O+"px "+-S+"px "+-T+"px "+-I+"px",threshold:tt(0,Et(1,c))||1},k=!0;function Y(ne){let J=ne[0].intersectionRatio;if(J!==c){if(!k)return a();J?a(!1,J):n=setTimeout(()=>{a(!1,1e-7)},100)}k=!1}try{r=new IntersectionObserver(Y,{...A,root:i.ownerDocument})}catch{r=new IntersectionObserver(Y,A)}r.observe(e)}return a(!0),o}function ji(e,t,r,n){n===void 0&&(n={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=ri(e),y=i||o?[...u?Vn(u):[],...Vn(t)]:[];y.forEach($=>{i&&$.addEventListener("scroll",r,{passive:!0}),o&&$.addEventListener("resize",r)});let m=u&&d?Ia(u,r):null,E=-1,O=null;a&&(O=new ResizeObserver($=>{let[A]=$;A&&A.target===u&&O&&(O.unobserve(t),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var k;(k=O)==null||k.observe(t)})),r()}),u&&!c&&O.observe(u),O.observe(t));let S,T=c?vn(e):null;c&&I();function I(){let $=vn(e);T&&($.x!==T.x||$.y!==T.y||$.width!==T.width||$.height!==T.height)&&r(),T=$,S=requestAnimationFrame(I)}return r(),()=>{var $;y.forEach(A=>{i&&A.removeEventListener("scroll",r),o&&A.removeEventListener("resize",r)}),m?.(),($=O)==null||$.disconnect(),O=null,c&&cancelAnimationFrame(S)}}var ii=la,Zi=ha,eo=ca,to=va,no=fa,ro=aa,io=da,Bi=(e,t,r)=>{let n=new Map,i={platform:Ra,...r},o={...i.platform,_c:n};return oa(e,t,{...i,platform:o})},Fa=e=>{let t={placement:"bottom",strategy:"absolute",middleware:[]},r=Object.keys(e),n=i=>e[i];return r.includes("offset")&&t.middleware.push(Vi(n("offset"))),r.includes("teleport")&&(t.strategy="fixed"),r.includes("placement")&&(t.placement=n("placement")),r.includes("autoPlacement")&&!r.includes("flip")&&t.middleware.push(ii(n("autoPlacement"))),r.includes("flip")&&t.middleware.push(eo(n("flip"))),r.includes("shift")&&t.middleware.push(Zi(n("shift"))),r.includes("inline")&&t.middleware.push(io(n("inline"))),r.includes("arrow")&&t.middleware.push(ro(n("arrow"))),r.includes("hide")&&t.middleware.push(no(n("hide"))),r.includes("size")&&t.middleware.push(to(n("size"))),t},La=(e,t)=>{let r={component:{trap:!1},float:{placement:"bottom",strategy:"absolute",middleware:[]}},n=i=>e[e.indexOf(i)+1];if(e.includes("trap")&&(r.component.trap=!0),e.includes("teleport")&&(r.float.strategy="fixed"),e.includes("offset")&&r.float.middleware.push(Vi(t.offset||10)),e.includes("placement")&&(r.float.placement=n("placement")),e.includes("autoPlacement")&&!e.includes("flip")&&r.float.middleware.push(ii(t.autoPlacement)),e.includes("flip")&&r.float.middleware.push(eo(t.flip)),e.includes("shift")&&r.float.middleware.push(Zi(t.shift)),e.includes("inline")&&r.float.middleware.push(io(t.inline)),e.includes("arrow")&&r.float.middleware.push(ro(t.arrow)),e.includes("hide")&&r.float.middleware.push(no(t.hide)),e.includes("size")){let i=t.size?.availableWidth??null,o=t.size?.availableHeight??null;i&&delete t.size.availableWidth,o&&delete t.size.availableHeight,r.float.middleware.push(to({...t.size,apply({availableWidth:a,availableHeight:d,elements:c}){Object.assign(c.floating.style,{maxWidth:`${i??a}px`,maxHeight:`${o??d}px`})}}))}return r},Na=e=>{var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split(""),r="";e||(e=Math.floor(Math.random()*t.length));for(var n=0;n{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}function ja(e){let t={dismissable:!0,trap:!1};function r(n,i=null){if(n){if(n.hasAttribute("aria-expanded")||n.setAttribute("aria-expanded",!1),i.hasAttribute("id"))n.setAttribute("aria-controls",i.getAttribute("id"));else{let o=`panel-${Na(8)}`;n.setAttribute("aria-controls",o),i.setAttribute("id",o)}i.setAttribute("aria-modal",!0),i.setAttribute("role","dialog")}}e.magic("float",n=>(i={},o={})=>{let a={...t,...o},d=Object.keys(i).length>0?Fa(i):{middleware:[ii()]},c=n,u=n.parentElement.closest("[x-data]"),y=u.querySelector('[x-ref="panel"]');r(c,y);function m(){return y.style.display=="block"}function E(){y.style.display="none",c.setAttribute("aria-expanded","false"),a.trap&&y.setAttribute("x-trap","false"),ji(n,y,T)}function O(){y.style.display="block",c.setAttribute("aria-expanded","true"),a.trap&&y.setAttribute("x-trap","true"),T()}function S(){m()?E():O()}async function T(){return await Bi(n,y,d).then(({middlewareData:I,placement:$,x:A,y:k})=>{if(I.arrow){let Y=I.arrow?.x,ne=I.arrow?.y,J=d.middleware.filter(de=>de.name=="arrow")[0].options.element,V={top:"bottom",right:"left",bottom:"top",left:"right"}[$.split("-")[0]];Object.assign(J.style,{left:Y!=null?`${Y}px`:"",top:ne!=null?`${ne}px`:"",right:"",bottom:"",[V]:"-4px"})}if(I.hide){let{referenceHidden:Y}=I.hide;Object.assign(y.style,{visibility:Y?"hidden":"visible"})}Object.assign(y.style,{left:`${A}px`,top:`${k}px`})})}a.dismissable&&(window.addEventListener("click",I=>{!u.contains(I.target)&&m()&&S()}),window.addEventListener("keydown",I=>{I.key==="Escape"&&m()&&S()},!0)),S()}),e.directive("float",(n,{modifiers:i,expression:o},{evaluate:a,effect:d})=>{let c=o?a(o):{},u=i.length>0?La(i,c):{},y=null;u.float.strategy=="fixed"&&(n.style.position="fixed");let m=V=>n.parentElement&&!n.parentElement.closest("[x-data]").contains(V.target)?n.close():null,E=V=>V.key==="Escape"?n.close():null,O=n.getAttribute("x-ref"),S=n.parentElement.closest("[x-data]"),T=S.querySelectorAll(`[\\@click^="$refs.${O}"]`),I=S.querySelectorAll(`[x-on\\:click^="$refs.${O}"]`);n.style.setProperty("display","none"),r([...T,...I][0],n),n._x_isShown=!1,n.trigger=null,n._x_doHide||(n._x_doHide=()=>{n.style.setProperty("display","none",i.includes("important")?"important":void 0)}),n._x_doShow||(n._x_doShow=()=>{n.style.setProperty("display","block",i.includes("important")?"important":void 0)});let $=()=>{n._x_doHide(),n._x_isShown=!1},A=()=>{n._x_doShow(),n._x_isShown=!0},k=()=>setTimeout(A),Y=ka(V=>V?A():$(),V=>{typeof n._x_toggleAndCascadeWithTransitions=="function"?n._x_toggleAndCascadeWithTransitions(n,V,A,$):V?k():$()}),ne,J=!0;d(()=>a(V=>{!J&&V===ne||(i.includes("immediate")&&(V?k():$()),Y(V),ne=V,J=!1)})),n.open=async function(V){n.trigger=V.currentTarget?V.currentTarget:V,Y(!0),n.trigger.setAttribute("aria-expanded","true"),u.component.trap&&n.setAttribute("x-trap","true"),y=ji(n.trigger,n,()=>{Bi(n.trigger,n,u.float).then(({middlewareData:de,placement:X,x:Q,y:me})=>{if(de.arrow){let l=de.arrow?.x,h=de.arrow?.y,v=u.float.middleware.filter(j=>j.name=="arrow")[0].options.element,p={top:"bottom",right:"left",bottom:"top",left:"right"}[X.split("-")[0]];Object.assign(v.style,{left:l!=null?`${l}px`:"",top:h!=null?`${h}px`:"",right:"",bottom:"",[p]:"-4px"})}if(de.hide){let{referenceHidden:l}=de.hide;Object.assign(n.style,{visibility:l?"hidden":"visible"})}Object.assign(n.style,{left:`${Q}px`,top:`${me}px`})})}),window.addEventListener("click",m),window.addEventListener("keydown",E,!0)},n.close=function(){if(!n._x_isShown)return!1;Y(!1),n.trigger.setAttribute("aria-expanded","false"),u.component.trap&&n.setAttribute("x-trap","false"),y(),window.removeEventListener("click",m),window.removeEventListener("keydown",E,!1)},n.toggle=function(V){n._x_isShown?n.close():n.open(V)}})}var oo=ja;function Ba(e){e.store("lazyLoadedAssets",{loaded:new Set,check(a){return Array.isArray(a)?a.every(d=>this.loaded.has(d)):this.loaded.has(a)},markLoaded(a){Array.isArray(a)?a.forEach(d=>this.loaded.add(d)):this.loaded.add(a)}});let t=a=>new CustomEvent(a,{bubbles:!0,composed:!0,cancelable:!0}),r=(a,d={},c,u)=>{let y=document.createElement(a);return Object.entries(d).forEach(([m,E])=>y[m]=E),c&&(u?c.insertBefore(y,u):c.appendChild(y)),y},n=(a,d,c={},u=null,y=null)=>{let m=a==="link"?`link[href="${d}"]`:`script[src="${d}"]`;if(document.querySelector(m)||e.store("lazyLoadedAssets").check(d))return Promise.resolve();let E=a==="link"?{...c,href:d}:{...c,src:d},O=r(a,E,u,y);return new Promise((S,T)=>{O.onload=()=>{e.store("lazyLoadedAssets").markLoaded(d),S()},O.onerror=()=>{T(new Error(`Failed to load ${a}: ${d}`))}})},i=async(a,d,c=null,u=null)=>{let y={type:"text/css",rel:"stylesheet"};d&&(y.media=d);let m=document.head,E=null;if(c&&u){let O=document.querySelector(`link[href*="${u}"]`);O?(m=O.parentElement,E=c==="before"?O:O.nextSibling):(console.warn(`Target (${u}) not found for ${a}. Appending to head.`),m=document.head,E=null)}await n("link",a,y,m,E)},o=async(a,d,c=null,u=null,y=null)=>{let m=document.head,E=null;if(c&&u){let S=document.querySelector(`script[src*="${u}"]`);S?(m=S.parentElement,E=c==="before"?S:S.nextSibling):(console.warn(`Target (${u}) not found for ${a}. Falling back to head or body.`),m=document.head,E=null)}else(d.has("body-start")||d.has("body-end"))&&(m=document.body,d.has("body-start")&&(E=document.body.firstChild));let O={};y&&(O.type="module"),await n("script",a,O,m,E)};e.directive("load-css",(a,{expression:d},{evaluate:c})=>{let u=c(d),y=a.media,m=a.getAttribute("data-dispatch"),E=a.getAttribute("data-css-before")?"before":a.getAttribute("data-css-after")?"after":null,O=a.getAttribute("data-css-before")||a.getAttribute("data-css-after")||null;Promise.all(u.map(S=>i(S,y,E,O))).then(()=>{m&&window.dispatchEvent(t(`${m}-css`))}).catch(console.error)}),e.directive("load-js",(a,{expression:d,modifiers:c},{evaluate:u})=>{let y=u(d),m=new Set(c),E=a.getAttribute("data-js-before")?"before":a.getAttribute("data-js-after")?"after":null,O=a.getAttribute("data-js-before")||a.getAttribute("data-js-after")||null,S=a.getAttribute("data-js-as-module")||a.getAttribute("data-as-module")||!1,T=a.getAttribute("data-dispatch");Promise.all(y.map(I=>o(I,m,E,O,S))).then(()=>{T&&window.dispatchEvent(t(`${T}-js`))}).catch(console.error)})}var ao=Ba;function Ha(){return!0}function $a({component:e,argument:t}){return new Promise(r=>{if(t)window.addEventListener(t,()=>r(),{once:!0});else{let n=i=>{i.detail.id===e.id&&(window.removeEventListener("async-alpine:load",n),r())};window.addEventListener("async-alpine:load",n)}})}function Wa(){return new Promise(e=>{"requestIdleCallback"in window?window.requestIdleCallback(e):setTimeout(e,200)})}function Ua({argument:e}){return new Promise(t=>{if(!e)return console.log("Async Alpine: media strategy requires a media query. Treating as 'eager'"),t();let r=window.matchMedia(`(${e})`);r.matches?t():r.addEventListener("change",t,{once:!0})})}function Va({component:e,argument:t}){return new Promise(r=>{let n=t||"0px 0px 0px 0px",i=new IntersectionObserver(o=>{o[0].isIntersecting&&(i.disconnect(),r())},{rootMargin:n});i.observe(e.el)})}var so={eager:Ha,event:$a,idle:Wa,media:Ua,visible:Va};async function za(e){let t=Ya(e.strategy);await oi(e,t)}async function oi(e,t){if(t.type==="expression"){if(t.operator==="&&")return Promise.all(t.parameters.map(r=>oi(e,r)));if(t.operator==="||")return Promise.any(t.parameters.map(r=>oi(e,r)))}return so[t.method]?so[t.method]({component:e,argument:t.argument}):!1}function Ya(e){let t=Xa(e),r=co(t);return r.type==="method"?{type:"expression",operator:"&&",parameters:[r]}:r}function Xa(e){let t=/\s*([()])\s*|\s*(\|\||&&|\|)\s*|\s*((?:[^()&|]+\([^()]+\))|[^()&|]+)\s*/g,r=[],n;for(;(n=t.exec(e))!==null;){let[i,o,a,d]=n;if(o!==void 0)r.push({type:"parenthesis",value:o});else if(a!==void 0)r.push({type:"operator",value:a==="|"?"&&":a});else{let c={type:"method",method:d.trim()};d.includes("(")&&(c.method=d.substring(0,d.indexOf("(")).trim(),c.argument=d.substring(d.indexOf("(")+1,d.indexOf(")"))),d.method==="immediate"&&(d.method="eager"),r.push(c)}}return r}function co(e){let t=lo(e);for(;e.length>0&&(e[0].value==="&&"||e[0].value==="|"||e[0].value==="||");){let r=e.shift().value,n=lo(e);t.type==="expression"&&t.operator===r?t.parameters.push(n):t={type:"expression",operator:r,parameters:[t,n]}}return t}function lo(e){if(e[0].value==="("){e.shift();let t=co(e);return e[0].value===")"&&e.shift(),t}else return e.shift()}function fo(e){let t="load",r=e.prefixed("load-src"),n=e.prefixed("ignore"),i={defaultStrategy:"eager",keepRelativeURLs:!1},o=!1,a={},d=0;function c(){return d++}e.asyncOptions=A=>{i={...i,...A}},e.asyncData=(A,k=!1)=>{a[A]={loaded:!1,download:k}},e.asyncUrl=(A,k)=>{!A||!k||a[A]||(a[A]={loaded:!1,download:()=>import($(k))})},e.asyncAlias=A=>{o=A};let u=A=>{e.skipDuringClone(()=>{A._x_async||(A._x_async="init",A._x_ignore=!0,A.setAttribute(n,""))})()},y=async A=>{e.skipDuringClone(async()=>{if(A._x_async!=="init")return;A._x_async="await";let{name:k,strategy:Y}=m(A);await za({name:k,strategy:Y,el:A,id:A.id||c()}),await E(k),S(A),A._x_async="loaded"})()};y.inline=u,e.directive(t,y).before("ignore");function m(A){let k=I(A.getAttribute(e.prefixed("data"))),Y=A.getAttribute(e.prefixed(t))||i.defaultStrategy,ne=A.getAttribute(r);return ne&&e.asyncUrl(k,ne),{name:k,strategy:Y}}async function E(A){if(A.startsWith("_x_async_")||(T(A),!a[A]||a[A].loaded))return;let k=await O(A);e.data(A,k),a[A].loaded=!0}async function O(A){if(!a[A])return;let k=await a[A].download(A);return typeof k=="function"?k:k[A]||k.default||Object.values(k)[0]||!1}function S(A){e.destroyTree(A),A._x_ignore=!1,A.removeAttribute(n),!A.closest(`[${n}]`)&&e.initTree(A)}function T(A){if(!(!o||a[A])){if(typeof o=="function"){e.asyncData(A,o);return}e.asyncUrl(A,o.replaceAll("[name]",A))}}function I(A){return(A||"").split(/[({]/g)[0]||`_x_async_${c()}`}function $(A){return i.keepRelativeURLs||new RegExp("^(?:[a-z+]+:)?//","i").test(A)?A:new URL(A,document.baseURI).href}}var zo=Qo(ho(),1);function vo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mt(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function Ka(e,t){if(e==null)return{};var r=Ga(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ja="1.15.6";function Ht(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Wt=Ht(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),er=Ht(/Edge/i),mo=Ht(/firefox/i),Gn=Ht(/safari/i)&&!Ht(/chrome/i)&&!Ht(/android/i),yi=Ht(/iP(ad|od|hone)/i),So=Ht(/chrome/i)&&Ht(/android/i),Ao={capture:!1,passive:!1};function Oe(e,t,r){e.addEventListener(t,r,!Wt&&Ao)}function Ee(e,t,r){e.removeEventListener(t,r,!Wt&&Ao)}function Tr(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Do(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function St(e,t,r,n){if(e){r=r||document;do{if(t!=null&&(t[0]===">"?e.parentNode===r&&Tr(e,t):Tr(e,t))||n&&e===r)return e;if(e===r)break}while(e=Do(e))}return null}var go=/\s+/g;function ft(e,t,r){if(e&&t)if(e.classList)e.classList[r?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(go," ").replace(" "+t+" "," ");e.className=(n+(r?" "+t:"")).replace(go," ")}}function ae(e,t,r){var n=e&&e.style;if(n){if(r===void 0)return document.defaultView&&document.defaultView.getComputedStyle?r=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(r=e.currentStyle),t===void 0?r:r[t];!(t in n)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),n[t]=r+(typeof r=="string"?"":"px")}}function Ln(e,t){var r="";if(typeof e=="string")r=e;else do{var n=ae(e,"transform");n&&n!=="none"&&(r=n+" "+r)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(r)}function Co(e,t,r){if(e){var n=e.getElementsByTagName(t),i=0,o=n.length;if(r)for(;i=o:a=i<=o,!a)return n;if(n===Pt())break;n=sn(n,!1)}return!1}function Nn(e,t,r,n){for(var i=0,o=0,a=e.children;o2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,o=Ka(n,os);tr.pluginEvent.bind(se)(t,r,Mt({dragEl:N,parentEl:Ve,ghostEl:ue,rootEl:ke,nextEl:bn,lastDownEl:Ar,cloneEl:We,cloneHidden:an,dragStarted:Yn,putSortable:Qe,activeSortable:se.active,originalEvent:i,oldIndex:Fn,oldDraggableIndex:Jn,newIndex:ut,newDraggableIndex:on,hideGhostForTarget:Lo,unhideGhostForTarget:No,cloneNowHidden:function(){an=!0},cloneNowShown:function(){an=!1},dispatchSortableEvent:function(d){it({sortable:r,name:d,originalEvent:i})}},o))};function it(e){is(Mt({putSortable:Qe,cloneEl:We,targetEl:N,rootEl:ke,oldIndex:Fn,oldDraggableIndex:Jn,newIndex:ut,newDraggableIndex:on},e))}var N,Ve,ue,ke,bn,Ar,We,an,Fn,ut,Jn,on,wr,Qe,In=!1,Pr=!1,Mr=[],mn,Ot,li,ci,wo,xo,Yn,Rn,Qn,Zn=!1,xr=!1,Dr,nt,fi=[],vi=!1,Rr=[],Fr=typeof document<"u",Er=yi,Eo=er||Wt?"cssFloat":"float",as=Fr&&!So&&!yi&&"draggable"in document.createElement("div"),Ro=function(){if(Fr){if(Wt)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),Io=function(t,r){var n=ae(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Nn(t,0,r),a=Nn(t,1,r),d=o&&ae(o),c=a&&ae(a),u=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+qe(o).width,y=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+qe(a).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&d.float&&d.float!=="none"){var m=d.float==="left"?"left":"right";return a&&(c.clear==="both"||c.clear===m)?"vertical":"horizontal"}return o&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||u>=i&&n[Eo]==="none"||a&&n[Eo]==="none"&&u+y>i)?"vertical":"horizontal"},ss=function(t,r,n){var i=n?t.left:t.top,o=n?t.right:t.bottom,a=n?t.width:t.height,d=n?r.left:r.top,c=n?r.right:r.bottom,u=n?r.width:r.height;return i===d||o===c||i+a/2===d+u/2},ls=function(t,r){var n;return Mr.some(function(i){var o=i[st].options.emptyInsertThreshold;if(!(!o||wi(i))){var a=qe(i),d=t>=a.left-o&&t<=a.right+o,c=r>=a.top-o&&r<=a.bottom+o;if(d&&c)return n=i}}),n},Fo=function(t){function r(o,a){return function(d,c,u,y){var m=d.options.group.name&&c.options.group.name&&d.options.group.name===c.options.group.name;if(o==null&&(a||m))return!0;if(o==null||o===!1)return!1;if(a&&o==="clone")return o;if(typeof o=="function")return r(o(d,c,u,y),a)(d,c,u,y);var E=(a?d:c).options.group.name;return o===!0||typeof o=="string"&&o===E||o.join&&o.indexOf(E)>-1}}var n={},i=t.group;(!i||Sr(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=r(i.pull,!0),n.checkPut=r(i.put),n.revertClone=i.revertClone,t.group=n},Lo=function(){!Ro&&ue&&ae(ue,"display","none")},No=function(){!Ro&&ue&&ae(ue,"display","")};Fr&&!So&&document.addEventListener("click",function(e){if(Pr)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Pr=!1,!1},!0);var gn=function(t){if(N){t=t.touches?t.touches[0]:t;var r=ls(t.clientX,t.clientY);if(r){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.target=n.rootEl=r,n.preventDefault=void 0,n.stopPropagation=void 0,r[st]._onDragOver(n)}}},cs=function(t){N&&N.parentNode[st]._isOutsideThisEl(t.target)};function se(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=$t({},t),e[st]=this;var r={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Io(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,d){a.setData("Text",d.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:se.supportPointer!==!1&&"PointerEvent"in window&&(!Gn||yi),emptyInsertThreshold:5};tr.initializePlugins(this,e,r);for(var n in r)!(n in t)&&(t[n]=r[n]);Fo(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:as,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Oe(e,"pointerdown",this._onTapStart):(Oe(e,"mousedown",this._onTapStart),Oe(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Oe(e,"dragover",this),Oe(e,"dragenter",this)),Mr.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),$t(this,ts())}se.prototype={constructor:se,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Rn=null)},_getDirection:function(t,r){return typeof this.options.direction=="function"?this.options.direction.call(this,t,r,N):this.options.direction},_onTapStart:function(t){if(t.cancelable){var r=this,n=this.el,i=this.options,o=i.preventOnFilter,a=t.type,d=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,c=(d||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||c,y=i.filter;if(gs(n),!N&&!(/mousedown|pointerdown/.test(a)&&t.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Gn&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=St(c,i.draggable,n,!1),!(c&&c.animated)&&Ar!==c)){if(Fn=vt(c),Jn=vt(c,i.draggable),typeof y=="function"){if(y.call(this,t,c,this)){it({sortable:r,rootEl:u,name:"filter",targetEl:c,toEl:n,fromEl:n}),at("filter",r,{evt:t}),o&&t.preventDefault();return}}else if(y&&(y=y.split(",").some(function(m){if(m=St(u,m.trim(),n,!1),m)return it({sortable:r,rootEl:m,name:"filter",targetEl:c,fromEl:n,toEl:n}),at("filter",r,{evt:t}),!0}),y)){o&&t.preventDefault();return}i.handle&&!St(u,i.handle,n,!1)||this._prepareDragStart(t,d,c)}}},_prepareDragStart:function(t,r,n){var i=this,o=i.el,a=i.options,d=o.ownerDocument,c;if(n&&!N&&n.parentNode===o){var u=qe(n);if(ke=o,N=n,Ve=N.parentNode,bn=N.nextSibling,Ar=n,wr=a.group,se.dragged=N,mn={target:N,clientX:(r||t).clientX,clientY:(r||t).clientY},wo=mn.clientX-u.left,xo=mn.clientY-u.top,this._lastX=(r||t).clientX,this._lastY=(r||t).clientY,N.style["will-change"]="all",c=function(){if(at("delayEnded",i,{evt:t}),se.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!mo&&i.nativeDraggable&&(N.draggable=!0),i._triggerDragStart(t,r),it({sortable:i,name:"choose",originalEvent:t}),ft(N,a.chosenClass,!0)},a.ignore.split(",").forEach(function(y){Co(N,y.trim(),ui)}),Oe(d,"dragover",gn),Oe(d,"mousemove",gn),Oe(d,"touchmove",gn),a.supportPointer?(Oe(d,"pointerup",i._onDrop),!this.nativeDraggable&&Oe(d,"pointercancel",i._onDrop)):(Oe(d,"mouseup",i._onDrop),Oe(d,"touchend",i._onDrop),Oe(d,"touchcancel",i._onDrop)),mo&&this.nativeDraggable&&(this.options.touchStartThreshold=4,N.draggable=!0),at("delayStart",this,{evt:t}),a.delay&&(!a.delayOnTouchOnly||r)&&(!this.nativeDraggable||!(er||Wt))){if(se.eventCanceled){this._onDrop();return}a.supportPointer?(Oe(d,"pointerup",i._disableDelayedDrag),Oe(d,"pointercancel",i._disableDelayedDrag)):(Oe(d,"mouseup",i._disableDelayedDrag),Oe(d,"touchend",i._disableDelayedDrag),Oe(d,"touchcancel",i._disableDelayedDrag)),Oe(d,"mousemove",i._delayedDragTouchMoveHandler),Oe(d,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&Oe(d,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(c,a.delay)}else c()}},_delayedDragTouchMoveHandler:function(t){var r=t.touches?t.touches[0]:t;Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){N&&ui(N),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Ee(t,"mouseup",this._disableDelayedDrag),Ee(t,"touchend",this._disableDelayedDrag),Ee(t,"touchcancel",this._disableDelayedDrag),Ee(t,"pointerup",this._disableDelayedDrag),Ee(t,"pointercancel",this._disableDelayedDrag),Ee(t,"mousemove",this._delayedDragTouchMoveHandler),Ee(t,"touchmove",this._delayedDragTouchMoveHandler),Ee(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,r){r=r||t.pointerType=="touch"&&t,!this.nativeDraggable||r?this.options.supportPointer?Oe(document,"pointermove",this._onTouchMove):r?Oe(document,"touchmove",this._onTouchMove):Oe(document,"mousemove",this._onTouchMove):(Oe(N,"dragend",this),Oe(ke,"dragstart",this._onDragStart));try{document.selection?Cr(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,r){if(In=!1,ke&&N){at("dragStarted",this,{evt:r}),this.nativeDraggable&&Oe(document,"dragover",cs);var n=this.options;!t&&ft(N,n.dragClass,!1),ft(N,n.ghostClass,!0),se.active=this,t&&this._appendGhost(),it({sortable:this,name:"start",originalEvent:r})}else this._nulling()},_emulateDragOver:function(){if(Ot){this._lastX=Ot.clientX,this._lastY=Ot.clientY,Lo();for(var t=document.elementFromPoint(Ot.clientX,Ot.clientY),r=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Ot.clientX,Ot.clientY),t!==r);)r=t;if(N.parentNode[st]._isOutsideThisEl(t),r)do{if(r[st]){var n=void 0;if(n=r[st]._onDragOver({clientX:Ot.clientX,clientY:Ot.clientY,target:t,rootEl:r}),n&&!this.options.dragoverBubble)break}t=r}while(r=Do(r));No()}},_onTouchMove:function(t){if(mn){var r=this.options,n=r.fallbackTolerance,i=r.fallbackOffset,o=t.touches?t.touches[0]:t,a=ue&&Ln(ue,!0),d=ue&&a&&a.a,c=ue&&a&&a.d,u=Er&&nt&&yo(nt),y=(o.clientX-mn.clientX+i.x)/(d||1)+(u?u[0]-fi[0]:0)/(d||1),m=(o.clientY-mn.clientY+i.y)/(c||1)+(u?u[1]-fi[1]:0)/(c||1);if(!se.active&&!In){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(it({rootEl:Ve,name:"add",toEl:Ve,fromEl:ke,originalEvent:t}),it({sortable:this,name:"remove",toEl:Ve,originalEvent:t}),it({rootEl:Ve,name:"sort",toEl:Ve,fromEl:ke,originalEvent:t}),it({sortable:this,name:"sort",toEl:Ve,originalEvent:t})),Qe&&Qe.save()):ut!==Fn&&ut>=0&&(it({sortable:this,name:"update",toEl:Ve,originalEvent:t}),it({sortable:this,name:"sort",toEl:Ve,originalEvent:t})),se.active&&((ut==null||ut===-1)&&(ut=Fn,on=Jn),it({sortable:this,name:"end",toEl:Ve,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){at("nulling",this),ke=N=Ve=ue=bn=We=Ar=an=mn=Ot=Yn=ut=on=Fn=Jn=Rn=Qn=Qe=wr=se.dragged=se.ghost=se.clone=se.active=null,Rr.forEach(function(t){t.checked=!0}),Rr.length=li=ci=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":N&&(this._onDragOver(t),fs(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],r,n=this.el.children,i=0,o=n.length,a=this.options;ii.right+o||e.clientY>n.bottom&&e.clientX>n.left:e.clientY>i.bottom+o||e.clientX>n.right&&e.clientY>n.top}function hs(e,t,r,n,i,o,a,d){var c=n?e.clientY:e.clientX,u=n?r.height:r.width,y=n?r.top:r.left,m=n?r.bottom:r.right,E=!1;if(!a){if(d&&Dry+u*o/2:cm-Dr)return-Qn}else if(c>y+u*(1-i)/2&&cm-u*o/2)?c>y+u/2?1:-1:0}function vs(e){return vt(N){e.directive("sortable",t=>{let r=parseInt(t.dataset?.sortableAnimationDuration);r!==0&&!r&&(r=300),t.sortable=Oi.create(t,{group:t.getAttribute("x-sortable-group"),draggable:"[x-sortable-item]",handle:"[x-sortable-handle]",dataIdAttr:"x-sortable-item",animation:r,ghostClass:"fi-sortable-ghost"})})};var ys=Object.create,Di=Object.defineProperty,ws=Object.getPrototypeOf,xs=Object.prototype.hasOwnProperty,Es=Object.getOwnPropertyNames,Os=Object.getOwnPropertyDescriptor,Ss=e=>Di(e,"__esModule",{value:!0}),Bo=(e,t)=>()=>(t||(t={exports:{}},e(t.exports,t)),t.exports),As=(e,t,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Es(t))!xs.call(e,n)&&n!=="default"&&Di(e,n,{get:()=>t[n],enumerable:!(r=Os(t,n))||r.enumerable});return e},Ho=e=>As(Ss(Di(e!=null?ys(ws(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Ds=Bo(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function t(f){var s=f.getBoundingClientRect();return{width:s.width,height:s.height,top:s.top,right:s.right,bottom:s.bottom,left:s.left,x:s.left,y:s.top}}function r(f){if(f==null)return window;if(f.toString()!=="[object Window]"){var s=f.ownerDocument;return s&&s.defaultView||window}return f}function n(f){var s=r(f),b=s.pageXOffset,_=s.pageYOffset;return{scrollLeft:b,scrollTop:_}}function i(f){var s=r(f).Element;return f instanceof s||f instanceof Element}function o(f){var s=r(f).HTMLElement;return f instanceof s||f instanceof HTMLElement}function a(f){if(typeof ShadowRoot>"u")return!1;var s=r(f).ShadowRoot;return f instanceof s||f instanceof ShadowRoot}function d(f){return{scrollLeft:f.scrollLeft,scrollTop:f.scrollTop}}function c(f){return f===r(f)||!o(f)?n(f):d(f)}function u(f){return f?(f.nodeName||"").toLowerCase():null}function y(f){return((i(f)?f.ownerDocument:f.document)||window.document).documentElement}function m(f){return t(y(f)).left+n(f).scrollLeft}function E(f){return r(f).getComputedStyle(f)}function O(f){var s=E(f),b=s.overflow,_=s.overflowX,P=s.overflowY;return/auto|scroll|overlay|hidden/.test(b+P+_)}function S(f,s,b){b===void 0&&(b=!1);var _=y(s),P=t(f),L=o(s),U={scrollLeft:0,scrollTop:0},H={x:0,y:0};return(L||!L&&!b)&&((u(s)!=="body"||O(_))&&(U=c(s)),o(s)?(H=t(s),H.x+=s.clientLeft,H.y+=s.clientTop):_&&(H.x=m(_))),{x:P.left+U.scrollLeft-H.x,y:P.top+U.scrollTop-H.y,width:P.width,height:P.height}}function T(f){var s=t(f),b=f.offsetWidth,_=f.offsetHeight;return Math.abs(s.width-b)<=1&&(b=s.width),Math.abs(s.height-_)<=1&&(_=s.height),{x:f.offsetLeft,y:f.offsetTop,width:b,height:_}}function I(f){return u(f)==="html"?f:f.assignedSlot||f.parentNode||(a(f)?f.host:null)||y(f)}function $(f){return["html","body","#document"].indexOf(u(f))>=0?f.ownerDocument.body:o(f)&&O(f)?f:$(I(f))}function A(f,s){var b;s===void 0&&(s=[]);var _=$(f),P=_===((b=f.ownerDocument)==null?void 0:b.body),L=r(_),U=P?[L].concat(L.visualViewport||[],O(_)?_:[]):_,H=s.concat(U);return P?H:H.concat(A(I(U)))}function k(f){return["table","td","th"].indexOf(u(f))>=0}function Y(f){return!o(f)||E(f).position==="fixed"?null:f.offsetParent}function ne(f){var s=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,b=navigator.userAgent.indexOf("Trident")!==-1;if(b&&o(f)){var _=E(f);if(_.position==="fixed")return null}for(var P=I(f);o(P)&&["html","body"].indexOf(u(P))<0;){var L=E(P);if(L.transform!=="none"||L.perspective!=="none"||L.contain==="paint"||["transform","perspective"].indexOf(L.willChange)!==-1||s&&L.willChange==="filter"||s&&L.filter&&L.filter!=="none")return P;P=P.parentNode}return null}function J(f){for(var s=r(f),b=Y(f);b&&k(b)&&E(b).position==="static";)b=Y(b);return b&&(u(b)==="html"||u(b)==="body"&&E(b).position==="static")?s:b||ne(f)||s}var V="top",de="bottom",X="right",Q="left",me="auto",l=[V,de,X,Q],h="start",v="end",p="clippingParents",j="viewport",M="popper",R="reference",Z=l.reduce(function(f,s){return f.concat([s+"-"+h,s+"-"+v])},[]),ze=[].concat(l,[me]).reduce(function(f,s){return f.concat([s,s+"-"+h,s+"-"+v])},[]),Rt="beforeRead",Ut="read",Lr="afterRead",Nr="beforeMain",kr="main",Vt="afterMain",nr="beforeWrite",jr="write",rr="afterWrite",It=[Rt,Ut,Lr,Nr,kr,Vt,nr,jr,rr];function Br(f){var s=new Map,b=new Set,_=[];f.forEach(function(L){s.set(L.name,L)});function P(L){b.add(L.name);var U=[].concat(L.requires||[],L.requiresIfExists||[]);U.forEach(function(H){if(!b.has(H)){var G=s.get(H);G&&P(G)}}),_.push(L)}return f.forEach(function(L){b.has(L.name)||P(L)}),_}function mt(f){var s=Br(f);return It.reduce(function(b,_){return b.concat(s.filter(function(P){return P.phase===_}))},[])}function zt(f){var s;return function(){return s||(s=new Promise(function(b){Promise.resolve().then(function(){s=void 0,b(f())})})),s}}function At(f){for(var s=arguments.length,b=new Array(s>1?s-1:0),_=1;_=0,_=b&&o(f)?J(f):f;return i(_)?s.filter(function(P){return i(P)&&kn(P,_)&&u(P)!=="body"}):[]}function wn(f,s,b){var _=s==="clippingParents"?yn(f):[].concat(s),P=[].concat(_,[b]),L=P[0],U=P.reduce(function(H,G){var oe=sr(f,G);return H.top=gt(oe.top,H.top),H.right=ln(oe.right,H.right),H.bottom=ln(oe.bottom,H.bottom),H.left=gt(oe.left,H.left),H},sr(f,L));return U.width=U.right-U.left,U.height=U.bottom-U.top,U.x=U.left,U.y=U.top,U}function cn(f){return f.split("-")[1]}function dt(f){return["top","bottom"].indexOf(f)>=0?"x":"y"}function lr(f){var s=f.reference,b=f.element,_=f.placement,P=_?ot(_):null,L=_?cn(_):null,U=s.x+s.width/2-b.width/2,H=s.y+s.height/2-b.height/2,G;switch(P){case V:G={x:U,y:s.y-b.height};break;case de:G={x:U,y:s.y+s.height};break;case X:G={x:s.x+s.width,y:H};break;case Q:G={x:s.x-b.width,y:H};break;default:G={x:s.x,y:s.y}}var oe=P?dt(P):null;if(oe!=null){var z=oe==="y"?"height":"width";switch(L){case h:G[oe]=G[oe]-(s[z]/2-b[z]/2);break;case v:G[oe]=G[oe]+(s[z]/2-b[z]/2);break}}return G}function cr(){return{top:0,right:0,bottom:0,left:0}}function fr(f){return Object.assign({},cr(),f)}function ur(f,s){return s.reduce(function(b,_){return b[_]=f,b},{})}function qt(f,s){s===void 0&&(s={});var b=s,_=b.placement,P=_===void 0?f.placement:_,L=b.boundary,U=L===void 0?p:L,H=b.rootBoundary,G=H===void 0?j:H,oe=b.elementContext,z=oe===void 0?M:oe,Ce=b.altBoundary,Le=Ce===void 0?!1:Ce,De=b.padding,xe=De===void 0?0:De,Me=fr(typeof xe!="number"?xe:ur(xe,l)),Se=z===M?R:M,Be=f.elements.reference,Re=f.rects.popper,He=f.elements[Le?Se:z],ce=wn(i(He)?He:He.contextElement||y(f.elements.popper),U,G),Pe=t(Be),_e=lr({reference:Pe,element:Re,strategy:"absolute",placement:P}),Ne=Xt(Object.assign({},Re,_e)),Fe=z===M?Ne:Pe,Ye={top:ce.top-Fe.top+Me.top,bottom:Fe.bottom-ce.bottom+Me.bottom,left:ce.left-Fe.left+Me.left,right:Fe.right-ce.right+Me.right},$e=f.modifiersData.offset;if(z===M&&$e){var Ue=$e[P];Object.keys(Ye).forEach(function(wt){var et=[X,de].indexOf(wt)>=0?1:-1,Lt=[V,de].indexOf(wt)>=0?"y":"x";Ye[wt]+=Ue[Lt]*et})}return Ye}var dr="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",Vr="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",xn={placement:"bottom",modifiers:[],strategy:"absolute"};function fn(){for(var f=arguments.length,s=new Array(f),b=0;b100){console.error(Vr);break}if(z.reset===!0){z.reset=!1,Pe=-1;continue}var _e=z.orderedModifiers[Pe],Ne=_e.fn,Fe=_e.options,Ye=Fe===void 0?{}:Fe,$e=_e.name;typeof Ne=="function"&&(z=Ne({state:z,options:Ye,name:$e,instance:De})||z)}}},update:zt(function(){return new Promise(function(Se){De.forceUpdate(),Se(z)})}),destroy:function(){Me(),Le=!0}};if(!fn(H,G))return console.error(dr),De;De.setOptions(oe).then(function(Se){!Le&&oe.onFirstUpdate&&oe.onFirstUpdate(Se)});function xe(){z.orderedModifiers.forEach(function(Se){var Be=Se.name,Re=Se.options,He=Re===void 0?{}:Re,ce=Se.effect;if(typeof ce=="function"){var Pe=ce({state:z,name:Be,instance:De,options:He}),_e=function(){};Ce.push(Pe||_e)}})}function Me(){Ce.forEach(function(Se){return Se()}),Ce=[]}return De}}var On={passive:!0};function zr(f){var s=f.state,b=f.instance,_=f.options,P=_.scroll,L=P===void 0?!0:P,U=_.resize,H=U===void 0?!0:U,G=r(s.elements.popper),oe=[].concat(s.scrollParents.reference,s.scrollParents.popper);return L&&oe.forEach(function(z){z.addEventListener("scroll",b.update,On)}),H&&G.addEventListener("resize",b.update,On),function(){L&&oe.forEach(function(z){z.removeEventListener("scroll",b.update,On)}),H&&G.removeEventListener("resize",b.update,On)}}var jn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:zr,data:{}};function Yr(f){var s=f.state,b=f.name;s.modifiersData[b]=lr({reference:s.rects.reference,element:s.rects.popper,strategy:"absolute",placement:s.placement})}var Bn={name:"popperOffsets",enabled:!0,phase:"read",fn:Yr,data:{}},Xr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qr(f){var s=f.x,b=f.y,_=window,P=_.devicePixelRatio||1;return{x:Yt(Yt(s*P)/P)||0,y:Yt(Yt(b*P)/P)||0}}function Hn(f){var s,b=f.popper,_=f.popperRect,P=f.placement,L=f.offsets,U=f.position,H=f.gpuAcceleration,G=f.adaptive,oe=f.roundOffsets,z=oe===!0?qr(L):typeof oe=="function"?oe(L):L,Ce=z.x,Le=Ce===void 0?0:Ce,De=z.y,xe=De===void 0?0:De,Me=L.hasOwnProperty("x"),Se=L.hasOwnProperty("y"),Be=Q,Re=V,He=window;if(G){var ce=J(b),Pe="clientHeight",_e="clientWidth";ce===r(b)&&(ce=y(b),E(ce).position!=="static"&&(Pe="scrollHeight",_e="scrollWidth")),ce=ce,P===V&&(Re=de,xe-=ce[Pe]-_.height,xe*=H?1:-1),P===Q&&(Be=X,Le-=ce[_e]-_.width,Le*=H?1:-1)}var Ne=Object.assign({position:U},G&&Xr);if(H){var Fe;return Object.assign({},Ne,(Fe={},Fe[Re]=Se?"0":"",Fe[Be]=Me?"0":"",Fe.transform=(He.devicePixelRatio||1)<2?"translate("+Le+"px, "+xe+"px)":"translate3d("+Le+"px, "+xe+"px, 0)",Fe))}return Object.assign({},Ne,(s={},s[Re]=Se?xe+"px":"",s[Be]=Me?Le+"px":"",s.transform="",s))}function g(f){var s=f.state,b=f.options,_=b.gpuAcceleration,P=_===void 0?!0:_,L=b.adaptive,U=L===void 0?!0:L,H=b.roundOffsets,G=H===void 0?!0:H,oe=E(s.elements.popper).transitionProperty||"";U&&["transform","top","right","bottom","left"].some(function(Ce){return oe.indexOf(Ce)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',` +(()=>{var Yo=Object.create;var Ti=Object.defineProperty;var Xo=Object.getOwnPropertyDescriptor;var qo=Object.getOwnPropertyNames;var Go=Object.getPrototypeOf,Ko=Object.prototype.hasOwnProperty;var Kr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Jo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of qo(t))!Ko.call(e,i)&&i!==r&&Ti(e,i,{get:()=>t[i],enumerable:!(n=Xo(t,i))||n.enumerable});return e};var Qo=(e,t,r)=>(r=e!=null?Yo(Go(e)):{},Jo(t||!e||!e.__esModule?Ti(r,"default",{value:e,enumerable:!0}):r,e));var uo=Kr(()=>{});var po=Kr(()=>{});var ho=Kr((Bs,yr)=>{(function(){"use strict";var e="input is invalid type",t="finalize already called",r=typeof window=="object",n=r?window:{};n.JS_MD5_NO_WINDOW&&(r=!1);var i=!r&&typeof self=="object",o=!n.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?n=global:i&&(n=self);var a=!n.JS_MD5_NO_COMMON_JS&&typeof yr=="object"&&yr.exports,d=typeof define=="function"&&define.amd,c=!n.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),y=[128,32768,8388608,-2147483648],m=[0,8,16,24],E=["hex","array","digest","buffer","arrayBuffer","base64"],O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),S=[],T;if(c){var I=new ArrayBuffer(68);T=new Uint8Array(I),S=new Uint32Array(I)}var $=Array.isArray;(n.JS_MD5_NO_NODE_JS||!$)&&($=function(l){return Object.prototype.toString.call(l)==="[object Array]"});var A=ArrayBuffer.isView;c&&(n.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!A)&&(A=function(l){return typeof l=="object"&&l.buffer&&l.buffer.constructor===ArrayBuffer});var k=function(l){var h=typeof l;if(h==="string")return[l,!0];if(h!=="object"||l===null)throw new Error(e);if(c&&l.constructor===ArrayBuffer)return[new Uint8Array(l),!1];if(!$(l)&&!A(l))throw new Error(e);return[l,!1]},Y=function(l){return function(h){return new X(!0).update(h)[l]()}},ne=function(){var l=Y("hex");o&&(l=J(l)),l.create=function(){return new X},l.update=function(p){return l.create().update(p)};for(var h=0;h>>6,ze[M++]=128|p&63):p<55296||p>=57344?(ze[M++]=224|p>>>12,ze[M++]=128|p>>>6&63,ze[M++]=128|p&63):(p=65536+((p&1023)<<10|l.charCodeAt(++j)&1023),ze[M++]=240|p>>>18,ze[M++]=128|p>>>12&63,ze[M++]=128|p>>>6&63,ze[M++]=128|p&63);else for(M=this.start;j>>2]|=p<>>2]|=(192|p>>>6)<>>2]|=(128|p&63)<=57344?(Z[M>>>2]|=(224|p>>>12)<>>2]|=(128|p>>>6&63)<>>2]|=(128|p&63)<>>2]|=(240|p>>>18)<>>2]|=(128|p>>>12&63)<>>2]|=(128|p>>>6&63)<>>2]|=(128|p&63)<>>2]|=l[j]<=64?(this.start=M-64,this.hash(),this.hashed=!0):this.start=M}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},X.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var l=this.blocks,h=this.lastByteIndex;l[h>>>2]|=y[h&3],h>=56&&(this.hashed||this.hash(),l[0]=l[16],l[16]=l[1]=l[2]=l[3]=l[4]=l[5]=l[6]=l[7]=l[8]=l[9]=l[10]=l[11]=l[12]=l[13]=l[14]=l[15]=0),l[14]=this.bytes<<3,l[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},X.prototype.hash=function(){var l,h,v,p,j,M,R=this.blocks;this.first?(l=R[0]-680876937,l=(l<<7|l>>>25)-271733879<<0,p=(-1732584194^l&2004318071)+R[1]-117830708,p=(p<<12|p>>>20)+l<<0,v=(-271733879^p&(l^-271733879))+R[2]-1126478375,v=(v<<17|v>>>15)+p<<0,h=(l^v&(p^l))+R[3]-1316259209,h=(h<<22|h>>>10)+v<<0):(l=this.h0,h=this.h1,v=this.h2,p=this.h3,l+=(p^h&(v^p))+R[0]-680876936,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[1]-389564586,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[2]+606105819,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[3]-1044525330,h=(h<<22|h>>>10)+v<<0),l+=(p^h&(v^p))+R[4]-176418897,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[5]+1200080426,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[6]-1473231341,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[7]-45705983,h=(h<<22|h>>>10)+v<<0,l+=(p^h&(v^p))+R[8]+1770035416,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[9]-1958414417,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[10]-42063,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[11]-1990404162,h=(h<<22|h>>>10)+v<<0,l+=(p^h&(v^p))+R[12]+1804603682,l=(l<<7|l>>>25)+h<<0,p+=(v^l&(h^v))+R[13]-40341101,p=(p<<12|p>>>20)+l<<0,v+=(h^p&(l^h))+R[14]-1502002290,v=(v<<17|v>>>15)+p<<0,h+=(l^v&(p^l))+R[15]+1236535329,h=(h<<22|h>>>10)+v<<0,l+=(v^p&(h^v))+R[1]-165796510,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[6]-1069501632,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[11]+643717713,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[0]-373897302,h=(h<<20|h>>>12)+v<<0,l+=(v^p&(h^v))+R[5]-701558691,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[10]+38016083,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[15]-660478335,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[4]-405537848,h=(h<<20|h>>>12)+v<<0,l+=(v^p&(h^v))+R[9]+568446438,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[14]-1019803690,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[3]-187363961,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[8]+1163531501,h=(h<<20|h>>>12)+v<<0,l+=(v^p&(h^v))+R[13]-1444681467,l=(l<<5|l>>>27)+h<<0,p+=(h^v&(l^h))+R[2]-51403784,p=(p<<9|p>>>23)+l<<0,v+=(l^h&(p^l))+R[7]+1735328473,v=(v<<14|v>>>18)+p<<0,h+=(p^l&(v^p))+R[12]-1926607734,h=(h<<20|h>>>12)+v<<0,j=h^v,l+=(j^p)+R[5]-378558,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[8]-2022574463,p=(p<<11|p>>>21)+l<<0,M=p^l,v+=(M^h)+R[11]+1839030562,v=(v<<16|v>>>16)+p<<0,h+=(M^v)+R[14]-35309556,h=(h<<23|h>>>9)+v<<0,j=h^v,l+=(j^p)+R[1]-1530992060,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[4]+1272893353,p=(p<<11|p>>>21)+l<<0,M=p^l,v+=(M^h)+R[7]-155497632,v=(v<<16|v>>>16)+p<<0,h+=(M^v)+R[10]-1094730640,h=(h<<23|h>>>9)+v<<0,j=h^v,l+=(j^p)+R[13]+681279174,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[0]-358537222,p=(p<<11|p>>>21)+l<<0,M=p^l,v+=(M^h)+R[3]-722521979,v=(v<<16|v>>>16)+p<<0,h+=(M^v)+R[6]+76029189,h=(h<<23|h>>>9)+v<<0,j=h^v,l+=(j^p)+R[9]-640364487,l=(l<<4|l>>>28)+h<<0,p+=(j^l)+R[12]-421815835,p=(p<<11|p>>>21)+l<<0,M=p^l,v+=(M^h)+R[15]+530742520,v=(v<<16|v>>>16)+p<<0,h+=(M^v)+R[2]-995338651,h=(h<<23|h>>>9)+v<<0,l+=(v^(h|~p))+R[0]-198630844,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[7]+1126891415,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[14]-1416354905,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[5]-57434055,h=(h<<21|h>>>11)+v<<0,l+=(v^(h|~p))+R[12]+1700485571,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[3]-1894986606,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[10]-1051523,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[1]-2054922799,h=(h<<21|h>>>11)+v<<0,l+=(v^(h|~p))+R[8]+1873313359,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[15]-30611744,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[6]-1560198380,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[13]+1309151649,h=(h<<21|h>>>11)+v<<0,l+=(v^(h|~p))+R[4]-145523070,l=(l<<6|l>>>26)+h<<0,p+=(h^(l|~v))+R[11]-1120210379,p=(p<<10|p>>>22)+l<<0,v+=(l^(p|~h))+R[2]+718787259,v=(v<<15|v>>>17)+p<<0,h+=(p^(v|~l))+R[9]-343485551,h=(h<<21|h>>>11)+v<<0,this.first?(this.h0=l+1732584193<<0,this.h1=h-271733879<<0,this.h2=v-1732584194<<0,this.h3=p+271733878<<0,this.first=!1):(this.h0=this.h0+l<<0,this.h1=this.h1+h<<0,this.h2=this.h2+v<<0,this.h3=this.h3+p<<0)},X.prototype.hex=function(){this.finalize();var l=this.h0,h=this.h1,v=this.h2,p=this.h3;return u[l>>>4&15]+u[l&15]+u[l>>>12&15]+u[l>>>8&15]+u[l>>>20&15]+u[l>>>16&15]+u[l>>>28&15]+u[l>>>24&15]+u[h>>>4&15]+u[h&15]+u[h>>>12&15]+u[h>>>8&15]+u[h>>>20&15]+u[h>>>16&15]+u[h>>>28&15]+u[h>>>24&15]+u[v>>>4&15]+u[v&15]+u[v>>>12&15]+u[v>>>8&15]+u[v>>>20&15]+u[v>>>16&15]+u[v>>>28&15]+u[v>>>24&15]+u[p>>>4&15]+u[p&15]+u[p>>>12&15]+u[p>>>8&15]+u[p>>>20&15]+u[p>>>16&15]+u[p>>>28&15]+u[p>>>24&15]},X.prototype.toString=X.prototype.hex,X.prototype.digest=function(){this.finalize();var l=this.h0,h=this.h1,v=this.h2,p=this.h3;return[l&255,l>>>8&255,l>>>16&255,l>>>24&255,h&255,h>>>8&255,h>>>16&255,h>>>24&255,v&255,v>>>8&255,v>>>16&255,v>>>24&255,p&255,p>>>8&255,p>>>16&255,p>>>24&255]},X.prototype.array=X.prototype.digest,X.prototype.arrayBuffer=function(){this.finalize();var l=new ArrayBuffer(16),h=new Uint32Array(l);return h[0]=this.h0,h[1]=this.h1,h[2]=this.h2,h[3]=this.h3,l},X.prototype.buffer=X.prototype.arrayBuffer,X.prototype.base64=function(){for(var l,h,v,p="",j=this.array(),M=0;M<15;)l=j[M++],h=j[M++],v=j[M++],p+=O[l>>>2]+O[(l<<4|h>>>4)&63]+O[(h<<2|v>>>6)&63]+O[v&63];return l=j[M],p+=O[l>>>2]+O[l<<4&63]+"==",p};function Q(l,h){var v,p=k(l);if(l=p[0],p[1]){var j=[],M=l.length,R=0,Z;for(v=0;v>>6,j[R++]=128|Z&63):Z<55296||Z>=57344?(j[R++]=224|Z>>>12,j[R++]=128|Z>>>6&63,j[R++]=128|Z&63):(Z=65536+((Z&1023)<<10|l.charCodeAt(++v)&1023),j[R++]=240|Z>>>18,j[R++]=128|Z>>>12&63,j[R++]=128|Z>>>6&63,j[R++]=128|Z&63);l=j}l.length>64&&(l=new X(!0).update(l).array());var ze=[],Rt=[];for(v=0;v<64;++v){var Ut=l[v]||0;ze[v]=92^Ut,Rt[v]=54^Ut}X.call(this,h),this.update(Rt),this.oKeyPad=ze,this.inner=!0,this.sharedMemory=h}Q.prototype=new X,Q.prototype.finalize=function(){if(X.prototype.finalize.call(this),this.inner){this.inner=!1;var l=this.array();X.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(l),X.prototype.finalize.call(this)}};var me=ne();me.md5=me,me.md5.hmac=de(),a?yr.exports=me:(n.md5=me,d&&define(function(){return me}))})()});var Hi=["top","right","bottom","left"],Pi=["start","end"],Mi=Hi.reduce((e,t)=>e.concat(t,t+"-"+Pi[0],t+"-"+Pi[1]),[]),Et=Math.min,tt=Math.max,hr=Math.round,pr=Math.floor,nn=e=>({x:e,y:e}),Zo={left:"right",right:"left",bottom:"top",top:"bottom"},ea={start:"end",end:"start"};function Jr(e,t,r){return tt(e,Et(t,r))}function jt(e,t){return typeof e=="function"?e(t):e}function pt(e){return e.split("-")[0]}function xt(e){return e.split("-")[1]}function $i(e){return e==="x"?"y":"x"}function Qr(e){return e==="y"?"height":"width"}function Pn(e){return["top","bottom"].includes(pt(e))?"y":"x"}function Zr(e){return $i(Pn(e))}function Wi(e,t,r){r===void 0&&(r=!1);let n=xt(e),i=Zr(e),o=Qr(i),a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=mr(a)),[a,mr(a)]}function ta(e){let t=mr(e);return[vr(e),t,vr(t)]}function vr(e){return e.replace(/start|end/g,t=>ea[t])}function na(e,t,r){let n=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?i:n:t?n:i;case"left":case"right":return t?o:a;default:return[]}}function ra(e,t,r,n){let i=xt(e),o=na(pt(e),r==="start",n);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(vr)))),o}function mr(e){return e.replace(/left|right|bottom|top/g,t=>Zo[t])}function ia(e){return{top:0,right:0,bottom:0,left:0,...e}}function ei(e){return typeof e!="number"?ia(e):{top:e,right:e,bottom:e,left:e}}function Dn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Ri(e,t,r){let{reference:n,floating:i}=e,o=Pn(t),a=Zr(t),d=Qr(a),c=pt(t),u=o==="y",y=n.x+n.width/2-i.width/2,m=n.y+n.height/2-i.height/2,E=n[d]/2-i[d]/2,O;switch(c){case"top":O={x:y,y:n.y-i.height};break;case"bottom":O={x:y,y:n.y+n.height};break;case"right":O={x:n.x+n.width,y:m};break;case"left":O={x:n.x-i.width,y:m};break;default:O={x:n.x,y:n.y}}switch(xt(t)){case"start":O[a]-=E*(r&&u?-1:1);break;case"end":O[a]+=E*(r&&u?-1:1);break}return O}var oa=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,d=o.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t)),u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:y,y:m}=Ri(u,n,c),E=n,O={},S=0;for(let T=0;T({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:i,rects:o,platform:a,elements:d,middlewareData:c}=t,{element:u,padding:y=0}=jt(e,t)||{};if(u==null)return{};let m=ei(y),E={x:r,y:n},O=Zr(i),S=Qr(O),T=await a.getDimensions(u),I=O==="y",$=I?"top":"left",A=I?"bottom":"right",k=I?"clientHeight":"clientWidth",Y=o.reference[S]+o.reference[O]-E[O]-o.floating[S],ne=E[O]-o.reference[O],J=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u)),V=J?J[k]:0;(!V||!await(a.isElement==null?void 0:a.isElement(J)))&&(V=d.floating[k]||o.floating[S]);let de=Y/2-ne/2,X=V/2-T[S]/2-1,Q=Et(m[$],X),me=Et(m[A],X),l=Q,h=V-T[S]-me,v=V/2-T[S]/2+de,p=Jr(l,v,h),j=!c.arrow&&xt(i)!=null&&v!==p&&o.reference[S]/2-(vxt(i)===e),...r.filter(i=>xt(i)!==e)]:r.filter(i=>pt(i)===i)).filter(i=>e?xt(i)===e||(t?vr(i)!==i:!1):!0)}var la=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,n,i;let{rects:o,middlewareData:a,placement:d,platform:c,elements:u}=t,{crossAxis:y=!1,alignment:m,allowedPlacements:E=Mi,autoAlignment:O=!0,...S}=jt(e,t),T=m!==void 0||E===Mi?sa(m||null,O,E):E,I=await _n(t,S),$=((r=a.autoPlacement)==null?void 0:r.index)||0,A=T[$];if(A==null)return{};let k=Wi(A,o,await(c.isRTL==null?void 0:c.isRTL(u.floating)));if(d!==A)return{reset:{placement:T[0]}};let Y=[I[pt(A)],I[k[0]],I[k[1]]],ne=[...((n=a.autoPlacement)==null?void 0:n.overflows)||[],{placement:A,overflows:Y}],J=T[$+1];if(J)return{data:{index:$+1,overflows:ne},reset:{placement:J}};let V=ne.map(Q=>{let me=xt(Q.placement);return[Q.placement,me&&y?Q.overflows.slice(0,2).reduce((l,h)=>l+h,0):Q.overflows[0],Q.overflows]}).sort((Q,me)=>Q[1]-me[1]),X=((i=V.filter(Q=>Q[2].slice(0,xt(Q[0])?2:3).every(me=>me<=0))[0])==null?void 0:i[0])||V[0][0];return X!==d?{data:{index:$+1,overflows:ne},reset:{placement:X}}:{}}}},ca=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;let{placement:i,middlewareData:o,rects:a,initialPlacement:d,platform:c,elements:u}=t,{mainAxis:y=!0,crossAxis:m=!0,fallbackPlacements:E,fallbackStrategy:O="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:T=!0,...I}=jt(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};let $=pt(i),A=pt(d)===d,k=await(c.isRTL==null?void 0:c.isRTL(u.floating)),Y=E||(A||!T?[mr(d)]:ta(d));!E&&S!=="none"&&Y.push(...ra(d,T,S,k));let ne=[d,...Y],J=await _n(t,I),V=[],de=((n=o.flip)==null?void 0:n.overflows)||[];if(y&&V.push(J[$]),m){let l=Wi(i,a,k);V.push(J[l[0]],J[l[1]])}if(de=[...de,{placement:i,overflows:V}],!V.every(l=>l<=0)){var X,Q;let l=(((X=o.flip)==null?void 0:X.index)||0)+1,h=ne[l];if(h)return{data:{index:l,overflows:de},reset:{placement:h}};let v=(Q=de.filter(p=>p.overflows[0]<=0).sort((p,j)=>p.overflows[1]-j.overflows[1])[0])==null?void 0:Q.placement;if(!v)switch(O){case"bestFit":{var me;let p=(me=de.map(j=>[j.placement,j.overflows.filter(M=>M>0).reduce((M,R)=>M+R,0)]).sort((j,M)=>j[1]-M[1])[0])==null?void 0:me[0];p&&(v=p);break}case"initialPlacement":v=d;break}if(i!==v)return{reset:{placement:v}}}return{}}}};function Ii(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Fi(e){return Hi.some(t=>e[t]>=0)}var fa=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:n="referenceHidden",...i}=jt(e,t);switch(n){case"referenceHidden":{let o=await _n(t,{...i,elementContext:"reference"}),a=Ii(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Fi(a)}}}case"escaped":{let o=await _n(t,{...i,altBoundary:!0}),a=Ii(o,r.floating);return{data:{escapedOffsets:a,escaped:Fi(a)}}}default:return{}}}}};function Ui(e){let t=Et(...e.map(o=>o.left)),r=Et(...e.map(o=>o.top)),n=tt(...e.map(o=>o.right)),i=tt(...e.map(o=>o.bottom));return{x:t,y:r,width:n-t,height:i-r}}function ua(e){let t=e.slice().sort((i,o)=>i.y-o.y),r=[],n=null;for(let i=0;in.height/2?r.push([o]):r[r.length-1].push(o),n=o}return r.map(i=>Dn(Ui(i)))}var da=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){let{placement:r,elements:n,rects:i,platform:o,strategy:a}=t,{padding:d=2,x:c,y:u}=jt(e,t),y=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(n.reference))||[]),m=ua(y),E=Dn(Ui(y)),O=ei(d);function S(){if(m.length===2&&m[0].left>m[1].right&&c!=null&&u!=null)return m.find(I=>c>I.left-O.left&&cI.top-O.top&&u=2){if(Pn(r)==="y"){let Q=m[0],me=m[m.length-1],l=pt(r)==="top",h=Q.top,v=me.bottom,p=l?Q.left:me.left,j=l?Q.right:me.right,M=j-p,R=v-h;return{top:h,bottom:v,left:p,right:j,width:M,height:R,x:p,y:h}}let I=pt(r)==="left",$=tt(...m.map(Q=>Q.right)),A=Et(...m.map(Q=>Q.left)),k=m.filter(Q=>I?Q.left===A:Q.right===$),Y=k[0].top,ne=k[k.length-1].bottom,J=A,V=$,de=V-J,X=ne-Y;return{top:Y,bottom:ne,left:J,right:V,width:de,height:X,x:J,y:Y}}return E}let T=await o.getElementRects({reference:{getBoundingClientRect:S},floating:n.floating,strategy:a});return i.reference.x!==T.reference.x||i.reference.y!==T.reference.y||i.reference.width!==T.reference.width||i.reference.height!==T.reference.height?{reset:{rects:T}}:{}}}};async function pa(e,t){let{placement:r,platform:n,elements:i}=e,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),a=pt(r),d=xt(r),c=Pn(r)==="y",u=["left","top"].includes(a)?-1:1,y=o&&c?-1:1,m=jt(t,e),{mainAxis:E,crossAxis:O,alignmentAxis:S}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return d&&typeof S=="number"&&(O=d==="end"?S*-1:S),c?{x:O*y,y:E*u}:{x:E*u,y:O*y}}var Vi=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;let{x:i,y:o,placement:a,middlewareData:d}=t,c=await pa(t,e);return a===((r=d.offset)==null?void 0:r.placement)&&(n=d.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:a}}}}},ha=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:d={fn:I=>{let{x:$,y:A}=I;return{x:$,y:A}}},...c}=jt(e,t),u={x:r,y:n},y=await _n(t,c),m=Pn(pt(i)),E=$i(m),O=u[E],S=u[m];if(o){let I=E==="y"?"top":"left",$=E==="y"?"bottom":"right",A=O+y[I],k=O-y[$];O=Jr(A,O,k)}if(a){let I=m==="y"?"top":"left",$=m==="y"?"bottom":"right",A=S+y[I],k=S-y[$];S=Jr(A,S,k)}let T=d.fn({...t,[E]:O,[m]:S});return{...T,data:{x:T.x-r,y:T.y-n}}}}},va=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){let{placement:r,rects:n,platform:i,elements:o}=t,{apply:a=()=>{},...d}=jt(e,t),c=await _n(t,d),u=pt(r),y=xt(r),m=Pn(r)==="y",{width:E,height:O}=n.floating,S,T;u==="top"||u==="bottom"?(S=u,T=y===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(T=u,S=y==="end"?"top":"bottom");let I=O-c[S],$=E-c[T],A=!t.middlewareData.shift,k=I,Y=$;if(m){let J=E-c.left-c.right;Y=y||A?Et($,J):J}else{let J=O-c.top-c.bottom;k=y||A?Et(I,J):J}if(A&&!y){let J=tt(c.left,0),V=tt(c.right,0),de=tt(c.top,0),X=tt(c.bottom,0);m?Y=E-2*(J!==0||V!==0?J+V:tt(c.left,c.right)):k=O-2*(de!==0||X!==0?de+X:tt(c.top,c.bottom))}await a({...t,availableWidth:Y,availableHeight:k});let ne=await i.getDimensions(o.floating);return E!==ne.width||O!==ne.height?{reset:{rects:!0}}:{}}}};function rn(e){return zi(e)?(e.nodeName||"").toLowerCase():"#document"}function ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bt(e){var t;return(t=(zi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zi(e){return e instanceof Node||e instanceof ct(e).Node}function kt(e){return e instanceof Element||e instanceof ct(e).Element}function Tt(e){return e instanceof HTMLElement||e instanceof ct(e).HTMLElement}function Li(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ct(e).ShadowRoot}function zn(e){let{overflow:t,overflowX:r,overflowY:n,display:i}=ht(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function ma(e){return["table","td","th"].includes(rn(e))}function ti(e){let t=ni(),r=ht(e);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function ga(e){let t=Tn(e);for(;Tt(t)&&!gr(t);){if(ti(t))return t;t=Tn(t)}return null}function ni(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function gr(e){return["html","body","#document"].includes(rn(e))}function ht(e){return ct(e).getComputedStyle(e)}function br(e){return kt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Tn(e){if(rn(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Li(e)&&e.host||Bt(e);return Li(t)?t.host:t}function Yi(e){let t=Tn(e);return gr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tt(t)&&zn(t)?t:Yi(t)}function Vn(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);let i=Yi(e),o=i===((n=e.ownerDocument)==null?void 0:n.body),a=ct(i);return o?t.concat(a,a.visualViewport||[],zn(i)?i:[],a.frameElement&&r?Vn(a.frameElement):[]):t.concat(i,Vn(i,[],r))}function Xi(e){let t=ht(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=Tt(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,d=hr(r)!==o||hr(n)!==a;return d&&(r=o,n=a),{width:r,height:n,$:d}}function ri(e){return kt(e)?e:e.contextElement}function Cn(e){let t=ri(e);if(!Tt(t))return nn(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:o}=Xi(t),a=(o?hr(r.width):r.width)/n,d=(o?hr(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!d||!Number.isFinite(d))&&(d=1),{x:a,y:d}}var ba=nn(0);function qi(e){let t=ct(e);return!ni()||!t.visualViewport?ba:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ya(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==ct(e)?!1:t}function vn(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);let i=e.getBoundingClientRect(),o=ri(e),a=nn(1);t&&(n?kt(n)&&(a=Cn(n)):a=Cn(e));let d=ya(o,r,n)?qi(o):nn(0),c=(i.left+d.x)/a.x,u=(i.top+d.y)/a.y,y=i.width/a.x,m=i.height/a.y;if(o){let E=ct(o),O=n&&kt(n)?ct(n):n,S=E,T=S.frameElement;for(;T&&n&&O!==S;){let I=Cn(T),$=T.getBoundingClientRect(),A=ht(T),k=$.left+(T.clientLeft+parseFloat(A.paddingLeft))*I.x,Y=$.top+(T.clientTop+parseFloat(A.paddingTop))*I.y;c*=I.x,u*=I.y,y*=I.x,m*=I.y,c+=k,u+=Y,S=ct(T),T=S.frameElement}}return Dn({width:y,height:m,x:c,y:u})}var wa=[":popover-open",":modal"];function Gi(e){return wa.some(t=>{try{return e.matches(t)}catch{return!1}})}function xa(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,o=i==="fixed",a=Bt(n),d=t?Gi(t.floating):!1;if(n===a||d&&o)return r;let c={scrollLeft:0,scrollTop:0},u=nn(1),y=nn(0),m=Tt(n);if((m||!m&&!o)&&((rn(n)!=="body"||zn(a))&&(c=br(n)),Tt(n))){let E=vn(n);u=Cn(n),y.x=E.x+n.clientLeft,y.y=E.y+n.clientTop}return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+y.x,y:r.y*u.y-c.scrollTop*u.y+y.y}}function Ea(e){return Array.from(e.getClientRects())}function Ki(e){return vn(Bt(e)).left+br(e).scrollLeft}function Oa(e){let t=Bt(e),r=br(e),n=e.ownerDocument.body,i=tt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=tt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),a=-r.scrollLeft+Ki(e),d=-r.scrollTop;return ht(n).direction==="rtl"&&(a+=tt(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:a,y:d}}function Sa(e,t){let r=ct(e),n=Bt(e),i=r.visualViewport,o=n.clientWidth,a=n.clientHeight,d=0,c=0;if(i){o=i.width,a=i.height;let u=ni();(!u||u&&t==="fixed")&&(d=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:d,y:c}}function Aa(e,t){let r=vn(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=Tt(e)?Cn(e):nn(1),a=e.clientWidth*o.x,d=e.clientHeight*o.y,c=i*o.x,u=n*o.y;return{width:a,height:d,x:c,y:u}}function Ni(e,t,r){let n;if(t==="viewport")n=Sa(e,r);else if(t==="document")n=Oa(Bt(e));else if(kt(t))n=Aa(t,r);else{let i=qi(e);n={...t,x:t.x-i.x,y:t.y-i.y}}return Dn(n)}function Ji(e,t){let r=Tn(e);return r===t||!kt(r)||gr(r)?!1:ht(r).position==="fixed"||Ji(r,t)}function Ca(e,t){let r=t.get(e);if(r)return r;let n=Vn(e,[],!1).filter(d=>kt(d)&&rn(d)!=="body"),i=null,o=ht(e).position==="fixed",a=o?Tn(e):e;for(;kt(a)&&!gr(a);){let d=ht(a),c=ti(a);!c&&d.position==="fixed"&&(i=null),(o?!c&&!i:!c&&d.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||zn(a)&&!c&&Ji(e,a))?n=n.filter(y=>y!==a):i=d,a=Tn(a)}return t.set(e,n),n}function Da(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,a=[...r==="clippingAncestors"?Ca(t,this._c):[].concat(r),n],d=a[0],c=a.reduce((u,y)=>{let m=Ni(t,y,i);return u.top=tt(m.top,u.top),u.right=Et(m.right,u.right),u.bottom=Et(m.bottom,u.bottom),u.left=tt(m.left,u.left),u},Ni(t,d,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _a(e){let{width:t,height:r}=Xi(e);return{width:t,height:r}}function Ta(e,t,r){let n=Tt(t),i=Bt(t),o=r==="fixed",a=vn(e,!0,o,t),d={scrollLeft:0,scrollTop:0},c=nn(0);if(n||!n&&!o)if((rn(t)!=="body"||zn(i))&&(d=br(t)),n){let m=vn(t,!0,o,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else i&&(c.x=Ki(i));let u=a.left+d.scrollLeft-c.x,y=a.top+d.scrollTop-c.y;return{x:u,y,width:a.width,height:a.height}}function ki(e,t){return!Tt(e)||ht(e).position==="fixed"?null:t?t(e):e.offsetParent}function Qi(e,t){let r=ct(e);if(!Tt(e)||Gi(e))return r;let n=ki(e,t);for(;n&&ma(n)&&ht(n).position==="static";)n=ki(n,t);return n&&(rn(n)==="html"||rn(n)==="body"&&ht(n).position==="static"&&!ti(n))?r:n||ga(e)||r}var Pa=async function(e){let t=this.getOffsetParent||Qi,r=this.getDimensions;return{reference:Ta(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await r(e.floating)}}};function Ma(e){return ht(e).direction==="rtl"}var Ra={convertOffsetParentRelativeRectToViewportRelativeRect:xa,getDocumentElement:Bt,getClippingRect:Da,getOffsetParent:Qi,getElementRects:Pa,getClientRects:Ea,getDimensions:_a,getScale:Cn,isElement:kt,isRTL:Ma};function Ia(e,t){let r=null,n,i=Bt(e);function o(){var d;clearTimeout(n),(d=r)==null||d.disconnect(),r=null}function a(d,c){d===void 0&&(d=!1),c===void 0&&(c=1),o();let{left:u,top:y,width:m,height:E}=e.getBoundingClientRect();if(d||t(),!m||!E)return;let O=pr(y),S=pr(i.clientWidth-(u+m)),T=pr(i.clientHeight-(y+E)),I=pr(u),A={rootMargin:-O+"px "+-S+"px "+-T+"px "+-I+"px",threshold:tt(0,Et(1,c))||1},k=!0;function Y(ne){let J=ne[0].intersectionRatio;if(J!==c){if(!k)return a();J?a(!1,J):n=setTimeout(()=>{a(!1,1e-7)},100)}k=!1}try{r=new IntersectionObserver(Y,{...A,root:i.ownerDocument})}catch{r=new IntersectionObserver(Y,A)}r.observe(e)}return a(!0),o}function ji(e,t,r,n){n===void 0&&(n={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=ri(e),y=i||o?[...u?Vn(u):[],...Vn(t)]:[];y.forEach($=>{i&&$.addEventListener("scroll",r,{passive:!0}),o&&$.addEventListener("resize",r)});let m=u&&d?Ia(u,r):null,E=-1,O=null;a&&(O=new ResizeObserver($=>{let[A]=$;A&&A.target===u&&O&&(O.unobserve(t),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var k;(k=O)==null||k.observe(t)})),r()}),u&&!c&&O.observe(u),O.observe(t));let S,T=c?vn(e):null;c&&I();function I(){let $=vn(e);T&&($.x!==T.x||$.y!==T.y||$.width!==T.width||$.height!==T.height)&&r(),T=$,S=requestAnimationFrame(I)}return r(),()=>{var $;y.forEach(A=>{i&&A.removeEventListener("scroll",r),o&&A.removeEventListener("resize",r)}),m?.(),($=O)==null||$.disconnect(),O=null,c&&cancelAnimationFrame(S)}}var ii=la,Zi=ha,eo=ca,to=va,no=fa,ro=aa,io=da,Bi=(e,t,r)=>{let n=new Map,i={platform:Ra,...r},o={...i.platform,_c:n};return oa(e,t,{...i,platform:o})},Fa=e=>{let t={placement:"bottom",strategy:"absolute",middleware:[]},r=Object.keys(e),n=i=>e[i];return r.includes("offset")&&t.middleware.push(Vi(n("offset"))),r.includes("teleport")&&(t.strategy="fixed"),r.includes("placement")&&(t.placement=n("placement")),r.includes("autoPlacement")&&!r.includes("flip")&&t.middleware.push(ii(n("autoPlacement"))),r.includes("flip")&&t.middleware.push(eo(n("flip"))),r.includes("shift")&&t.middleware.push(Zi(n("shift"))),r.includes("inline")&&t.middleware.push(io(n("inline"))),r.includes("arrow")&&t.middleware.push(ro(n("arrow"))),r.includes("hide")&&t.middleware.push(no(n("hide"))),r.includes("size")&&t.middleware.push(to(n("size"))),t},La=(e,t)=>{let r={component:{trap:!1},float:{placement:"bottom",strategy:"absolute",middleware:[]}},n=i=>e[e.indexOf(i)+1];if(e.includes("trap")&&(r.component.trap=!0),e.includes("teleport")&&(r.float.strategy="fixed"),e.includes("offset")&&r.float.middleware.push(Vi(t.offset||10)),e.includes("placement")&&(r.float.placement=n("placement")),e.includes("autoPlacement")&&!e.includes("flip")&&r.float.middleware.push(ii(t.autoPlacement)),e.includes("flip")&&r.float.middleware.push(eo(t.flip)),e.includes("shift")&&r.float.middleware.push(Zi(t.shift)),e.includes("inline")&&r.float.middleware.push(io(t.inline)),e.includes("arrow")&&r.float.middleware.push(ro(t.arrow)),e.includes("hide")&&r.float.middleware.push(no(t.hide)),e.includes("size")){let i=t.size?.availableWidth??null,o=t.size?.availableHeight??null;i&&delete t.size.availableWidth,o&&delete t.size.availableHeight,r.float.middleware.push(to({...t.size,apply({availableWidth:a,availableHeight:d,elements:c}){Object.assign(c.floating.style,{maxWidth:`${i??a}px`,maxHeight:`${o??d}px`})}}))}return r},Na=e=>{var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split(""),r="";e||(e=Math.floor(Math.random()*t.length));for(var n=0;n{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}function ja(e){let t={dismissable:!0,trap:!1};function r(n,i=null){if(n){if(n.hasAttribute("aria-expanded")||n.setAttribute("aria-expanded",!1),i.hasAttribute("id"))n.setAttribute("aria-controls",i.getAttribute("id"));else{let o=`panel-${Na(8)}`;n.setAttribute("aria-controls",o),i.setAttribute("id",o)}i.setAttribute("aria-modal",!0),i.setAttribute("role","dialog")}}e.magic("float",n=>(i={},o={})=>{let a={...t,...o},d=Object.keys(i).length>0?Fa(i):{middleware:[ii()]},c=n,u=n.parentElement.closest("[x-data]"),y=u.querySelector('[x-ref="panel"]');r(c,y);function m(){return y.style.display=="block"}function E(){y.style.display="none",c.setAttribute("aria-expanded","false"),a.trap&&y.setAttribute("x-trap","false"),ji(n,y,T)}function O(){y.style.display="block",c.setAttribute("aria-expanded","true"),a.trap&&y.setAttribute("x-trap","true"),T()}function S(){m()?E():O()}async function T(){return await Bi(n,y,d).then(({middlewareData:I,placement:$,x:A,y:k})=>{if(I.arrow){let Y=I.arrow?.x,ne=I.arrow?.y,J=d.middleware.filter(de=>de.name=="arrow")[0].options.element,V={top:"bottom",right:"left",bottom:"top",left:"right"}[$.split("-")[0]];Object.assign(J.style,{left:Y!=null?`${Y}px`:"",top:ne!=null?`${ne}px`:"",right:"",bottom:"",[V]:"-4px"})}if(I.hide){let{referenceHidden:Y}=I.hide;Object.assign(y.style,{visibility:Y?"hidden":"visible"})}Object.assign(y.style,{left:`${A}px`,top:`${k}px`})})}a.dismissable&&(window.addEventListener("click",I=>{!u.contains(I.target)&&m()&&S()}),window.addEventListener("keydown",I=>{I.key==="Escape"&&m()&&S()},!0)),S()}),e.directive("float",(n,{modifiers:i,expression:o},{evaluate:a,effect:d})=>{let c=o?a(o):{},u=i.length>0?La(i,c):{},y=null;u.float.strategy=="fixed"&&(n.style.position="fixed");let m=V=>n.parentElement&&!n.parentElement.closest("[x-data]").contains(V.target)?n.close():null,E=V=>V.key==="Escape"?n.close():null,O=n.getAttribute("x-ref"),S=n.parentElement.closest("[x-data]"),T=S.querySelectorAll(`[\\@click^="$refs.${O}"]`),I=S.querySelectorAll(`[x-on\\:click^="$refs.${O}"]`);n.style.setProperty("display","none"),r([...T,...I][0],n),n._x_isShown=!1,n.trigger=null,n._x_doHide||(n._x_doHide=()=>{n.style.setProperty("display","none",i.includes("important")?"important":void 0)}),n._x_doShow||(n._x_doShow=()=>{n.style.setProperty("display","block",i.includes("important")?"important":void 0)});let $=()=>{n._x_doHide(),n._x_isShown=!1},A=()=>{n._x_doShow(),n._x_isShown=!0},k=()=>setTimeout(A),Y=ka(V=>V?A():$(),V=>{typeof n._x_toggleAndCascadeWithTransitions=="function"?n._x_toggleAndCascadeWithTransitions(n,V,A,$):V?k():$()}),ne,J=!0;d(()=>a(V=>{!J&&V===ne||(i.includes("immediate")&&(V?k():$()),Y(V),ne=V,J=!1)})),n.open=async function(V){n.trigger=V.currentTarget?V.currentTarget:V,Y(!0),n.trigger.setAttribute("aria-expanded","true"),u.component.trap&&n.setAttribute("x-trap","true"),y=ji(n.trigger,n,()=>{Bi(n.trigger,n,u.float).then(({middlewareData:de,placement:X,x:Q,y:me})=>{if(de.arrow){let l=de.arrow?.x,h=de.arrow?.y,v=u.float.middleware.filter(j=>j.name=="arrow")[0].options.element,p={top:"bottom",right:"left",bottom:"top",left:"right"}[X.split("-")[0]];Object.assign(v.style,{left:l!=null?`${l}px`:"",top:h!=null?`${h}px`:"",right:"",bottom:"",[p]:"-4px"})}if(de.hide){let{referenceHidden:l}=de.hide;Object.assign(n.style,{visibility:l?"hidden":"visible"})}Object.assign(n.style,{left:`${Q}px`,top:`${me}px`})})}),window.addEventListener("click",m),window.addEventListener("keydown",E,!0)},n.close=function(){if(!n._x_isShown)return!1;Y(!1),n.trigger.setAttribute("aria-expanded","false"),u.component.trap&&n.setAttribute("x-trap","false"),y(),window.removeEventListener("click",m),window.removeEventListener("keydown",E,!1)},n.toggle=function(V){n._x_isShown?n.close():n.open(V)}})}var oo=ja;function Ba(e){e.store("lazyLoadedAssets",{loaded:new Set,check(a){return Array.isArray(a)?a.every(d=>this.loaded.has(d)):this.loaded.has(a)},markLoaded(a){Array.isArray(a)?a.forEach(d=>this.loaded.add(d)):this.loaded.add(a)}});let t=a=>new CustomEvent(a,{bubbles:!0,composed:!0,cancelable:!0}),r=(a,d={},c,u)=>{let y=document.createElement(a);return Object.entries(d).forEach(([m,E])=>y[m]=E),c&&(u?c.insertBefore(y,u):c.appendChild(y)),y},n=(a,d,c={},u=null,y=null)=>{let m=a==="link"?`link[href="${d}"]`:`script[src="${d}"]`;if(document.querySelector(m)||e.store("lazyLoadedAssets").check(d))return Promise.resolve();let E=a==="link"?{...c,href:d}:{...c,src:d},O=r(a,E,u,y);return new Promise((S,T)=>{O.onload=()=>{e.store("lazyLoadedAssets").markLoaded(d),S()},O.onerror=()=>{T(new Error(`Failed to load ${a}: ${d}`))}})},i=async(a,d,c=null,u=null)=>{let y={type:"text/css",rel:"stylesheet"};d&&(y.media=d);let m=document.head,E=null;if(c&&u){let O=document.querySelector(`link[href*="${u}"]`);O?(m=O.parentElement,E=c==="before"?O:O.nextSibling):(console.warn(`Target (${u}) not found for ${a}. Appending to head.`),m=document.head,E=null)}await n("link",a,y,m,E)},o=async(a,d,c=null,u=null,y=null)=>{let m=document.head,E=null;if(c&&u){let S=document.querySelector(`script[src*="${u}"]`);S?(m=S.parentElement,E=c==="before"?S:S.nextSibling):(console.warn(`Target (${u}) not found for ${a}. Falling back to head or body.`),m=document.head,E=null)}else(d.has("body-start")||d.has("body-end"))&&(m=document.body,d.has("body-start")&&(E=document.body.firstChild));let O={};y&&(O.type="module"),await n("script",a,O,m,E)};e.directive("load-css",(a,{expression:d},{evaluate:c})=>{let u=c(d),y=a.media,m=a.getAttribute("data-dispatch"),E=a.getAttribute("data-css-before")?"before":a.getAttribute("data-css-after")?"after":null,O=a.getAttribute("data-css-before")||a.getAttribute("data-css-after")||null;Promise.all(u.map(S=>i(S,y,E,O))).then(()=>{m&&window.dispatchEvent(t(`${m}-css`))}).catch(console.error)}),e.directive("load-js",(a,{expression:d,modifiers:c},{evaluate:u})=>{let y=u(d),m=new Set(c),E=a.getAttribute("data-js-before")?"before":a.getAttribute("data-js-after")?"after":null,O=a.getAttribute("data-js-before")||a.getAttribute("data-js-after")||null,S=a.getAttribute("data-js-as-module")||a.getAttribute("data-as-module")||!1,T=a.getAttribute("data-dispatch");Promise.all(y.map(I=>o(I,m,E,O,S))).then(()=>{T&&window.dispatchEvent(t(`${T}-js`))}).catch(console.error)})}var ao=Ba;function Ha(){return!0}function $a({component:e,argument:t}){return new Promise(r=>{if(t)window.addEventListener(t,()=>r(),{once:!0});else{let n=i=>{i.detail.id===e.id&&(window.removeEventListener("async-alpine:load",n),r())};window.addEventListener("async-alpine:load",n)}})}function Wa(){return new Promise(e=>{"requestIdleCallback"in window?window.requestIdleCallback(e):setTimeout(e,200)})}function Ua({argument:e}){return new Promise(t=>{if(!e)return console.log("Async Alpine: media strategy requires a media query. Treating as 'eager'"),t();let r=window.matchMedia(`(${e})`);r.matches?t():r.addEventListener("change",t,{once:!0})})}function Va({component:e,argument:t}){return new Promise(r=>{let n=t||"0px 0px 0px 0px",i=new IntersectionObserver(o=>{o[0].isIntersecting&&(i.disconnect(),r())},{rootMargin:n});i.observe(e.el)})}var so={eager:Ha,event:$a,idle:Wa,media:Ua,visible:Va};async function za(e){let t=Ya(e.strategy);await oi(e,t)}async function oi(e,t){if(t.type==="expression"){if(t.operator==="&&")return Promise.all(t.parameters.map(r=>oi(e,r)));if(t.operator==="||")return Promise.any(t.parameters.map(r=>oi(e,r)))}return so[t.method]?so[t.method]({component:e,argument:t.argument}):!1}function Ya(e){let t=Xa(e),r=co(t);return r.type==="method"?{type:"expression",operator:"&&",parameters:[r]}:r}function Xa(e){let t=/\s*([()])\s*|\s*(\|\||&&|\|)\s*|\s*((?:[^()&|]+\([^()]+\))|[^()&|]+)\s*/g,r=[],n;for(;(n=t.exec(e))!==null;){let[i,o,a,d]=n;if(o!==void 0)r.push({type:"parenthesis",value:o});else if(a!==void 0)r.push({type:"operator",value:a==="|"?"&&":a});else{let c={type:"method",method:d.trim()};d.includes("(")&&(c.method=d.substring(0,d.indexOf("(")).trim(),c.argument=d.substring(d.indexOf("(")+1,d.indexOf(")"))),d.method==="immediate"&&(d.method="eager"),r.push(c)}}return r}function co(e){let t=lo(e);for(;e.length>0&&(e[0].value==="&&"||e[0].value==="|"||e[0].value==="||");){let r=e.shift().value,n=lo(e);t.type==="expression"&&t.operator===r?t.parameters.push(n):t={type:"expression",operator:r,parameters:[t,n]}}return t}function lo(e){if(e[0].value==="("){e.shift();let t=co(e);return e[0].value===")"&&e.shift(),t}else return e.shift()}function fo(e){let t="load",r=e.prefixed("load-src"),n=e.prefixed("ignore"),i={defaultStrategy:"eager",keepRelativeURLs:!1},o=!1,a={},d=0;function c(){return d++}e.asyncOptions=A=>{i={...i,...A}},e.asyncData=(A,k=!1)=>{a[A]={loaded:!1,download:k}},e.asyncUrl=(A,k)=>{!A||!k||a[A]||(a[A]={loaded:!1,download:()=>import($(k))})},e.asyncAlias=A=>{o=A};let u=A=>{e.skipDuringClone(()=>{A._x_async||(A._x_async="init",A._x_ignore=!0,A.setAttribute(n,""))})()},y=async A=>{e.skipDuringClone(async()=>{if(A._x_async!=="init")return;A._x_async="await";let{name:k,strategy:Y}=m(A);await za({name:k,strategy:Y,el:A,id:A.id||c()}),A.isConnected&&(await E(k),A.isConnected&&(S(A),A._x_async="loaded"))})()};y.inline=u,e.directive(t,y).before("ignore");function m(A){let k=I(A.getAttribute(e.prefixed("data"))),Y=A.getAttribute(e.prefixed(t))||i.defaultStrategy,ne=A.getAttribute(r);return ne&&e.asyncUrl(k,ne),{name:k,strategy:Y}}async function E(A){if(A.startsWith("_x_async_")||(T(A),!a[A]||a[A].loaded))return;let k=await O(A);e.data(A,k),a[A].loaded=!0}async function O(A){if(!a[A])return;let k=await a[A].download(A);return typeof k=="function"?k:k[A]||k.default||Object.values(k)[0]||!1}function S(A){e.destroyTree(A),A._x_ignore=!1,A.removeAttribute(n),!A.closest(`[${n}]`)&&e.initTree(A)}function T(A){if(!(!o||a[A])){if(typeof o=="function"){e.asyncData(A,o);return}e.asyncUrl(A,o.replaceAll("[name]",A))}}function I(A){return(A||"").split(/[({]/g)[0]||`_x_async_${c()}`}function $(A){return i.keepRelativeURLs||new RegExp("^(?:[a-z+]+:)?//","i").test(A)?A:new URL(A,document.baseURI).href}}var zo=Qo(ho(),1);function vo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mt(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function Ka(e,t){if(e==null)return{};var r=Ga(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ja="1.15.6";function Ht(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Wt=Ht(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),er=Ht(/Edge/i),mo=Ht(/firefox/i),Gn=Ht(/safari/i)&&!Ht(/chrome/i)&&!Ht(/android/i),yi=Ht(/iP(ad|od|hone)/i),So=Ht(/chrome/i)&&Ht(/android/i),Ao={capture:!1,passive:!1};function Oe(e,t,r){e.addEventListener(t,r,!Wt&&Ao)}function Ee(e,t,r){e.removeEventListener(t,r,!Wt&&Ao)}function Tr(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Co(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function St(e,t,r,n){if(e){r=r||document;do{if(t!=null&&(t[0]===">"?e.parentNode===r&&Tr(e,t):Tr(e,t))||n&&e===r)return e;if(e===r)break}while(e=Co(e))}return null}var go=/\s+/g;function ft(e,t,r){if(e&&t)if(e.classList)e.classList[r?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(go," ").replace(" "+t+" "," ");e.className=(n+(r?" "+t:"")).replace(go," ")}}function ae(e,t,r){var n=e&&e.style;if(n){if(r===void 0)return document.defaultView&&document.defaultView.getComputedStyle?r=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(r=e.currentStyle),t===void 0?r:r[t];!(t in n)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),n[t]=r+(typeof r=="string"?"":"px")}}function Ln(e,t){var r="";if(typeof e=="string")r=e;else do{var n=ae(e,"transform");n&&n!=="none"&&(r=n+" "+r)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(r)}function Do(e,t,r){if(e){var n=e.getElementsByTagName(t),i=0,o=n.length;if(r)for(;i=o:a=i<=o,!a)return n;if(n===Pt())break;n=sn(n,!1)}return!1}function Nn(e,t,r,n){for(var i=0,o=0,a=e.children;o2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,o=Ka(n,os);tr.pluginEvent.bind(se)(t,r,Mt({dragEl:N,parentEl:Ve,ghostEl:ue,rootEl:ke,nextEl:bn,lastDownEl:Ar,cloneEl:We,cloneHidden:an,dragStarted:Yn,putSortable:Qe,activeSortable:se.active,originalEvent:i,oldIndex:Fn,oldDraggableIndex:Jn,newIndex:ut,newDraggableIndex:on,hideGhostForTarget:Lo,unhideGhostForTarget:No,cloneNowHidden:function(){an=!0},cloneNowShown:function(){an=!1},dispatchSortableEvent:function(d){it({sortable:r,name:d,originalEvent:i})}},o))};function it(e){is(Mt({putSortable:Qe,cloneEl:We,targetEl:N,rootEl:ke,oldIndex:Fn,oldDraggableIndex:Jn,newIndex:ut,newDraggableIndex:on},e))}var N,Ve,ue,ke,bn,Ar,We,an,Fn,ut,Jn,on,wr,Qe,In=!1,Pr=!1,Mr=[],mn,Ot,li,ci,wo,xo,Yn,Rn,Qn,Zn=!1,xr=!1,Cr,nt,fi=[],vi=!1,Rr=[],Fr=typeof document<"u",Er=yi,Eo=er||Wt?"cssFloat":"float",as=Fr&&!So&&!yi&&"draggable"in document.createElement("div"),Ro=function(){if(Fr){if(Wt)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),Io=function(t,r){var n=ae(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Nn(t,0,r),a=Nn(t,1,r),d=o&&ae(o),c=a&&ae(a),u=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+qe(o).width,y=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+qe(a).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(o&&d.float&&d.float!=="none"){var m=d.float==="left"?"left":"right";return a&&(c.clear==="both"||c.clear===m)?"vertical":"horizontal"}return o&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||u>=i&&n[Eo]==="none"||a&&n[Eo]==="none"&&u+y>i)?"vertical":"horizontal"},ss=function(t,r,n){var i=n?t.left:t.top,o=n?t.right:t.bottom,a=n?t.width:t.height,d=n?r.left:r.top,c=n?r.right:r.bottom,u=n?r.width:r.height;return i===d||o===c||i+a/2===d+u/2},ls=function(t,r){var n;return Mr.some(function(i){var o=i[st].options.emptyInsertThreshold;if(!(!o||wi(i))){var a=qe(i),d=t>=a.left-o&&t<=a.right+o,c=r>=a.top-o&&r<=a.bottom+o;if(d&&c)return n=i}}),n},Fo=function(t){function r(o,a){return function(d,c,u,y){var m=d.options.group.name&&c.options.group.name&&d.options.group.name===c.options.group.name;if(o==null&&(a||m))return!0;if(o==null||o===!1)return!1;if(a&&o==="clone")return o;if(typeof o=="function")return r(o(d,c,u,y),a)(d,c,u,y);var E=(a?d:c).options.group.name;return o===!0||typeof o=="string"&&o===E||o.join&&o.indexOf(E)>-1}}var n={},i=t.group;(!i||Sr(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=r(i.pull,!0),n.checkPut=r(i.put),n.revertClone=i.revertClone,t.group=n},Lo=function(){!Ro&&ue&&ae(ue,"display","none")},No=function(){!Ro&&ue&&ae(ue,"display","")};Fr&&!So&&document.addEventListener("click",function(e){if(Pr)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Pr=!1,!1},!0);var gn=function(t){if(N){t=t.touches?t.touches[0]:t;var r=ls(t.clientX,t.clientY);if(r){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.target=n.rootEl=r,n.preventDefault=void 0,n.stopPropagation=void 0,r[st]._onDragOver(n)}}},cs=function(t){N&&N.parentNode[st]._isOutsideThisEl(t.target)};function se(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=$t({},t),e[st]=this;var r={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Io(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(a,d){a.setData("Text",d.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:se.supportPointer!==!1&&"PointerEvent"in window&&(!Gn||yi),emptyInsertThreshold:5};tr.initializePlugins(this,e,r);for(var n in r)!(n in t)&&(t[n]=r[n]);Fo(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:as,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Oe(e,"pointerdown",this._onTapStart):(Oe(e,"mousedown",this._onTapStart),Oe(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Oe(e,"dragover",this),Oe(e,"dragenter",this)),Mr.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),$t(this,ts())}se.prototype={constructor:se,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Rn=null)},_getDirection:function(t,r){return typeof this.options.direction=="function"?this.options.direction.call(this,t,r,N):this.options.direction},_onTapStart:function(t){if(t.cancelable){var r=this,n=this.el,i=this.options,o=i.preventOnFilter,a=t.type,d=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,c=(d||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||c,y=i.filter;if(gs(n),!N&&!(/mousedown|pointerdown/.test(a)&&t.button!==0||i.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Gn&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=St(c,i.draggable,n,!1),!(c&&c.animated)&&Ar!==c)){if(Fn=vt(c),Jn=vt(c,i.draggable),typeof y=="function"){if(y.call(this,t,c,this)){it({sortable:r,rootEl:u,name:"filter",targetEl:c,toEl:n,fromEl:n}),at("filter",r,{evt:t}),o&&t.preventDefault();return}}else if(y&&(y=y.split(",").some(function(m){if(m=St(u,m.trim(),n,!1),m)return it({sortable:r,rootEl:m,name:"filter",targetEl:c,fromEl:n,toEl:n}),at("filter",r,{evt:t}),!0}),y)){o&&t.preventDefault();return}i.handle&&!St(u,i.handle,n,!1)||this._prepareDragStart(t,d,c)}}},_prepareDragStart:function(t,r,n){var i=this,o=i.el,a=i.options,d=o.ownerDocument,c;if(n&&!N&&n.parentNode===o){var u=qe(n);if(ke=o,N=n,Ve=N.parentNode,bn=N.nextSibling,Ar=n,wr=a.group,se.dragged=N,mn={target:N,clientX:(r||t).clientX,clientY:(r||t).clientY},wo=mn.clientX-u.left,xo=mn.clientY-u.top,this._lastX=(r||t).clientX,this._lastY=(r||t).clientY,N.style["will-change"]="all",c=function(){if(at("delayEnded",i,{evt:t}),se.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!mo&&i.nativeDraggable&&(N.draggable=!0),i._triggerDragStart(t,r),it({sortable:i,name:"choose",originalEvent:t}),ft(N,a.chosenClass,!0)},a.ignore.split(",").forEach(function(y){Do(N,y.trim(),ui)}),Oe(d,"dragover",gn),Oe(d,"mousemove",gn),Oe(d,"touchmove",gn),a.supportPointer?(Oe(d,"pointerup",i._onDrop),!this.nativeDraggable&&Oe(d,"pointercancel",i._onDrop)):(Oe(d,"mouseup",i._onDrop),Oe(d,"touchend",i._onDrop),Oe(d,"touchcancel",i._onDrop)),mo&&this.nativeDraggable&&(this.options.touchStartThreshold=4,N.draggable=!0),at("delayStart",this,{evt:t}),a.delay&&(!a.delayOnTouchOnly||r)&&(!this.nativeDraggable||!(er||Wt))){if(se.eventCanceled){this._onDrop();return}a.supportPointer?(Oe(d,"pointerup",i._disableDelayedDrag),Oe(d,"pointercancel",i._disableDelayedDrag)):(Oe(d,"mouseup",i._disableDelayedDrag),Oe(d,"touchend",i._disableDelayedDrag),Oe(d,"touchcancel",i._disableDelayedDrag)),Oe(d,"mousemove",i._delayedDragTouchMoveHandler),Oe(d,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&Oe(d,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(c,a.delay)}else c()}},_delayedDragTouchMoveHandler:function(t){var r=t.touches?t.touches[0]:t;Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){N&&ui(N),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Ee(t,"mouseup",this._disableDelayedDrag),Ee(t,"touchend",this._disableDelayedDrag),Ee(t,"touchcancel",this._disableDelayedDrag),Ee(t,"pointerup",this._disableDelayedDrag),Ee(t,"pointercancel",this._disableDelayedDrag),Ee(t,"mousemove",this._delayedDragTouchMoveHandler),Ee(t,"touchmove",this._delayedDragTouchMoveHandler),Ee(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,r){r=r||t.pointerType=="touch"&&t,!this.nativeDraggable||r?this.options.supportPointer?Oe(document,"pointermove",this._onTouchMove):r?Oe(document,"touchmove",this._onTouchMove):Oe(document,"mousemove",this._onTouchMove):(Oe(N,"dragend",this),Oe(ke,"dragstart",this._onDragStart));try{document.selection?Dr(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,r){if(In=!1,ke&&N){at("dragStarted",this,{evt:r}),this.nativeDraggable&&Oe(document,"dragover",cs);var n=this.options;!t&&ft(N,n.dragClass,!1),ft(N,n.ghostClass,!0),se.active=this,t&&this._appendGhost(),it({sortable:this,name:"start",originalEvent:r})}else this._nulling()},_emulateDragOver:function(){if(Ot){this._lastX=Ot.clientX,this._lastY=Ot.clientY,Lo();for(var t=document.elementFromPoint(Ot.clientX,Ot.clientY),r=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Ot.clientX,Ot.clientY),t!==r);)r=t;if(N.parentNode[st]._isOutsideThisEl(t),r)do{if(r[st]){var n=void 0;if(n=r[st]._onDragOver({clientX:Ot.clientX,clientY:Ot.clientY,target:t,rootEl:r}),n&&!this.options.dragoverBubble)break}t=r}while(r=Co(r));No()}},_onTouchMove:function(t){if(mn){var r=this.options,n=r.fallbackTolerance,i=r.fallbackOffset,o=t.touches?t.touches[0]:t,a=ue&&Ln(ue,!0),d=ue&&a&&a.a,c=ue&&a&&a.d,u=Er&&nt&&yo(nt),y=(o.clientX-mn.clientX+i.x)/(d||1)+(u?u[0]-fi[0]:0)/(d||1),m=(o.clientY-mn.clientY+i.y)/(c||1)+(u?u[1]-fi[1]:0)/(c||1);if(!se.active&&!In){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))=0&&(it({rootEl:Ve,name:"add",toEl:Ve,fromEl:ke,originalEvent:t}),it({sortable:this,name:"remove",toEl:Ve,originalEvent:t}),it({rootEl:Ve,name:"sort",toEl:Ve,fromEl:ke,originalEvent:t}),it({sortable:this,name:"sort",toEl:Ve,originalEvent:t})),Qe&&Qe.save()):ut!==Fn&&ut>=0&&(it({sortable:this,name:"update",toEl:Ve,originalEvent:t}),it({sortable:this,name:"sort",toEl:Ve,originalEvent:t})),se.active&&((ut==null||ut===-1)&&(ut=Fn,on=Jn),it({sortable:this,name:"end",toEl:Ve,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){at("nulling",this),ke=N=Ve=ue=bn=We=Ar=an=mn=Ot=Yn=ut=on=Fn=Jn=Rn=Qn=Qe=wr=se.dragged=se.ghost=se.clone=se.active=null,Rr.forEach(function(t){t.checked=!0}),Rr.length=li=ci=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":N&&(this._onDragOver(t),fs(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],r,n=this.el.children,i=0,o=n.length,a=this.options;ii.right+o||e.clientY>n.bottom&&e.clientX>n.left:e.clientY>i.bottom+o||e.clientX>n.right&&e.clientY>n.top}function hs(e,t,r,n,i,o,a,d){var c=n?e.clientY:e.clientX,u=n?r.height:r.width,y=n?r.top:r.left,m=n?r.bottom:r.right,E=!1;if(!a){if(d&&Cry+u*o/2:cm-Cr)return-Qn}else if(c>y+u*(1-i)/2&&cm-u*o/2)?c>y+u/2?1:-1:0}function vs(e){return vt(N){e.directive("sortable",t=>{let r=parseInt(t.dataset?.sortableAnimationDuration);r!==0&&!r&&(r=300),t.sortable=Oi.create(t,{group:t.getAttribute("x-sortable-group"),draggable:"[x-sortable-item]",handle:"[x-sortable-handle]",dataIdAttr:"x-sortable-item",animation:r,ghostClass:"fi-sortable-ghost"})})};var ys=Object.create,Ci=Object.defineProperty,ws=Object.getPrototypeOf,xs=Object.prototype.hasOwnProperty,Es=Object.getOwnPropertyNames,Os=Object.getOwnPropertyDescriptor,Ss=e=>Ci(e,"__esModule",{value:!0}),Bo=(e,t)=>()=>(t||(t={exports:{}},e(t.exports,t)),t.exports),As=(e,t,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Es(t))!xs.call(e,n)&&n!=="default"&&Ci(e,n,{get:()=>t[n],enumerable:!(r=Os(t,n))||r.enumerable});return e},Ho=e=>As(Ss(Ci(e!=null?ys(ws(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Cs=Bo(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function t(f){var s=f.getBoundingClientRect();return{width:s.width,height:s.height,top:s.top,right:s.right,bottom:s.bottom,left:s.left,x:s.left,y:s.top}}function r(f){if(f==null)return window;if(f.toString()!=="[object Window]"){var s=f.ownerDocument;return s&&s.defaultView||window}return f}function n(f){var s=r(f),b=s.pageXOffset,_=s.pageYOffset;return{scrollLeft:b,scrollTop:_}}function i(f){var s=r(f).Element;return f instanceof s||f instanceof Element}function o(f){var s=r(f).HTMLElement;return f instanceof s||f instanceof HTMLElement}function a(f){if(typeof ShadowRoot>"u")return!1;var s=r(f).ShadowRoot;return f instanceof s||f instanceof ShadowRoot}function d(f){return{scrollLeft:f.scrollLeft,scrollTop:f.scrollTop}}function c(f){return f===r(f)||!o(f)?n(f):d(f)}function u(f){return f?(f.nodeName||"").toLowerCase():null}function y(f){return((i(f)?f.ownerDocument:f.document)||window.document).documentElement}function m(f){return t(y(f)).left+n(f).scrollLeft}function E(f){return r(f).getComputedStyle(f)}function O(f){var s=E(f),b=s.overflow,_=s.overflowX,P=s.overflowY;return/auto|scroll|overlay|hidden/.test(b+P+_)}function S(f,s,b){b===void 0&&(b=!1);var _=y(s),P=t(f),L=o(s),U={scrollLeft:0,scrollTop:0},H={x:0,y:0};return(L||!L&&!b)&&((u(s)!=="body"||O(_))&&(U=c(s)),o(s)?(H=t(s),H.x+=s.clientLeft,H.y+=s.clientTop):_&&(H.x=m(_))),{x:P.left+U.scrollLeft-H.x,y:P.top+U.scrollTop-H.y,width:P.width,height:P.height}}function T(f){var s=t(f),b=f.offsetWidth,_=f.offsetHeight;return Math.abs(s.width-b)<=1&&(b=s.width),Math.abs(s.height-_)<=1&&(_=s.height),{x:f.offsetLeft,y:f.offsetTop,width:b,height:_}}function I(f){return u(f)==="html"?f:f.assignedSlot||f.parentNode||(a(f)?f.host:null)||y(f)}function $(f){return["html","body","#document"].indexOf(u(f))>=0?f.ownerDocument.body:o(f)&&O(f)?f:$(I(f))}function A(f,s){var b;s===void 0&&(s=[]);var _=$(f),P=_===((b=f.ownerDocument)==null?void 0:b.body),L=r(_),U=P?[L].concat(L.visualViewport||[],O(_)?_:[]):_,H=s.concat(U);return P?H:H.concat(A(I(U)))}function k(f){return["table","td","th"].indexOf(u(f))>=0}function Y(f){return!o(f)||E(f).position==="fixed"?null:f.offsetParent}function ne(f){var s=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,b=navigator.userAgent.indexOf("Trident")!==-1;if(b&&o(f)){var _=E(f);if(_.position==="fixed")return null}for(var P=I(f);o(P)&&["html","body"].indexOf(u(P))<0;){var L=E(P);if(L.transform!=="none"||L.perspective!=="none"||L.contain==="paint"||["transform","perspective"].indexOf(L.willChange)!==-1||s&&L.willChange==="filter"||s&&L.filter&&L.filter!=="none")return P;P=P.parentNode}return null}function J(f){for(var s=r(f),b=Y(f);b&&k(b)&&E(b).position==="static";)b=Y(b);return b&&(u(b)==="html"||u(b)==="body"&&E(b).position==="static")?s:b||ne(f)||s}var V="top",de="bottom",X="right",Q="left",me="auto",l=[V,de,X,Q],h="start",v="end",p="clippingParents",j="viewport",M="popper",R="reference",Z=l.reduce(function(f,s){return f.concat([s+"-"+h,s+"-"+v])},[]),ze=[].concat(l,[me]).reduce(function(f,s){return f.concat([s,s+"-"+h,s+"-"+v])},[]),Rt="beforeRead",Ut="read",Lr="afterRead",Nr="beforeMain",kr="main",Vt="afterMain",nr="beforeWrite",jr="write",rr="afterWrite",It=[Rt,Ut,Lr,Nr,kr,Vt,nr,jr,rr];function Br(f){var s=new Map,b=new Set,_=[];f.forEach(function(L){s.set(L.name,L)});function P(L){b.add(L.name);var U=[].concat(L.requires||[],L.requiresIfExists||[]);U.forEach(function(H){if(!b.has(H)){var G=s.get(H);G&&P(G)}}),_.push(L)}return f.forEach(function(L){b.has(L.name)||P(L)}),_}function mt(f){var s=Br(f);return It.reduce(function(b,_){return b.concat(s.filter(function(P){return P.phase===_}))},[])}function zt(f){var s;return function(){return s||(s=new Promise(function(b){Promise.resolve().then(function(){s=void 0,b(f())})})),s}}function At(f){for(var s=arguments.length,b=new Array(s>1?s-1:0),_=1;_=0,_=b&&o(f)?J(f):f;return i(_)?s.filter(function(P){return i(P)&&kn(P,_)&&u(P)!=="body"}):[]}function wn(f,s,b){var _=s==="clippingParents"?yn(f):[].concat(s),P=[].concat(_,[b]),L=P[0],U=P.reduce(function(H,G){var oe=sr(f,G);return H.top=gt(oe.top,H.top),H.right=ln(oe.right,H.right),H.bottom=ln(oe.bottom,H.bottom),H.left=gt(oe.left,H.left),H},sr(f,L));return U.width=U.right-U.left,U.height=U.bottom-U.top,U.x=U.left,U.y=U.top,U}function cn(f){return f.split("-")[1]}function dt(f){return["top","bottom"].indexOf(f)>=0?"x":"y"}function lr(f){var s=f.reference,b=f.element,_=f.placement,P=_?ot(_):null,L=_?cn(_):null,U=s.x+s.width/2-b.width/2,H=s.y+s.height/2-b.height/2,G;switch(P){case V:G={x:U,y:s.y-b.height};break;case de:G={x:U,y:s.y+s.height};break;case X:G={x:s.x+s.width,y:H};break;case Q:G={x:s.x-b.width,y:H};break;default:G={x:s.x,y:s.y}}var oe=P?dt(P):null;if(oe!=null){var z=oe==="y"?"height":"width";switch(L){case h:G[oe]=G[oe]-(s[z]/2-b[z]/2);break;case v:G[oe]=G[oe]+(s[z]/2-b[z]/2);break}}return G}function cr(){return{top:0,right:0,bottom:0,left:0}}function fr(f){return Object.assign({},cr(),f)}function ur(f,s){return s.reduce(function(b,_){return b[_]=f,b},{})}function qt(f,s){s===void 0&&(s={});var b=s,_=b.placement,P=_===void 0?f.placement:_,L=b.boundary,U=L===void 0?p:L,H=b.rootBoundary,G=H===void 0?j:H,oe=b.elementContext,z=oe===void 0?M:oe,De=b.altBoundary,Le=De===void 0?!1:De,Ce=b.padding,xe=Ce===void 0?0:Ce,Me=fr(typeof xe!="number"?xe:ur(xe,l)),Se=z===M?R:M,Be=f.elements.reference,Re=f.rects.popper,He=f.elements[Le?Se:z],ce=wn(i(He)?He:He.contextElement||y(f.elements.popper),U,G),Pe=t(Be),_e=lr({reference:Pe,element:Re,strategy:"absolute",placement:P}),Ne=Xt(Object.assign({},Re,_e)),Fe=z===M?Ne:Pe,Ye={top:ce.top-Fe.top+Me.top,bottom:Fe.bottom-ce.bottom+Me.bottom,left:ce.left-Fe.left+Me.left,right:Fe.right-ce.right+Me.right},$e=f.modifiersData.offset;if(z===M&&$e){var Ue=$e[P];Object.keys(Ye).forEach(function(wt){var et=[X,de].indexOf(wt)>=0?1:-1,Lt=[V,de].indexOf(wt)>=0?"y":"x";Ye[wt]+=Ue[Lt]*et})}return Ye}var dr="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",Vr="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",xn={placement:"bottom",modifiers:[],strategy:"absolute"};function fn(){for(var f=arguments.length,s=new Array(f),b=0;b100){console.error(Vr);break}if(z.reset===!0){z.reset=!1,Pe=-1;continue}var _e=z.orderedModifiers[Pe],Ne=_e.fn,Fe=_e.options,Ye=Fe===void 0?{}:Fe,$e=_e.name;typeof Ne=="function"&&(z=Ne({state:z,options:Ye,name:$e,instance:Ce})||z)}}},update:zt(function(){return new Promise(function(Se){Ce.forceUpdate(),Se(z)})}),destroy:function(){Me(),Le=!0}};if(!fn(H,G))return console.error(dr),Ce;Ce.setOptions(oe).then(function(Se){!Le&&oe.onFirstUpdate&&oe.onFirstUpdate(Se)});function xe(){z.orderedModifiers.forEach(function(Se){var Be=Se.name,Re=Se.options,He=Re===void 0?{}:Re,ce=Se.effect;if(typeof ce=="function"){var Pe=ce({state:z,name:Be,instance:Ce,options:He}),_e=function(){};De.push(Pe||_e)}})}function Me(){De.forEach(function(Se){return Se()}),De=[]}return Ce}}var On={passive:!0};function zr(f){var s=f.state,b=f.instance,_=f.options,P=_.scroll,L=P===void 0?!0:P,U=_.resize,H=U===void 0?!0:U,G=r(s.elements.popper),oe=[].concat(s.scrollParents.reference,s.scrollParents.popper);return L&&oe.forEach(function(z){z.addEventListener("scroll",b.update,On)}),H&&G.addEventListener("resize",b.update,On),function(){L&&oe.forEach(function(z){z.removeEventListener("scroll",b.update,On)}),H&&G.removeEventListener("resize",b.update,On)}}var jn={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:zr,data:{}};function Yr(f){var s=f.state,b=f.name;s.modifiersData[b]=lr({reference:s.rects.reference,element:s.rects.popper,strategy:"absolute",placement:s.placement})}var Bn={name:"popperOffsets",enabled:!0,phase:"read",fn:Yr,data:{}},Xr={top:"auto",right:"auto",bottom:"auto",left:"auto"};function qr(f){var s=f.x,b=f.y,_=window,P=_.devicePixelRatio||1;return{x:Yt(Yt(s*P)/P)||0,y:Yt(Yt(b*P)/P)||0}}function Hn(f){var s,b=f.popper,_=f.popperRect,P=f.placement,L=f.offsets,U=f.position,H=f.gpuAcceleration,G=f.adaptive,oe=f.roundOffsets,z=oe===!0?qr(L):typeof oe=="function"?oe(L):L,De=z.x,Le=De===void 0?0:De,Ce=z.y,xe=Ce===void 0?0:Ce,Me=L.hasOwnProperty("x"),Se=L.hasOwnProperty("y"),Be=Q,Re=V,He=window;if(G){var ce=J(b),Pe="clientHeight",_e="clientWidth";ce===r(b)&&(ce=y(b),E(ce).position!=="static"&&(Pe="scrollHeight",_e="scrollWidth")),ce=ce,P===V&&(Re=de,xe-=ce[Pe]-_.height,xe*=H?1:-1),P===Q&&(Be=X,Le-=ce[_e]-_.width,Le*=H?1:-1)}var Ne=Object.assign({position:U},G&&Xr);if(H){var Fe;return Object.assign({},Ne,(Fe={},Fe[Re]=Se?"0":"",Fe[Be]=Me?"0":"",Fe.transform=(He.devicePixelRatio||1)<2?"translate("+Le+"px, "+xe+"px)":"translate3d("+Le+"px, "+xe+"px, 0)",Fe))}return Object.assign({},Ne,(s={},s[Re]=Se?xe+"px":"",s[Be]=Me?Le+"px":"",s.transform="",s))}function g(f){var s=f.state,b=f.options,_=b.gpuAcceleration,P=_===void 0?!0:_,L=b.adaptive,U=L===void 0?!0:L,H=b.roundOffsets,G=H===void 0?!0:H,oe=E(s.elements.popper).transitionProperty||"";U&&["transform","top","right","bottom","left"].some(function(De){return oe.indexOf(De)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',` `,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",` -`,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "));var z={placement:ot(s.placement),popper:s.elements.popper,popperRect:s.rects.popper,gpuAcceleration:P};s.modifiersData.popperOffsets!=null&&(s.styles.popper=Object.assign({},s.styles.popper,Hn(Object.assign({},z,{offsets:s.modifiersData.popperOffsets,position:s.options.strategy,adaptive:U,roundOffsets:G})))),s.modifiersData.arrow!=null&&(s.styles.arrow=Object.assign({},s.styles.arrow,Hn(Object.assign({},z,{offsets:s.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:G})))),s.attributes.popper=Object.assign({},s.attributes.popper,{"data-popper-placement":s.placement})}var w={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:g,data:{}};function D(f){var s=f.state;Object.keys(s.elements).forEach(function(b){var _=s.styles[b]||{},P=s.attributes[b]||{},L=s.elements[b];!o(L)||!u(L)||(Object.assign(L.style,_),Object.keys(P).forEach(function(U){var H=P[U];H===!1?L.removeAttribute(U):L.setAttribute(U,H===!0?"":H)}))})}function F(f){var s=f.state,b={popper:{position:s.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(s.elements.popper.style,b.popper),s.styles=b,s.elements.arrow&&Object.assign(s.elements.arrow.style,b.arrow),function(){Object.keys(s.elements).forEach(function(_){var P=s.elements[_],L=s.attributes[_]||{},U=Object.keys(s.styles.hasOwnProperty(_)?s.styles[_]:b[_]),H=U.reduce(function(G,oe){return G[oe]="",G},{});!o(P)||!u(P)||(Object.assign(P.style,H),Object.keys(L).forEach(function(G){P.removeAttribute(G)}))})}}var q={name:"applyStyles",enabled:!0,phase:"write",fn:D,effect:F,requires:["computeStyles"]};function W(f,s,b){var _=ot(f),P=[Q,V].indexOf(_)>=0?-1:1,L=typeof b=="function"?b(Object.assign({},s,{placement:f})):b,U=L[0],H=L[1];return U=U||0,H=(H||0)*P,[Q,X].indexOf(_)>=0?{x:H,y:U}:{x:U,y:H}}function B(f){var s=f.state,b=f.options,_=f.name,P=b.offset,L=P===void 0?[0,0]:P,U=ze.reduce(function(z,Ce){return z[Ce]=W(Ce,s.rects,L),z},{}),H=U[s.placement],G=H.x,oe=H.y;s.modifiersData.popperOffsets!=null&&(s.modifiersData.popperOffsets.x+=G,s.modifiersData.popperOffsets.y+=oe),s.modifiersData[_]=U}var be={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:B},le={left:"right",right:"left",bottom:"top",top:"bottom"};function pe(f){return f.replace(/left|right|bottom|top/g,function(s){return le[s]})}var ye={start:"end",end:"start"};function Te(f){return f.replace(/start|end/g,function(s){return ye[s]})}function je(f,s){s===void 0&&(s={});var b=s,_=b.placement,P=b.boundary,L=b.rootBoundary,U=b.padding,H=b.flipVariations,G=b.allowedAutoPlacements,oe=G===void 0?ze:G,z=cn(_),Ce=z?H?Z:Z.filter(function(xe){return cn(xe)===z}):l,Le=Ce.filter(function(xe){return oe.indexOf(xe)>=0});Le.length===0&&(Le=Ce,console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var De=Le.reduce(function(xe,Me){return xe[Me]=qt(f,{placement:Me,boundary:P,rootBoundary:L,padding:U})[ot(Me)],xe},{});return Object.keys(De).sort(function(xe,Me){return De[xe]-De[Me]})}function Ae(f){if(ot(f)===me)return[];var s=pe(f);return[Te(f),s,Te(s)]}function Ie(f){var s=f.state,b=f.options,_=f.name;if(!s.modifiersData[_]._skip){for(var P=b.mainAxis,L=P===void 0?!0:P,U=b.altAxis,H=U===void 0?!0:U,G=b.fallbackPlacements,oe=b.padding,z=b.boundary,Ce=b.rootBoundary,Le=b.altBoundary,De=b.flipVariations,xe=De===void 0?!0:De,Me=b.allowedAutoPlacements,Se=s.options.placement,Be=ot(Se),Re=Be===Se,He=G||(Re||!xe?[pe(Se)]:Ae(Se)),ce=[Se].concat(He).reduce(function(te,ge){return te.concat(ot(ge)===me?je(s,{placement:ge,boundary:z,rootBoundary:Ce,padding:oe,flipVariations:xe,allowedAutoPlacements:Me}):ge)},[]),Pe=s.rects.reference,_e=s.rects.popper,Ne=new Map,Fe=!0,Ye=ce[0],$e=0;$e=0,dn=Lt?"width":"height",Qt=qt(s,{placement:Ue,boundary:z,rootBoundary:Ce,altBoundary:Le,padding:oe}),Nt=Lt?et?X:Q:et?de:V;Pe[dn]>_e[dn]&&(Nt=pe(Nt));var $n=pe(Nt),Zt=[];if(L&&Zt.push(Qt[wt]<=0),H&&Zt.push(Qt[Nt]<=0,Qt[$n]<=0),Zt.every(function(te){return te})){Ye=Ue,Fe=!1;break}Ne.set(Ue,Zt)}if(Fe)for(var Sn=xe?3:1,Wn=function(ge){var we=ce.find(function(Ke){var Je=Ne.get(Ke);if(Je)return Je.slice(0,ge).every(function(Ct){return Ct})});if(we)return Ye=we,"break"},C=Sn;C>0;C--){var K=Wn(C);if(K==="break")break}s.placement!==Ye&&(s.modifiersData[_]._skip=!0,s.placement=Ye,s.reset=!0)}}var re={name:"flip",enabled:!0,phase:"main",fn:Ie,requiresIfExists:["offset"],data:{_skip:!1}};function he(f){return f==="x"?"y":"x"}function ve(f,s,b){return gt(f,ln(s,b))}function ee(f){var s=f.state,b=f.options,_=f.name,P=b.mainAxis,L=P===void 0?!0:P,U=b.altAxis,H=U===void 0?!1:U,G=b.boundary,oe=b.rootBoundary,z=b.altBoundary,Ce=b.padding,Le=b.tether,De=Le===void 0?!0:Le,xe=b.tetherOffset,Me=xe===void 0?0:xe,Se=qt(s,{boundary:G,rootBoundary:oe,padding:Ce,altBoundary:z}),Be=ot(s.placement),Re=cn(s.placement),He=!Re,ce=dt(Be),Pe=he(ce),_e=s.modifiersData.popperOffsets,Ne=s.rects.reference,Fe=s.rects.popper,Ye=typeof Me=="function"?Me(Object.assign({},s.rects,{placement:s.placement})):Me,$e={x:0,y:0};if(_e){if(L||H){var Ue=ce==="y"?V:Q,wt=ce==="y"?de:X,et=ce==="y"?"height":"width",Lt=_e[ce],dn=_e[ce]+Se[Ue],Qt=_e[ce]-Se[wt],Nt=De?-Fe[et]/2:0,$n=Re===h?Ne[et]:Fe[et],Zt=Re===h?-Fe[et]:-Ne[et],Sn=s.elements.arrow,Wn=De&&Sn?T(Sn):{width:0,height:0},C=s.modifiersData["arrow#persistent"]?s.modifiersData["arrow#persistent"].padding:cr(),K=C[Ue],te=C[wt],ge=ve(0,Ne[et],Wn[et]),we=He?Ne[et]/2-Nt-ge-K-Ye:$n-ge-K-Ye,Ke=He?-Ne[et]/2+Nt+ge+te+Ye:Zt+ge+te+Ye,Je=s.elements.arrow&&J(s.elements.arrow),Ct=Je?ce==="y"?Je.clientTop||0:Je.clientLeft||0:0,Un=s.modifiersData.offset?s.modifiersData.offset[s.placement][ce]:0,_t=_e[ce]+we-Un-Ct,An=_e[ce]+Ke-Un;if(L){var pn=ve(De?ln(dn,_t):dn,Lt,De?gt(Qt,An):Qt);_e[ce]=pn,$e[ce]=pn-Lt}if(H){var en=ce==="x"?V:Q,Gr=ce==="x"?de:X,tn=_e[Pe],hn=tn+Se[en],Ci=tn-Se[Gr],_i=ve(De?ln(hn,_t):hn,tn,De?gt(Ci,An):Ci);_e[Pe]=_i,$e[Pe]=_i-tn}}s.modifiersData[_]=$e}}var ie={name:"preventOverflow",enabled:!0,phase:"main",fn:ee,requiresIfExists:["offset"]},x=function(s,b){return s=typeof s=="function"?s(Object.assign({},b.rects,{placement:b.placement})):s,fr(typeof s!="number"?s:ur(s,l))};function Ge(f){var s,b=f.state,_=f.name,P=f.options,L=b.elements.arrow,U=b.modifiersData.popperOffsets,H=ot(b.placement),G=dt(H),oe=[Q,X].indexOf(H)>=0,z=oe?"height":"width";if(!(!L||!U)){var Ce=x(P.padding,b),Le=T(L),De=G==="y"?V:Q,xe=G==="y"?de:X,Me=b.rects.reference[z]+b.rects.reference[G]-U[G]-b.rects.popper[z],Se=U[G]-b.rects.reference[G],Be=J(L),Re=Be?G==="y"?Be.clientHeight||0:Be.clientWidth||0:0,He=Me/2-Se/2,ce=Ce[De],Pe=Re-Le[z]-Ce[xe],_e=Re/2-Le[z]/2+He,Ne=ve(ce,_e,Pe),Fe=G;b.modifiersData[_]=(s={},s[Fe]=Ne,s.centerOffset=Ne-_e,s)}}function fe(f){var s=f.state,b=f.options,_=b.element,P=_===void 0?"[data-popper-arrow]":_;if(P!=null&&!(typeof P=="string"&&(P=s.elements.popper.querySelector(P),!P))){if(o(P)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" ")),!kn(s.elements.popper,P)){console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}s.elements.arrow=P}}var Ft={name:"arrow",enabled:!0,phase:"main",fn:Ge,effect:fe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function bt(f,s,b){return b===void 0&&(b={x:0,y:0}),{top:f.top-s.height-b.y,right:f.right-s.width+b.x,bottom:f.bottom-s.height+b.y,left:f.left-s.width-b.x}}function Gt(f){return[V,X,de,Q].some(function(s){return f[s]>=0})}function Kt(f){var s=f.state,b=f.name,_=s.rects.reference,P=s.rects.popper,L=s.modifiersData.preventOverflow,U=qt(s,{elementContext:"reference"}),H=qt(s,{altBoundary:!0}),G=bt(U,_),oe=bt(H,P,L),z=Gt(G),Ce=Gt(oe);s.modifiersData[b]={referenceClippingOffsets:G,popperEscapeOffsets:oe,isReferenceHidden:z,hasPopperEscaped:Ce},s.attributes.popper=Object.assign({},s.attributes.popper,{"data-popper-reference-hidden":z,"data-popper-escaped":Ce})}var Jt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Kt},rt=[jn,Bn,w,q],lt=En({defaultModifiers:rt}),yt=[jn,Bn,w,q,be,re,ie,Ft,Jt],un=En({defaultModifiers:yt});e.applyStyles=q,e.arrow=Ft,e.computeStyles=w,e.createPopper=un,e.createPopperLite=lt,e.defaultModifiers=yt,e.detectOverflow=qt,e.eventListeners=jn,e.flip=re,e.hide=Jt,e.offset=be,e.popperGenerator=En,e.popperOffsets=Bn,e.preventOverflow=ie}),$o=Bo(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Ds(),r='',n="tippy-box",i="tippy-content",o="tippy-backdrop",a="tippy-arrow",d="tippy-svg-arrow",c={passive:!0,capture:!0};function u(g,w){return{}.hasOwnProperty.call(g,w)}function y(g,w,D){if(Array.isArray(g)){var F=g[w];return F??(Array.isArray(D)?D[w]:D)}return g}function m(g,w){var D={}.toString.call(g);return D.indexOf("[object")===0&&D.indexOf(w+"]")>-1}function E(g,w){return typeof g=="function"?g.apply(void 0,w):g}function O(g,w){if(w===0)return g;var D;return function(F){clearTimeout(D),D=setTimeout(function(){g(F)},w)}}function S(g,w){var D=Object.assign({},g);return w.forEach(function(F){delete D[F]}),D}function T(g){return g.split(/\s+/).filter(Boolean)}function I(g){return[].concat(g)}function $(g,w){g.indexOf(w)===-1&&g.push(w)}function A(g){return g.filter(function(w,D){return g.indexOf(w)===D})}function k(g){return g.split("-")[0]}function Y(g){return[].slice.call(g)}function ne(g){return Object.keys(g).reduce(function(w,D){return g[D]!==void 0&&(w[D]=g[D]),w},{})}function J(){return document.createElement("div")}function V(g){return["Element","Fragment"].some(function(w){return m(g,w)})}function de(g){return m(g,"NodeList")}function X(g){return m(g,"MouseEvent")}function Q(g){return!!(g&&g._tippy&&g._tippy.reference===g)}function me(g){return V(g)?[g]:de(g)?Y(g):Array.isArray(g)?g:Y(document.querySelectorAll(g))}function l(g,w){g.forEach(function(D){D&&(D.style.transitionDuration=w+"ms")})}function h(g,w){g.forEach(function(D){D&&D.setAttribute("data-state",w)})}function v(g){var w,D=I(g),F=D[0];return!(F==null||(w=F.ownerDocument)==null)&&w.body?F.ownerDocument:document}function p(g,w){var D=w.clientX,F=w.clientY;return g.every(function(q){var W=q.popperRect,B=q.popperState,be=q.props,le=be.interactiveBorder,pe=k(B.placement),ye=B.modifiersData.offset;if(!ye)return!0;var Te=pe==="bottom"?ye.top.y:0,je=pe==="top"?ye.bottom.y:0,Ae=pe==="right"?ye.left.x:0,Ie=pe==="left"?ye.right.x:0,re=W.top-F+Te>le,he=F-W.bottom-je>le,ve=W.left-D+Ae>le,ee=D-W.right-Ie>le;return re||he||ve||ee})}function j(g,w,D){var F=w+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(q){g[F](q,D)})}var M={isTouch:!1},R=0;function Z(){M.isTouch||(M.isTouch=!0,window.performance&&document.addEventListener("mousemove",ze))}function ze(){var g=performance.now();g-R<20&&(M.isTouch=!1,document.removeEventListener("mousemove",ze)),R=g}function Rt(){var g=document.activeElement;if(Q(g)){var w=g._tippy;g.blur&&!w.state.isVisible&&g.blur()}}function Ut(){document.addEventListener("touchstart",Z,c),window.addEventListener("blur",Rt)}var Lr=typeof window<"u"&&typeof document<"u",Nr=Lr?navigator.userAgent:"",kr=/MSIE |Trident\//.test(Nr);function Vt(g){var w=g==="destroy"?"n already-":" ";return[g+"() was called on a"+w+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function nr(g){var w=/[ \t]{2,}/g,D=/^[ \t]*/gm;return g.replace(w," ").replace(D,"").trim()}function jr(g){return nr(` +`,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "));var z={placement:ot(s.placement),popper:s.elements.popper,popperRect:s.rects.popper,gpuAcceleration:P};s.modifiersData.popperOffsets!=null&&(s.styles.popper=Object.assign({},s.styles.popper,Hn(Object.assign({},z,{offsets:s.modifiersData.popperOffsets,position:s.options.strategy,adaptive:U,roundOffsets:G})))),s.modifiersData.arrow!=null&&(s.styles.arrow=Object.assign({},s.styles.arrow,Hn(Object.assign({},z,{offsets:s.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:G})))),s.attributes.popper=Object.assign({},s.attributes.popper,{"data-popper-placement":s.placement})}var w={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:g,data:{}};function C(f){var s=f.state;Object.keys(s.elements).forEach(function(b){var _=s.styles[b]||{},P=s.attributes[b]||{},L=s.elements[b];!o(L)||!u(L)||(Object.assign(L.style,_),Object.keys(P).forEach(function(U){var H=P[U];H===!1?L.removeAttribute(U):L.setAttribute(U,H===!0?"":H)}))})}function F(f){var s=f.state,b={popper:{position:s.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(s.elements.popper.style,b.popper),s.styles=b,s.elements.arrow&&Object.assign(s.elements.arrow.style,b.arrow),function(){Object.keys(s.elements).forEach(function(_){var P=s.elements[_],L=s.attributes[_]||{},U=Object.keys(s.styles.hasOwnProperty(_)?s.styles[_]:b[_]),H=U.reduce(function(G,oe){return G[oe]="",G},{});!o(P)||!u(P)||(Object.assign(P.style,H),Object.keys(L).forEach(function(G){P.removeAttribute(G)}))})}}var q={name:"applyStyles",enabled:!0,phase:"write",fn:C,effect:F,requires:["computeStyles"]};function W(f,s,b){var _=ot(f),P=[Q,V].indexOf(_)>=0?-1:1,L=typeof b=="function"?b(Object.assign({},s,{placement:f})):b,U=L[0],H=L[1];return U=U||0,H=(H||0)*P,[Q,X].indexOf(_)>=0?{x:H,y:U}:{x:U,y:H}}function B(f){var s=f.state,b=f.options,_=f.name,P=b.offset,L=P===void 0?[0,0]:P,U=ze.reduce(function(z,De){return z[De]=W(De,s.rects,L),z},{}),H=U[s.placement],G=H.x,oe=H.y;s.modifiersData.popperOffsets!=null&&(s.modifiersData.popperOffsets.x+=G,s.modifiersData.popperOffsets.y+=oe),s.modifiersData[_]=U}var be={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:B},le={left:"right",right:"left",bottom:"top",top:"bottom"};function pe(f){return f.replace(/left|right|bottom|top/g,function(s){return le[s]})}var ye={start:"end",end:"start"};function Te(f){return f.replace(/start|end/g,function(s){return ye[s]})}function je(f,s){s===void 0&&(s={});var b=s,_=b.placement,P=b.boundary,L=b.rootBoundary,U=b.padding,H=b.flipVariations,G=b.allowedAutoPlacements,oe=G===void 0?ze:G,z=cn(_),De=z?H?Z:Z.filter(function(xe){return cn(xe)===z}):l,Le=De.filter(function(xe){return oe.indexOf(xe)>=0});Le.length===0&&(Le=De,console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var Ce=Le.reduce(function(xe,Me){return xe[Me]=qt(f,{placement:Me,boundary:P,rootBoundary:L,padding:U})[ot(Me)],xe},{});return Object.keys(Ce).sort(function(xe,Me){return Ce[xe]-Ce[Me]})}function Ae(f){if(ot(f)===me)return[];var s=pe(f);return[Te(f),s,Te(s)]}function Ie(f){var s=f.state,b=f.options,_=f.name;if(!s.modifiersData[_]._skip){for(var P=b.mainAxis,L=P===void 0?!0:P,U=b.altAxis,H=U===void 0?!0:U,G=b.fallbackPlacements,oe=b.padding,z=b.boundary,De=b.rootBoundary,Le=b.altBoundary,Ce=b.flipVariations,xe=Ce===void 0?!0:Ce,Me=b.allowedAutoPlacements,Se=s.options.placement,Be=ot(Se),Re=Be===Se,He=G||(Re||!xe?[pe(Se)]:Ae(Se)),ce=[Se].concat(He).reduce(function(te,ge){return te.concat(ot(ge)===me?je(s,{placement:ge,boundary:z,rootBoundary:De,padding:oe,flipVariations:xe,allowedAutoPlacements:Me}):ge)},[]),Pe=s.rects.reference,_e=s.rects.popper,Ne=new Map,Fe=!0,Ye=ce[0],$e=0;$e=0,dn=Lt?"width":"height",Qt=qt(s,{placement:Ue,boundary:z,rootBoundary:De,altBoundary:Le,padding:oe}),Nt=Lt?et?X:Q:et?de:V;Pe[dn]>_e[dn]&&(Nt=pe(Nt));var $n=pe(Nt),Zt=[];if(L&&Zt.push(Qt[wt]<=0),H&&Zt.push(Qt[Nt]<=0,Qt[$n]<=0),Zt.every(function(te){return te})){Ye=Ue,Fe=!1;break}Ne.set(Ue,Zt)}if(Fe)for(var Sn=xe?3:1,Wn=function(ge){var we=ce.find(function(Ke){var Je=Ne.get(Ke);if(Je)return Je.slice(0,ge).every(function(Dt){return Dt})});if(we)return Ye=we,"break"},D=Sn;D>0;D--){var K=Wn(D);if(K==="break")break}s.placement!==Ye&&(s.modifiersData[_]._skip=!0,s.placement=Ye,s.reset=!0)}}var re={name:"flip",enabled:!0,phase:"main",fn:Ie,requiresIfExists:["offset"],data:{_skip:!1}};function he(f){return f==="x"?"y":"x"}function ve(f,s,b){return gt(f,ln(s,b))}function ee(f){var s=f.state,b=f.options,_=f.name,P=b.mainAxis,L=P===void 0?!0:P,U=b.altAxis,H=U===void 0?!1:U,G=b.boundary,oe=b.rootBoundary,z=b.altBoundary,De=b.padding,Le=b.tether,Ce=Le===void 0?!0:Le,xe=b.tetherOffset,Me=xe===void 0?0:xe,Se=qt(s,{boundary:G,rootBoundary:oe,padding:De,altBoundary:z}),Be=ot(s.placement),Re=cn(s.placement),He=!Re,ce=dt(Be),Pe=he(ce),_e=s.modifiersData.popperOffsets,Ne=s.rects.reference,Fe=s.rects.popper,Ye=typeof Me=="function"?Me(Object.assign({},s.rects,{placement:s.placement})):Me,$e={x:0,y:0};if(_e){if(L||H){var Ue=ce==="y"?V:Q,wt=ce==="y"?de:X,et=ce==="y"?"height":"width",Lt=_e[ce],dn=_e[ce]+Se[Ue],Qt=_e[ce]-Se[wt],Nt=Ce?-Fe[et]/2:0,$n=Re===h?Ne[et]:Fe[et],Zt=Re===h?-Fe[et]:-Ne[et],Sn=s.elements.arrow,Wn=Ce&&Sn?T(Sn):{width:0,height:0},D=s.modifiersData["arrow#persistent"]?s.modifiersData["arrow#persistent"].padding:cr(),K=D[Ue],te=D[wt],ge=ve(0,Ne[et],Wn[et]),we=He?Ne[et]/2-Nt-ge-K-Ye:$n-ge-K-Ye,Ke=He?-Ne[et]/2+Nt+ge+te+Ye:Zt+ge+te+Ye,Je=s.elements.arrow&&J(s.elements.arrow),Dt=Je?ce==="y"?Je.clientTop||0:Je.clientLeft||0:0,Un=s.modifiersData.offset?s.modifiersData.offset[s.placement][ce]:0,_t=_e[ce]+we-Un-Dt,An=_e[ce]+Ke-Un;if(L){var pn=ve(Ce?ln(dn,_t):dn,Lt,Ce?gt(Qt,An):Qt);_e[ce]=pn,$e[ce]=pn-Lt}if(H){var en=ce==="x"?V:Q,Gr=ce==="x"?de:X,tn=_e[Pe],hn=tn+Se[en],Di=tn-Se[Gr],_i=ve(Ce?ln(hn,_t):hn,tn,Ce?gt(Di,An):Di);_e[Pe]=_i,$e[Pe]=_i-tn}}s.modifiersData[_]=$e}}var ie={name:"preventOverflow",enabled:!0,phase:"main",fn:ee,requiresIfExists:["offset"]},x=function(s,b){return s=typeof s=="function"?s(Object.assign({},b.rects,{placement:b.placement})):s,fr(typeof s!="number"?s:ur(s,l))};function Ge(f){var s,b=f.state,_=f.name,P=f.options,L=b.elements.arrow,U=b.modifiersData.popperOffsets,H=ot(b.placement),G=dt(H),oe=[Q,X].indexOf(H)>=0,z=oe?"height":"width";if(!(!L||!U)){var De=x(P.padding,b),Le=T(L),Ce=G==="y"?V:Q,xe=G==="y"?de:X,Me=b.rects.reference[z]+b.rects.reference[G]-U[G]-b.rects.popper[z],Se=U[G]-b.rects.reference[G],Be=J(L),Re=Be?G==="y"?Be.clientHeight||0:Be.clientWidth||0:0,He=Me/2-Se/2,ce=De[Ce],Pe=Re-Le[z]-De[xe],_e=Re/2-Le[z]/2+He,Ne=ve(ce,_e,Pe),Fe=G;b.modifiersData[_]=(s={},s[Fe]=Ne,s.centerOffset=Ne-_e,s)}}function fe(f){var s=f.state,b=f.options,_=b.element,P=_===void 0?"[data-popper-arrow]":_;if(P!=null&&!(typeof P=="string"&&(P=s.elements.popper.querySelector(P),!P))){if(o(P)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" ")),!kn(s.elements.popper,P)){console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}s.elements.arrow=P}}var Ft={name:"arrow",enabled:!0,phase:"main",fn:Ge,effect:fe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function bt(f,s,b){return b===void 0&&(b={x:0,y:0}),{top:f.top-s.height-b.y,right:f.right-s.width+b.x,bottom:f.bottom-s.height+b.y,left:f.left-s.width-b.x}}function Gt(f){return[V,X,de,Q].some(function(s){return f[s]>=0})}function Kt(f){var s=f.state,b=f.name,_=s.rects.reference,P=s.rects.popper,L=s.modifiersData.preventOverflow,U=qt(s,{elementContext:"reference"}),H=qt(s,{altBoundary:!0}),G=bt(U,_),oe=bt(H,P,L),z=Gt(G),De=Gt(oe);s.modifiersData[b]={referenceClippingOffsets:G,popperEscapeOffsets:oe,isReferenceHidden:z,hasPopperEscaped:De},s.attributes.popper=Object.assign({},s.attributes.popper,{"data-popper-reference-hidden":z,"data-popper-escaped":De})}var Jt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Kt},rt=[jn,Bn,w,q],lt=En({defaultModifiers:rt}),yt=[jn,Bn,w,q,be,re,ie,Ft,Jt],un=En({defaultModifiers:yt});e.applyStyles=q,e.arrow=Ft,e.computeStyles=w,e.createPopper=un,e.createPopperLite=lt,e.defaultModifiers=yt,e.detectOverflow=qt,e.eventListeners=jn,e.flip=re,e.hide=Jt,e.offset=be,e.popperGenerator=En,e.popperOffsets=Bn,e.preventOverflow=ie}),$o=Bo(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Cs(),r='',n="tippy-box",i="tippy-content",o="tippy-backdrop",a="tippy-arrow",d="tippy-svg-arrow",c={passive:!0,capture:!0};function u(g,w){return{}.hasOwnProperty.call(g,w)}function y(g,w,C){if(Array.isArray(g)){var F=g[w];return F??(Array.isArray(C)?C[w]:C)}return g}function m(g,w){var C={}.toString.call(g);return C.indexOf("[object")===0&&C.indexOf(w+"]")>-1}function E(g,w){return typeof g=="function"?g.apply(void 0,w):g}function O(g,w){if(w===0)return g;var C;return function(F){clearTimeout(C),C=setTimeout(function(){g(F)},w)}}function S(g,w){var C=Object.assign({},g);return w.forEach(function(F){delete C[F]}),C}function T(g){return g.split(/\s+/).filter(Boolean)}function I(g){return[].concat(g)}function $(g,w){g.indexOf(w)===-1&&g.push(w)}function A(g){return g.filter(function(w,C){return g.indexOf(w)===C})}function k(g){return g.split("-")[0]}function Y(g){return[].slice.call(g)}function ne(g){return Object.keys(g).reduce(function(w,C){return g[C]!==void 0&&(w[C]=g[C]),w},{})}function J(){return document.createElement("div")}function V(g){return["Element","Fragment"].some(function(w){return m(g,w)})}function de(g){return m(g,"NodeList")}function X(g){return m(g,"MouseEvent")}function Q(g){return!!(g&&g._tippy&&g._tippy.reference===g)}function me(g){return V(g)?[g]:de(g)?Y(g):Array.isArray(g)?g:Y(document.querySelectorAll(g))}function l(g,w){g.forEach(function(C){C&&(C.style.transitionDuration=w+"ms")})}function h(g,w){g.forEach(function(C){C&&C.setAttribute("data-state",w)})}function v(g){var w,C=I(g),F=C[0];return!(F==null||(w=F.ownerDocument)==null)&&w.body?F.ownerDocument:document}function p(g,w){var C=w.clientX,F=w.clientY;return g.every(function(q){var W=q.popperRect,B=q.popperState,be=q.props,le=be.interactiveBorder,pe=k(B.placement),ye=B.modifiersData.offset;if(!ye)return!0;var Te=pe==="bottom"?ye.top.y:0,je=pe==="top"?ye.bottom.y:0,Ae=pe==="right"?ye.left.x:0,Ie=pe==="left"?ye.right.x:0,re=W.top-F+Te>le,he=F-W.bottom-je>le,ve=W.left-C+Ae>le,ee=C-W.right-Ie>le;return re||he||ve||ee})}function j(g,w,C){var F=w+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(q){g[F](q,C)})}var M={isTouch:!1},R=0;function Z(){M.isTouch||(M.isTouch=!0,window.performance&&document.addEventListener("mousemove",ze))}function ze(){var g=performance.now();g-R<20&&(M.isTouch=!1,document.removeEventListener("mousemove",ze)),R=g}function Rt(){var g=document.activeElement;if(Q(g)){var w=g._tippy;g.blur&&!w.state.isVisible&&g.blur()}}function Ut(){document.addEventListener("touchstart",Z,c),window.addEventListener("blur",Rt)}var Lr=typeof window<"u"&&typeof document<"u",Nr=Lr?navigator.userAgent:"",kr=/MSIE |Trident\//.test(Nr);function Vt(g){var w=g==="destroy"?"n already-":" ";return[g+"() was called on a"+w+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function nr(g){var w=/[ \t]{2,}/g,C=/^[ \t]*/gm;return g.replace(w," ").replace(C,"").trim()}function jr(g){return nr(` %ctippy.js %c`+nr(g)+` %c\u{1F477}\u200D This is a development-only message. It will be removed in production. - `)}function rr(g){return[jr(g),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var It;Br();function Br(){It=new Set}function mt(g,w){if(g&&!It.has(w)){var D;It.add(w),(D=console).warn.apply(D,rr(w))}}function zt(g,w){if(g&&!It.has(w)){var D;It.add(w),(D=console).error.apply(D,rr(w))}}function At(g){var w=!g,D=Object.prototype.toString.call(g)==="[object Object]"&&!g.addEventListener;zt(w,["tippy() was passed","`"+String(g)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),zt(D,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Dt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Hr={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ze=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Dt,{},Hr),$r=Object.keys(Ze),Wr=function(w){gt(w,[]);var D=Object.keys(w);D.forEach(function(F){Ze[F]=w[F]})};function ot(g){var w=g.plugins||[],D=w.reduce(function(F,q){var W=q.name,B=q.defaultValue;return W&&(F[W]=g[W]!==void 0?g[W]:B),F},{});return Object.assign({},g,{},D)}function Ur(g,w){var D=w?Object.keys(ot(Object.assign({},Ze,{plugins:w}))):$r,F=D.reduce(function(q,W){var B=(g.getAttribute("data-tippy-"+W)||"").trim();if(!B)return q;if(W==="content")q[W]=B;else try{q[W]=JSON.parse(B)}catch{q[W]=B}return q},{});return F}function ir(g,w){var D=Object.assign({},w,{content:E(w.content,[g])},w.ignoreAttributes?{}:Ur(g,w.plugins));return D.aria=Object.assign({},Ze.aria,{},D.aria),D.aria={expanded:D.aria.expanded==="auto"?w.interactive:D.aria.expanded,content:D.aria.content==="auto"?w.interactive?null:"describedby":D.aria.content},D}function gt(g,w){g===void 0&&(g={}),w===void 0&&(w=[]);var D=Object.keys(g);D.forEach(function(F){var q=S(Ze,Object.keys(Dt)),W=!u(q,F);W&&(W=w.filter(function(B){return B.name===F}).length===0),mt(W,["`"+F+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",` + `)}function rr(g){return[jr(g),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var It;Br();function Br(){It=new Set}function mt(g,w){if(g&&!It.has(w)){var C;It.add(w),(C=console).warn.apply(C,rr(w))}}function zt(g,w){if(g&&!It.has(w)){var C;It.add(w),(C=console).error.apply(C,rr(w))}}function At(g){var w=!g,C=Object.prototype.toString.call(g)==="[object Object]"&&!g.addEventListener;zt(w,["tippy() was passed","`"+String(g)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),zt(C,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Ct={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Hr={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ze=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Ct,{},Hr),$r=Object.keys(Ze),Wr=function(w){gt(w,[]);var C=Object.keys(w);C.forEach(function(F){Ze[F]=w[F]})};function ot(g){var w=g.plugins||[],C=w.reduce(function(F,q){var W=q.name,B=q.defaultValue;return W&&(F[W]=g[W]!==void 0?g[W]:B),F},{});return Object.assign({},g,{},C)}function Ur(g,w){var C=w?Object.keys(ot(Object.assign({},Ze,{plugins:w}))):$r,F=C.reduce(function(q,W){var B=(g.getAttribute("data-tippy-"+W)||"").trim();if(!B)return q;if(W==="content")q[W]=B;else try{q[W]=JSON.parse(B)}catch{q[W]=B}return q},{});return F}function ir(g,w){var C=Object.assign({},w,{content:E(w.content,[g])},w.ignoreAttributes?{}:Ur(g,w.plugins));return C.aria=Object.assign({},Ze.aria,{},C.aria),C.aria={expanded:C.aria.expanded==="auto"?w.interactive:C.aria.expanded,content:C.aria.content==="auto"?w.interactive?null:"describedby":C.aria.content},C}function gt(g,w){g===void 0&&(g={}),w===void 0&&(w=[]);var C=Object.keys(g);C.forEach(function(F){var q=S(Ze,Object.keys(Ct)),W=!u(q,F);W&&(W=w.filter(function(B){return B.name===F}).length===0),mt(W,["`"+F+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",` `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/ -`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var ln=function(){return"innerHTML"};function Yt(g,w){g[ln()]=w}function or(g){var w=J();return g===!0?w.className=a:(w.className=d,V(g)?w.appendChild(g):Yt(w,g)),w}function kn(g,w){V(w.content)?(Yt(g,""),g.appendChild(w.content)):typeof w.content!="function"&&(w.allowHTML?Yt(g,w.content):g.textContent=w.content)}function Xt(g){var w=g.firstElementChild,D=Y(w.children);return{box:w,content:D.find(function(F){return F.classList.contains(i)}),arrow:D.find(function(F){return F.classList.contains(a)||F.classList.contains(d)}),backdrop:D.find(function(F){return F.classList.contains(o)})}}function ar(g){var w=J(),D=J();D.className=n,D.setAttribute("data-state","hidden"),D.setAttribute("tabindex","-1");var F=J();F.className=i,F.setAttribute("data-state","hidden"),kn(F,g.props),w.appendChild(D),D.appendChild(F),q(g.props,g.props);function q(W,B){var be=Xt(w),le=be.box,pe=be.content,ye=be.arrow;B.theme?le.setAttribute("data-theme",B.theme):le.removeAttribute("data-theme"),typeof B.animation=="string"?le.setAttribute("data-animation",B.animation):le.removeAttribute("data-animation"),B.inertia?le.setAttribute("data-inertia",""):le.removeAttribute("data-inertia"),le.style.maxWidth=typeof B.maxWidth=="number"?B.maxWidth+"px":B.maxWidth,B.role?le.setAttribute("role",B.role):le.removeAttribute("role"),(W.content!==B.content||W.allowHTML!==B.allowHTML)&&kn(pe,g.props),B.arrow?ye?W.arrow!==B.arrow&&(le.removeChild(ye),le.appendChild(or(B.arrow))):le.appendChild(or(B.arrow)):ye&&le.removeChild(ye)}return{popper:w,onUpdate:q}}ar.$$tippy=!0;var sr=1,yn=[],wn=[];function cn(g,w){var D=ir(g,Object.assign({},Ze,{},ot(ne(w)))),F,q,W,B=!1,be=!1,le=!1,pe=!1,ye,Te,je,Ae=[],Ie=O(Re,D.interactiveDebounce),re,he=sr++,ve=null,ee=A(D.plugins),ie={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},x={id:he,reference:g,popper:J(),popperInstance:ve,props:D,state:ie,plugins:ee,clearDelayTimeouts:Lt,setProps:dn,setContent:Qt,show:Nt,hide:$n,hideWithInteractivity:Zt,enable:wt,disable:et,unmount:Sn,destroy:Wn};if(!D.render)return zt(!0,"render() function has not been supplied."),x;var Ge=D.render(x),fe=Ge.popper,Ft=Ge.onUpdate;fe.setAttribute("data-tippy-root",""),fe.id="tippy-"+x.id,x.popper=fe,g._tippy=x,fe._tippy=x;var bt=ee.map(function(C){return C.fn(x)}),Gt=g.hasAttribute("aria-expanded");return Me(),P(),s(),b("onCreate",[x]),D.showOnCreate&&$e(),fe.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),fe.addEventListener("mouseleave",function(C){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&(yt().addEventListener("mousemove",Ie),Ie(C))}),x;function Kt(){var C=x.props.touch;return Array.isArray(C)?C:[C,0]}function Jt(){return Kt()[0]==="hold"}function rt(){var C;return!!((C=x.props.render)!=null&&C.$$tippy)}function lt(){return re||g}function yt(){var C=lt().parentNode;return C?v(C):document}function un(){return Xt(fe)}function f(C){return x.state.isMounted&&!x.state.isVisible||M.isTouch||ye&&ye.type==="focus"?0:y(x.props.delay,C?0:1,Ze.delay)}function s(){fe.style.pointerEvents=x.props.interactive&&x.state.isVisible?"":"none",fe.style.zIndex=""+x.props.zIndex}function b(C,K,te){if(te===void 0&&(te=!0),bt.forEach(function(we){we[C]&&we[C].apply(void 0,K)}),te){var ge;(ge=x.props)[C].apply(ge,K)}}function _(){var C=x.props.aria;if(C.content){var K="aria-"+C.content,te=fe.id,ge=I(x.props.triggerTarget||g);ge.forEach(function(we){var Ke=we.getAttribute(K);if(x.state.isVisible)we.setAttribute(K,Ke?Ke+" "+te:te);else{var Je=Ke&&Ke.replace(te,"").trim();Je?we.setAttribute(K,Je):we.removeAttribute(K)}})}}function P(){if(!(Gt||!x.props.aria.expanded)){var C=I(x.props.triggerTarget||g);C.forEach(function(K){x.props.interactive?K.setAttribute("aria-expanded",x.state.isVisible&&K===lt()?"true":"false"):K.removeAttribute("aria-expanded")})}}function L(){yt().removeEventListener("mousemove",Ie),yn=yn.filter(function(C){return C!==Ie})}function U(C){if(!(M.isTouch&&(le||C.type==="mousedown"))&&!(x.props.interactive&&fe.contains(C.target))){if(lt().contains(C.target)){if(M.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else b("onClickOutside",[x,C]);x.props.hideOnClick===!0&&(x.clearDelayTimeouts(),x.hide(),be=!0,setTimeout(function(){be=!1}),x.state.isMounted||z())}}function H(){le=!0}function G(){le=!1}function oe(){var C=yt();C.addEventListener("mousedown",U,!0),C.addEventListener("touchend",U,c),C.addEventListener("touchstart",G,c),C.addEventListener("touchmove",H,c)}function z(){var C=yt();C.removeEventListener("mousedown",U,!0),C.removeEventListener("touchend",U,c),C.removeEventListener("touchstart",G,c),C.removeEventListener("touchmove",H,c)}function Ce(C,K){De(C,function(){!x.state.isVisible&&fe.parentNode&&fe.parentNode.contains(fe)&&K()})}function Le(C,K){De(C,K)}function De(C,K){var te=un().box;function ge(we){we.target===te&&(j(te,"remove",ge),K())}if(C===0)return K();j(te,"remove",Te),j(te,"add",ge),Te=ge}function xe(C,K,te){te===void 0&&(te=!1);var ge=I(x.props.triggerTarget||g);ge.forEach(function(we){we.addEventListener(C,K,te),Ae.push({node:we,eventType:C,handler:K,options:te})})}function Me(){Jt()&&(xe("touchstart",Be,{passive:!0}),xe("touchend",He,{passive:!0})),T(x.props.trigger).forEach(function(C){if(C!=="manual")switch(xe(C,Be),C){case"mouseenter":xe("mouseleave",He);break;case"focus":xe(kr?"focusout":"blur",ce);break;case"focusin":xe("focusout",ce);break}})}function Se(){Ae.forEach(function(C){var K=C.node,te=C.eventType,ge=C.handler,we=C.options;K.removeEventListener(te,ge,we)}),Ae=[]}function Be(C){var K,te=!1;if(!(!x.state.isEnabled||Pe(C)||be)){var ge=((K=ye)==null?void 0:K.type)==="focus";ye=C,re=C.currentTarget,P(),!x.state.isVisible&&X(C)&&yn.forEach(function(we){return we(C)}),C.type==="click"&&(x.props.trigger.indexOf("mouseenter")<0||B)&&x.props.hideOnClick!==!1&&x.state.isVisible?te=!0:$e(C),C.type==="click"&&(B=!te),te&&!ge&&Ue(C)}}function Re(C){var K=C.target,te=lt().contains(K)||fe.contains(K);if(!(C.type==="mousemove"&&te)){var ge=Ye().concat(fe).map(function(we){var Ke,Je=we._tippy,Ct=(Ke=Je.popperInstance)==null?void 0:Ke.state;return Ct?{popperRect:we.getBoundingClientRect(),popperState:Ct,props:D}:null}).filter(Boolean);p(ge,C)&&(L(),Ue(C))}}function He(C){var K=Pe(C)||x.props.trigger.indexOf("click")>=0&&B;if(!K){if(x.props.interactive){x.hideWithInteractivity(C);return}Ue(C)}}function ce(C){x.props.trigger.indexOf("focusin")<0&&C.target!==lt()||x.props.interactive&&C.relatedTarget&&fe.contains(C.relatedTarget)||Ue(C)}function Pe(C){return M.isTouch?Jt()!==C.type.indexOf("touch")>=0:!1}function _e(){Ne();var C=x.props,K=C.popperOptions,te=C.placement,ge=C.offset,we=C.getReferenceClientRect,Ke=C.moveTransition,Je=rt()?Xt(fe).arrow:null,Ct=we?{getBoundingClientRect:we,contextElement:we.contextElement||lt()}:g,Un={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(pn){var en=pn.state;if(rt()){var Gr=un(),tn=Gr.box;["placement","reference-hidden","escaped"].forEach(function(hn){hn==="placement"?tn.setAttribute("data-placement",en.placement):en.attributes.popper["data-popper-"+hn]?tn.setAttribute("data-"+hn,""):tn.removeAttribute("data-"+hn)}),en.attributes.popper={}}}},_t=[{name:"offset",options:{offset:ge}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ke}},Un];rt()&&Je&&_t.push({name:"arrow",options:{element:Je,padding:3}}),_t.push.apply(_t,K?.modifiers||[]),x.popperInstance=t.createPopper(Ct,fe,Object.assign({},K,{placement:te,onFirstUpdate:je,modifiers:_t}))}function Ne(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function Fe(){var C=x.props.appendTo,K,te=lt();x.props.interactive&&C===Ze.appendTo||C==="parent"?K=te.parentNode:K=E(C,[te]),K.contains(fe)||K.appendChild(fe),_e(),mt(x.props.interactive&&C===Ze.appendTo&&te.nextElementSibling!==fe,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",` +`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var ln=function(){return"innerHTML"};function Yt(g,w){g[ln()]=w}function or(g){var w=J();return g===!0?w.className=a:(w.className=d,V(g)?w.appendChild(g):Yt(w,g)),w}function kn(g,w){V(w.content)?(Yt(g,""),g.appendChild(w.content)):typeof w.content!="function"&&(w.allowHTML?Yt(g,w.content):g.textContent=w.content)}function Xt(g){var w=g.firstElementChild,C=Y(w.children);return{box:w,content:C.find(function(F){return F.classList.contains(i)}),arrow:C.find(function(F){return F.classList.contains(a)||F.classList.contains(d)}),backdrop:C.find(function(F){return F.classList.contains(o)})}}function ar(g){var w=J(),C=J();C.className=n,C.setAttribute("data-state","hidden"),C.setAttribute("tabindex","-1");var F=J();F.className=i,F.setAttribute("data-state","hidden"),kn(F,g.props),w.appendChild(C),C.appendChild(F),q(g.props,g.props);function q(W,B){var be=Xt(w),le=be.box,pe=be.content,ye=be.arrow;B.theme?le.setAttribute("data-theme",B.theme):le.removeAttribute("data-theme"),typeof B.animation=="string"?le.setAttribute("data-animation",B.animation):le.removeAttribute("data-animation"),B.inertia?le.setAttribute("data-inertia",""):le.removeAttribute("data-inertia"),le.style.maxWidth=typeof B.maxWidth=="number"?B.maxWidth+"px":B.maxWidth,B.role?le.setAttribute("role",B.role):le.removeAttribute("role"),(W.content!==B.content||W.allowHTML!==B.allowHTML)&&kn(pe,g.props),B.arrow?ye?W.arrow!==B.arrow&&(le.removeChild(ye),le.appendChild(or(B.arrow))):le.appendChild(or(B.arrow)):ye&&le.removeChild(ye)}return{popper:w,onUpdate:q}}ar.$$tippy=!0;var sr=1,yn=[],wn=[];function cn(g,w){var C=ir(g,Object.assign({},Ze,{},ot(ne(w)))),F,q,W,B=!1,be=!1,le=!1,pe=!1,ye,Te,je,Ae=[],Ie=O(Re,C.interactiveDebounce),re,he=sr++,ve=null,ee=A(C.plugins),ie={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},x={id:he,reference:g,popper:J(),popperInstance:ve,props:C,state:ie,plugins:ee,clearDelayTimeouts:Lt,setProps:dn,setContent:Qt,show:Nt,hide:$n,hideWithInteractivity:Zt,enable:wt,disable:et,unmount:Sn,destroy:Wn};if(!C.render)return zt(!0,"render() function has not been supplied."),x;var Ge=C.render(x),fe=Ge.popper,Ft=Ge.onUpdate;fe.setAttribute("data-tippy-root",""),fe.id="tippy-"+x.id,x.popper=fe,g._tippy=x,fe._tippy=x;var bt=ee.map(function(D){return D.fn(x)}),Gt=g.hasAttribute("aria-expanded");return Me(),P(),s(),b("onCreate",[x]),C.showOnCreate&&$e(),fe.addEventListener("mouseenter",function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()}),fe.addEventListener("mouseleave",function(D){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&(yt().addEventListener("mousemove",Ie),Ie(D))}),x;function Kt(){var D=x.props.touch;return Array.isArray(D)?D:[D,0]}function Jt(){return Kt()[0]==="hold"}function rt(){var D;return!!((D=x.props.render)!=null&&D.$$tippy)}function lt(){return re||g}function yt(){var D=lt().parentNode;return D?v(D):document}function un(){return Xt(fe)}function f(D){return x.state.isMounted&&!x.state.isVisible||M.isTouch||ye&&ye.type==="focus"?0:y(x.props.delay,D?0:1,Ze.delay)}function s(){fe.style.pointerEvents=x.props.interactive&&x.state.isVisible?"":"none",fe.style.zIndex=""+x.props.zIndex}function b(D,K,te){if(te===void 0&&(te=!0),bt.forEach(function(we){we[D]&&we[D].apply(void 0,K)}),te){var ge;(ge=x.props)[D].apply(ge,K)}}function _(){var D=x.props.aria;if(D.content){var K="aria-"+D.content,te=fe.id,ge=I(x.props.triggerTarget||g);ge.forEach(function(we){var Ke=we.getAttribute(K);if(x.state.isVisible)we.setAttribute(K,Ke?Ke+" "+te:te);else{var Je=Ke&&Ke.replace(te,"").trim();Je?we.setAttribute(K,Je):we.removeAttribute(K)}})}}function P(){if(!(Gt||!x.props.aria.expanded)){var D=I(x.props.triggerTarget||g);D.forEach(function(K){x.props.interactive?K.setAttribute("aria-expanded",x.state.isVisible&&K===lt()?"true":"false"):K.removeAttribute("aria-expanded")})}}function L(){yt().removeEventListener("mousemove",Ie),yn=yn.filter(function(D){return D!==Ie})}function U(D){if(!(M.isTouch&&(le||D.type==="mousedown"))&&!(x.props.interactive&&fe.contains(D.target))){if(lt().contains(D.target)){if(M.isTouch||x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else b("onClickOutside",[x,D]);x.props.hideOnClick===!0&&(x.clearDelayTimeouts(),x.hide(),be=!0,setTimeout(function(){be=!1}),x.state.isMounted||z())}}function H(){le=!0}function G(){le=!1}function oe(){var D=yt();D.addEventListener("mousedown",U,!0),D.addEventListener("touchend",U,c),D.addEventListener("touchstart",G,c),D.addEventListener("touchmove",H,c)}function z(){var D=yt();D.removeEventListener("mousedown",U,!0),D.removeEventListener("touchend",U,c),D.removeEventListener("touchstart",G,c),D.removeEventListener("touchmove",H,c)}function De(D,K){Ce(D,function(){!x.state.isVisible&&fe.parentNode&&fe.parentNode.contains(fe)&&K()})}function Le(D,K){Ce(D,K)}function Ce(D,K){var te=un().box;function ge(we){we.target===te&&(j(te,"remove",ge),K())}if(D===0)return K();j(te,"remove",Te),j(te,"add",ge),Te=ge}function xe(D,K,te){te===void 0&&(te=!1);var ge=I(x.props.triggerTarget||g);ge.forEach(function(we){we.addEventListener(D,K,te),Ae.push({node:we,eventType:D,handler:K,options:te})})}function Me(){Jt()&&(xe("touchstart",Be,{passive:!0}),xe("touchend",He,{passive:!0})),T(x.props.trigger).forEach(function(D){if(D!=="manual")switch(xe(D,Be),D){case"mouseenter":xe("mouseleave",He);break;case"focus":xe(kr?"focusout":"blur",ce);break;case"focusin":xe("focusout",ce);break}})}function Se(){Ae.forEach(function(D){var K=D.node,te=D.eventType,ge=D.handler,we=D.options;K.removeEventListener(te,ge,we)}),Ae=[]}function Be(D){var K,te=!1;if(!(!x.state.isEnabled||Pe(D)||be)){var ge=((K=ye)==null?void 0:K.type)==="focus";ye=D,re=D.currentTarget,P(),!x.state.isVisible&&X(D)&&yn.forEach(function(we){return we(D)}),D.type==="click"&&(x.props.trigger.indexOf("mouseenter")<0||B)&&x.props.hideOnClick!==!1&&x.state.isVisible?te=!0:$e(D),D.type==="click"&&(B=!te),te&&!ge&&Ue(D)}}function Re(D){var K=D.target,te=lt().contains(K)||fe.contains(K);if(!(D.type==="mousemove"&&te)){var ge=Ye().concat(fe).map(function(we){var Ke,Je=we._tippy,Dt=(Ke=Je.popperInstance)==null?void 0:Ke.state;return Dt?{popperRect:we.getBoundingClientRect(),popperState:Dt,props:C}:null}).filter(Boolean);p(ge,D)&&(L(),Ue(D))}}function He(D){var K=Pe(D)||x.props.trigger.indexOf("click")>=0&&B;if(!K){if(x.props.interactive){x.hideWithInteractivity(D);return}Ue(D)}}function ce(D){x.props.trigger.indexOf("focusin")<0&&D.target!==lt()||x.props.interactive&&D.relatedTarget&&fe.contains(D.relatedTarget)||Ue(D)}function Pe(D){return M.isTouch?Jt()!==D.type.indexOf("touch")>=0:!1}function _e(){Ne();var D=x.props,K=D.popperOptions,te=D.placement,ge=D.offset,we=D.getReferenceClientRect,Ke=D.moveTransition,Je=rt()?Xt(fe).arrow:null,Dt=we?{getBoundingClientRect:we,contextElement:we.contextElement||lt()}:g,Un={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(pn){var en=pn.state;if(rt()){var Gr=un(),tn=Gr.box;["placement","reference-hidden","escaped"].forEach(function(hn){hn==="placement"?tn.setAttribute("data-placement",en.placement):en.attributes.popper["data-popper-"+hn]?tn.setAttribute("data-"+hn,""):tn.removeAttribute("data-"+hn)}),en.attributes.popper={}}}},_t=[{name:"offset",options:{offset:ge}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ke}},Un];rt()&&Je&&_t.push({name:"arrow",options:{element:Je,padding:3}}),_t.push.apply(_t,K?.modifiers||[]),x.popperInstance=t.createPopper(Dt,fe,Object.assign({},K,{placement:te,onFirstUpdate:je,modifiers:_t}))}function Ne(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function Fe(){var D=x.props.appendTo,K,te=lt();x.props.interactive&&D===Ze.appendTo||D==="parent"?K=te.parentNode:K=E(D,[te]),K.contains(fe)||K.appendChild(fe),_e(),mt(x.props.interactive&&D===Ze.appendTo&&te.nextElementSibling!==fe,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",` `,"Using a wrapper
or tag around the reference element","solves this by creating a new parentNode context.",` `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",` -`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Ye(){return Y(fe.querySelectorAll("[data-tippy-root]"))}function $e(C){x.clearDelayTimeouts(),C&&b("onTrigger",[x,C]),oe();var K=f(!0),te=Kt(),ge=te[0],we=te[1];M.isTouch&&ge==="hold"&&we&&(K=we),K?F=setTimeout(function(){x.show()},K):x.show()}function Ue(C){if(x.clearDelayTimeouts(),b("onUntrigger",[x,C]),!x.state.isVisible){z();return}if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(C.type)>=0&&B)){var K=f(!1);K?q=setTimeout(function(){x.state.isVisible&&x.hide()},K):W=requestAnimationFrame(function(){x.hide()})}}function wt(){x.state.isEnabled=!0}function et(){x.hide(),x.state.isEnabled=!1}function Lt(){clearTimeout(F),clearTimeout(q),cancelAnimationFrame(W)}function dn(C){if(mt(x.state.isDestroyed,Vt("setProps")),!x.state.isDestroyed){b("onBeforeUpdate",[x,C]),Se();var K=x.props,te=ir(g,Object.assign({},x.props,{},C,{ignoreAttributes:!0}));x.props=te,Me(),K.interactiveDebounce!==te.interactiveDebounce&&(L(),Ie=O(Re,te.interactiveDebounce)),K.triggerTarget&&!te.triggerTarget?I(K.triggerTarget).forEach(function(ge){ge.removeAttribute("aria-expanded")}):te.triggerTarget&&g.removeAttribute("aria-expanded"),P(),s(),Ft&&Ft(K,te),x.popperInstance&&(_e(),Ye().forEach(function(ge){requestAnimationFrame(ge._tippy.popperInstance.forceUpdate)})),b("onAfterUpdate",[x,C])}}function Qt(C){x.setProps({content:C})}function Nt(){mt(x.state.isDestroyed,Vt("show"));var C=x.state.isVisible,K=x.state.isDestroyed,te=!x.state.isEnabled,ge=M.isTouch&&!x.props.touch,we=y(x.props.duration,0,Ze.duration);if(!(C||K||te||ge)&&!lt().hasAttribute("disabled")&&(b("onShow",[x],!1),x.props.onShow(x)!==!1)){if(x.state.isVisible=!0,rt()&&(fe.style.visibility="visible"),s(),oe(),x.state.isMounted||(fe.style.transition="none"),rt()){var Ke=un(),Je=Ke.box,Ct=Ke.content;l([Je,Ct],0)}je=function(){var _t;if(!(!x.state.isVisible||pe)){if(pe=!0,fe.offsetHeight,fe.style.transition=x.props.moveTransition,rt()&&x.props.animation){var An=un(),pn=An.box,en=An.content;l([pn,en],we),h([pn,en],"visible")}_(),P(),$(wn,x),(_t=x.popperInstance)==null||_t.forceUpdate(),x.state.isMounted=!0,b("onMount",[x]),x.props.animation&&rt()&&Le(we,function(){x.state.isShown=!0,b("onShown",[x])})}},Fe()}}function $n(){mt(x.state.isDestroyed,Vt("hide"));var C=!x.state.isVisible,K=x.state.isDestroyed,te=!x.state.isEnabled,ge=y(x.props.duration,1,Ze.duration);if(!(C||K||te)&&(b("onHide",[x],!1),x.props.onHide(x)!==!1)){if(x.state.isVisible=!1,x.state.isShown=!1,pe=!1,B=!1,rt()&&(fe.style.visibility="hidden"),L(),z(),s(),rt()){var we=un(),Ke=we.box,Je=we.content;x.props.animation&&(l([Ke,Je],ge),h([Ke,Je],"hidden"))}_(),P(),x.props.animation?rt()&&Ce(ge,x.unmount):x.unmount()}}function Zt(C){mt(x.state.isDestroyed,Vt("hideWithInteractivity")),yt().addEventListener("mousemove",Ie),$(yn,Ie),Ie(C)}function Sn(){mt(x.state.isDestroyed,Vt("unmount")),x.state.isVisible&&x.hide(),x.state.isMounted&&(Ne(),Ye().forEach(function(C){C._tippy.unmount()}),fe.parentNode&&fe.parentNode.removeChild(fe),wn=wn.filter(function(C){return C!==x}),x.state.isMounted=!1,b("onHidden",[x]))}function Wn(){mt(x.state.isDestroyed,Vt("destroy")),!x.state.isDestroyed&&(x.clearDelayTimeouts(),x.unmount(),Se(),delete g._tippy,x.state.isDestroyed=!0,b("onDestroy",[x]))}}function dt(g,w){w===void 0&&(w={});var D=Ze.plugins.concat(w.plugins||[]);At(g),gt(w,D),Ut();var F=Object.assign({},w,{plugins:D}),q=me(g),W=V(F.content),B=q.length>1;mt(W&&B,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",` +`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Ye(){return Y(fe.querySelectorAll("[data-tippy-root]"))}function $e(D){x.clearDelayTimeouts(),D&&b("onTrigger",[x,D]),oe();var K=f(!0),te=Kt(),ge=te[0],we=te[1];M.isTouch&&ge==="hold"&&we&&(K=we),K?F=setTimeout(function(){x.show()},K):x.show()}function Ue(D){if(x.clearDelayTimeouts(),b("onUntrigger",[x,D]),!x.state.isVisible){z();return}if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(D.type)>=0&&B)){var K=f(!1);K?q=setTimeout(function(){x.state.isVisible&&x.hide()},K):W=requestAnimationFrame(function(){x.hide()})}}function wt(){x.state.isEnabled=!0}function et(){x.hide(),x.state.isEnabled=!1}function Lt(){clearTimeout(F),clearTimeout(q),cancelAnimationFrame(W)}function dn(D){if(mt(x.state.isDestroyed,Vt("setProps")),!x.state.isDestroyed){b("onBeforeUpdate",[x,D]),Se();var K=x.props,te=ir(g,Object.assign({},x.props,{},D,{ignoreAttributes:!0}));x.props=te,Me(),K.interactiveDebounce!==te.interactiveDebounce&&(L(),Ie=O(Re,te.interactiveDebounce)),K.triggerTarget&&!te.triggerTarget?I(K.triggerTarget).forEach(function(ge){ge.removeAttribute("aria-expanded")}):te.triggerTarget&&g.removeAttribute("aria-expanded"),P(),s(),Ft&&Ft(K,te),x.popperInstance&&(_e(),Ye().forEach(function(ge){requestAnimationFrame(ge._tippy.popperInstance.forceUpdate)})),b("onAfterUpdate",[x,D])}}function Qt(D){x.setProps({content:D})}function Nt(){mt(x.state.isDestroyed,Vt("show"));var D=x.state.isVisible,K=x.state.isDestroyed,te=!x.state.isEnabled,ge=M.isTouch&&!x.props.touch,we=y(x.props.duration,0,Ze.duration);if(!(D||K||te||ge)&&!lt().hasAttribute("disabled")&&(b("onShow",[x],!1),x.props.onShow(x)!==!1)){if(x.state.isVisible=!0,rt()&&(fe.style.visibility="visible"),s(),oe(),x.state.isMounted||(fe.style.transition="none"),rt()){var Ke=un(),Je=Ke.box,Dt=Ke.content;l([Je,Dt],0)}je=function(){var _t;if(!(!x.state.isVisible||pe)){if(pe=!0,fe.offsetHeight,fe.style.transition=x.props.moveTransition,rt()&&x.props.animation){var An=un(),pn=An.box,en=An.content;l([pn,en],we),h([pn,en],"visible")}_(),P(),$(wn,x),(_t=x.popperInstance)==null||_t.forceUpdate(),x.state.isMounted=!0,b("onMount",[x]),x.props.animation&&rt()&&Le(we,function(){x.state.isShown=!0,b("onShown",[x])})}},Fe()}}function $n(){mt(x.state.isDestroyed,Vt("hide"));var D=!x.state.isVisible,K=x.state.isDestroyed,te=!x.state.isEnabled,ge=y(x.props.duration,1,Ze.duration);if(!(D||K||te)&&(b("onHide",[x],!1),x.props.onHide(x)!==!1)){if(x.state.isVisible=!1,x.state.isShown=!1,pe=!1,B=!1,rt()&&(fe.style.visibility="hidden"),L(),z(),s(),rt()){var we=un(),Ke=we.box,Je=we.content;x.props.animation&&(l([Ke,Je],ge),h([Ke,Je],"hidden"))}_(),P(),x.props.animation?rt()&&De(ge,x.unmount):x.unmount()}}function Zt(D){mt(x.state.isDestroyed,Vt("hideWithInteractivity")),yt().addEventListener("mousemove",Ie),$(yn,Ie),Ie(D)}function Sn(){mt(x.state.isDestroyed,Vt("unmount")),x.state.isVisible&&x.hide(),x.state.isMounted&&(Ne(),Ye().forEach(function(D){D._tippy.unmount()}),fe.parentNode&&fe.parentNode.removeChild(fe),wn=wn.filter(function(D){return D!==x}),x.state.isMounted=!1,b("onHidden",[x]))}function Wn(){mt(x.state.isDestroyed,Vt("destroy")),!x.state.isDestroyed&&(x.clearDelayTimeouts(),x.unmount(),Se(),delete g._tippy,x.state.isDestroyed=!0,b("onDestroy",[x]))}}function dt(g,w){w===void 0&&(w={});var C=Ze.plugins.concat(w.plugins||[]);At(g),gt(w,C),Ut();var F=Object.assign({},w,{plugins:C}),q=me(g),W=V(F.content),B=q.length>1;mt(W&&B,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",` `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",` `,`1) content: element.innerHTML -`,"2) content: () => element.cloneNode(true)"].join(" "));var be=q.reduce(function(le,pe){var ye=pe&&cn(pe,F);return ye&&le.push(ye),le},[]);return V(g)?be[0]:be}dt.defaultProps=Ze,dt.setDefaultProps=Wr,dt.currentInput=M;var lr=function(w){var D=w===void 0?{}:w,F=D.exclude,q=D.duration;wn.forEach(function(W){var B=!1;if(F&&(B=Q(F)?W.reference===F:W.popper===F.popper),!B){var be=W.props.duration;W.setProps({duration:q}),W.hide(),W.state.isDestroyed||W.setProps({duration:be})}})},cr=Object.assign({},t.applyStyles,{effect:function(w){var D=w.state,F={popper:{position:D.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(D.elements.popper.style,F.popper),D.styles=F,D.elements.arrow&&Object.assign(D.elements.arrow.style,F.arrow)}}),fr=function(w,D){var F;D===void 0&&(D={}),zt(!Array.isArray(w),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(w)].join(" "));var q=w,W=[],B,be=D.overrides,le=[],pe=!1;function ye(){W=q.map(function(ee){return ee.reference})}function Te(ee){q.forEach(function(ie){ee?ie.enable():ie.disable()})}function je(ee){return q.map(function(ie){var x=ie.setProps;return ie.setProps=function(Ge){x(Ge),ie.reference===B&&ee.setProps(Ge)},function(){ie.setProps=x}})}function Ae(ee,ie){var x=W.indexOf(ie);if(ie!==B){B=ie;var Ge=(be||[]).concat("content").reduce(function(fe,Ft){return fe[Ft]=q[x].props[Ft],fe},{});ee.setProps(Object.assign({},Ge,{getReferenceClientRect:typeof Ge.getReferenceClientRect=="function"?Ge.getReferenceClientRect:function(){return ie.getBoundingClientRect()}}))}}Te(!1),ye();var Ie={fn:function(){return{onDestroy:function(){Te(!0)},onHidden:function(){B=null},onClickOutside:function(x){x.props.showOnCreate&&!pe&&(pe=!0,B=null)},onShow:function(x){x.props.showOnCreate&&!pe&&(pe=!0,Ae(x,W[0]))},onTrigger:function(x,Ge){Ae(x,Ge.currentTarget)}}}},re=dt(J(),Object.assign({},S(D,["overrides"]),{plugins:[Ie].concat(D.plugins||[]),triggerTarget:W,popperOptions:Object.assign({},D.popperOptions,{modifiers:[].concat(((F=D.popperOptions)==null?void 0:F.modifiers)||[],[cr])})})),he=re.show;re.show=function(ee){if(he(),!B&&ee==null)return Ae(re,W[0]);if(!(B&&ee==null)){if(typeof ee=="number")return W[ee]&&Ae(re,W[ee]);if(q.includes(ee)){var ie=ee.reference;return Ae(re,ie)}if(W.includes(ee))return Ae(re,ee)}},re.showNext=function(){var ee=W[0];if(!B)return re.show(0);var ie=W.indexOf(B);re.show(W[ie+1]||ee)},re.showPrevious=function(){var ee=W[W.length-1];if(!B)return re.show(ee);var ie=W.indexOf(B),x=W[ie-1]||ee;re.show(x)};var ve=re.setProps;return re.setProps=function(ee){be=ee.overrides||be,ve(ee)},re.setInstances=function(ee){Te(!0),le.forEach(function(ie){return ie()}),q=ee,Te(!1),ye(),je(re),re.setProps({triggerTarget:W})},le=je(re),re},ur={mouseover:"mouseenter",focusin:"focus",click:"click"};function qt(g,w){zt(!(w&&w.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a tippy."].join(" "));var D=[],F=[],q=!1,W=w.target,B=S(w,["target"]),be=Object.assign({},B,{trigger:"manual",touch:!1}),le=Object.assign({},B,{showOnCreate:!0}),pe=dt(g,be),ye=I(pe);function Te(he){if(!(!he.target||q)){var ve=he.target.closest(W);if(ve){var ee=ve.getAttribute("data-tippy-trigger")||w.trigger||Ze.trigger;if(!ve._tippy&&!(he.type==="touchstart"&&typeof le.touch=="boolean")&&!(he.type!=="touchstart"&&ee.indexOf(ur[he.type])<0)){var ie=dt(ve,le);ie&&(F=F.concat(ie))}}}}function je(he,ve,ee,ie){ie===void 0&&(ie=!1),he.addEventListener(ve,ee,ie),D.push({node:he,eventType:ve,handler:ee,options:ie})}function Ae(he){var ve=he.reference;je(ve,"touchstart",Te,c),je(ve,"mouseover",Te),je(ve,"focusin",Te),je(ve,"click",Te)}function Ie(){D.forEach(function(he){var ve=he.node,ee=he.eventType,ie=he.handler,x=he.options;ve.removeEventListener(ee,ie,x)}),D=[]}function re(he){var ve=he.destroy,ee=he.enable,ie=he.disable;he.destroy=function(x){x===void 0&&(x=!0),x&&F.forEach(function(Ge){Ge.destroy()}),F=[],Ie(),ve()},he.enable=function(){ee(),F.forEach(function(x){return x.enable()}),q=!1},he.disable=function(){ie(),F.forEach(function(x){return x.disable()}),q=!0},Ae(he)}return ye.forEach(re),pe}var dr={name:"animateFill",defaultValue:!1,fn:function(w){var D;if(!((D=w.props.render)!=null&&D.$$tippy))return zt(w.props.animateFill,"The `animateFill` plugin requires the default render function."),{};var F=Xt(w.popper),q=F.box,W=F.content,B=w.props.animateFill?Vr():null;return{onCreate:function(){B&&(q.insertBefore(B,q.firstElementChild),q.setAttribute("data-animatefill",""),q.style.overflow="hidden",w.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(B){var le=q.style.transitionDuration,pe=Number(le.replace("ms",""));W.style.transitionDelay=Math.round(pe/10)+"ms",B.style.transitionDuration=le,h([B],"visible")}},onShow:function(){B&&(B.style.transitionDuration="0ms")},onHide:function(){B&&h([B],"hidden")}}}};function Vr(){var g=J();return g.className=o,h([g],"hidden"),g}var xn={clientX:0,clientY:0},fn=[];function En(g){var w=g.clientX,D=g.clientY;xn={clientX:w,clientY:D}}function On(g){g.addEventListener("mousemove",En)}function zr(g){g.removeEventListener("mousemove",En)}var jn={name:"followCursor",defaultValue:!1,fn:function(w){var D=w.reference,F=v(w.props.triggerTarget||D),q=!1,W=!1,B=!0,be=w.props;function le(){return w.props.followCursor==="initial"&&w.state.isVisible}function pe(){F.addEventListener("mousemove",je)}function ye(){F.removeEventListener("mousemove",je)}function Te(){q=!0,w.setProps({getReferenceClientRect:null}),q=!1}function je(re){var he=re.target?D.contains(re.target):!0,ve=w.props.followCursor,ee=re.clientX,ie=re.clientY,x=D.getBoundingClientRect(),Ge=ee-x.left,fe=ie-x.top;(he||!w.props.interactive)&&w.setProps({getReferenceClientRect:function(){var bt=D.getBoundingClientRect(),Gt=ee,Kt=ie;ve==="initial"&&(Gt=bt.left+Ge,Kt=bt.top+fe);var Jt=ve==="horizontal"?bt.top:Kt,rt=ve==="vertical"?bt.right:Gt,lt=ve==="horizontal"?bt.bottom:Kt,yt=ve==="vertical"?bt.left:Gt;return{width:rt-yt,height:lt-Jt,top:Jt,right:rt,bottom:lt,left:yt}}})}function Ae(){w.props.followCursor&&(fn.push({instance:w,doc:F}),On(F))}function Ie(){fn=fn.filter(function(re){return re.instance!==w}),fn.filter(function(re){return re.doc===F}).length===0&&zr(F)}return{onCreate:Ae,onDestroy:Ie,onBeforeUpdate:function(){be=w.props},onAfterUpdate:function(he,ve){var ee=ve.followCursor;q||ee!==void 0&&be.followCursor!==ee&&(Ie(),ee?(Ae(),w.state.isMounted&&!W&&!le()&&pe()):(ye(),Te()))},onMount:function(){w.props.followCursor&&!W&&(B&&(je(xn),B=!1),le()||pe())},onTrigger:function(he,ve){X(ve)&&(xn={clientX:ve.clientX,clientY:ve.clientY}),W=ve.type==="focus"},onHidden:function(){w.props.followCursor&&(Te(),ye(),B=!0)}}}};function Yr(g,w){var D;return{popperOptions:Object.assign({},g.popperOptions,{modifiers:[].concat((((D=g.popperOptions)==null?void 0:D.modifiers)||[]).filter(function(F){var q=F.name;return q!==w.name}),[w])})}}var Bn={name:"inlinePositioning",defaultValue:!1,fn:function(w){var D=w.reference;function F(){return!!w.props.inlinePositioning}var q,W=-1,B=!1,be={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(je){var Ae=je.state;F()&&(q!==Ae.placement&&w.setProps({getReferenceClientRect:function(){return le(Ae.placement)}}),q=Ae.placement)}};function le(Te){return Xr(k(Te),D.getBoundingClientRect(),Y(D.getClientRects()),W)}function pe(Te){B=!0,w.setProps(Te),B=!1}function ye(){B||pe(Yr(w.props,be))}return{onCreate:ye,onAfterUpdate:ye,onTrigger:function(je,Ae){if(X(Ae)){var Ie=Y(w.reference.getClientRects()),re=Ie.find(function(he){return he.left-2<=Ae.clientX&&he.right+2>=Ae.clientX&&he.top-2<=Ae.clientY&&he.bottom+2>=Ae.clientY});W=Ie.indexOf(re)}},onUntrigger:function(){W=-1}}}};function Xr(g,w,D,F){if(D.length<2||g===null)return w;if(D.length===2&&F>=0&&D[0].left>D[1].right)return D[F]||w;switch(g){case"top":case"bottom":{var q=D[0],W=D[D.length-1],B=g==="top",be=q.top,le=W.bottom,pe=B?q.left:W.left,ye=B?q.right:W.right,Te=ye-pe,je=le-be;return{top:be,bottom:le,left:pe,right:ye,width:Te,height:je}}case"left":case"right":{var Ae=Math.min.apply(Math,D.map(function(fe){return fe.left})),Ie=Math.max.apply(Math,D.map(function(fe){return fe.right})),re=D.filter(function(fe){return g==="left"?fe.left===Ae:fe.right===Ie}),he=re[0].top,ve=re[re.length-1].bottom,ee=Ae,ie=Ie,x=ie-ee,Ge=ve-he;return{top:he,bottom:ve,left:ee,right:ie,width:x,height:Ge}}default:return w}}var qr={name:"sticky",defaultValue:!1,fn:function(w){var D=w.reference,F=w.popper;function q(){return w.popperInstance?w.popperInstance.state.elements.reference:D}function W(pe){return w.props.sticky===!0||w.props.sticky===pe}var B=null,be=null;function le(){var pe=W("reference")?q().getBoundingClientRect():null,ye=W("popper")?F.getBoundingClientRect():null;(pe&&Hn(B,pe)||ye&&Hn(be,ye))&&w.popperInstance&&w.popperInstance.update(),B=pe,be=ye,w.state.isMounted&&requestAnimationFrame(le)}return{onMount:function(){w.props.sticky&&le()}}}};function Hn(g,w){return g&&w?g.top!==w.top||g.right!==w.right||g.bottom!==w.bottom||g.left!==w.left:!0}dt.setDefaultProps({render:ar}),e.animateFill=dr,e.createSingleton=fr,e.default=dt,e.delegate=qt,e.followCursor=jn,e.hideAll=lr,e.inlinePositioning=Bn,e.roundArrow=r,e.sticky=qr}),Si=Ho($o()),Cs=Ho($o()),_s=e=>{let t={plugins:[]},r=i=>e[e.indexOf(i)+1];if(e.includes("animation")&&(t.animation=r("animation")),e.includes("duration")&&(t.duration=parseInt(r("duration"))),e.includes("delay")){let i=r("delay");t.delay=i.includes("-")?i.split("-").map(o=>parseInt(o)):parseInt(i)}if(e.includes("cursor")){t.plugins.push(Cs.followCursor);let i=r("cursor");["x","initial"].includes(i)?t.followCursor=i==="x"?"horizontal":"initial":t.followCursor=!0}e.includes("on")&&(t.trigger=r("on")),e.includes("arrowless")&&(t.arrow=!1),e.includes("html")&&(t.allowHTML=!0),e.includes("interactive")&&(t.interactive=!0),e.includes("border")&&t.interactive&&(t.interactiveBorder=parseInt(r("border"))),e.includes("debounce")&&t.interactive&&(t.interactiveDebounce=parseInt(r("debounce"))),e.includes("max-width")&&(t.maxWidth=parseInt(r("max-width"))),e.includes("theme")&&(t.theme=r("theme")),e.includes("placement")&&(t.placement=r("placement"));let n={};return e.includes("no-flip")&&(n.modifiers||(n.modifiers=[]),n.modifiers.push({name:"flip",enabled:!1})),t.popperOptions=n,t};function Ai(e){e.magic("tooltip",t=>(r,n={})=>{let i=n.timeout;delete n.timeout;let o=(0,Si.default)(t,{content:r,trigger:"manual",...n});o.show(),setTimeout(()=>{o.hide(),setTimeout(()=>o.destroy(),n.duration||300)},i||2e3)}),e.directive("tooltip",(t,{modifiers:r,expression:n},{evaluateLater:i,effect:o,cleanup:a})=>{let d=r.length>0?_s(r):{};t.__x_tippy||(t.__x_tippy=(0,Si.default)(t,d)),a(()=>{t.__x_tippy&&(t.__x_tippy.destroy(),delete t.__x_tippy)});let c=()=>t.__x_tippy.enable(),u=()=>t.__x_tippy.disable(),y=m=>{m?(c(),t.__x_tippy.setContent(m)):u()};if(r.includes("raw"))y(n);else{let m=i(n);o(()=>{m(E=>{typeof E=="object"?(t.__x_tippy.setProps(E),c()):y(E)})})}})}Ai.defaultProps=e=>(Si.default.setDefaultProps(e),Ai);var Ts=Ai,Wo=Ts;var Uo=()=>({toggle:function(e){this.$refs.panel.toggle(e)},open:function(e){this.$refs.panel.open(e)},close:function(e){this.$refs.panel.close(e)}});var Vo=({id:e})=>({isOpen:!1,livewire:null,close:function(){this.closeQuietly(),this.$refs.modalContainer.dispatchEvent(new CustomEvent("modal-closed",{id:e}))},closeQuietly:function(){this.isOpen=!1},open:function(){this.$nextTick(()=>{this.isOpen=!0,this.$dispatch("x-modal-opened")})}});document.addEventListener("alpine:init",()=>{window.Alpine.plugin(oo),window.Alpine.plugin(ao),window.Alpine.plugin(fo),window.Alpine.plugin(jo),window.Alpine.plugin(Wo),window.Alpine.data("filamentDropdown",Uo),window.Alpine.data("filamentModal",Vo)});document.addEventListener("livewire:init",()=>{Livewire.hook("commit",({component:e,commit:t,respond:r,succeed:n,fail:i})=>{r(()=>{queueMicrotask(()=>{if(!e.effects.html)for(let[c,u]of Object.entries(e.effects.partials??{})){let y=e.el.querySelector('[wire\\:partial="'+c+'"]');if(!y)continue;let m=y.parentElement?y.parentElement.tagName.toLowerCase():"div",E=document.createElement(m);E.innerHTML=u;let O;try{O=d(y.parentElement)}catch{}O&&(E.__livewire=O);let S=E.firstElementChild;S.__livewire=e,window.Alpine.morph(y,S,{updating:(T,I,$,A)=>{if(!o(T)){if(T.__livewire_ignore===!0||(T.__livewire_ignore_self===!0&&$(),a(T)&&T.getAttribute("wire:id")!==e.id))return A();a(T)&&(I.__livewire=e)}},key:T=>{if(!o(T))return T.hasAttribute("wire:key")?T.getAttribute("wire:key"):T.hasAttribute("wire:id")?T.getAttribute("wire:id"):T.id},lookahead:!1})}})});function o(c){return typeof c.hasAttribute!="function"}function a(c){return c.hasAttribute("wire:id")}function d(c,u=!0){let y=Alpine.findClosest(c,m=>m.__livewire);if(!y){if(u)throw"Could not find Livewire component in DOM tree";return}return y.__livewire}})});var Ps=function(e,t,r){function n(y,m){for(let E of y){let O=i(E,m);if(O!==null)return O}}function i(y,m){let E=y.match(/^[\{\[]([^\[\]\{\}]*)[\}\]](.*)/s);if(E===null||E.length!==3)return null;let O=E[1],S=E[2];if(O.includes(",")){let[T,I]=O.split(",",2);if(I==="*"&&m>=T)return S;if(T==="*"&&m<=I)return S;if(m>=T&&m<=I)return S}return O==m?S:null}function o(y){return y.toString().charAt(0).toUpperCase()+y.toString().slice(1)}function a(y,m){if(m.length===0)return y;let E={};for(let[O,S]of Object.entries(m))E[":"+o(O??"")]=o(S??""),E[":"+O.toUpperCase()]=S.toString().toUpperCase(),E[":"+O]=S;return Object.entries(E).forEach(([O,S])=>{y=y.replaceAll(O,S)}),y}function d(y){return y.map(m=>m.replace(/^[\{\[]([^\[\]\{\}]*)[\}\]]/,""))}let c=e.split("|"),u=n(c,t);return u!=null?a(u.trim(),r):(c=d(c),a(c.length>1&&t>1?c[1]:c[0],r))};window.jsMd5=zo.md5;window.pluralize=Ps;})(); +`,"2) content: () => element.cloneNode(true)"].join(" "));var be=q.reduce(function(le,pe){var ye=pe&&cn(pe,F);return ye&&le.push(ye),le},[]);return V(g)?be[0]:be}dt.defaultProps=Ze,dt.setDefaultProps=Wr,dt.currentInput=M;var lr=function(w){var C=w===void 0?{}:w,F=C.exclude,q=C.duration;wn.forEach(function(W){var B=!1;if(F&&(B=Q(F)?W.reference===F:W.popper===F.popper),!B){var be=W.props.duration;W.setProps({duration:q}),W.hide(),W.state.isDestroyed||W.setProps({duration:be})}})},cr=Object.assign({},t.applyStyles,{effect:function(w){var C=w.state,F={popper:{position:C.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(C.elements.popper.style,F.popper),C.styles=F,C.elements.arrow&&Object.assign(C.elements.arrow.style,F.arrow)}}),fr=function(w,C){var F;C===void 0&&(C={}),zt(!Array.isArray(w),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(w)].join(" "));var q=w,W=[],B,be=C.overrides,le=[],pe=!1;function ye(){W=q.map(function(ee){return ee.reference})}function Te(ee){q.forEach(function(ie){ee?ie.enable():ie.disable()})}function je(ee){return q.map(function(ie){var x=ie.setProps;return ie.setProps=function(Ge){x(Ge),ie.reference===B&&ee.setProps(Ge)},function(){ie.setProps=x}})}function Ae(ee,ie){var x=W.indexOf(ie);if(ie!==B){B=ie;var Ge=(be||[]).concat("content").reduce(function(fe,Ft){return fe[Ft]=q[x].props[Ft],fe},{});ee.setProps(Object.assign({},Ge,{getReferenceClientRect:typeof Ge.getReferenceClientRect=="function"?Ge.getReferenceClientRect:function(){return ie.getBoundingClientRect()}}))}}Te(!1),ye();var Ie={fn:function(){return{onDestroy:function(){Te(!0)},onHidden:function(){B=null},onClickOutside:function(x){x.props.showOnCreate&&!pe&&(pe=!0,B=null)},onShow:function(x){x.props.showOnCreate&&!pe&&(pe=!0,Ae(x,W[0]))},onTrigger:function(x,Ge){Ae(x,Ge.currentTarget)}}}},re=dt(J(),Object.assign({},S(C,["overrides"]),{plugins:[Ie].concat(C.plugins||[]),triggerTarget:W,popperOptions:Object.assign({},C.popperOptions,{modifiers:[].concat(((F=C.popperOptions)==null?void 0:F.modifiers)||[],[cr])})})),he=re.show;re.show=function(ee){if(he(),!B&&ee==null)return Ae(re,W[0]);if(!(B&&ee==null)){if(typeof ee=="number")return W[ee]&&Ae(re,W[ee]);if(q.includes(ee)){var ie=ee.reference;return Ae(re,ie)}if(W.includes(ee))return Ae(re,ee)}},re.showNext=function(){var ee=W[0];if(!B)return re.show(0);var ie=W.indexOf(B);re.show(W[ie+1]||ee)},re.showPrevious=function(){var ee=W[W.length-1];if(!B)return re.show(ee);var ie=W.indexOf(B),x=W[ie-1]||ee;re.show(x)};var ve=re.setProps;return re.setProps=function(ee){be=ee.overrides||be,ve(ee)},re.setInstances=function(ee){Te(!0),le.forEach(function(ie){return ie()}),q=ee,Te(!1),ye(),je(re),re.setProps({triggerTarget:W})},le=je(re),re},ur={mouseover:"mouseenter",focusin:"focus",click:"click"};function qt(g,w){zt(!(w&&w.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a tippy."].join(" "));var C=[],F=[],q=!1,W=w.target,B=S(w,["target"]),be=Object.assign({},B,{trigger:"manual",touch:!1}),le=Object.assign({},B,{showOnCreate:!0}),pe=dt(g,be),ye=I(pe);function Te(he){if(!(!he.target||q)){var ve=he.target.closest(W);if(ve){var ee=ve.getAttribute("data-tippy-trigger")||w.trigger||Ze.trigger;if(!ve._tippy&&!(he.type==="touchstart"&&typeof le.touch=="boolean")&&!(he.type!=="touchstart"&&ee.indexOf(ur[he.type])<0)){var ie=dt(ve,le);ie&&(F=F.concat(ie))}}}}function je(he,ve,ee,ie){ie===void 0&&(ie=!1),he.addEventListener(ve,ee,ie),C.push({node:he,eventType:ve,handler:ee,options:ie})}function Ae(he){var ve=he.reference;je(ve,"touchstart",Te,c),je(ve,"mouseover",Te),je(ve,"focusin",Te),je(ve,"click",Te)}function Ie(){C.forEach(function(he){var ve=he.node,ee=he.eventType,ie=he.handler,x=he.options;ve.removeEventListener(ee,ie,x)}),C=[]}function re(he){var ve=he.destroy,ee=he.enable,ie=he.disable;he.destroy=function(x){x===void 0&&(x=!0),x&&F.forEach(function(Ge){Ge.destroy()}),F=[],Ie(),ve()},he.enable=function(){ee(),F.forEach(function(x){return x.enable()}),q=!1},he.disable=function(){ie(),F.forEach(function(x){return x.disable()}),q=!0},Ae(he)}return ye.forEach(re),pe}var dr={name:"animateFill",defaultValue:!1,fn:function(w){var C;if(!((C=w.props.render)!=null&&C.$$tippy))return zt(w.props.animateFill,"The `animateFill` plugin requires the default render function."),{};var F=Xt(w.popper),q=F.box,W=F.content,B=w.props.animateFill?Vr():null;return{onCreate:function(){B&&(q.insertBefore(B,q.firstElementChild),q.setAttribute("data-animatefill",""),q.style.overflow="hidden",w.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(B){var le=q.style.transitionDuration,pe=Number(le.replace("ms",""));W.style.transitionDelay=Math.round(pe/10)+"ms",B.style.transitionDuration=le,h([B],"visible")}},onShow:function(){B&&(B.style.transitionDuration="0ms")},onHide:function(){B&&h([B],"hidden")}}}};function Vr(){var g=J();return g.className=o,h([g],"hidden"),g}var xn={clientX:0,clientY:0},fn=[];function En(g){var w=g.clientX,C=g.clientY;xn={clientX:w,clientY:C}}function On(g){g.addEventListener("mousemove",En)}function zr(g){g.removeEventListener("mousemove",En)}var jn={name:"followCursor",defaultValue:!1,fn:function(w){var C=w.reference,F=v(w.props.triggerTarget||C),q=!1,W=!1,B=!0,be=w.props;function le(){return w.props.followCursor==="initial"&&w.state.isVisible}function pe(){F.addEventListener("mousemove",je)}function ye(){F.removeEventListener("mousemove",je)}function Te(){q=!0,w.setProps({getReferenceClientRect:null}),q=!1}function je(re){var he=re.target?C.contains(re.target):!0,ve=w.props.followCursor,ee=re.clientX,ie=re.clientY,x=C.getBoundingClientRect(),Ge=ee-x.left,fe=ie-x.top;(he||!w.props.interactive)&&w.setProps({getReferenceClientRect:function(){var bt=C.getBoundingClientRect(),Gt=ee,Kt=ie;ve==="initial"&&(Gt=bt.left+Ge,Kt=bt.top+fe);var Jt=ve==="horizontal"?bt.top:Kt,rt=ve==="vertical"?bt.right:Gt,lt=ve==="horizontal"?bt.bottom:Kt,yt=ve==="vertical"?bt.left:Gt;return{width:rt-yt,height:lt-Jt,top:Jt,right:rt,bottom:lt,left:yt}}})}function Ae(){w.props.followCursor&&(fn.push({instance:w,doc:F}),On(F))}function Ie(){fn=fn.filter(function(re){return re.instance!==w}),fn.filter(function(re){return re.doc===F}).length===0&&zr(F)}return{onCreate:Ae,onDestroy:Ie,onBeforeUpdate:function(){be=w.props},onAfterUpdate:function(he,ve){var ee=ve.followCursor;q||ee!==void 0&&be.followCursor!==ee&&(Ie(),ee?(Ae(),w.state.isMounted&&!W&&!le()&&pe()):(ye(),Te()))},onMount:function(){w.props.followCursor&&!W&&(B&&(je(xn),B=!1),le()||pe())},onTrigger:function(he,ve){X(ve)&&(xn={clientX:ve.clientX,clientY:ve.clientY}),W=ve.type==="focus"},onHidden:function(){w.props.followCursor&&(Te(),ye(),B=!0)}}}};function Yr(g,w){var C;return{popperOptions:Object.assign({},g.popperOptions,{modifiers:[].concat((((C=g.popperOptions)==null?void 0:C.modifiers)||[]).filter(function(F){var q=F.name;return q!==w.name}),[w])})}}var Bn={name:"inlinePositioning",defaultValue:!1,fn:function(w){var C=w.reference;function F(){return!!w.props.inlinePositioning}var q,W=-1,B=!1,be={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(je){var Ae=je.state;F()&&(q!==Ae.placement&&w.setProps({getReferenceClientRect:function(){return le(Ae.placement)}}),q=Ae.placement)}};function le(Te){return Xr(k(Te),C.getBoundingClientRect(),Y(C.getClientRects()),W)}function pe(Te){B=!0,w.setProps(Te),B=!1}function ye(){B||pe(Yr(w.props,be))}return{onCreate:ye,onAfterUpdate:ye,onTrigger:function(je,Ae){if(X(Ae)){var Ie=Y(w.reference.getClientRects()),re=Ie.find(function(he){return he.left-2<=Ae.clientX&&he.right+2>=Ae.clientX&&he.top-2<=Ae.clientY&&he.bottom+2>=Ae.clientY});W=Ie.indexOf(re)}},onUntrigger:function(){W=-1}}}};function Xr(g,w,C,F){if(C.length<2||g===null)return w;if(C.length===2&&F>=0&&C[0].left>C[1].right)return C[F]||w;switch(g){case"top":case"bottom":{var q=C[0],W=C[C.length-1],B=g==="top",be=q.top,le=W.bottom,pe=B?q.left:W.left,ye=B?q.right:W.right,Te=ye-pe,je=le-be;return{top:be,bottom:le,left:pe,right:ye,width:Te,height:je}}case"left":case"right":{var Ae=Math.min.apply(Math,C.map(function(fe){return fe.left})),Ie=Math.max.apply(Math,C.map(function(fe){return fe.right})),re=C.filter(function(fe){return g==="left"?fe.left===Ae:fe.right===Ie}),he=re[0].top,ve=re[re.length-1].bottom,ee=Ae,ie=Ie,x=ie-ee,Ge=ve-he;return{top:he,bottom:ve,left:ee,right:ie,width:x,height:Ge}}default:return w}}var qr={name:"sticky",defaultValue:!1,fn:function(w){var C=w.reference,F=w.popper;function q(){return w.popperInstance?w.popperInstance.state.elements.reference:C}function W(pe){return w.props.sticky===!0||w.props.sticky===pe}var B=null,be=null;function le(){var pe=W("reference")?q().getBoundingClientRect():null,ye=W("popper")?F.getBoundingClientRect():null;(pe&&Hn(B,pe)||ye&&Hn(be,ye))&&w.popperInstance&&w.popperInstance.update(),B=pe,be=ye,w.state.isMounted&&requestAnimationFrame(le)}return{onMount:function(){w.props.sticky&&le()}}}};function Hn(g,w){return g&&w?g.top!==w.top||g.right!==w.right||g.bottom!==w.bottom||g.left!==w.left:!0}dt.setDefaultProps({render:ar}),e.animateFill=dr,e.createSingleton=fr,e.default=dt,e.delegate=qt,e.followCursor=jn,e.hideAll=lr,e.inlinePositioning=Bn,e.roundArrow=r,e.sticky=qr}),Si=Ho($o()),Ds=Ho($o()),_s=e=>{let t={plugins:[]},r=i=>e[e.indexOf(i)+1];if(e.includes("animation")&&(t.animation=r("animation")),e.includes("duration")&&(t.duration=parseInt(r("duration"))),e.includes("delay")){let i=r("delay");t.delay=i.includes("-")?i.split("-").map(o=>parseInt(o)):parseInt(i)}if(e.includes("cursor")){t.plugins.push(Ds.followCursor);let i=r("cursor");["x","initial"].includes(i)?t.followCursor=i==="x"?"horizontal":"initial":t.followCursor=!0}e.includes("on")&&(t.trigger=r("on")),e.includes("arrowless")&&(t.arrow=!1),e.includes("html")&&(t.allowHTML=!0),e.includes("interactive")&&(t.interactive=!0),e.includes("border")&&t.interactive&&(t.interactiveBorder=parseInt(r("border"))),e.includes("debounce")&&t.interactive&&(t.interactiveDebounce=parseInt(r("debounce"))),e.includes("max-width")&&(t.maxWidth=parseInt(r("max-width"))),e.includes("theme")&&(t.theme=r("theme")),e.includes("placement")&&(t.placement=r("placement"));let n={};return e.includes("no-flip")&&(n.modifiers||(n.modifiers=[]),n.modifiers.push({name:"flip",enabled:!1})),t.popperOptions=n,t};function Ai(e){e.magic("tooltip",t=>(r,n={})=>{let i=n.timeout;delete n.timeout;let o=(0,Si.default)(t,{content:r,trigger:"manual",...n});o.show(),setTimeout(()=>{o.hide(),setTimeout(()=>o.destroy(),n.duration||300)},i||2e3)}),e.directive("tooltip",(t,{modifiers:r,expression:n},{evaluateLater:i,effect:o,cleanup:a})=>{let d=r.length>0?_s(r):{};t.__x_tippy||(t.__x_tippy=(0,Si.default)(t,d)),a(()=>{t.__x_tippy&&(t.__x_tippy.destroy(),delete t.__x_tippy)});let c=()=>t.__x_tippy.enable(),u=()=>t.__x_tippy.disable(),y=m=>{m?(c(),t.__x_tippy.setContent(m)):u()};if(r.includes("raw"))y(n);else{let m=i(n);o(()=>{m(E=>{typeof E=="object"?(t.__x_tippy.setProps(E),c()):y(E)})})}})}Ai.defaultProps=e=>(Si.default.setDefaultProps(e),Ai);var Ts=Ai,Wo=Ts;var Uo=()=>({toggle:function(e){this.$refs.panel.toggle(e)},open:function(e){this.$refs.panel.open(e)},close:function(e){this.$refs.panel.close(e)}});var Vo=({id:e})=>({isOpen:!1,livewire:null,close:function(){this.closeQuietly(),this.$refs.modalContainer.dispatchEvent(new CustomEvent("modal-closed",{id:e}))},closeQuietly:function(){this.isOpen=!1},open:function(){this.$nextTick(()=>{this.isOpen=!0,this.$dispatch("x-modal-opened")})}});document.addEventListener("alpine:init",()=>{window.Alpine.plugin(oo),window.Alpine.plugin(ao),window.Alpine.plugin(fo),window.Alpine.plugin(jo),window.Alpine.plugin(Wo),window.Alpine.data("filamentDropdown",Uo),window.Alpine.data("filamentModal",Vo)});document.addEventListener("livewire:init",()=>{Livewire.hook("commit",({component:e,commit:t,respond:r,succeed:n,fail:i})=>{r(()=>{queueMicrotask(()=>{if(!e.effects.html)for(let[c,u]of Object.entries(e.effects.partials??{})){let y=e.el.querySelector('[wire\\:partial="'+c+'"]');if(!y)continue;let m=y.parentElement?y.parentElement.tagName.toLowerCase():"div",E=document.createElement(m);E.innerHTML=u;let O;try{O=d(y.parentElement)}catch{}O&&(E.__livewire=O);let S=E.firstElementChild;S.__livewire=e,window.Alpine.morph(y,S,{updating:(T,I,$,A)=>{if(!o(T)){if(T.__livewire_ignore===!0||(T.__livewire_ignore_self===!0&&$(),a(T)&&T.getAttribute("wire:id")!==e.id))return A();a(T)&&(I.__livewire=e)}},key:T=>{if(!o(T))return T.hasAttribute("wire:key")?T.getAttribute("wire:key"):T.hasAttribute("wire:id")?T.getAttribute("wire:id"):T.id},lookahead:!1})}})});function o(c){return typeof c.hasAttribute!="function"}function a(c){return c.hasAttribute("wire:id")}function d(c,u=!0){let y=Alpine.findClosest(c,m=>m.__livewire);if(!y){if(u)throw"Could not find Livewire component in DOM tree";return}return y.__livewire}})});var Ps=function(e,t,r){function n(y,m){for(let E of y){let O=i(E,m);if(O!==null)return O}}function i(y,m){let E=y.match(/^[\{\[]([^\[\]\{\}]*)[\}\]](.*)/s);if(E===null||E.length!==3)return null;let O=E[1],S=E[2];if(O.includes(",")){let[T,I]=O.split(",",2);if(I==="*"&&m>=T)return S;if(T==="*"&&m<=I)return S;if(m>=T&&m<=I)return S}return O==m?S:null}function o(y){return y.toString().charAt(0).toUpperCase()+y.toString().slice(1)}function a(y,m){if(m.length===0)return y;let E={};for(let[O,S]of Object.entries(m))E[":"+o(O??"")]=o(S??""),E[":"+O.toUpperCase()]=S.toString().toUpperCase(),E[":"+O]=S;return Object.entries(E).forEach(([O,S])=>{y=y.replaceAll(O,S)}),y}function d(y){return y.map(m=>m.replace(/^[\{\[]([^\[\]\{\}]*)[\}\]]/,""))}let c=e.split("|"),u=n(c,t);return u!=null?a(u.trim(),r):(c=d(c),a(c.length>1&&t>1?c[1]:c[0],r))};window.jsMd5=zo.md5;window.pluralize=Ps;})(); /*! Bundled license information: js-md5/src/md5.js: