(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),c=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;lt[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=s((e=>{ /** * @license React * react.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function te(e,t){return E(e.type,t,e.props)}function ne(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(ne(o)&&(o=te(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u{t.exports=d()})),p=s(((e,t)=>{ /* object-assign (c) Sindre Sorhus @license MIT */ var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(e==null)throw TypeError(`Object.assign cannot be called with null or undefined`);return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String(`abc`);if(e[5]=`de`,Object.getOwnPropertyNames(e)[0]===`5`)return!1;for(var t={},n=0;n<10;n++)t[`_`+String.fromCharCode(n)]=n;if(Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(``)!==`0123456789`)return!1;var r={};return`abcdefghijklmnopqrst`.split(``).forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join(``)===`abcdefghijklmnopqrst`}catch{return!1}}t.exports=o()?Object.assign:function(e,t){for(var o,s=a(e),c,l=1;l{var n=p(),r={};function i(e,t,n,r,i,a,o,s){if(!e){var c;if(t===void 0)c=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var l=[n,r,i,a,o,s],u=0;c=Error(t.replace(/%s/g,function(){return l[u++]})),c.name=`Invariant Violation`}throw c.framesToPop=1,c}}var a=`mixins`;function o(e){return e}function s(e,t,s){var c=[],l={mixins:`DEFINE_MANY`,statics:`DEFINE_MANY`,propTypes:`DEFINE_MANY`,contextTypes:`DEFINE_MANY`,childContextTypes:`DEFINE_MANY`,getDefaultProps:`DEFINE_MANY_MERGED`,getInitialState:`DEFINE_MANY_MERGED`,getChildContext:`DEFINE_MANY_MERGED`,render:`DEFINE_ONCE`,componentWillMount:`DEFINE_MANY`,componentDidMount:`DEFINE_MANY`,componentWillReceiveProps:`DEFINE_MANY`,shouldComponentUpdate:`DEFINE_ONCE`,componentWillUpdate:`DEFINE_MANY`,componentDidUpdate:`DEFINE_MANY`,componentWillUnmount:`DEFINE_MANY`,UNSAFE_componentWillMount:`DEFINE_MANY`,UNSAFE_componentWillReceiveProps:`DEFINE_MANY`,UNSAFE_componentWillUpdate:`DEFINE_MANY`,updateComponent:`OVERRIDE_BASE`},u={getDerivedStateFromProps:`DEFINE_MANY_MERGED`},d={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n{var n=f(),r=m();if(n===void 0)throw Error(`create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.`);var i=new n.Component().updater;t.exports=r(n.Component,n.isValidElement,i)}))(),1); /*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */ function g(e,t){this.v=e,this.k=t}function _(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n2?n-2:0),i=2;i1?t-1:0),r=1;r`u`?null:Me(BigInt.prototype.toString),De=typeof Symbol>`u`?null:Me(Symbol.prototype.toString),Oe=Me(Object.prototype.hasOwnProperty),ke=Me(Object.prototype.toString),Ae=Me(RegExp.prototype.test),je=Ne(TypeError);function Me(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:ve;if(T&&T(e,null),!me(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ee(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Fe(e){for(let t=0;t/g),eee=re(/\${[\w\W]*/g),et=re(/^data-[\-\w.\u00B7-\uFFFF]+$/),tt=re(/^aria-[\-\w]+$/),nt=re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),tee=re(/^(?:\w+script|data):/i),nee=re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ree=re(/^html$/i),iee=re(/^[a-z][.\w]*(-[.\w]+)+$/i),rt=re(/<[/\w!]/g),aee=re(/<[/\w]/g),oee=re(/<\/no(script|embed|frames)/i),it=re(/\/>/i),at={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},see=ne(Pe({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),cee=function(){return typeof window>`u`?null:window},lee=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},ot=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},st=function(e,t,n,r){return Oe(e,t)&&me(e[t])?Pe(r.base?Ie(r.base):{},e[t],r.transform):n},ct=function(e,t,n){let r=Oe(e,t)?e[t]:void 0;return r&&typeof r==`object`?Ie(r):n()};function lt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:cee(),t=e=>lt(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==at.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Re(d,`cloneNode`),p=Re(d,`remove`),m=Re(d,`removeAttributeNode`),h=Re(d,`nextSibling`),g=Re(d,`childNodes`),_=Re(d,`parentNode`),v=Re(d,`shadowRoot`),y=Re(d,`attributes`),b=o&&o.prototype?Re(o.prototype,`nodeType`):null,x=o&&o.prototype?Re(o.prototype,`nodeName`):null,S=o&&o.prototype?Re(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},T=function(e){return x?x(e):e.nodeName},ee=ze(d,`namespaceURI`),E=function(e){return ee?ee(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let te,ae=``,oe,se=!1,we=0,Te=function(){if(we>0)throw je(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},Ee=function(e){Te(),we++;try{return te.createHTML(e)}finally{we--}},De=function(e){Te(),we++;try{return te.createScriptURL(e)}finally{we--}},ke=function(){return se||=(oe=lee(u,i),!0),oe},Me=n,Ne=Me.implementation,Fe=Me.createNodeIterator,ut=Me.createDocumentFragment,dt=Me.getElementsByTagName,ft=r.importNode,pt=ot();t.isSupported=typeof w==`function`&&typeof _==`function`&&Ne&&Ne.createHTMLDocument!==void 0;let mt=Qe,ht=$e,gt=eee,_t=et,vt=tt,yt=tee,bt=nee,xt=iee,St=nt,Ct=null,wt=Pe({},[...Ve,...He,...Ue,...Ge,...qe]),Tt=null,Et=Pe({},[...Je,...Ye,...Xe,...Ze]),Dt=Object.seal(ie(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}})),Ot=null,kt=null,At=Object.seal(ie(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),jt=!0,Mt=!0,Nt=!1,Pt=!0,Ft=!1,It=!0,Lt=!1,Rt=!1,zt=null,Bt=null,Vt=!1,Ht=!1,Ut=!1,Wt=!1,Gt=!0,Kt=!1,qt=`user-content-`,Jt=!0,Yt=!1,Xt=null,Zt={},Qt=null,$t=Pe({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),en=null,tn=Pe({},[`audio`,`video`,`img`,`source`,`image`,`track`]),nn=null,rn=Pe({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),an=`http://www.w3.org/1998/Math/MathML`,on=`http://www.w3.org/2000/svg`,sn=`http://www.w3.org/1999/xhtml`,cn=sn,ln=!1,un=null,dn=Pe({},[an,on,sn],ye),fn=ne([`mi`,`mo`,`mn`,`ms`,`mtext`]),pn=Pe({},fn),mn=ne([`annotation-xml`]),hn=Pe({},mn),gn=Pe({},[`title`,`style`,`font`,`a`,`script`]),_n=null,uee=[`application/xhtml+xml`,`text/html`],vn=null,yn=null,dee=n.createElement(`form`),bn=function(e){return e instanceof RegExp||e instanceof Function},xn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(yn&&yn===e)return;e&&typeof e==`object`||(e={}),e=Ie(e),_n=uee.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,vn=_n===`application/xhtml+xml`?ye:ve,Ct=st(e,`ALLOWED_TAGS`,wt,{transform:vn}),Tt=st(e,`ALLOWED_ATTR`,Et,{transform:vn}),un=st(e,`ALLOWED_NAMESPACES`,dn,{transform:ye}),nn=st(e,`ADD_URI_SAFE_ATTR`,rn,{transform:vn,base:rn}),en=st(e,`ADD_DATA_URI_TAGS`,tn,{transform:vn,base:tn}),Qt=st(e,`FORBID_CONTENTS`,$t,{transform:vn}),Ot=st(e,`FORBID_TAGS`,Ie({}),{transform:vn}),kt=st(e,`FORBID_ATTR`,Ie({}),{transform:vn}),Zt=Oe(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Ie(e.USE_PROFILES):e.USE_PROFILES:!1,jt=e.ALLOW_ARIA_ATTR!==!1,Mt=e.ALLOW_DATA_ATTR!==!1,Nt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Pt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ft=e.SAFE_FOR_TEMPLATES||!1,It=e.SAFE_FOR_XML!==!1,Lt=e.WHOLE_DOCUMENT||!1,Ht=e.RETURN_DOM||!1,Ut=e.RETURN_DOM_FRAGMENT||!1,Wt=e.RETURN_TRUSTED_TYPE||!1,Vt=e.FORCE_BODY||!1,Gt=e.SANITIZE_DOM!==!1,Kt=e.SANITIZE_NAMED_PROPS||!1,Jt=e.KEEP_CONTENT!==!1,Yt=e.IN_PLACE||!1,St=Be(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:nt,cn=typeof e.NAMESPACE==`string`?e.NAMESPACE:sn,pn=ct(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>Pe({},fn)),hn=ct(e,`HTML_INTEGRATION_POINTS`,()=>Pe({},mn));let t=ct(e,`CUSTOM_ELEMENT_HANDLING`,()=>ie(null));if(Dt=ie(null),Oe(t,`tagNameCheck`)&&bn(t.tagNameCheck)&&(Dt.tagNameCheck=t.tagNameCheck),Oe(t,`attributeNameCheck`)&&bn(t.attributeNameCheck)&&(Dt.attributeNameCheck=t.attributeNameCheck),Oe(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Dt.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),re(Dt),Ft&&(Mt=!1),Ut&&(Ht=!0),Zt&&(Ct=Pe({},qe),Tt=ie(null),Zt.html===!0&&(Pe(Ct,Ve),Pe(Tt,Je)),Zt.svg===!0&&(Pe(Ct,He),Pe(Tt,Ye),Pe(Tt,Ze)),Zt.svgFilters===!0&&(Pe(Ct,Ue),Pe(Tt,Ye),Pe(Tt,Ze)),Zt.mathMl===!0&&(Pe(Ct,Ge),Pe(Tt,Xe),Pe(Tt,Ze))),At.tagCheck=null,At.attributeCheck=null,Oe(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?At.tagCheck=e.ADD_TAGS:me(e.ADD_TAGS)&&(Ct===wt&&(Ct=Ie(Ct)),Pe(Ct,e.ADD_TAGS,vn))),Oe(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?At.attributeCheck=e.ADD_ATTR:me(e.ADD_ATTR)&&(Tt===Et&&(Tt=Ie(Tt)),Pe(Tt,e.ADD_ATTR,vn))),Oe(e,`ADD_FORBID_CONTENTS`)&&me(e.ADD_FORBID_CONTENTS)&&(Qt===$t&&(Qt=Ie(Qt)),Pe(Qt,e.ADD_FORBID_CONTENTS,vn)),Jt&&(Ct[`#text`]=!0),Lt&&Pe(Ct,[`html`,`head`,`body`]),Ct.table&&(Pe(Ct,[`tbody`]),delete Ot.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw je(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw je(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=te;te=e.TRUSTED_TYPES_POLICY;try{ae=Ee(``)}catch(e){throw te=t,e}}else e.TRUSTED_TYPES_POLICY===null?(te=void 0,ae=``):(te===void 0&&(te=ke()),te&&typeof ae==`string`&&(ae=Ee(``)));ne&&ne(e),yn=e},Sn=Pe({},[...He,...Ue,...We]),Cn=Pe({},[...Ge,...Ke]),wn=function(e,t,n){return t.namespaceURI===sn?e===`svg`:t.namespaceURI===an?e===`svg`&&(n===`annotation-xml`||pn[n]):!!Sn[e]},Tn=function(e,t,n){return t.namespaceURI===sn?e===`math`:t.namespaceURI===on?e===`math`&&hn[n]:!!Cn[e]},En=function(e,t,n){return t.namespaceURI===on&&!hn[n]||t.namespaceURI===an&&!pn[n]?!1:!Cn[e]&&(gn[e]||!Sn[e])},Dn=function(e){let t=E(e),n=ve(T(e)),r=_(e),i,a;return r&&C(r)===at.element?(i={namespaceURI:E(r)},a=ve(T(r))):(i={namespaceURI:cn},a=`template`),un[t]?t===on?wn(n,i,a):t===an?Tn(n,i,a):t===sn?En(n,i,a):!!(_n===`application/xhtml+xml`&&un[t]):!1},On=function(e){de(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw je(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},kn=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},An=function(e){Pn(e);let t=g(e);t&&ce(fe(t),e=>{try{p(e)}catch{}});let n=C(e)===at.element?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&kn(e,r,i)}},jn=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}de(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Ht||Ut)try{On(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Mn=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||Tt[vn(i)]||kn(e,r,i)}},Nn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&C(e)===at.element){let t=v(e);Yn(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Pn=function(e){Nn(e,e=>{C(e)===at.element&&Mn(e)})},Fn=function(e){let t=[];return Nn(e,e=>{t.push(e)},!0),t},In=function(e,t){let n=he();ce(Fn(e),e=>{C(e)===at.element&&ge(n,e)}),ce(t,e=>{C(e)===at.element&&!_e(n,e)&&Mn(e)})},Ln=function(e,n){let r=!1;return ce(t.removed,t=>{t.element&&(r||=t.element===e,Pn(t.element))}),In(e,n),r},Rn=function(e,t){let n=Xt,r=null,i=()=>(r||(r=he(),ce(t,e=>{ge(r,e)})),r);for(let t=0;;t++){let r=Fn(e),a=[e],o=!1;if(ce(r,e=>{C(e)===at.documentFragment?de(a,e):!o&&!_e(n,e)&&(o=_e(i(),e))}),!o)return;if(t>=8)throw je(`the tree kept changing during in-place sanitization; refusing to return it`);ce(a,(t,n)=>{zn(t,n>0,e,i())})}},zn=function(e,t,n,r){let i=Wn(e),a;for(;a=i.nextNode();)_e(r,a)&&!_e(Xt,a)&&(t&&Zn(pt.uponSanitizeShadowNode,a,null),rr(a,n),ur(a,n),Yn(a.content)&&dr(a.content))},Bn=function(e){Xt&&ge(Xt,e)},Vn=function(e,t){return It?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Hn=function(e){It&&Nn(e,e=>{let t=C(e);if(t===at.processingInstruction||t===at.comment&&Ae(aee,e.data)){try{p(e)}catch{}return!1}if(t===at.element){let t=e,n=vn(T(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Vn(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Un=function(e){let t=null,r=null;if(Vt)e=``+e;else{let t=be(e,/^[\r\n\t ]+/);r=t&&t[0]}_n===`application/xhtml+xml`&&cn===sn&&(e=``+e+``);let i=te?Ee(e):e;if(cn===sn)try{t=new l().parseFromString(i,_n)}catch{}if(!t||!t.documentElement){t=Ne.createDocument(cn,`template`,null);try{t.documentElement.innerHTML=ln?ae:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),cn===sn?dt.call(t,Lt?`html`:`body`)[0]:Lt?t.documentElement:a},Wn=function(e){let t=S?S(e):e.ownerDocument;return Fe.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Gn=function(e){return e=xe(e,mt,` `),e=xe(e,ht,` `),e=xe(e,gt,` `),e},Kn=function(e){qn(e);let t=e.querySelectorAll?.call(e,`template`);t&&ce(t,e=>{Yn(e.content)&&Kn(e.content)})},qn=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=Fe.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Gn(r.data),r=n.nextNode()},Jn=function(e){let t=x?x(e):null;return typeof t!=`string`||vn(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Yn=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===at.documentFragment}catch{return!1}},Xn=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Zn(e,n,r){e.length!==0&&ce(e,e=>{e.call(t,n,r,yn)})}let Qn=function(e,t){return!!(It&&e.hasChildNodes()&&!Xn(e.firstElementChild)&&Ae(rt,e.textContent)&&Ae(rt,e.innerHTML)||It&&see[t]&&C(e)===at.element&&E(e)===sn&&(Xn(e.firstElementChild)||typeof e.textContent==`string`&&Ae(rt,e.textContent))||e.nodeType===at.processingInstruction||It&&e.nodeType===at.comment&&Ae(aee,e.data))},$n=function(e,t){if(e instanceof RegExp)return Ae(e,t);if(e instanceof Function){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return On(e),!0},tr=function(e,t,n,r){return e.length===0?t:t===n||t===r?Ie(t):t},nr=function(e,t){return e===t||_(e)!==null?!1:(Yt&&Pn(e),!0)},rr=function(e,n){if(Bn(e),Zn(pt.beforeSanitizeElements,e,null),nr(e,n))return!0;if(Jn(e))return On(e),!0;let r=vn(T(e));if(Ct=tr(pt.uponSanitizeElement,Ct,wt,zt),Zn(pt.uponSanitizeElement,e,{tagName:r,allowedTags:Ct}),nr(e,n))return!0;if(Qn(e,r))return On(e),!0;if(Ot[r]||!(At.tagCheck instanceof Function&&At.tagCheck(r))&&!Ct[r]){let t=er(e,r,n);return t===!1&&(Zn(pt.afterSanitizeElements,e,null),nr(e,n))?!0:t}if(C(e)===at.element&&!Dn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Ae(oee,e.innerHTML))return On(e),!0;if(Ft&&e.nodeType===at.text){let n=Gn(e.textContent);e.textContent!==n&&(de(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Zn(pt.afterSanitizeElements,e,null),nr(e,n)},ir=function(e,t,r){if(kt[t]||Vn(t,e)||Gt&&(t===`id`||t===`name`)&&(r in n||r in dee))return!1;let i=Tt[t]||At.attributeCheck instanceof Function&&At.attributeCheck(t,e);return Mt&&Ae(_t,t)||jt&&Ae(vt,t)?!0:i?nn[t]||Ae(St,xe(r,bt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Se(r,`data:`)===0&&en[e]||Nt&&!Ae(yt,xe(r,bt,``))?!0:!r:or(e)&&$n(Dt.tagNameCheck,e)&&$n(Dt.attributeNameCheck,t,e)||t===`is`&&Dt.allowCustomizedBuiltInElements&&$n(Dt.tagNameCheck,r)},ar=Pe({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),or=function(e){return!ar[ve(e)]&&Ae(xt,e)},sr=function(e,t,n,r){if(te&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return Ee(r);case`TrustedScriptURL`:return De(r)}return r},cr=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Jn(e)||(On(e),!1)}catch{return jn(t,e),!1}},lr=function(e,t){return It&&Ae(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:ve(e)===`attributename`&&be(t,`href`)!==null},ur=function(e,n){if(Zn(pt.beforeSanitizeAttributes,e,null),nr(e,n))return;let r=e.attributes;if(!r||Jn(e))return;Tt=tr(pt.uponSanitizeAttribute,Tt,Et,Bt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:Tt,forceKeepAttr:void 0},a=r.length,o=vn(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=vn(s),d=l,f=s===`value`?d:Ce(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Zn(pt.uponSanitizeAttribute,e,i),f=i.attrValue,Kt&&(u===`id`||u===`name`)&&Se(f,qt)!==0&&(jn(s,e,n),f=qt+f,p=!0),lr(s,f)?jn(s,e,n):i.forceKeepAttr||(i.keepAttr?!Pt&&Ae(it,f)?jn(s,e,n):(Ft&&(f=Gn(f)),ir(o,u,f)?(f=sr(o,u,c,f),f!==d&&cr(e,s,c,f)&&p&&ue(t.removed)):jn(s,e,n)):jn(s,e,n))}Zn(pt.afterSanitizeAttributes,e,null),nr(e,n)},dr=function(e){let t=null,n=Wn(e);for(Zn(pt.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Zn(pt.uponSanitizeShadowNode,t,null),rr(t,e),ur(t,e),Yn(t.content)&&dr(t.content),C(t)===at.element){let e=v(t);Yn(e)&&(fr(e),dr(e))}Ft&&qn(e),Zn(pt.afterSanitizeShadowDOM,e,null)},fr=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){dr(e.shadow);continue}let n=e.node,r=C(n)===at.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&vn(e)===`template`){let e=n.content;Yn(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Yn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(ln=!e,ln&&(e=``),typeof e!=`string`&&!Xn(e)&&(e=Le(e),typeof e!=`string`))throw je(`dirty is not a string, aborting`);if(!t.isSupported)return e;Rt?(Ct=zt,Tt=Bt):xn(n),(pt.uponSanitizeElement.length>0||pt.uponSanitizeAttribute.length>0)&&(Ct=Ie(Ct)),pt.uponSanitizeAttribute.length>0&&(Tt=Ie(Tt)),t.removed=[];let c=Yt&&typeof e!=`string`&&Xn(e),l=[],u=Xt;if(c){Hn(e);let t=T(e);if(typeof t==`string`){let n=vn(t);if(!Ct[n]||Ot[n])throw An(e),je(`root node is forbidden and cannot be sanitized in-place`)}if(Jn(e))throw An(e),je(`root node is clobbered and cannot be sanitized in-place`);l=Fn(e),Xt=he()}else if(Xn(e))i=Un(``),a=i.ownerDocument.importNode(e,!0),a.nodeType===at.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),fr(i);else{if(!Ht&&!Ft&&!Lt&&e.indexOf(`<`)===-1)return te&&Wt?Ee(e):e;if(i=Un(e),!i)return Ht?null:Wt?ae:``}i&&Vt&&On(i.firstChild);let d=c?e:i;try{c&&fr(e);let t=Wn(d);for(;o=t.nextNode();)rr(o,d),ur(o,d),Yn(o.content)&&dr(o.content);c&&Rn(e,l)}catch(t){throw c&&(An(e),Ln(e,l)),t}finally{Xt=u}if(c){if(Ln(e,l))throw je(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Ft&&Kn(e),e}if(Ht){if(Ft&&Kn(i),Ut)for(s=ut.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(Tt.shadowroot||Tt.shadowrootmode)&&(s=ft.call(r,s,!0)),s}let f=Lt?i.outerHTML:i.innerHTML;return Lt&&Ct[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Ae(ree,i.ownerDocument.doctype.name)&&(f=` `+f),Ft&&(f=Gn(f)),te&&Wt?Ee(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xn(e),Rt=!0,zt=Ct,Bt=Tt},t.clearConfig=function(){yn=null,Rt=!1,zt=null,Bt=null,te=oe,ae=``},t.isValidAttribute=function(e,t,n){yn||xn({});let r=vn(e),i=vn(t);return typeof n==`string`&&(lr(t,n)||!Pt&&Ae(it,n))?!1:ir(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Oe(pt,e)&&de(pt[e],t)},t.removeHook=function(e,t){if(Oe(pt,e)){if(t!==void 0){let n=le(pt[e],t);return n===-1?void 0:pe(pt[e],n,1)[0]}return ue(pt[e])}},t.removeHooks=function(e){Oe(pt,e)&&(pt[e]=[])},t.removeAllHooks=function(){pt=ot()},t}var ut=lt(),dt=ut,ft=ut.sanitize.bind(ut);ut.isSupported,ut.addHook.bind(ut),ut.removeHook.bind(ut),ut.removeHooks.bind(ut),ut.removeAllHooks.bind(ut),ut.setConfig.bind(ut),ut.clearConfig.bind(ut),ut.isValidAttribute.bind(ut),ut.version,ut.removed;function pt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var mt=pt();function ht(e){mt=e}var gt={exec:()=>null};function _t(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function vt(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(bt.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var yt=((e=``)=>{try{return!!RegExp(`(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:_t(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:_t(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:_t(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:_t(e=>RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:_t(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:_t(e=>RegExp(`^ {0,${e}}(?:)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|RegExp(`^ {0,${e}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},xt=/^(?:[ \t]*(?:\n|$))+/,St=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ct=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/,wt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Tt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Et=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Dt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,Ot=vt(Dt).replace(/bull/g,Et).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),kt=vt(Dt).replace(/bull/g,Et).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),At=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,jt=/^[^\n]+/,Mt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,Nt=vt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Mt).replace(`title`,/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),Pt=vt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Et).getRegex(),Ft=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,It=/|$))/,Lt=vt(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|[^\\n]*\\n*|$)|[^\\n]*\\n*|$)||$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,It).replace(`tag`,Ft).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Rt=e=>vt(At).replace(`hr`,wt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,` {0,3}(?:)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?| ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Bt).getRegex(),code:St,def:Nt,fences:Ct,heading:Tt,hr:wt,html:Lt,lheading:Ot,list:Pt,newline:xt,paragraph:zt,table:gt,text:jt},Ht=vt(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,wt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,` {0,3}(?:)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|(?: *\\n{2,}|\\s*$)|\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace(`comment`,It).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:gt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:vt(At).replace(`hr`,wt).replace(`heading`,` *#{1,6} *[^ ]`).replace(`lheading`,Ot).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Gt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Kt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,qt=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Jt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,yt?"(?`+)[^`]+\k(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),an=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,on=vt(an,`u`).replace(/punct/g,Yt).getRegex(),sn=vt(an,`u`).replace(/punct/g,en).getRegex(),cn=vt(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,$t).replace(/punct/g,Yt).getRegex(),ln=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,un=vt(ln,`gu`).replace(/notPunctSpace/g,Zt).replace(/punctSpace/g,Xt).replace(/punct/g,Yt).getRegex(),dn=vt(ln,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),fn=vt(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Zt).replace(/punctSpace/g,Xt).replace(/punct/g,Yt).getRegex(),pn=vt(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Zt).replace(/punctSpace/g,Xt).replace(/punct/g,Yt).getRegex(),mn=vt(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Zt).replace(/punctSpace/g,Xt).replace(/punct/g,Yt).getRegex(),hn=vt(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Yt).getRegex(),gn=vt(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Zt).replace(/punctSpace/g,Xt).replace(/punct/g,Yt).getRegex(),_n=vt(/\\(punct)/,`gu`).replace(/punct/g,Yt).getRegex(),uee=vt(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,Yt).getRegex(),vn=vt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),yn=vt(It).replace(`(?:-->|$)`,`-->`).getRegex(),dee=vt(`^comment|^|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^`).replace(`comment`,yn).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),bn=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,xn=vt(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,bn).getRegex(),Sn=vt(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,xn).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),Cn=vt(/^!?\[(label)\]\[(ref)\]/).replace(`label`,xn).replace(`ref`,Mt).getRegex(),wn=vt(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Mt).getRegex(),Tn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,En=vt(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,bn).getRegex(),Dn=vt(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,vt(/^!?\[(label)\]\[(ref)\]/).replace(`label`,En).replace(`ref`,Tn).getRegex()).replace(`nolink`,vt(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Tn).getRegex()).getRegex(),On=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,kn=vt(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),An={_backpedal:gt,anyPunctuation:_n,anyPunctuationOutsideCode:uee,autolink:vn,blockSkip:rn,br:qt,code:Kt,del:gt,delLDelim:gt,delRDelim:gt,emStrongLDelim:on,emStrongRDelimAst:un,emStrongRDelimUnd:pn,escape:Gt,link:Sn,nolink:wn,punctuation:Qt,reflink:Cn,reflinkSearch:Dn,tag:dee,text:Jt,url:gt},jn={...An,emStrongLDelim:cn,emStrongRDelimAst:fn,emStrongRDelimUnd:mn,link:vt(/^!?\[(label)\]\((.*?)\)/).replace(`label`,xn).getRegex(),reflink:vt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,xn).getRegex()},Mn={...An,emStrongRDelimAst:dn,emStrongLDelim:sn,delLDelim:hn,delRDelim:gn,url:vt(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,kn).replace(`protocol`,On).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:vt(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":`>`,'"':`"`,"'":`'`},Ln=e=>In[e];function Rn(e,t){if(t){if(bt.escapeTest.test(e))return e.replace(bt.escapeReplace,Ln)}else if(bt.escapeTestNoEncode.test(e))return e.replace(bt.escapeReplaceNoEncode,Ln);return e}function zn(e){return bt.numericCharacterReference.test(e)?e.replace(bt.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&`:String.fromCodePoint(r)}):e}function Bn(e){try{e=encodeURI(e).replace(bt.percentDecode,`%`)}catch{return null}return e}function Vn(e,t){let n=e.replace(bt.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(bt.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length=0&&bt.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(` `)}function Wn(e){return e.trim().replace(bt.multipleSpaceGlobal,` `).toLowerCase().toUpperCase().toLowerCase()}function Gn(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r0?-2:-1}var Kn=new WeakMap;function qn(e){let t={"*":-1,_:-1},n=-1,r=e.length;for(let i=0;i{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(` `)}function tr(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;it.length-i)return!0;i+=o[0].length-1}}return!1}var nr=class{options;rules;lexer;constructor(e){this.options=e||mt}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Un(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=er(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Hn(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Hn(t[0],` `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Hn(t[0],` `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Hn(t[0],` `).split(` `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;ot+Qn(n,t.length)).replace(this.rules.other.blockquoteSetextReplace,` $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n} ${s}`:s,r=r?`${r} ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`||u?.type===`table`)break;if(u?.type===`blockquote`){let t=u,a=e.join(` `),o=t.raw+` `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(` `).length:0,d=l?e.slice(0,-l):e;if(d.length>0&&(n=`${n} ${d.join(` `)}`),r=r.substring(0,r.length-t.text.length)+s.text,e=e.slice(d.length),e.length>0&&this.rules.other.blockquoteStart.test(e[0]))continue;break}if(u?.type===`list`){let t=u,a=t.raw+` `+e.join(` `),o=this.list(a);i[i.length-1]=o;let s=o.raw.length>t.raw.length?a.slice(t.raw.length+1,o.raw.length).split(` `).length:0;if(s>0){let t=e.slice(0,s).join(` `);n=`${n} ${t}`,r=`${r} ${t}`}e=e.slice(s)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&this.lexer.state.lastToken?.type===`text`&&!this.rules.other.listInterruptsParagraph.test(e))return;let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(` `,1)[0],d=t[1].length,f=this.options.pedantic?Qn(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>Qn(e,d)),p=e.split(` `,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(h):this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h),c=!1;for(;e;){let l=e.split(` `,1)[0],u;if(p=l,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),u=p):u=p.replace(this.rules.other.leadingSpaceTab,e=>Qn(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(u.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=` `+u.slice(h),c=!1;else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||o.test(f)||n.test(f))break;if(!this.options.pedantic&&!c){let e=f.replace(this.rules.other.nestedContainerMarkers,``);if(this.rules.block.fences.test(e)||this.rules.block.heading.test(e)||this.rules.block.hr.test(e))break}let e=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(p)&&this.rules.block.lheading.test(`${f} ${p}`)?` ${u.replace(/^ {0,3}/,``)}`:p;a+=` `+e,c=!0}m=!p.trim(),e=e.substring(l.length+1),f=u.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Un(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Gn(t[2],`()`)!==-1)return;let e=Wn(t[1]),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:Hn(t[0],` `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Vn(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(` `):[],a={type:`table`,raw:Hn(t[0],` `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:Hn(t[0],` `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===` `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&tr(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=Hn(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=Gn(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=Hn(t[0].slice(0,-1),`\\`);if((t[0].length-i.length)%2==0)return;let a=t[2],o=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(a);e&&(a=e[1],o=e[3])}else o=t[3]?t[3].slice(1,-1):``;return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(a=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a.slice(1):a.slice(1,-1)),$n(t,{href:a&&a.replace(this.rules.inline.anyPunctuation,`$1`),title:o&&o.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&tr(e,n[1],r,this.rules))return;let i=t[Wn(n[2]||n[1])];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return $n(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],a=n===i,o=t.length-e.length,s=o;for(;!this.options.pedantic&&s>0&&t[s-1]===i;)s--;let c=[...t.slice(Math.max(0,s-2),s)].at(-1)??``,l=c===`*`||c===`_`||!!this.rules.inline.punctuation.exec(c);sb);){if(u=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!u)continue;if(f=[...u].length,r[3]||r[4]){p+=f;continue}if(r[5]||r[6]||g){if(a&&(r[5]||r[6]))break;if(h%3&&!((h+f)%3)){m+=f;continue}}if(p-=f,p>0)continue;f=Math.min(f,f+p+m);let t=[...r[0]][0].length,i=e.slice(0,n+r.index+t+f);if(Math.min(n,f)%2){let e=i.slice(1,-1);return{type:`em`,raw:i,text:e,tokens:this.lexer.inlineTokens(e)}}let o=i.slice(2,-2);return{type:`strong`,raw:i,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim,c=Zn(this,t),l=t.length-e.length+n;if(cu);){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:zn(t[0]),escaped:e}}}},rr=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||mt,this.options.tokenizer=this.options.tokenizer||new nr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:bt,block:Pn.normal,inline:Fn.normal};this.options.pedantic?(t.block=Pn.pedantic,t.inline=Fn.pedantic):this.options.gfm&&(t.block=Pn.gfm,t.inline=this.options.breaks?Fn.breaks:Fn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Pn,inline:Fn}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(bt.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let e=0;e(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=` `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(` `)?``:` `)+r.raw,n.text+=` `+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if((r=this.tokenizer.fences(e))||(r=this.tokenizer.heading(e))||(r=this.tokenizer.hr(e))||(r=this.tokenizer.blockquote(e))||(r=this.tokenizer.list(e))||(r=this.tokenizer.html(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(` `)?``:` `)+r.raw,n.text+=` `+r.raw,this.inlineQueue.at(-1).src=n.text):(this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}),t.push(r));continue}if((r=this.tokenizer.table(e))||(r=this.tokenizer.lheading(e))){e=e.substring(r.raw.length),t.push(r);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){let i=t.at(-1);n&&i?.type===`paragraph`?(i.raw+=(i.raw.endsWith(` `)?``:` `)+r.raw,i.text+=` `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(r),n=a.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(` `)?``:` `)+r.raw,n.text+=` `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=r,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,Wn(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e.includes(`*`)||e.includes(`_`)||e.includes(`~`)||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==nr.prototype.emStrong||this.tokenizer.del!==nr.prototype.del?this.#r(e):e;Jn(this.tokenizer,n);try{return this.#t(e,n,t)}finally{Yn(this.tokenizer)}}#t(e,t,n){let r=!1,i=``,a=1/0;for(;e;){if(e.length(o=t.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let t=n.at(-1);o.type===`text`&&t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o);continue}if((o=this.tokenizer.emStrong(e,t,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,t,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let t=n.at(-1);t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#n(e){let{blockSkip:t,tag:n,autolink:r}=this.tokenizer.rules.inline,i=``,a=0,o;for(t.lastIndex=0;o=t.exec(e);){let s=o.index+(o[2]?o[2].length:0),c=o.index+o[0].length;if(e.charAt(s)===`<`){let i=e.slice(s),a=n.exec(i)||r.exec(i);if(!a){t.lastIndex=s+1;continue}c=s+a[0].length,t.lastIndex=c}i+=e.slice(a,s)+`[`+`a`.repeat(c-s-2)+`]`,a=c}return i+e.slice(a)}#r(e){let t=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,n=t=>{let r=t.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,Wn(t.slice(r+1,-1))))return t;if(r>1&&t.charAt(0)!==`!`){let i=t.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,n)+`][`+`a`.repeat(t.length-r-2)+`]`}return`[`+`a`.repeat(t.length-2)+`]`};t=t.replace(e,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),t=this.#n(t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},ir=class{options;parser;constructor(e){this.options=e||mt}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(bt.notSpaceStart)?.[0],i=e?e.replace(bt.endingNewline,``)+` `:``;return r?`
`+(n?i:Rn(i,!0))+`
`:`
`+(n?i:Rn(i,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} `}hr(e){return`
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t `+r+` `}listitem(e){return`
  • ${this.parser.parse(e.tokens)}
  • `}checkbox({checked:e}){return` `}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    `}table(e){let t=``,n=``;for(let t=0;t${r}`,` `+t+` `+r+`
    `}tablerow({text:e}){return` ${e} `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${Rn(e,!0)}`}br(e){return`
    `}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Rn(n,!0):this.parser.parseInline(r),o=Bn(e);if(o===null)return a;e=Rn(o,i);let s=`
    `+a+``,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Bn(e);if(i===null)return Rn(n);e=i;let a=`${Rn(n)}`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Rn(e.text)}},ar=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return` `}checkbox({raw:e}){return e}},or=class e{options;renderer;textRenderer;constructor(e){this.options=e||mt,this.options.renderer=this.options.renderer||new ir,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ar,this.textRenderer.parser=this}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n{let i=e[r].flat(1/0);cr(n,this.walkTokens(i,t))}):e.tokens&&cr(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ir(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n===!1?``:n??``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new nr(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new sr;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=sr.passThroughHooks.has(n)?e=>{if(t.options.async&&sr.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(t.options.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return cr(n,r.call(this,e)),t&&cr(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return rr.lex(e,t??this.defaults)}parser(e,t){return or.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?rr.lex:rr.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?or.parse:or.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?rr.lex:rr.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?or.parse:or.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=` Please report this to https://github.com/markedjs/marked.`,e){let e=`

    An error occurred:

    `+Rn(n.message+``,!0)+`
    `;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},ur=new lr;function dr(e,t){return ur.parse(e,t)}dr.options=dr.setOptions=function(e){return ur.setOptions(e),dr.defaults=ur.defaults,ht(dr.defaults),dr},dr.getDefaults=pt,dr.defaults=mt;function fr(...e){return ur.use(...e),dr.defaults=ur.defaults,ht(dr.defaults),dr}dr.use=fr,dr.walkTokens=function(e,t){return ur.walkTokens(e,t)},dr.parseInline=ur.parseInline,dr.Parser=or,dr.parser=or.parse,dr.Renderer=ir,dr.TextRenderer=ar,dr.Lexer=rr,dr.lexer=rr.lex,dr.Tokenizer=nr,dr.Hooks=sr,dr.parse=dr,dr.options,dr.setOptions,dr.walkTokens;var pr=dr.parseInline,mr=dr;or.parse;var fee=rr.lex,hr=u(f(),1),gr={},_r=Symbol(`uninitialized`),vr=Array.isArray,pee=Array.prototype.indexOf,yr=Array.prototype.includes,br=Array.from,mee=Object.defineProperty,xr=Object.getOwnPropertyDescriptor,hee=Object.getOwnPropertyDescriptors,Sr=Object.prototype,gee=Array.prototype,Cr=Object.getPrototypeOf,wr=Object.isExtensible;function Tr(e){return typeof e==`function`}var Er=()=>{};function Dr(e){return typeof e?.then==`function`}function _ee(e){for(var t=0;t{e=n,t=r}),resolve:e,reject:t}}function kr(e,t,n=!1){return e===void 0?n?t():t:e}function Ar(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var jr=Symbol(`$state`),Mr=Symbol(`component`),Nr=Symbol(`legacy props`),vee=Symbol(``),Pr=Symbol(`attributes`),Fr=Symbol(`class`),Ir=Symbol(`style`),Lr=Symbol(`text`),Rr=Symbol(`form reset`),zr=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Br=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function yee(){console.warn(`https://svelte.dev/e/derived_inert`)}function Vr(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function bee(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function xee(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var Hr=!1;function Ur(e){Hr=e}var Wr;function Gr(e){if(e===null)throw Vr(),gr;return Wr=e}function Kr(){return Gr(ua(Wr))}function D(e){if(Hr){if(ua(Wr)!==null)throw Vr(),gr;Wr=e}}function qr(e=1){if(Hr){for(var t=e,n=Wr;t--;)n=ua(n);Wr=n}}function Jr(e=!0){for(var t=0,n=Wr;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=ua(n);e&&n.remove(),n=i}}function Yr(e){if(!e||e.nodeType!==8)throw Vr(),gr;return e.data}function Xr(e){return e===this.v}function See(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Zr(e){return!See(e,this.v)}function Qr(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function Cee(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function wee(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Tee(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Eee(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Dee(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Oee(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function kee(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Aee(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function jee(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Mee(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Nee(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Pee=[];function $r(e,t=!1,n=!1){return ei(e,new Map,``,Pee,null,n)}function ei(e,t,n,r,i=null,a=!1){if(typeof e==`object`&&e){var o=t.get(e);if(o!==void 0)return o;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(vr(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var c=0;c{t===ci&&li()})}ci.push(e)}function Lee(){for(;ci.length>0;)li()}var Ree=-7169;function di(e,t){e.f=e.f&Ree|t}function fi(e){e.f&512||e.deps===null?di(e,1024):di(e,4096)}function pi(e,t){e.f&2048?t.set(e,2048):e.f&4096&&t.get(e)!==2048&&t.set(e,4096),di(e,1024)}function zee(e,t){if(t){let t=document.body;e.autofocus=!0,ui(()=>{document.activeElement===t&&e.focus()})}}function Bee(e){Hr&&la(e)!==null&&Yee(e)}var mi=!1;function hi(){mi||(mi=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[Rr]?.()})},{capture:!0}))}function gi(e){var t=Fa,n=Ra;La(null),za(null);try{return e()}finally{La(t),za(n)}}function Vee(e,t,n,r=n){e.addEventListener(t,()=>gi(n));let i=e[Rr];e[Rr]=i?()=>{i(),r(!0)}:()=>r(!0),hi()}function _i(e,t,n,r){let i=si()?xi:Ci;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=Ra,c=vi(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){pa(e,s)}yi()}}var d=bi();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>Hee(e))).then(u).catch(e=>pa(e,s)).finally(d)}l?l.then(()=>{s.f&16384?d():(c(),f(),yi())}):f()}function vi(){var e=Ra,t=Fa,n=ni,r=Oi;return function(i=!0){za(e),La(t),ri(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function yi(e=!0){za(null),La(null),ri(null),e&&Oi?.deactivate()}function bi(){var e=Ra,t=e.b,n=Oi,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function xi(e){return Ra!==null&&(Ra.f|=524288),{ctx:ni,deps:null,effects:null,equals:Xr,f:2050,fn:e,reactions:null,rv:0,v:_r,wv:0,parent:Ra,ac:null}}var Si=Symbol(`obsolete`);function Hee(e,t,n){let r=Ra;r===null&&Cee();var i=void 0,a=qi(_r),o=!Fa,s=new Set;return nte(()=>{var t=Ra,n=Or();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==zr&&n.reject(e)}).finally(yi)}catch(e){n.reject(e),yi()}var c=Oi;if(o){if(t.f&32768)var l=bi();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(Si);else for(let e of s.values())e.reject(Si);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==Si&&(c.activate(),t?(a.f|=8388608,Zi(a,t)):(a.f&8388608&&(a.f^=8388608),Zi(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),ga(()=>{for(let e of s)e.reject(Si)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function A(e){let t=xi(e);return Va(t),t}function Ci(e){let t=xi(e);return t.equals=Zr,t}function Uee(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n{t.ac.abort(zr),t.ac=null}),t.fn!==null&&(t.teardown=Er),eo(t,0),wa(t))}function Ei(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&to(t)}var Di=null,Oi=null,ki=null,Ai=null,ji=null,Mi=!1,Ni=!1,Pi=null,Fi=null,Ii=0,Gee=1,Li=class e{id=Gee++;started=!1;linked=!0;prev=null;next=null;async_deriveds=new Map;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=0;#r=new Map;#i=null;#a=[];#o=[];#s=new Map;#c=new Map;#l=new Set;is_fork=!1;#u=!1;constructor(){Di===null?Di=this:(Di.next=this,this.prev=Di),Di=this}#d(){if(this.is_fork)return!0;for(let e of this.#r.keys())if(!this.#f(e))return!0;return!1}#f(e){for(var t=e;t!==null;t=t.parent)if(this.#c.has(t))return!0;return!1}skip_effect(e){this.#c.has(e)||this.#c.set(e,{d:[],m:[]}),this.#l.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#c.get(e);if(n){this.#c.delete(e);for(var r of n.d)di(r,2048),t(r);for(r of n.m)di(r,4096),t(r)}this.#l.add(e)}#p(){var e=[];for(let i of this.#a)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=1024}}n||e.push(t)}return this.#a=[],e}#m(){this.started=!0;for(let[e,t]of this.#s)di(e,t),this.schedule(e);this.apply();for(var t=Pi=[],n=[],r=Fi=[];this.#a.length>0;){Ii++>1e3&&(this.#b(),Kee());for(let e of this.#p())try{this.#h(e,t,n)}catch(t){throw Ui(e),this.#d()||this.discard(),t}}if(Oi=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Pi=null,Fi=null,this.#d()){this.#y(n),this.#y(t);for(let[e,t]of this.#c)Hi(e,t);r.length>0&&Oi.#m();return}let a=this.#g();if(a)this.#y(n),this.#y(t),a.#v(this);else{this.#s.clear();for(let e of this.#e)e(this);this.#e.clear(),ki=this,Bi(n),Bi(t),ki=null,this.#i?.resolve();var o=Oi;this.#n===0&&(this.#a.length===0||o!==null)&&this.#b(),o!==null&&(Gi.clear(),o.#m())}}#h(e,t,n){e.f^=1024;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#c.has(r))&&r.fn!==null){a?r.f^=1024:i&4?t.push(r):Xa(r)&&(i&16&&this.add_dirty_reaction(r,4096),to(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#g(){for(var e=this.prev;e!==null;e=e.prev)if(!e.is_fork&&this.#_(e))return e;return null}#_(e){for(let[t,[,n]]of this.current)if(!n&&e.current.has(t))return!0;return!1}#v(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_reactions(e.#s);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#s.delete(i),di(i,2048),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#b(),Oi=this,this.#m()}#y(e){for(var t=0;t{this.#u=!1,this.linked&&this.flush()}))}transfer_reactions(e){for(let[t,n]of e)this.add_dirty_reaction(t,n);e.clear()}add_dirty_reaction(e,t){(t===2048||this.#s.get(e)!==2048)&&this.#s.set(e,t)}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=Or()).promise}static ensure(){if(Oi===null){let t=Oi=new e;!Ni&&!Mi&&ui(()=>{t.started||t.flush()})}return Oi}apply(){Ai=null}schedule(e){ji=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)?e.b.defer_effect(e):this.#a.push(e)}#b(){if(this.linked){var e=this.prev,t=this.next;e===null||(e.next=t),t===null?Di=e:t.prev=e,this.linked=!1}}};function Ri(e){var t=Mi,n=ki;ki=null,Mi=!0;try{var r;for(e&&(Ri(),r=e());;){if(Lee(),Oi===null)return r;Oi.flush()}}finally{Mi=t,ki=n}}function Kee(){try{Oee()}catch(e){pa(e,ji)}}var zi=null;function Bi(e){var t=e.length;if(t!==0){for(var n=0;n0)){Gi.clear();for(let e of zi){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)zi.has(n)&&(zi.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||to(n)}}zi.clear()}}zi=null}}function Vi(e){Oi.schedule(e)}function Hi(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),di(e,1024);for(var n=e.first;n!==null;)Hi(n,t),n=n.next}}function Ui(e){di(e,1024);for(var t=e.first;t!==null;)Ui(t),t=t.next}var Wi=new Set,Gi=new Map,Ki=!1;function qi(e,t){return{f:0,v:e,reactions:null,equals:Xr,rv:0,wv:0}}function j(e,t){let n=qi(e,t);return Va(n),n}function Ji(e,t=!1,n=!0){let r=qi(e);return t||(r.equals=Zr),r}function M(e,t,n=!1){return Fa!==null&&(!Ia||Fa.f&131072)&&si()&&Fa.f&4325394&&(Ba===null||!Ba.has(e))&&Mee(),Zi(e,n?ea(t):t,Fi)}var Yi=null,Xi=0;function Zi(e,t,n=null){if(!e.equals(t)){Na?Gi.set(e,t):Gi.has(e)||Gi.set(e,e.v);var r=Li.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&wi(t),Ai===null&&fi(t)}e.wv=Ya(),Yi=null,Xi=0,$i(e,2048,n),Yi=null,si()&&Ra!==null&&Ra.f&1024&&!(Ra.f&96)&&(Wa===null?ste([e]):Wa.push(e)),!r.is_fork&&Wi.size>0&&!Ki&&qee()}return t}function qee(){Ki=!1;for(let e of Wi){e.f&1024&&di(e,4096);let t;try{t=Xa(e)}catch{t=!0}t&&to(e)}Wi.clear()}function Qi(e){M(e,e.v+1)}function $i(e,t,n){var r=e.reactions;if(r!==null){var i=si(),a=r.length;if(Xi+=a,Xi>1e5&&Yi===null&&(Yi=new Set),Yi!==null){if(Yi.has(e))return;Yi.add(e)}for(var o=0;o{if(qa===o)return e();var t=Fa,n=qa;La(null),Ja(o);var r=e();return La(t),Ja(n),r};return r&&n.set(`length`,j(e.length,a)),new Proxy(e,{defineProperty(e,t,r){`value`in r&&r.configurable!==!1&&r.enumerable!==!1&&r.writable!==!1||Aee();var i=n.get(t);return i===void 0?s(()=>{var e=j(r.value,a);return n.set(t,e),e}):M(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>j(_r,a));n.set(t,e),Qi(i)}}else M(r,_r),Qi(i);return!0},get(t,r,i){if(r===jr)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||xr(t,r)?.writable)&&(o=s(()=>j(ea(c?t[r]:_r),a)),n.set(r,o)),o!==void 0){var l=z(o);return l===_r?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var r=Reflect.getOwnPropertyDescriptor(e,t),i=n.get(t);if(i!==void 0){var a=z(i);if(a===_r)return;if(r&&`value`in r)r.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return r},has(e,t){if(t===jr)return!0;var r=n.get(t),i=r!==void 0&&r.v!==_r||Reflect.has(e,t);return(r!==void 0||(Ra!==null||Fa!==null)&&(!i||xr(e,t)?.writable))&&(r===void 0&&(r=s(()=>j(i?ea(e[t]):_r,a)),n.set(t,r)),z(r)===_r)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=o;dj(_r,a)),n.set(d+``,f)):M(f,_r)}if(l===void 0)(!u||xr(e,t)?.writable)&&(l=s(()=>j(void 0,a)),M(l,ea(o)),n.set(t,l));else{u=l.v!==_r;var p=s(()=>ea(o));M(l,p)}var m=Reflect.getOwnPropertyDescriptor(e,t);if(m?.set&&m.set.call(c,o),!u){if(r&&typeof t==`string`){var h=n.get(`length`),g=Number(t);Number.isInteger(g)&&g>=h.v&&M(h,g+1)}Qi(i)}return!0},ownKeys(e){z(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==_r});for(var[r,a]of n)a.v!==_r&&!(r in e)&&t.push(r);return t},setPrototypeOf(){jee()}})}function ta(e){try{if(typeof e==`object`&&e&&jr in e)return e[jr]}catch{}return e}function na(e,t){return Object.is(ta(e),ta(t))}var ra,ia,aa,oa,sa;function Jee(){if(ra===void 0){ra=window,ia=document,aa=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;oa=xr(t,`firstChild`).get,sa=xr(t,`nextSibling`).get,wr(e)&&(e[Fr]=void 0,e[Pr]=null,e[Ir]=void 0,e.__e=void 0),wr(n)&&(n[Lr]=void 0)}}function ca(e=``){return document.createTextNode(e)}function la(e){return oa.call(e)}function ua(e){return sa.call(e)}function N(e,t){if(!Hr)return la(e);var n=la(Wr);if(n===null)n=Wr.appendChild(ca());else if(t&&n.nodeType!==3){var r=ca();return n?.before(r),Gr(r),r}return t&&fa(n),Gr(n),n}function P(e,t=!1){if(!Hr){var n=la(e);return n instanceof Comment&&n.data===``?ua(n):n}if(t){if(Wr?.nodeType!==3){var r=ca();return Wr?.before(r),Gr(r),r}fa(Wr)}return Wr}function F(e,t=!1){if(!Hr)return la(e);var n=N(e,t);return D(e),n}function I(e,t=1,n=!1){let r=Hr?Wr:e;for(var i;t--;)i=r,r=ua(r);if(!Hr)return r;if(n){if(r?.nodeType!==3){var a=ca();return r===null?i?.after(a):r.before(a),Gr(a),a}fa(r)}return Gr(r),r}function Yee(e){e.textContent=``}function Xee(){return!1}function da(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function fa(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Zee(e){var t=Ra;if(t===null)return Fa.f|=8388608,e;if(!(t.f&32768)&&!(t.f&4))throw e;pa(e,t)}function pa(e,t){if(e===gr)throw e;if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function Qee(e){Ra===null&&(Fa===null&&Dee(e),Eee()),Na&&Tee(e)}function $ee(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function ma(e,t){var n=Ra;n!==null&&n.f&8192&&(e|=8192);var r={ctx:ni,deps:null,nodes:null,f:e|2560,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};Oi?.register_created_effect(r);var i=r;if(e&4)Pi===null?Li.ensure().schedule(r):Pi.push(r);else if(t!==null){try{to(r)}catch(e){throw Ta(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=65536))}if(i!==null&&(i.parent=n,n!==null&&$ee(i,n),Fa!==null&&Fa.f&2&&!(e&64))){var a=Fa;(a.effects??=[]).push(i)}return r}function ha(){return Fa!==null&&!Ia}function ga(e){let t=ma(8,null);return di(t,1024),t.teardown=e,t}function L(e){Qee(`$effect`);var t=Ra.f;if(!Fa&&t&32&&ni!==null&&!ni.i){var n=ni;(n.e??=[]).push(e)}else return ete(e)}function ete(e){return ma(1048580,e)}function _a(e){return Qee(`$effect.pre`),ma(1048584,e)}function va(e){Li.ensure();let t=ma(524352,e);return()=>{Ta(t)}}function tte(e){Li.ensure();let t=ma(524352,e);return(e={})=>new Promise(n=>{e.outro?Oa(t,()=>{Ta(t),n(void 0)}):(Ta(t),n(void 0))})}function ya(e){return ma(4,e)}function nte(e){return ma(4718592,e)}function ba(e,t=0){return ma(8|t,e)}function R(e,t=[],n=[],r=[]){_i(r,t,n,t=>{ma(8,()=>{e(...t.map(z))})})}function rte(e,t=[],n=[],r=[]){_i(r,t,n,t=>{ma(4,()=>e(...t.map(z)))})}function xa(e,t=0){return ma(16|t,e)}function ite(e,t=0){return ma(16777216|t,e)}function Sa(e){return ma(524320,e)}function Ca(e){var t=e.teardown;if(t!==null){let n=Na,r=Fa;Pa(!0),La(null);try{t.call(null)}catch(t){pa(t,e.parent)}finally{Pa(n),La(r)}}}function wa(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&gi(()=>{e.abort(zr)});var r=n.next;n.f&64?n.parent=null:Ta(n,t),n=r}}function ate(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Ta(t),t=n}}function Ta(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Ea(e.nodes.start,e.nodes.end),n=!0),e.f|=33554432,wa(e,t&&!n),eo(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Ca(e),e.f^=33554432,e.f|=16384;var i=e.parent;i!==null&&i.first!==null&&Da(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Ea(e,t){for(;e!==null;){var n=e===t?null:ua(e);e.remove(),e=n}}function Da(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Oa(e,t,n=!0){var r=[];e.f|=256,ka(e,r,!0);var i=()=>{n&&Ta(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function ka(e,t,n){if(!(e.f&8192)){e.f^=8192;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);ka(i,t,o?n:!1)}i=a}}}function Aa(e){e.f&=-257,ja(e,!0)}function ja(e,t){if(!(e.f&256)&&e.f&8192){e.f^=8192,e.f&1024||(di(e,2048),Li.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);ja(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Ma(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:ua(n);t.append(n),n=i}}var ote=null,Na=!1;function Pa(e){Na=e}var Fa=null,Ia=!1;function La(e){Fa=e}var Ra=null;function za(e){Ra=e}var Ba=null;function Va(e){Fa!==null&&(Fa.f&2097152||Fa.f&2)&&(Ba??=new Set).add(e)}var Ha=null,Ua=0,Wa=null;function ste(e){Wa=e}var Ga=1,Ka=0,qa=Ka;function Ja(e){qa=e}function Ya(){return++Ga}function Xa(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}t&512&&Ai===null&&di(e,1024)}return!1}function Za(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Ba!==null&&Ba.has(e)))for(var i=0;i{e.ac.abort(zr)}),e.ac=null);try{e.f|=2097152;var u=e.fn,d=u();e.f|=32768;var f=$a(e);if(si()&&Wa!==null&&!Ia&&f!==null&&!(e.f&6146))for(var p=0;p0)for(t.length=Ua+Ha.length,r=0;r{a.ac.abort(zr),a.ac=null,di(a,2048)}),Wee(a),eo(a,0)}}function eo(e,t){var n=e.deps;if(n!==null)for(var r=t;r{e.isConnected&&e.dispatchEvent(t)}))}function lo(e,t,n,r={}){function i(e){if(r.capture||_o.call(t,e),!e.cancelBubble)return gi(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,ui(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function uo(e,t,n,r={}){var i=lo(t,e,n,r);return()=>{i.__removed=!0,e.removeEventListener(t,i,r)}}function fo(e,t,n,r,i){var a={capture:r,passive:i},o=lo(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&ga(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function po(e,t,n){(t[oo]??={})[e]=n}function mo(e){for(var t=0;t{go=!1,ho=null}));var o=0,s=ho===e&&e[oo];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[oo]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){mee(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=Fa,d=Ra;La(null),za(null);try{for(var f,p=[];a!==null&&a!==t;){try{var m=a[oo]?.[r];m==null||a.disabled&&e.target!==a||m.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble)break;o++,a=o{throw e});throw f}}finally{e[oo]=t,delete e.currentTarget,La(u),za(d)}}}var ute=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function dte(e){return ute?.createHTML(e)??e}function fte(e){var t=da(`template`);return t.innerHTML=dte(e.replaceAll(``,``)),t.content}function vo(e,t){var n=Ra;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function B(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(``);return()=>{if(Hr)return vo(Wr,null),Wr;i===void 0&&(i=fte(a?e:``+e),n||(i=la(i)));var t=r||aa?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=la(t),s=t.lastChild;vo(o,s)}else vo(t,t);return t}}function V(e=``){if(!Hr){var t=ca(e+``);return vo(t,t),t}var n=Wr;return n.nodeType===3?fa(n):(n.before(n=ca()),Gr(n)),vo(n,n),n}function H(){if(Hr)return vo(Wr,null),Wr;var e=document.createDocumentFragment(),t=document.createComment(``),n=ca();return e.append(t,n),vo(t,n),e}function U(e,t){if(Hr){var n=Ra;n.f&32768&&n.nodes.end!==null||(n.nodes.end=Wr),Kr()}else e!==null&&e.before(t)}function yo(){if(Hr&&Wr&&Wr.nodeType===8&&Wr.textContent?.startsWith(`$`)){let e=Wr.textContent.substring(1);return Kr(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function pte(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var mte=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function hte(e){return mte.includes(e)}var gte=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),_te={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`};function vte(e){return e=e.toLowerCase(),_te[e]??e}[...gte];var yte=[`touchstart`,`touchmove`];function bte(e){return yte.includes(e)}var xte=[`textarea`,`script`,`style`,`title`];function Ste(e){return xte.includes(e)}function Cte(e){let t=0,n=qi(0),r;return()=>{ha()&&(z(n),ba(()=>(t===0&&(r=ao(()=>e(()=>Qi(n)))),t+=1,()=>{ui(()=>{--t,t===0&&(r?.(),r=void 0,Qi(n))})})))}}var wte=589824;function bo(e,t,n,r){new Tte(e,t,n,r)}var Tte=class{parent;is_pending=!1;transform_error;#e;#t=Hr?Wr:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Map;#p=null;#m=Cte(()=>(this.#p=qi(this.#l),()=>{this.#p=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=Ra;t.b=this,t.f|=128,n(e)},this.parent=Ra.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=xa(()=>{if(Hr){let e=Yr(this.#t);Kr();let t=e===`[!`;if(e.startsWith(`[?`)){let t=JSON.parse(e.slice(2));this.#g(t)}else t?this.#y():this.#h()}else this.#b()},wte),Hr&&(this.#e=Wr)}#h(){try{this.#a=Sa(()=>this.#r(this.#e))}catch(e){this.error(e)}}#g(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#_(e);ui(r),t&&(this.#s=Sa(()=>{t(this.#e,()=>e,()=>n)}))}#_(e){var t=!1,n=!1;let r=()=>{this.#v()||(t?xee():(t=!0,n&&Nee(),this.#s!==null&&Oa(this.#s,()=>{this.#s=null}),this.#S(()=>{this.#b()})))};return{reset:r,invoke_onerror:()=>{if(!this.#v())try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){pa(e,this.#i&&this.#i.parent)}}}}#v(){return!!(this.#i.f&33570816)}#y(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Sa(()=>e(this.#e)),ui(()=>{if(!this.#v()){var e=this.#c=document.createDocumentFragment(),t=ca(),n=!1;e.append(t),this.#a=this.#S(()=>{try{return Sa(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){pa(e,this.#i.parent)}return null}}),this.#a===null?(this.#c=null,n&&this.#x(Oi)):this.#u===0&&(this.#e.before(e),this.#c=null,Oa(this.#o,()=>{this.#o=null}),this.#x(Oi))}}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Sa(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Ma(this.#a,e);let t=this.#n.pending;this.#o=Sa(()=>t(this.#e))}else this.#x(Oi)}catch(e){this.error(e)}}#x(e){this.is_pending=!1,e.transfer_reactions(this.#f)}defer_effect(e){pi(e,this.#f)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#S(e){var t=Ra,n=Fa,r=ni;za(this.#i),La(this.#i),ri(this.#i.ctx);try{return Li.ensure(),e()}finally{za(t),La(n),ri(r)}}#C(e,t){this.has_pending_snippet()?(this.#u+=e,this.#u===0&&(this.#x(t),this.#o&&Oa(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))):this.parent&&this.parent.#C(e,t)}update_pending_count(e,t){this.#C(e,t),this.#l+=e,!this.#p||this.#d||(this.#d=!0,ui(()=>{this.#d=!1,this.#p&&Zi(this.#p,this.#l)}))}get_effect_pending(){return this.#m(),z(this.#p)}error(e){if(e===gr||!this.#n.onerror&&!this.#n.failed)throw e;Oi?.is_fork?(this.#a&&Oi.skip_effect(this.#a),this.#o&&Oi.skip_effect(this.#o),this.#s&&Oi.skip_effect(this.#s),Oi.oncommit(()=>{this.#v()||this.#w(e)})):this.#w(e)}#w(e){this.#a&&=(Ta(this.#a),null),this.#o&&=(Ta(this.#o),null),this.#s&&=(Ta(this.#s),null),Hr&&(Gr(this.#t),qr(),Gr(Jr()));let t=this.#n.failed,n=e=>{if(this.#v())return;let{reset:n,invoke_onerror:r}=this.#_(e);r(),t&&!this.#v()&&(this.#s=this.#S(()=>{try{return Sa(()=>{var r=Ra;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return pa(e,this.#i.parent),null}}))};ui(()=>{if(!this.#v()){var t;try{t=this.transform_error(e)}catch(e){pa(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>pa(e,this.#i&&this.#i.parent)):n(t)}})}};function W(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[Lr]??=e.nodeValue)&&(e[Lr]=n,e.nodeValue=`${n}`)}function xo(e,t){return Ete(e,t)}var So=new Map;function Ete(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){Jee();var c=void 0,l=tte(()=>{var o=n??t.appendChild(ca());bo(o,{pending:()=>{}},t=>{O({});var n=ni;if(a&&(n.c=a),i&&(r.$$events=i),Hr&&vo(t,null),c=e(t,r)||oi(),Hr&&(Ra.nodes.end=Wr,Wr===null||Wr.nodeType!==8||Wr.data!==`]`))throw Vr(),gr;k()},s);var l=new Set,u=e=>{for(var n=0;n{for(var e of l)for(let n of[t,document]){var r=So.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,_o),r.delete(e),r.size===0&&So.delete(n)):r.set(e,i)}co.delete(u),o!==n&&o.parentNode?.removeChild(o)}});return Co.set(c,l),c}var Co=new WeakMap;function wo(e,t){let n=Co.get(e);return n?(Co.delete(e),n(t)):Promise.resolve()}var To=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Aa(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Aa(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(Ta(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Ma(r,t),t.append(ca()),this.#n.set(e,{effect:r,fragment:t})}else Ta(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Oa(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(Ta(n.effect),this.#n.delete(e))};ensure(e,t){var n=Oi,r=Xee();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=ca();i.append(a),this.#n.set(e,{effect:Sa(()=>t(a)),fragment:i})}else this.#t.set(e,Sa(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else Hr&&(this.anchor=Wr),this.#a(n)}};function Eo(e,t,...n){var r=new To(e);xa(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},65536)}function Do(e){ni===null&&Qr(`onMount`),L(()=>{let t=ao(e);if(typeof t==`function`)return t})}function Oo(e){ni===null&&Qr(`onDestroy`),Do(()=>()=>ao(e))}function ko(){return Symbol(`@attach`)}var Ao=0,jo=1,Dte=2;function Mo(e,t,n,r,i){Hr&&Kr();var a=si(),o=_r,s=a?qi(o):Ji(o,!1,!1),c=a?qi(o):Ji(o,!1,!1),l=new To(e);xa(()=>{var a=Oi,o=t(),u=!1;let d=Hr&&Dr(o)===(e.data===`[!`);if(d&&(Gr(Jr()),Ur(!1)),Dr(o)){var f=vi(),p=!1;let e=e=>{if(!u){p=!0,f(!1),Oi===a&&a.deactivate(),Li.ensure();try{e()}finally{yi(!1),Mi||Ri()}}};o.then(t=>{e(()=>{Zi(s,t),l.ensure(jo,r&&(e=>r(e,s)))})},t=>{e(()=>{if(Zi(c,t),l.ensure(Dte,i&&(e=>i(e,c))),!i)throw c.v})}),Hr?l.ensure(Ao,n):ui(()=>{p||e(()=>{l.ensure(Ao,n)})})}else Zi(s,o),l.ensure(jo,r&&(e=>r(e,s)));return d&&Ur(!0),()=>{u=!0}})}function G(e,t,n=!1){var r;Hr&&(r=Wr,Kr());var i=new To(e),a=n?65536:0;function o(e,t){if(Hr){var n=Yr(r);if(e!==parseInt(n.substring(1))){var a=Jr();Gr(a),i.anchor=a,Ur(!1),i.ensure(e,t),Ur(!0);return}}i.ensure(e,t)}xa(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var Ote=Symbol(`NaN`);function No(e,t,n){Hr&&Kr();var r=new To(e),i=!si();xa(()=>{var e=t();e!==e&&(e=Ote),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function Po(e,t){Hr&&Gr(la(e)),ba(()=>{var n=t();for(var r in n){var i=n[r];i==null||i===``?e.style.removeProperty(r):e.style.setProperty(r,i)}})}function Fo(e,t){return t}function kte(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Io(e,br(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--o},!1)}if(o===0){var c=r.length===0&&n!==null&&e.pending.size===0;if(c){var l=n,u=l.parentNode;Yee(u),u.append(l),e.items.clear()}Io(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Io(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i{var e=n();return vr(e)?e:e==null?[]:br(e)}),d=new Map,f=!0;function p(e){if(!(h.effect.f&16384)){h.pending.delete(e);var n=z(u);h.fallback=l,Ate(h,n,o,t,r),l!==null&&(n.length===0?l.f&33554432?(l.f^=33554432,Bo(l,null,o)):Aa(l):Oa(l,()=>{l=null}))}}function m(e){h.pending.delete(e)}var h={effect:xa(()=>{var e=z(u),c=e.length;let h=!1;Hr&&Yr(o)===`[!`!=(c===0)&&(o=Jr(),Gr(o),Ur(!1),h=!0);for(var g=new Set,_=Oi,v=Xee(),y=0;ya(o)):(l=Sa(()=>a(Lo??=ca())),l.f|=33554432)),c>g.size&&wee(``,``,``),Hr&&c>0&&Gr(Jr()),!f){if(d.set(_,g),v){for(let[e,t]of s)g.has(e)||_.skip_effect(t.e);_.oncommit(p),_.ondiscard(m)}else p(_)}h&&Ur(!0),z(u)}),flags:t,items:s,pending:d,outrogroups:null,fallback:l};f=!1,Hr&&(o=Wr)}function zo(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Ate(e,t,n,r,i){var a=!!(r&8),o=t.length,s=e.items,c=zo(e.effect.first),l,u=null,d,f=[],p=[],m,h,g,_;if(a)for(_=0;_0){var T=r&4&&o===0?n:null;if(a){for(_=0;_{if(d!==void 0)for(g of d)g.nodes?.a?.apply()})}function jte(e,t,n,r,i,a,o,s){var c=o&1?o&16?qi(n):Ji(n,!1,!1):null,l=o&2?qi(i):null;return{v:c,i:l,e:Sa(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Bo(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=ua(r);if(a.before(r),r===i)return;r=o}}function Vo(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Ho(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;Hr&&(o=Gr(la(c)))}R(()=>{var e=Ra;if(s===(s=t()??``))Hr&&Kr();else if(n&&!Hr)e.nodes=null,c.innerHTML=s,s!==``&&vo(la(c),c.lastChild);else if(e.nodes!==null&&(Ea(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(Hr){for(var a=Wr.data,l=Kr(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=ua(l);if(l===null)throw Vr(),gr;vo(Wr,u),o=Gr(l)}else{var d=da(r?`svg`:i?`math`:`template`,r?`http://www.w3.org/2000/svg`:i?`http://www.w3.org/1998/Math/MathML`:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(vo(la(f),f.lastChild),r||i)for(;la(f);)o.before(la(f));else o.before(f)}}})}function Uo(e,t,n){var r;Hr&&(r=Wr,Kr());var i=new To(e);xa(()=>{var e=t()??null;if(Hr&&Yr(r)===`[`!=(e!==null)){var a=Jr();Gr(a),i.anchor=a,Ur(!1),i.ensure(e,e&&(t=>n(t,e))),Ur(!0)}else i.ensure(e,e&&(t=>n(t,e)))},65536)}var Mte=()=>performance.now(),Wo={tick:e=>requestAnimationFrame(e),now:()=>Mte(),tasks:new Set};function Go(){let e=Wo.now();Wo.tasks.forEach(t=>{t.c(e)||(Wo.tasks.delete(t),t.f())}),Wo.tasks.size!==0&&Wo.tick(Go)}function Nte(e){let t;return Wo.tasks.size===0&&Wo.tick(Go),{promise:new Promise(n=>{Wo.tasks.add(t={c:e,f:n})}),abort(){Wo.tasks.delete(t)}}}function Pte(e){if(e===`float`)return`cssFloat`;if(e===`offset`)return`cssOffset`;if(e.startsWith(`--`))return e;let t=e.split(`-`);return t.length===1?t[0]:t[0]+t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join(``)}function Ko(e){let t={},n=e.split(`;`);for(let e of n){let[n,r]=e.split(`:`);if(!n||r===void 0)break;let i=Pte(n.trim());t[i]=r.trim()}return t}var Fte=e=>e,qo=null;function Jo(e){qo=e}function Yo(e,t,n){var r=(qo??Ra).nodes,i,a,o,s=null;r.a??={element:e,measure(){i=this.element.getBoundingClientRect()},apply(){if(o?.abort(),a=this.element.getBoundingClientRect(),i.left!==a.left||i.right!==a.right||i.top!==a.top||i.bottom!==a.bottom){let e=t()(this.element,{from:i,to:a},n?.());o=Xo(this.element,e,void 0,1,()=>{},()=>{o?.abort(),o=void 0})}},fix(){if(!e.getAnimations().length){var{position:t,width:n,height:r}=getComputedStyle(e);if(t!==`absolute`&&t!==`fixed`){var a=e.style;s={position:a.position,width:a.width,height:a.height,transform:a.transform},a.position=`absolute`,a.width=n,a.height=r;var o=e.getBoundingClientRect();if(i.left!==o.left||i.top!==o.top){var c=`translate(${i.left-o.left}px, ${i.top-o.top}px)`;a.transform=a.transform?`${a.transform} ${c}`:c}}}},unfix(){if(s){var t=e.style;t.position=s.position,t.width=s.width,t.height=s.height,t.transform=s.transform}}},r.a.element=e}function Xo(e,t,n,r,i,a){var o=r===1,s=!1;if(Tr(t)){var c;return ui(()=>{s||(c=Xo(e,t({direction:o?`in`:`out`}),n,r,i,a))}),{abort:()=>{s=!0,c?.abort()},deactivate:()=>c?.deactivate(),reset:()=>c?.reset(),t:()=>c?.t()??1-r}}if(n?.deactivate(),!t?.duration&&!t?.delay)return i(),a(),{abort:Er,deactivate:Er,reset:Er,t:()=>r};let{delay:l=0,css:u,tick:d,easing:f=Fte}=t;var p,m=()=>1-r;return ui(()=>{if(!s){var c=[];if(o&&n===void 0&&(d&&d(0,1),u)){var h=Ko(u(0,1));c.push(h,h)}p=e.animate(c,{duration:l,fill:`forwards`}),p.onfinish=()=>{p.cancel(),i();var o=n?.t()??1-r;n?.abort();var s=r-o,c=t.duration*Math.abs(s),l=[];if(c>0){var h=!1;if(u)for(var g=Math.ceil(c/(1e3/60)),_=0;_<=g;_+=1){var v=o+s*f(_/g),y=Ko(u(v,1-v));l.push(y),h||=y.overflow===`hidden`}h&&(e.style.overflow=`hidden`),m=()=>{var e=p.currentTime;return o+s*f(e/c)},d&&Nte(()=>{if(p.playState!==`running`)return!1;var e=m();return d(e,1-e),!0})}p=e.animate(l,{duration:c,fill:`forwards`}),p.onfinish=()=>{m=()=>r,d?.(r,1-r),a()}}}}),{abort:()=>{s=!0,p&&(p.cancel(),p.effect=null,p.onfinish=Er)},deactivate:()=>{a=Er},reset:()=>{r===0&&d?.(1,0)},t:()=>m()}}function Ite(e,t,n,r,i,a){let o=Hr;Hr&&Kr();var s=null;Hr&&Wr.nodeType===1&&(s=Wr,Kr());var c=Hr?Wr:e,l=Ra,u=new To(c,!1);xa(()=>{let e=t()||null;var a=i?i():n||e===`svg`?`http://www.w3.org/2000/svg`:void 0;if(e===null)u.ensure(null,null);else return u.ensure(e,t=>{if(e){var n=Hr;if(s=Hr?s:da(e,a),vo(s,s),r){var i=null;Hr&&Ste(e)&&s.append(i=document.createComment(``));var o=Hr?la(s):s.appendChild(ca());Hr&&(o===null?Ur(!1):Gr(o)),Jo(l),r(s,o),i?.remove(),Jo(null)}Ra.nodes.end=s,n||t.before(s)}Hr&&Gr(t)}),()=>{}},65536),ga(()=>{}),o&&(Ur(!0),Gr(c))}function Zo(e,t){let n=null,r=Hr;var i;if(Hr){n=Wr;for(var a=la(document.head);a!==null&&(a.nodeType!==8||a.data!==e);)a=ua(a);if(a===null)Ur(!1);else{var o=ua(a);a.remove(),Gr(o)}}Hr||(i=document.head.appendChild(ca()));try{xa(()=>{var e=Sa(()=>t(i));e.f|=262144,Hr||(e.nodes===null?e.nodes={start:i,end:i,a:null,t:null}:e.nodes.end=i)})}finally{r&&(Ur(!0),Gr(n))}}function K(e,t){ya(()=>{e=Ra?.parent?.nodes?.start??e;var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=da(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}function Qo(e,t){var n=void 0,r;ite(()=>{n!==(n=t())&&(r&&=(Ta(r),null),n&&(r=Sa(()=>{ya(()=>n(e))})))})}function $o(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t=0;){var s=o+a;(o===0||ts.includes(r[o-1]))&&(s===r.length||ts.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function ns(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function rs(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function zte(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(rs)),i&&c.push(...Object.keys(i).map(rs));var l=0,u=-1;let t=e.length;for(var d=0;d{t.every(Vte)||(`__defaultValue`in e&&ls(e,!1),`__value`in e&&us(e,e.__value))});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),ga(()=>{t.disconnect()})}function ds(e){return`__value`in e?e.__value:e.value}function Vte(e){if(e.target.closest(`selectedcontent`)!==null)return!0;if(e.type===`childList`){var t=[...e.addedNodes,...e.removedNodes];return t.length>0&&t.every(e=>e.nodeName===`SELECTEDCONTENT`)}return!1}var fs=Symbol(`class`),ps=Symbol(`style`),ms=Symbol(`is custom element`),hs=Symbol(`is html`),Hte=Br?`link`:`LINK`,Ute=Br?`input`:`INPUT`,Wte=Br?`option`:`OPTION`,Gte=Br?`select`:`SELECT`,Kte=Br?`progress`:`PROGRESS`;function qte(e){if(Hr){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;q(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;q(e,`checked`,null),e.checked=r}}};e[Rr]=n,ui(n),hi()}}function q(e,t,n,r){var i=Yte(e);if(!(Hr&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Hte))){var a=i[t];a!==(i[t]=n)&&(t===`loading`&&(e[vee]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&Zte(e).has(t)?e[t]=n:(!Hr||typeof n!=`number`&&typeof n!=`boolean`||a!==String(n))&&e.setAttribute(t,n))}}function Jte(e,t,n,r,i=!1,a=!1){Hr&&i&&e.nodeName===Ute&&(`defaultValue`in n||`defaultChecked`in n||qte(e));var o=Yte(e),s=o[ms],c=!o[hs];let l=Hr&&s;l&&Ur(!1);var u=t||{},d=e.nodeName===Wte,f=e.nodeName===Gte;try{for(var p in t)!(p in n)&&p[0]+p[1]!==`$$`&&(n[p]=null);n.class?n.class=es(n.class):(r||n[fs])&&(n.class=null),n[ps]&&(n.style??=null);var m=Zte(e);if(e.nodeName===Ute&&`type`in n&&(`value`in n||`__value`in n)){var h=n.type;(h!==u.type||h===void 0&&e.hasAttribute(`type`))&&(u.type=h,q(e,`type`,h,a))}for(let i in n){let l=n[i];if(d&&i===`value`&&l==null)e.value=e.__value=``,u[i]=l;else if(i===`class`)is(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,l,r,t?.[fs],n[fs]),u[i]=l,u[fs]=n[fs];else if(i===`style`)os(e,l,t?.[ps],n[ps]),u[i]=l,u[ps]=n[ps];else{var g=u[i];if(l!==g||l===void 0&&e.hasAttribute(i)){u[i]=l;var _=i[0]+i[1];if(_!==`$$`){if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=hte(r);if(pte(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(l!=null)continue;e.removeEventListener(r,u[n],t),u[n]=null}if(v)po(r,e,l),mo([r]);else if(l!=null){function y(e){u[i].call(this,e)}u[n]=lo(r,e,y,t)}}else if(i===`style`)q(e,i,l);else if(i===`autofocus`)zee(e,!!l);else if(!s&&(i===`__value`||i===`value`&&l!=null))e.__value=l,(g==null||e.value!==l||l===0&&e.nodeName===Kte)&&(e.value=l);else if(i===`selected`&&d)ss(e,l);else{var b=i;c||(b=vte(b));var x=b===`defaultValue`||b===`defaultChecked`;if(f&&b===`defaultValue`)continue;if(l==null&&!s&&!x){if(o[i]=null,b===`value`||b===`checked`){let n=e,r=t===void 0;if(b===`value`){let e=n.defaultValue;n.removeAttribute(b),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(b),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i)}else x||(s||typeof l!=`string`)&&m.has(b)?(e[b]=l,b in o&&(o[b]=_r)):typeof l!=`function`&&q(e,b,l,a)}}}}}}finally{l&&Ur(!0)}return u}function gs(e,t,n=[],r=[],i=[],a,o=!1,s=!1){_i(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===Gte,l=!1;if(ite(()=>{var u=t(...n.map(z)),d=Jte(e,r,u,a,o,s);if(l&&c){var f=e;`defaultValue`in u&&cs(f,u.defaultValue),`value`in u&&us(f,u.value)}for(let e of Object.getOwnPropertySymbols(i))u[e]||Ta(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var p=u[t];t.description!==`@attach`||r&&p===r[t]||(i[t]&&Ta(i[t]),i[t]=Sa(()=>Qo(e,()=>p))),d[t]=p}r=d}),c){var u=e;ya(()=>{var e=r;`defaultValue`in e&&cs(u,e.defaultValue),us(u,e.value,!0),Bte(u)})}l=!0})}function Yte(e){return e[Pr]??={[ms]:e.nodeName.includes(`-`),[hs]:e.namespaceURI===`http://www.w3.org/1999/xhtml`}}var Xte=new Map;function Zte(e){var t=e.getAttribute(`is`)||e.nodeName,n=Xte.get(t);if(n)return n;Xte.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=hee(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.add(o);i=Cr(i)}return n}function Qte(e,t,n=t){var r=new WeakSet;Vee(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=_s(e)?vs(a):a,n(a),Oi!==null&&r.add(Oi),await no(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(Hr&&e.defaultValue!==e.value||ao(t)==null&&e.value)&&(n(_s(e)?vs(e.value):e.value),Oi!==null&&r.add(Oi)),ba(()=>{var n=t();if(e===document.activeElement){var i=Oi;if(r.has(i))return}_s(e)&&n===vs(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}function _s(e){var t=e.type;return t===`number`||t===`range`}function vs(e){return e===``?null:+e}var $te=new class e{#e=new WeakMap;#t;#n;static entries=new WeakMap;constructor(e){this.#n=e}observe(e,t){var n=this.#e.get(e)||new Set;return n.add(t),this.#e.set(e,n),this.#r().observe(e,this.#n),()=>{var n=this.#e.get(e);n.delete(t),n.size===0&&(this.#e.delete(e),this.#t.unobserve(e))}}#r(){return this.#t??=new ResizeObserver(t=>{for(var n of t){e.entries.set(n.target,n);for(var r of this.#e.get(n.target)||[])r(n)}})}}({box:`border-box`});function ene(e,t,n){var r=$te.observe(e,()=>n(e[t]));ya(()=>(ao(()=>n(e[t])),r))}function ys(e,t){return e===t||e?.[jr]===t}function bs(e=oi(),t,n,r){var i=ni.r,a=Ra;return ya(()=>{var o,s;return ba(()=>{o=s,s=r?.()||[],ao(()=>{ys(n(...s),e)||(t(e,...s),o&&ys(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&ys(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}var xs=!1;function tne(e){var t=xs;try{return xs=!1,[e(),xs]}finally{xs=t}}var nne={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return!e.exclude.has(t)&&t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function Ss(e,t,n){return new Proxy({props:e,exclude:t},nne)}var rne={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Tr(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];Tr(i)&&(i=i());let a=xr(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Tr(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=xr(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===jr||t===Nr)return!1;for(let n of e.props)if(Tr(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(Tr(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function Cs(...e){return new Proxy({props:e},rne)}function J(e,t,n,r){var i=!0,a=!!(n&8),o=!!(n&16),s=r,c=!0,l=void 0,u=()=>o&&i?(l??=xi(r),z(l)):(c&&(c=!1,s=o?ao(r):r),s);let d;if(a){var f=jr in e||Nr in e;d=xr(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=tne(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&kee(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?xi:Ci)(()=>(_=!1,h()));a&&z(v);var y=Ra;return(function(e,t){if(arguments.length>0){let n=t?z(v):i&&a?ea(e):e;return M(v,n),_=!0,s!==void 0&&(s=n),e}return Na&&_||y.f&16384?v.v:z(v)})}var ine=/^[\u061c\u200e\u200f\u2066-\u2069]+/,ane=/^[-.+0-9A-Z_a-z\u{a1}-\u{61b}\u{61d}-\u{167f}\u{1681}-\u{1fff}\u{200b}-\u{200d}\u{2010}-\u{2027}\u{2030}-\u{205e}\u{2060}-\u{2065}\u{206a}-\u{2fff}\u{3001}-\u{d7ff}\u{e000}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{1fffd}\u{20000}-\u{2fffd}\u{30000}-\u{3fffd}\u{40000}-\u{4fffd}\u{50000}-\u{5fffd}\u{60000}-\u{6fffd}\u{70000}-\u{7fffd}\u{80000}-\u{8fffd}\u{90000}-\u{9fffd}\u{a0000}-\u{afffd}\u{b0000}-\u{bfffd}\u{c0000}-\u{cfffd}\u{d0000}-\u{dfffd}\u{e0000}-\u{efffd}\u{f0000}-\u{ffffd}\u{100000}-\u{10fffd}]+/u,one=/^[-.0-9]/;function sne(e,t){let n=t,r=e.slice(n).match(ine);r&&(n+=r[0].length);let i=e.slice(n).match(ane);if(!i)return null;let a=i[0];if(one.test(a))return null;n+=a.length;let o=e.slice(n).match(ine);return o&&(n+=o[0].length),{value:a.normalize(),end:n}}var cne=(e,t)=>e.slice(t).match(ane)?.[0]??``,lne=Symbol.for(`CST`),ws=class extends Error{type;constructor(e,t){super(t),this.type=e}},Ts=class extends ws{start;end;constructor(e,t,n,r){let i=r?`Missing ${r}`:e;t>=0&&(i+=` at ${t}`),super(e,i),this.start=t,this.end=n??t+1}},une=class extends Ts{constructor(e,t){let{start:n,end:r}=t[lne]??{start:-1,end:-1};super(e,n,r)}},Es=class extends ws{source;cause;constructor(e,t,n,r){super(e,t),this.source=n,r!==void 0&&(this.cause=r)}},Ds=class extends ws{source;cause;constructor(e,t){super(e,t),this.source=`�`}},dne=new Set(`؜‎‏⁦⁧⁨⁩`),fne=new Set(` \r  `),Os,ks,As=(e,t)=>new Ts(`missing-syntax`,e,e+t.length,t),js=(...e)=>new Ts(...e);function Ms(e,t){if(ks.startsWith(e,Os))t&&(Os+=e.length);else throw As(Os,e)}function pne(e){Os=0,ks=e;let t=_ne();if(ks.startsWith(`.match`,Os))return mne(t);let n=t.length>0||ks.startsWith(`{{`,Os);!n&&Os>0&&(Os=0);let r=gne(n);if(n&&(Ls(),Os{if(e){let n=u?.(e,t);if(d)for(let n of Object.values(e))d(n,t,`option`);n?.()}},m=(e,t)=>{if(e){let n=a?.(e,t);if(d)for(let n of Object.values(e))n!==!0&&d(n,t,`attribute`);n?.()}},h=(e,t)=>{if(typeof e==`object`){let n;switch(e.type){case`expression`:if(n=s?.(e,t),e.arg&&d?.(e.arg,t,`arg`),e.functionRef){let n=i?.(e.functionRef,t,e.arg);p(e.functionRef.options,t),n?.()}m(e.attributes,t);break;case`markup`:n=l?.(e,t),p(e.options,t),m(e.attributes,t)}n?.()}},g=e=>{let t=r?.(e);for(let t of e)h(t,`placeholder`);t?.()};for(let t of e.declarations){let e=o?.(t);t.value&&h(t.value,`declaration`),e?.()}if(e.type===`message`)g(e.pattern);else{if(d)for(let t of e.selectors)d(t,`selector`,`arg`);for(let t of e.variants){let e=f?.(t);c&&t.keys.forEach(c),g(t.value),e?.()}}}function Dne(e,t=(e,t)=>{throw new une(e,t)}){let n=0,r=null,i=new Set,a=new Set,o=new Set,s=new Set,c=new Set,l=new Set,u=!0;Ene(e,{declaration(e){if(e.name)return(e.value.functionRef||e.type===`local`&&e.value.arg?.type===`variable`&&i.has(e.value.arg.name))&&i.add(e.name),e.type===`local`&&s.add(e.name),u=e.type===`local`,()=>{a.has(e.name)?t(`duplicate-declaration`,e):a.add(e.name)}},expression({functionRef:e}){e&&o.add(e.name)},value(e,o,s){if(e.type===`variable`)switch(c.add(e.name),o){case`declaration`:(s!==`arg`||u)&&a.add(e.name);break;case`selector`:n+=1,r=e,i.has(e.name)||t(`missing-selector-annotation`,e)}},variant(e){let{keys:i}=e;i.length!==n&&t(`key-mismatch`,e);let a=JSON.stringify(i.map(e=>e.type===`literal`?e.value:0));l.has(a)?t(`duplicate-variant`,e):l.add(a),r&&=i.every(e=>e.type===`*`)?null:e}}),r&&t(`missing-fallback`,r);for(let e of s)c.delete(e);return{functions:o,variables:c}}var One=`Adlm,Arab,Hebr,Mand,Nkoo,Rohg,Syrc,Thaa`;function Rs(e){if(e)try{typeof e==`string`&&(e=new Intl.Locale(e));let t=e.getTextInfo?.()??e.textInfo;if(t?.direction)return t.direction;let n=e.maximize().script;if(n)return One.includes(n)?`rtl`:`ltr`}catch{}return`auto`}function kne(e){if(e&&typeof e==`object`&&(e=e.valueOf()),typeof e==`boolean`)return e;if(e&&typeof e==`object`&&(e=String(e)),e===`true`)return!0;if(e===`false`)return!1;throw RangeError(`Not a boolean`)}function zs(e){if(e&&typeof e==`object`&&(e=e.valueOf()),e&&typeof e==`object`&&(e=String(e)),typeof e==`string`&&/^(0|[1-9][0-9]*)$/.test(e)&&(e=Number(e)),typeof e==`number`&&e>=0&&Number.isInteger(e))return e;throw RangeError(`Not a positive integer`)}function Bs(e){if(e&&typeof e==`object`&&(e=e.valueOf()),typeof e==`string`)return e;if(e&&typeof e==`object`)return String(e);throw RangeError(`Not a string`)}function Vs(e){let t;if(typeof e==`object`){let n=e?.valueOf;typeof n==`function`&&(t=e.options,e=n.call(e))}if(typeof e==`string`)try{e=JSON.parse(e)}catch{}if(typeof e!=`bigint`&&typeof e!=`number`)throw new Ds(`bad-operand`,`Input is not numeric`);return{value:e,options:t}}function Hs(e,t,n,r){let{dir:i,locales:a}=e;n.useGrouping===`never`&&(n.useGrouping=!1),r&&`select`in n&&!e.literalOptionKeys.has(`select`)&&(e.onError(`bad-option`,`The option select may only be set by a literal value`),r=!1);let o,s,c,l;return{type:`number`,get dir(){return i??=(o??=Intl.NumberFormat.supportedLocalesOf(a,n)[0],Rs(o)),i},get options(){return{...n}},selectKey:r?e=>{let r=t;n.style===`percent`&&(r*=typeof r==`bigint`?100n:100);let i=String(r);if(e.has(i))return i;if(n.select===`exact`)return null;let o=n.select?{...n,select:void 0,type:n.select}:n;return c??=new Intl.PluralRules(a,o).select(Number(r)),e.has(c)?c:null}:void 0,toParts(){s??=new Intl.NumberFormat(a,n);let e=s.formatToParts(t);return o??=s.resolvedOptions().locale,i??=Rs(o),i===`ltr`||i===`rtl`?[{type:`number`,dir:i,locale:o,parts:e}]:[{type:`number`,locale:o,parts:e}]},toString(){return s??=new Intl.NumberFormat(a,n),l??=s.format(t),l},valueOf:()=>t}}function Ane(e,t,n){let r=Vs(n),i=r.value,a=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`decimal`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`minimumIntegerDigits`:case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:a[n]=zs(r);break;case`roundingMode`:case`roundingPriority`:case`select`:case`signDisplay`:case`trailingZeroDisplay`:case`useGrouping`:a[n]=Bs(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :number option ${n}`)}return Hs(e,i,a,!0)}function jne(e,t,n){let r=Vs(n),i=Number.isFinite(r.value)?Math.round(r.value):r.value,a=Object.assign({},r.options,{maximumFractionDigits:0,minimumFractionDigits:void 0,minimumSignificantDigits:void 0,style:`decimal`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`minimumIntegerDigits`:case`maximumSignificantDigits`:a[n]=zs(r);break;case`select`:case`signDisplay`:case`useGrouping`:a[n]=Bs(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :integer option ${n}`)}return Hs(e,i,a,!0)}function Mne(e,t,n){let r=Vs(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`currency`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`currency`:case`currencySign`:case`roundingMode`:case`roundingPriority`:case`trailingZeroDisplay`:case`useGrouping`:i[n]=Bs(r);break;case`minimumIntegerDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:i[n]=zs(r);break;case`currencyDisplay`:{let t=Bs(r);t===`never`?e.onError(`unsupported-operation`,`Currency display "never" is not yet supported`):i[n]=t;break}case`fractionDigits`:{let e=Bs(r);if(e===`auto`)i.minimumFractionDigits=void 0,i.maximumFractionDigits=void 0;else{let t=zs(e);i.minimumFractionDigits=t,i.maximumFractionDigits=t}break}}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :currency option ${n}`)}if(!i.currency)throw new Ds(`bad-operand`,`A currency code is required for :currency`);return Hs(e,r.value,i,!1)}var Nne=new Set([`weekday`,`day-weekday`,`month-day`,`month-day-weekday`,`year-month-day`,`year-month-day-weekday`]),Pne=new Set([`long`,`medium`,`short`]),Fne=new Set([`hour`,`minute`,`second`]),Ine=new Set([`long`,`short`]),Lne=(e,t,n)=>Us(`datetime`,e,t,n),Rne=(e,t,n)=>Us(`date`,e,t,n),zne=(e,t,n)=>Us(`time`,e,t,n);function Us(e,t,n,r){let i={localeMatcher:t.localeMatcher},a=r;if(typeof a==`object`&&a){let t=a.options;t&&(i.calendar=t.calendar,e!==`date`&&(i.hour12=t.hour12),i.timeZone=t.timeZone),typeof a.valueOf==`function`&&(a=a.valueOf())}switch(typeof a){case`number`:case`string`:a=new Date(a)}if(!(a instanceof Date)||isNaN(a.getTime()))throw new Ds(`bad-operand`,`Input is not a valid date`);if(n.calendar!==void 0)try{i.calendar=Bs(n.calendar)}catch{t.onError(`bad-option`,`Invalid :${e} calendar option value`)}if(n.hour12!==void 0&&e!==`date`)try{i.hour12=kne(n.hour12)}catch{t.onError(`bad-option`,`Invalid :${e} hour12 option value`)}if(n.timeZone!==void 0){let r;try{r=Bs(n.timeZone)}catch{t.onError(`bad-option`,`Invalid :${e} timeZone option value`)}if(r===`input`)i.timeZone===void 0&&t.onError(`bad-operand`,`Missing input timeZone value for :${e}`);else if(r!==void 0){if(i.timeZone!==void 0&&r!==i.timeZone)throw new Ds(`bad-option`,`Time zone conversion is not supported`);i.timeZone=r}}if(e!==`time`){let r=e===`date`?`fields`:`dateFields`,a=e===`date`?`length`:`dateLength`,o=Ws(t,n,r,Nne)??`year-month-day`,s=Ws(t,n,a,Pne),c=new Set(o.split(`-`));c.has(`year`)&&(i.year=`numeric`),c.has(`month`)&&(i.month=s===`long`?`long`:s===`short`?`numeric`:`short`),c.has(`day`)&&(i.day=`numeric`),c.has(`weekday`)&&(i.weekday=s===`long`?`long`:`short`)}if(e!==`date`){switch(Ws(t,n,e===`time`?`precision`:`timePrecision`,Fne)){case`hour`:i.hour=`numeric`;break;case`second`:i.hour=`numeric`,i.minute=`numeric`,i.second=`numeric`;break;default:i.hour=`numeric`,i.minute=`numeric`}i.timeZoneName=Ws(t,n,`timeZoneStyle`,Ine)}let o=new Intl.DateTimeFormat(t.locales,i),s=t.dir,c,l;return{type:`datetime`,get dir(){return s??=(c??=o.resolvedOptions().locale,Rs(c)),s},get options(){return{...i}},toParts(){let e=o.formatToParts(a);return c??=o.resolvedOptions().locale,s??=Rs(c),s===`ltr`||s===`rtl`?[{type:`datetime`,dir:s,locale:c,parts:e}]:[{type:`datetime`,locale:c,parts:e}]},toString(){return l??=o.format(a),l},valueOf:()=>a}}function Ws(e,t,n,r){let i=t[n];if(i!==void 0)try{let e=Bs(i);if(r&&!r.has(e))throw Error();return e}catch{e.onError(`bad-option`,`Invalid value for ${n} option`)}}function Bne(e,t,n){let{value:r,options:i}=Vs(n),a;try{a=`add`in t?zs(t.add):-1}catch{throw new Ds(`bad-option`,`Value ${t.add} is not valid for :offset option add`)}let o;try{o=`subtract`in t?zs(t.subtract):-1}catch{throw new Ds(`bad-option`,`Value ${t.subtract} is not valid for :offset option subtract`)}if(a<0==o<0)throw new Ds(`bad-option`,`Exactly one of "add" or "subtract" is required as an :offset option`);let s=a<0?-o:a;return r+=typeof r==`number`?s:BigInt(s),Ane(e,{},{valueOf:()=>r,options:i})}function Vne(e,t,n){let r=Vs(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`percent`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`roundingMode`:case`roundingPriority`:case`signDisplay`:case`trailingZeroDisplay`:case`useGrouping`:i[n]=Bs(r);break;case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:i[n]=zs(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :percent option ${n}`)}return Hs(e,r.value,i,!0)}function Gs(e,t,n){let r=n===void 0?``:String(n),i=r.normalize();return{type:`string`,dir:e.dir??`auto`,selectKey:e=>e.has(i)?i:null,toParts(){let{dir:t}=e,n=e.locales[0];return t===`ltr`||t===`rtl`?[{type:`string`,dir:t,locale:n,value:r}]:[{type:`string`,locale:n,value:r}]},toString:()=>r,valueOf:()=>r}}function Hne(e,t,n){let r=Vs(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`unit`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`signDisplay`:case`roundingMode`:case`roundingPriority`:case`trailingZeroDisplay`:case`unit`:case`unitDisplay`:case`useGrouping`:i[n]=Bs(r);break;case`minimumIntegerDigits`:case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:i[n]=zs(r)}}catch(t){t instanceof ws?e.onError(t):e.onError(`bad-option`,`Value ${r} is not valid for :currency option ${n}`)}if(!i.unit)throw new Ds(`bad-operand`,`A unit identifier is required for :unit`);return Hs(e,r.value,i,!1)}var Ks={currency:Mne,integer:jne,number:Ane,offset:Bne,percent:Vne,string:Gs};Ks=Object.freeze(Object.assign(Object.create(null),Ks));var qs={date:Rne,datetime:Lne,time:zne,unit:Hne};qs=Object.freeze(Object.assign(Object.create(null),qs));var Js=Symbol(`bidi-isolate`),Ys=(e=`�`)=>({type:`fallback`,source:e,toParts:()=>[{type:`fallback`,source:e}],toString:()=>`{${e}}`}),Une=(e,t)=>({type:`unknown`,source:e,dir:`auto`,toParts:()=>[{type:`unknown`,value:t}],toString:()=>String(t),valueOf:()=>t}),Xs=class{#e;#t;#n;dir;id;constructor(e,t,n){this.#e=e,this.#n=t,this.dir=void 0;let r=n&&Object.hasOwn(n,`u:dir`)?n[`u:dir`]:void 0;if(r){let t=String(nc(e,r));if(t===`ltr`||t===`rtl`||t===`auto`)this.dir=t;else if(t!==`inherit`){let t=new Ds(`bad-option`,`Unsupported value for u:dir option`);t.source=rc(r),e.onError(t)}}let i=n&&Object.hasOwn(n,`u:id`)?n[`u:id`]:void 0;if(this.id=i?String(nc(e,i)):void 0,n){this.#t=new Set;for(let[e,t]of Object.entries(n))t.type===`literal`&&this.#t.add(e)}}get literalOptionKeys(){return new Set(this.#t)}get localeMatcher(){return this.#e.localeMatcher}get locales(){return this.#e.locales.map(String)}onError(e,t){let n;e instanceof Ds?n=e:typeof e==`string`&&typeof t==`string`?n=new Ds(e,t):(n=new Ds(`function-error`,String(e)),n.cause=e),n.source=this.#n,this.#e.onError(n)}};function Wne(e,t,{name:n,options:r}){let i=`:${n}`,a=rc(t)??i;try{let o=t?[nc(e,t)]:[],s=e.functions[n];if(!s)throw new Es(`unknown-function`,`Unknown function ${i}`,a);let c=new Xs(e,a,r),l=s(c,Gne(e,r),...o);if(typeof l!=`object`||!l||typeof l.type!=`string`)throw new Es(`bad-function-result`,`Function ${i} did not return a MessageValue`,a);let u={source:a};return c.dir&&(u.dir=c.dir,u[Js]=!0),c.id&&typeof l.toParts==`function`&&(u.toParts=()=>{let e=l.toParts();for(let t of e)t.id=c.id;return e}),{...l,...u}}catch(t){return e.onError(t instanceof ws?t:new Es(`bad-function-result`,String(t),a,t)),Ys(a)}}function Gne(e,t){let n=Object.create(null);if(t)for(let[r,i]of Object.entries(t))r.startsWith(`u:`)||(n[r]=nc(e,i));return n}function Zs(e,{arg:t,functionRef:n}){if(n)return Wne(e,t,n);switch(t?.type){case`literal`:{let n=`|${t.value}|`,r=Gs(new Xs(e,n),{},t.value);return r.source=n,r}case`variable`:return tc(e,t);default:throw Error(`Unsupported expression: ${t?.type}`)}}var Qs=class{expression;scope;constructor(e,t){this.expression=e,this.scope=t}},Kne=e=>e!==null&&(typeof e==`object`||typeof e==`function`);function $s(e,t){if(Kne(e)){if(t in e)return e[t];let n=t.split(`.`);for(let t=n.length-1;t>0;--t){let r=n.slice(0,t).join(`.`);if(r in e){let i=n.slice(t).join(`.`);return $s(e[r],i)}}for(let[n,r]of Object.entries(e))if(n.normalize()===t)return r}}function ec(e,{name:t}){let n=$s(e.scope,t);if(n===void 0){let n=`$`+t,r=`Variable not available: ${n}`;e.onError(new Es(`unresolved-variable`,r,n))}else if(n instanceof Qs){let r=Zs(n.scope?{...e,scope:n.scope}:e,n.expression);return e.scope[t]=r,e.localVars.add(r),r}return n}function tc(e,t){let n=`$`+t.name,r=ec(e,t);if(r===void 0)return Ys(n);let i=typeof r;if(i===`object`){let t=r;if(t.type===`fallback`)return Ys(n);if(e.localVars.has(t))return t.source=n,t;r instanceof Number?i=`number`:r instanceof String&&(i=`string`)}let a;switch(i){case`bigint`:case`number`:a=e.functions.number;break;case`string`:a=e.functions.string;break;default:return Une(n,r)}let o=new Xs(e,n),s=a(o,{},r);return s.source=n,s}function nc(e,t){switch(t.type){case`literal`:return t.value;case`variable`:return ec(e,t);default:throw Error(`Unsupported value: ${t.type}`)}}function rc(e){switch(e?.type){case`literal`:return`|`+e.value.replaceAll(`\\`,`\\\\`).replaceAll(`|`,`\\|`)+`|`;case`variable`:return`$`+e.name;default:return}}function ic(e,{kind:t,name:n,options:r}){let i={type:`markup`,kind:t,name:n},a=r?Object.entries(r):null;if(a?.length){i.options={};for(let[t,n]of a)if(t===`u:dir`){let r=new Ds(`bad-option`,`The option ${t} is not valid for markup`);r.source=rc(n),e.onError(r)}else{let r=nc(e,n);typeof r==`object`&&typeof r?.valueOf==`function`&&(r=r.valueOf()),t===`u:id`?i.id=String(r):i.options[t]=r}}return i}function ac(e,t){if(t.type===`message`)return t.pattern;let n=t.selectors.map(t=>{let n=tc(e,t),r;return typeof n.selectKey==`function`?r=n.selectKey.bind(n):(e.onError(new Es(`bad-selector`,`Selector does not support selection`,n.source)),r=()=>null),{selectKey:r,source:n.source,best:null,keys:null}}),r=t.variants;loop:for(let i=0;inull,a.best=null}if(r=r.filter(e=>{let t=e.keys[i];return t.type===`*`?a.best==null:a.best===t.value}),r.length===0){if(i===0)break;let e=n[i-1];e.best==null?e.keys?.clear():e.keys?.delete(e.best);for(let e=i;enew Intl.Locale(e)):e?[new Intl.Locale(e)]:[],this.#t=n?.dir??Rs(this.#r[0]),this.#i=typeof t==`string`?pne(t):t,Dne(this.#i),this.#a=n?.functions?Object.assign(Object.create(null),Ks,n.functions):Ks}format(e,t){let n=this.#o(e,t),r=``;for(let e of ac(n,this.#i))if(typeof e==`string`)r+=e;else if(e.type===`markup`)ic(n,e);else{let t;try{if(t=Zs(n,e),typeof t.toString==`function`){if(this.#e&&(this.#t!==`ltr`||t.dir!==`ltr`||t[Js])){let e=t.dir===`ltr`?`⁦`:t.dir===`rtl`?`⁧`:`⁨`;r+=e+t.toString()+`⁩`}else r+=t.toString()}else{let e=new Ds(`not-formattable`,`Message part is not formattable`);throw e.source=t.source,e}}catch(e){n.onError(e);let i=`{${t?.source??`�`}}`;r+=this.#e?`⁨`+i+`⁩`:i}}return r}formatToParts(e,t){let n=this.#o(e,t),r=[];for(let e of ac(n,this.#i))if(typeof e==`string`)r.push({type:`text`,value:e});else if(e.type===`markup`)r.push(ic(n,e));else{let t;try{if(t=Zs(n,e),typeof t.toParts==`function`){let e=t.toParts();if(this.#e&&(this.#t!==`ltr`||t.dir!==`ltr`||t[Js])){let n=t.dir===`ltr`?`⁦`:t.dir===`rtl`?`⁧`:`⁨`;r.push({type:`bidiIsolation`,value:n},...e,{type:`bidiIsolation`,value:`⁩`})}else r.push(...e)}else{let e=new Ds(`not-formattable`,`Message part is not formattable`);throw e.source=t.source,e}}catch(e){n.onError(e);let i={type:`fallback`,source:t?.source??`�`};this.#e?r.push({type:`bidiIsolation`,value:`⁨`},i,{type:`bidiIsolation`,value:`⁩`}):r.push(i)}}return r}#o(e,t=e=>{try{process.emitWarning(e)}catch{console.warn(e)}}){let n={...e};for(let t of this.#i.declarations)n[t.name]=new Qs(t.value,t.type===`input`?e??{}:void 0);return{onError:t,localeMatcher:this.#n,locales:this.#r,localVars:new WeakSet,functions:this.#a,scope:n}}};var oc=j(``),sc=``,cc=ea([]),lc=ea({}),uc=``,dc=``,fc,pc={},qne={},mc,hc=(e,t)=>{if(typeof t!=`string`||!t)throw TypeError(`${e} must be a non-empty string (got ${JSON.stringify(t)})`)},gc=(e,t)=>{if(typeof t!=`string`)throw TypeError(`${e} must be a string (got ${typeof t})`)},_c=(e,t)=>{if(typeof t!=`function`)throw TypeError(`${e} must be a function (got ${typeof t})`)},vc=new Map,yc=e=>{if(!vc.has(e))try{let t=new Intl.Locale(e),{language:n,script:r,region:i}=t,a=r&&i?void 0:t.maximize();vc.set(e,{language:n,script:r??a?.script,region:i,preferredRegion:i??a?.region,anyScript:!r&&!i})}catch{vc.set(e,void 0)}return vc.get(e)},bc=(e,t)=>{if(!e||!t.length||t.includes(e))return e;let n=yc(e);if(!n)return e;let{language:r,script:i,anyScript:a,preferredRegion:o}=n,s=t.filter(e=>{let t=yc(e);return!!t&&t.language===r&&(a||t.script===i)});if(s.length<2)return s[0]??e;let c=e=>e?s.find(t=>yc(t)?.region===e):void 0;return c(o)??c(yc(r)?.preferredRegion)??s[0]},xc=(e,t=``)=>Object.entries(e).reduce((e,[n,r])=>{let i=t?`${t}.${n}`:n;return typeof r==`object`&&r&&!Array.isArray(r)?Object.assign(e,xc(r,i)):e[i]=r,e},Object.create(null)),Sc=e=>{cc.includes(e)||(cc.push(e),dc=bc(uc,cc))},Cc=e=>{if(!e||!cc.length)return e;let t=bc(e,cc);return!cc.includes(t)&&dc&&cc.includes(dc)?dc:t},wc=()=>{sc&&Cc(sc)!==z(oc)&&Ac.set(sc)},Tc=(e,...t)=>{hc(`addMessages: localeCode`,e),t.forEach((e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`addMessages: maps[${t}] must be a plain object (got ${Array.isArray(e)?`array`:typeof e})`)}),Sc(e),lc[e]??={};let n=lc[e],r={...are,...qne};t.forEach(t=>{Object.entries(xc(t)).forEach(([t,i])=>{n[t]=new Intl.MessageFormat(e,String(i),{functions:r})})}),wc()},Ec=new Map,Dc=new Map,Oc=(e=z(oc))=>{if(gc(`waitLocale: localeCode`,e),!e)return Promise.resolve();let t=Dc.get(e);if(!t){let n=Ec.get(e);t=n?Promise.resolve(n()).then(t=>{Tc(e,t)},()=>{if(Dc.delete(e),z(oc)===e&&!lc[e]&&dc&&dc!==e)return Ac.set(dc)}):Promise.resolve(),Dc.set(e,t)}return t},kc=(e=z(oc))=>Rs(e)===`rtl`,Ac={get current(){return z(oc)},set(e){gc(`locale.set: value`,e),sc=e;let t=Cc(e);if(M(oc,t,!0),typeof document<`u`&&t){document.documentElement.lang=t;let e=Rs(t);e!==`auto`&&(document.documentElement.dir=e)}return Oc(t)}},Jne=(e,t)=>{hc(`register: localeCode`,e),_c(`register: loader`,t),Ec.set(e,t),Dc.delete(e),Sc(e),wc()},Yne=()=>{if(typeof navigator>`u`)return;let e=navigator.languages?.length?navigator.languages:[navigator.language];return e.map(e=>bc(e,cc)).find(e=>cc.includes(e))??e[0]},Xne=e=>{if(!e||typeof e.fallbackLocale!=`string`)throw TypeError(`init: fallbackLocale must be a string (got ${JSON.stringify(e?.fallbackLocale)})`);e.initialLocale!==void 0&&gc(`init: initialLocale`,e.initialLocale),e.handleMissingMessage!==void 0&&_c(`init: handleMissingMessage`,e.handleMissingMessage),uc=e.fallbackLocale,dc=bc(uc,cc),fc=e.handleMissingMessage,pc=e.formats??{},e.initialLocale&&Ac.set(e.initialLocale)},Zne=(e,t)=>{let n=lc[e];return n&&Object.hasOwn(n,t)?n[t]:void 0},Qne=e=>{let t=e??z(oc);return t===dc?[t]:[t,dc]},Y=(e,{values:t={},locale:n,default:r,formats:i}={})=>{if(e==null)throw TypeError(`format: key must be a string or message object (got ${JSON.stringify(e)})`);if(typeof e==`object`){let{id:t,...n}=e;return Y(t,n)}let a=Qne(n),[o]=a,s=a.reduce((t,n)=>t??Zne(n,e),void 0);mc=i;let c;try{c=s?.format(t)}finally{mc=void 0}if(c!==void 0)return c;if(fc){let t=fc(e,o,r);if(t!==void 0)return t}return r??e},$ne=`_default`,ere={date:{short:{month:`numeric`,day:`numeric`,year:`2-digit`},medium:{month:`short`,day:`numeric`,year:`numeric`},long:{month:`long`,day:`numeric`,year:`numeric`},full:{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`}},time:{short:{hour:`numeric`,minute:`numeric`},medium:{hour:`numeric`,minute:`numeric`,second:`numeric`},long:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`},full:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`}},number:{currency:{style:`currency`},percent:{style:`percent`},scientific:{notation:`scientific`},engineering:{notation:`engineering`},compactLong:{notation:`compact`,compactDisplay:`long`},compactShort:{notation:`compact`,compactDisplay:`short`}}},tre=(e,t)=>pc[e]?.[t]??ere[e]?.[t],nre=e=>pc[e]?.[$ne],rre=e=>{let t=mc?.[e];return(typeof t==`string`?tre(e,t):t)??nre(e)},ire=(e,t,n)=>{let r=e.valueOf();return{...e,dir:n?Rs(n):e.dir,toString:()=>t.format(r)}},jc=(e,t,n)=>(r,i,a)=>{let o=e(r,i,a),s=rre(t);if(!s)return o;let{locale:c,...l}=s;return ire(o,new n(c??r.locales,l),c)},are={...qs,date:jc(qs.date,`date`,Intl.DateTimeFormat),time:jc(qs.time,`time`,Intl.DateTimeFormat),datetime:jc(qs.datetime,`datetime`,Intl.DateTimeFormat),number:jc(Ks.number,`number`,Intl.NumberFormat),integer:jc(Ks.integer,`number`,Intl.NumberFormat)},X=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Mc=e=>JSON.parse(JSON.stringify(e)),Nc=e=>Array.isArray(e)&&e.every(X),Pc=e=>[...new Set(e)],ore=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,Fc=e=>{let t=globalThis.crypto.randomUUID();return e===`short`?t.split(`-`).pop():e===`shorter`?t.split(`-`).shift():typeof e==`number`?t.split(`-`).join(``).slice(0,e):t},Ic=`abcdefghijklmnopqrstuvwxyz234567`,sre=e=>{let t=``,n=0,r=0;return e.forEach(e=>{for(n=n<<8|e,r+=8;r>=5;)r-=5,t+=Ic[n>>>r&31]}),r>0&&(t+=Ic[n<<5-r&31]),t},Lc=()=>sre(Uint8Array.fromHex(Fc().replaceAll(`-`,``))),Rc=async(e,{algorithm:t=`SHA-1`,format:n=`hex`}={})=>{let r;if(typeof e==`string`)r=new TextEncoder().encode(e);else if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))r=e;else if(e&&typeof e.arrayBuffer==`function`)r=await e.arrayBuffer();else throw Error(`Unsupported input type for getHash`);let i=await globalThis.crypto.subtle.digest(t,r);return n===`binary`?Array.from(new Uint8Array(i),e=>String.fromCharCode(e)).join(``):new Uint8Array(i).toHex()},zc=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),Bc=(e,t,{ellipsis:n=`…`}={})=>{let r=e.trim();if(r.length<=t)return r;let i=[...r.slice(0,t*2)];return`${i.slice(0,t).join(``).trim()}${i.length>t||r.length>t*2?n:``}`},Vc=e=>e.replace(/^\/+|\/+$/g,``),Hc,cre=e=>(Hc??=new DOMParser,Hc.parseFromString(e,`text/html`).body.textContent),Uc=e=>!/\s/.test(e)&&URL.canParse(e),Wc=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}).compare,Gc=(e=``)=>RegExp(`\\bblob:${zc(globalThis.location.origin)}\\/${ore.source}\\b`,e),lre=/(?:(.+?)\/)?(([^/]+?)(?:\.((?:[Tt][Aa][Rr]\.)?[a-zA-Z0-9]+))?)$/,ure=[`application/atom+xml`,`application/javascript`,`application/json`,`application/ld+json`,`application/rss+xml`,`application/xhtml+xml`,`application/xml`,`application/yaml`,`image/svg+xml`],Kc=e=>e.startsWith(`text/`)||ure.includes(e),qc=e=>{let t=e.length;for(;e[t-1]===`/`;)--t;let[,n,r=``,i=``,a]=e.slice(0,t).match(lre)??[];return{dirname:n,basename:r,filename:i,extension:a}},Jc=(e,t)=>{if(!t.length)return!0;let n=e.name.toLowerCase();return t.some(t=>{let r=t.toLowerCase();if(r.startsWith(`.`))return n.endsWith(r);let[i,a]=r.split(`/`);return a===`*`?e.type.split(`/`)[0]===i:e.type===r})},dre=async({items:e},{accept:t}={})=>{let n=t?t.split(`,`).map(e=>e.trim()).filter(Boolean):[],r=e=>new Promise(t=>{e.file(t,()=>t(null))}),i=e=>new Promise(t=>{e.readEntries(t,()=>t([]))}),a=async e=>{if(e.name.startsWith(`.`))return[];if(e.isFile){let t=await r(e);return t&&Jc(t,n)?[t]:[]}let t=e.createReader(),o=[];for(;;){let e=await i(t);if(!e.length)break;o.push(...e)}return(await Promise.all(o.map(a))).flat()},o=[...e].map(e=>e.webkitGetAsEntry()).filter(e=>e!==null);return(await Promise.all(o.map(a))).flat().sort((e,t)=>e.name.localeCompare(t.name))},fre=async e=>(await e.text()).replace(/\r\n?/g,` `),pre=e=>typeof e==`string`?new Blob([e],{type:`text/plain`}):e,Yc=async e=>{let t=pre(e);return new Uint8Array(await t.arrayBuffer()).toBase64()},mre=async e=>{let t=Uint8Array.fromBase64(e);return new TextDecoder().decode(t)},hre=new Map([[`application/gzip`,`gz`],[`application/javascript`,`js`],[`application/ld+json`,`jsonld`],[`audio/mpeg`,`mp3`],[`text/javascript`,`js`],[`text/markdown`,`md`],[`text/plain`,`txt`],[`video/quicktime`,`mov`]]),gre=e=>{let t=e.toLowerCase().split(`;`)[0].trim(),n=hre.get(t);if(n)return n;let r=t.split(`/`)[1]?.split(`+`)[0];if(r&&!/[.-]/.test(r))return r},_re=(e,t)=>{let n=document.createElement(`a`),r=URL.createObjectURL(e),i=gre(e.type);n.download=t||e.name||[Date.now(),i].filter(Boolean).join(`.`),n.href=r,n.click(),globalThis.setTimeout(()=>{URL.revokeObjectURL(r)},0)},vre={"@cfworker/json-schema":`^4.1.6`,"@discourse/heic":`^1.0.0`,"@fastify/deepmerge":`^3.2.4`,"@jsquash/webp":`^1.5.0`,"@lexical/markdown":`^0.53.0`,"@sindresorhus/transliterate":`^3.0.0`,"@sveltia/i18n":`^1.5.0`,"@sveltia/ui":`^0.90.0`,"@sveltia/utils":`^0.13.2`,buffer:`^6.0.3`,"create-react-class":`^15.7.0`,dayjs:`^1.11.23`,exifr:`^7.1.3`,"fast-deep-equal":`^3.1.3`,flat:`^6.0.1`,htm:`^3.1.1`,immutable:`^5.2.1`,"isomorphic-dompurify":`^4.7.0`,"isomorphic-git":`^1.44.13`,leaflet:`^1.9.4`,lexical:`^0.53.0`,marked:`^18.2.0`,mime:`^4.1.2`,"parse-entities":`^4.0.2`,"pdfjs-dist":`^6.5.438`,qrcode:`^1.5.4`,react:`^19.3.1`,"react-dom":`^19.3.1`,"sanitize-filename":`^1.6.5`,"smol-toml":`^1.9.1`,svgo:`^4.1.0`,"terra-draw":`^1.39.0`,turndown:`^7.2.5`,yaml:`^2.9.1`},yre=function(e,t,n){let r=Promise.resolve();function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Xc=(typeof document>`u`?void 0:document.currentScript?.src)||{}.url,Zc=e=>{let t=`https://unpkg.com/${e}`,n=vre[e]?.replace(/^\D/,``);return n?`${t}@${n}`:t},Qc=async(e,t)=>yre(()=>import(`${Zc(e)}/${t}`),void 0),bre=async()=>`${Zc(`leaflet`)}/dist/images/marker-icon-2x.png`,xre=[`unpkg.com`,`cdn.jsdelivr.net`],$c=e=>{let t=new URL(e),n=t.pathname.match(/^(.*\/@sveltia\/cms)(?:@([^/]*))?(\/.*)$/);if(!n)return;let[,r,i,a]=n;if(!(i===`0.266.0`||i===void 0&&!xre.includes(t.host)))return{url:t,packagePath:r,versionSpec:i,filePath:a}},Sre=e=>{let t=$c(e);if(!t)return e;let{url:n,packagePath:r,filePath:i}=t;return n.pathname=`${r}@0.266.0${i}`,n.href},Cre=(e=Xc)=>{let t=e?$c(e):void 0;return t?t.versionSpec??``:void 0},wre=(e,t=Xc)=>{let n=`chunks/${e}.js`,r=`https://unpkg.com/@sveltia/cms@0.266.0/dist/${n}`;if(!t)return[r];let i=new URL(n,Sre(t)).href;return i===r?[r]:[i,r]},el={},tl=async e=>{if(e in el)return el[e]();let t;for(let n of wre(e))try{return await import(n)}catch(e){t=e}throw Error(`Failed to load the ${e} chunk.`,{cause:t})},nl=u(s(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}}))(),1),rl=(e,t=[])=>(t.forEach(t=>{Object.hasOwn(e,t)&&Object.defineProperty(e,t,{value:e[t],writable:!1,enumerable:!0,configurable:!0})}),ea(e)),il=e=>$r(e),al=e=>{let t=j(e);return{get current(){return z(t)},set current(e){M(t,e)}}},ol=e=>ea({current:e}),sl=e=>{let t=A(e);return{get current(){return z(t)}}},cl=e=>{let t;return sl(()=>{let n=e();return(0,nl.default)(n,t)||(t=n),t})},ll=(e,t,n)=>(e.current?.respond(n),new Promise(n=>{let r={...t,respond:t=>{e.current===r&&(e.current=void 0),n(t)}};e.current=r})),ul=e=>va(()=>{L(e)}),dl=(e,t)=>{L(()=>(e(),ao(t)))},fl=(e,t,n)=>{L(()=>{let r=e();if(!r)return;let i=!1;return r.then(e=>{i||t(e)},n&&(e=>{i||n(e)})),()=>{i=!0}})},pl=(e,t,n,r,i=e=>e,a=e=>e)=>{let o,s=()=>{let t=i(e());n()!==t&&r(t),o=t},c=()=>{let r=a(n());e()!==r&&t(r)};return dl(e,s),dl(n,()=>{n()!==o&&c()}),{updateInput:s,updateValue:c}},ml=al(),hl=al(),gl=async(e,t)=>{let n={};if(e)try{n=await t(e)}catch{}ml.current=n.canPush===!1?e:void 0,hl.current=n.canMerge===!1?e:void 0},_l=2,vl=al(),Tre=e=>{vl.current=e>=_l?{phase:`preparing`,done:0,total:e,approximate:!1}:void 0},Ere=()=>{let e=vl.current;e?.phase===`preparing`&&(vl.current={...e,done:Math.min(e.done+1,e.total)})},yl=(e,t)=>{let n=Math.max(e,t);vl.current=n>=_l?{phase:`committing`,done:e,total:n,approximate:!0}:void 0},bl=()=>{vl.current=void 0},xl=[`gitea`,`forgejo`],Sl=e=>!!e&&xl.includes(e),Cl=class extends Error{},wl=(e,t,n)=>Error(e,{cause:new Cl(n?Y(t,{values:n}):Y(t))}),Tl=(e,t)=>e?.cause instanceof Cl&&e.cause.message||Y(t),El=e=>wl(`Not a collaborator of the repository`,`repository_no_access`,{repo:e}),Dre=e=>wl(`Not a collaborator of the repository`,`repository_no_write_access`,{repo:e}),Dl=(e,t)=>t?Dre(e):El(e),Ol=({owner:e,repo:t},n)=>n===401||n===403||n===404?El(t):wl(`Failed to check the repository permission.`,`open_authoring.permission_check_failed`,{repo:`${e}/${t}`}),{DEV:Ore,VITE_SITE_URL:kre}={DEV:!1},kl=Ore?kre||`http://localhost:5174`:void 0,Are=[`text/yaml`,`application/x-yaml`,`application/yaml`,`application/toml`,`application/json`],Al=al(),jl=Al,Ml={},Nl=al(),Pl=al([]),Fl=sl(()=>!!jl.current||!!Pl.current.length),Il={errors:new Set,warnings:new Set,mediaFields:new Set,relationFields:new Set,formatLocales:new Set},jre=s(((e,t)=>{function n(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}t.exports=function(e,t,i){if(typeof t!=`string`)throw Error(`Input must be string`);for(var a=t.length,o=0,s,c,l=0;li)return t.slice(0,l-c.length+1)}return t}})),Mre=s(((e,t)=>{function n(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}t.exports=function(e){if(typeof e!=`string`)throw Error(`Input must be string`);for(var t=e.length,i=0,a=null,o=null,s=0;s=128&&a<=2047?i+=2:a>=2048&&a<=65535&&(i+=3),o=a;return i}})),Nre=s(((e,t)=>{var n=jre(),r=Mre();t.exports=n.bind(null,r)})),Pre=u(s(((e,t)=>{var n=Nre(),r=/[\/\?<>\\:\*\|"]/g,i=/[\x00-\x1f\x80-\x9f]/g,a=/^\.+$/,o=/^(con|prn|aux|nul|com[0-9\u00b9\u00b2\u00b3]|lpt[0-9\u00b9\u00b2\u00b3])(\..*)?$/i;function s(e,t){for(var n=e.length;n>0&&(e[n-1]===`.`||e[n-1]===` `);)n--;return n===e.length?e:typeof t==`function`?e.slice(0,n)+t(e.slice(n),n,e):e.slice(0,n)+t}function c(e,t){if(typeof e!=`string`)throw Error(`Input must be string`);var c=e.replace(r,t).replace(i,t).replace(a,t).replace(o,t);return c=s(c,t),c=n(c,255),s(c,``).replace(o,``)}t.exports=function(e,t){var n=t&&t.replacement||``,r=c(e,n);return n===``?r:c(r,``)}}))(),1),Ll=(e,t,n)=>{let r=e;return r.has(t)||r.set(t,n()),r.get(t)},Rl=(e,t)=>{let n=e.get(t);return e.delete(t),e.set(t,n),n},zl=(e,t,n,r)=>{e.delete(t),e.set(t,n),e.size>r&&e.delete(e.keys().next().value)},Bl=e=>{let t=new Map;return{has:e=>t.has(e),get:e=>t.has(e)?Rl(t,e):void 0,set:(n,r)=>{zl(t,n,r,e)},clear:()=>{t.clear()}}},Vl=(e,t,n,r)=>{if(e.has(t))return Rl(e,t);let i=n();return zl(e,t,i,r),i},Hl=(e,t,n)=>Ll(e,t,()=>n().finally(()=>{e.delete(t)})),Ul=(e,t,n)=>Ll(e,t,()=>n().catch(n=>{throw e.delete(t),n})),Wl=(e,t)=>{let n;return()=>{let r=e();return n&&n.source===r||(n={source:r,value:t(r)}),n.value}},Gl=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[\da-f]{2})+/gi,e=>{try{return t(e)}catch{return e}})}},Kl=e=>Gl(e,decodeURI),ql=e=>Gl(e,decodeURIComponent),Jl=e=>{try{return new URL(e).href}catch{return encodeURI(Kl(e).toWellFormed())}},Yl=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Xl=(e,t=encodeURIComponent)=>e.split(`/`).map(e=>t(e)).join(`/`),Zl=e=>e.replace(/\/+$/,``),Ql=(e,t)=>RegExp(`^${e.split(`/`).map(t).join(`\\/`)}(?=\\/|$)`),$l=e=>{let t=e.startsWith(`@`);return t&&(e=e.slice(1)),e=Xl(e,Yl),t?`@${e}`:e},eu=(e,t,{hasExtension:n=!0}={})=>{let r=e.toLowerCase();if(!t.some(e=>e.toLowerCase()===r))return e;let{filename:i,extension:a}=n?qc(e):{filename:e,extension:void 0},o=a?`\\.${a}`:``,s=RegExp(`^${zc(i)}-(?\\d+)${o}$`,`i`),c=0;return t.forEach(e=>{let t=e.match(s);t&&(c=Math.max(c,Number(t.groups.num)))}),`${i}-${c+1}${a?`.${a}`:``}`},tu=e=>(0,Pre.default)(e.normalize().replace(/[\s\u00A0\u202F]+/g,` `)),Fre=[[`jpg`,`jpeg`,`jpe`,`jfif`],[`tif`,`tiff`],[`htm`,`html`],[`yml`,`yaml`],[`md`,`markdown`],[`mpg`,`mpeg`],[`mid`,`midi`],[`aif`,`aiff`]],nu=(e,t)=>{let n=e?.toLowerCase()??``,r=t?.toLowerCase()??``;return n===r||Fre.some(e=>e.includes(n)&&e.includes(r))},ru=e=>e.filter(Boolean).join(`/`),iu=e=>qc(e).dirname??``,au=e=>e.slice(e.lastIndexOf(`/`)+1),ou=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,su=e=>e.split(`/`).filter(e=>e!==`.`&&e!==`..`).join(`/`),cu=e=>{let t=[],n=!1;return e.split(`/`).forEach(e=>{if(e){if(!n||e!==`.`&&e!==`..`)n||=e!==`.`&&e!==`..`,t.push(e);else if(e===`..`){let n=t.at(-1);n!==void 0&&n!==`.`&&n!==`..`?t.pop():t.push(e)}}}),t.join(`/`)},lu=e=>typeof e==`string`?new Blob([e],{type:`text/plain`}):e,uu=e=>typeof e==`string`?new TextEncoder().encode(e).length:e.size,du=async e=>{let t=await e.arrayBuffer();return Rc(new Blob([`blob ${t.byteLength}\0`,t]))},Ire=new WeakMap,fu=e=>typeof e==`string`?du(lu(e)):Ul(Ire,e,()=>du(e)),pu=e=>typeof e==`string`?e.split(`/`).filter(e=>e&&e!==`.`).join(`/`):``,mu=()=>pu(jl.current?.backend?.root_dir),hu=(e,t=mu())=>t?cu(`${t}/${e}`):e,gu=(e,t=mu())=>{if(!t)return e;if(e.startsWith(`${t}/`))return e.slice(t.length+1);let n=t.split(`/`),r=e.split(`/`),i=0;for(;i`..`),...r.slice(i)].join(`/`)},_u=e=>!e.startsWith(`../`),vu=e=>{let t=mu();return t?e.map(({previousPath:e,...n})=>({...n,path:hu(n.path,t),...e!==void 0&&{previousPath:hu(e,t)}})):e},yu=class e{#e;#t;#n=``;#r=``;#i={};#a=[];constructor(e,t,{keyPath:n,autoIncrement:r,indexes:i=[]}={}){this.#e=void 0,this.#n=e,this.#r=t,this.#i={keyPath:n,autoIncrement:r},this.#a=i}async#o(e){return new Promise((t,n)=>{let r=globalThis.indexedDB.open(this.#n,e);r.onupgradeneeded=()=>{let e=r.result,t=this.#r,n=e.objectStoreNames.contains(t)?r.transaction.objectStore(t):e.createObjectStore(t,this.#i);this.#a.forEach(({name:e,keyPath:t,options:r})=>{n.indexNames.contains(e)||n.createIndex(e,t,r)})},r.onsuccess=()=>{t(r.result)},r.onerror=()=>{n(r.error)}})}#s(e){let t=this.#r;if(!e.objectStoreNames.contains(t))return!0;let n=e.transaction(t).objectStore(t);return this.#a.some(({name:e})=>!n.indexNames.contains(e))}async#c(){let e=await this.#o();for(;this.#s(e);){let{version:t}=e;e.close();try{e=await this.#o(t+1)}catch(t){if(t?.name!==`VersionError`)throw t;e=await this.#o()}}return e.onversionchange=()=>{e.close(),this.#e=void 0},e.onclose=()=>{this.#e=void 0},e}async#l(e,{mode:t=`readonly`}={}){if(!this.#e){this.#t??=this.#c();try{this.#e=await this.#t}finally{this.#t=void 0}}let n=this.#e,r=this.#r,i=n.transaction(r,t),a=e(i.objectStore(r));return new Promise((e,n)=>{if(i.onerror=()=>{n(i.error)},i.onabort=()=>{n(i.error)},t===`readwrite`){let t;a&&(a.onsuccess=()=>{t=a.result}),i.oncomplete=()=>{e(t)}}else a?a.onsuccess=()=>{e(a.result)}:i.oncomplete=()=>{e(void 0)}})}async set(e,t){return this.#l(n=>n.put(t,e),{mode:`readwrite`})}async put(e){return this.#l(t=>t.put(e),{mode:`readwrite`})}async saveEntries(e){return this.#l(t=>{e.forEach(([e,n])=>{t.put(n,e)})},{mode:`readwrite`})}async get(e){return this.#l(t=>t.get(e))}async keys(){return this.#l(e=>e.getAllKeys())}async values(){return this.#l(e=>e.getAll())}async entries(){let e=[],t=await this.#l(t=>{let n=t.getAllKeys();return n.onsuccess=()=>{e=n.result},t.getAll()});return e.map((e,n)=>[e,t[n]])}static#u(e,t){return t?e.index(t):e}async#d({callback:t=void 0,index:n=void 0,query:r=void 0,direction:i=`next`}){return new Promise((a,o)=>{this.#l(o=>{let s=e.#u(o,n).openCursor(r,i);s.onsuccess=()=>{let e=s.result;if(e){let{value:n}=e;typeof t!=`function`||t(n)?a(n):e.continue()}else a(void 0)}}).catch(o)})}async find(e,{index:t,query:n}={}){return this.#d({callback:e,index:t,query:n})}async findLast(e,{index:t,query:n}={}){return this.#d({callback:e,index:t,query:n,direction:`prev`})}async filter(t,{index:n,query:r}={}){let i=await this.#l(t=>e.#u(t,n).getAll(r));return typeof t==`function`?i.filter(e=>t(e)):i}async delete(e){await this.#l(t=>t.delete(e),{mode:`readwrite`})}async deleteEntries(e){await this.#l(t=>{e.forEach(e=>{t.delete(e)})},{mode:`readwrite`})}async clear(){await this.#l(e=>e.clear(),{mode:`readwrite`})}},bu=e=>{try{return JSON.parse(e)}catch{return null}},xu=class{static async set(e,t){t===void 0?globalThis.localStorage.removeItem(e):globalThis.localStorage.setItem(e,JSON.stringify(t))}static async get(e){let t=globalThis.localStorage.getItem(e);return t?bu(t):null}static async delete(e){globalThis.localStorage.removeItem(e)}static async clear(){globalThis.localStorage.clear()}static async keys(){return Object.keys(globalThis.localStorage)}static async values(){return Object.values(globalThis.localStorage).map(bu)}static async entries(){return Object.entries(globalThis.localStorage).map(([e,t])=>[e,bu(t)])}},Su=ea({current:void 0}),Cu=ea({}),wu=!1,Tu=0,Eu,Du=ea({current:void 0});va(()=>{(async()=>{Su.current=void 0;try{let e=await xu.get(`sveltia-cms.prefs`),t=X(e)?e:{};t.apiKeys??={},t.useDraftBackup??=!0,t.closeOnSave??=!0,t.closeWithEscape??=!0,t.underlineLinks??=!0,t.devModeEnabled??=!1,t.localGitCommits??=!1,t.defaultTranslationService??=`google`,t.locale??=`auto`,t.locale===`en`&&(t.locale=`auto`),delete t.beta,Object.assign(Cu,t)}catch{Su.current={type:`permission_denied`}}})(),L(()=>{if(!Object.keys(Cu).length)return;let e=$r(Cu);(async()=>{try{(0,nl.default)(e,await xu.get(`sveltia-cms.prefs`))||await xu.set(`sveltia-cms.prefs`,e)}catch{}})();let{theme:t,underlineLinks:n=!0,devModeEnabled:r=!1}=Cu,i=!t||t===`auto`,a=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;Object.assign(document.documentElement.dataset,{theme:i?a:t,autoTheming:i,underlineLinks:n,devMode:r})}),L(()=>{let{locale:e}=Cu,t=e===`auto`?Du.current:e;if(!t||!cc.includes(t))return;let n=ao(()=>Ac.current),r=wu&&e!==`auto`;wu=!0,Tu+=1;let i=Tu;Oc(t).then(()=>{i===Tu&&(t in lc?(Ac.set(t),Eu=e):r&&n&&(Cu.locale=Eu??n))})})});var Ou={service:``,label:``,owner:``,repo:``,branch:``,repoURL:``,treeBaseURL:``,blobBaseURL:``,isSelfHosted:!1,databaseName:``},Lre=/^(?(?:[a-z][a-z\d+.-]*:)?\/\/[^/]*)?(?.*?)\/api(?:\/.*)?$/i,ku=e=>e===`https://api.github.com`?`https://github.com`:e.replace(Lre,`$$`),Rre=(e,t)=>`${ku(e)}/${t}`,Au=({owner:e,repo:t})=>`/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,ju=e=>{let[t,n]=e.split(`/`);return{owner:t,repo:n}},Mu=(e,{owner:t,repo:n})=>typeof e==`string`&&e.toLowerCase()===`${t}/${n}`.toLowerCase(),Nu=(e,t)=>`${Au(e)}/pulls/${t}`,zre=(e,t)=>`${Au(e)}/branches/${Xl(t)}`,Pu=({tree:e,blob:t,commit:n})=>(r,i)=>({treeBaseURL:i?`${r}${e}/${Xl(i)}`:r,blobBaseURL:i?`${r}${t}/${Xl(i)}`:``,commitBaseURL:`${r}${n}`}),Fu=(e,t,n)=>{let r=e(t,n),i=mu();return!i||!n?r:{...r,treeBaseURL:`${r.treeBaseURL}/${Xl(i)}`,blobBaseURL:`${r.blobBaseURL}/${Xl(i)}`}},Bre=(e,{service:t,label:n,owner:r,repo:i,branch:a,restApiRoot:o,defaultApiRoot:s,getTokenPageURL:c,getBaseURLs:l})=>{o=Vc(o);let u=`${r}/${i}`,d=Rre(o,u),f=mu();return Object.assign(e,{service:t,label:n,owner:r,repo:i,branch:a,repoURL:d,tokenPageURL:c(ku(o)),databaseName:f?`${t}:${u}:${f}`:`${t}:${u}`,isSelfHosted:o!==s},Fu(l,d,a)),Cu.devModeEnabled&&console.info(`repositoryInfo`,e),e},Iu=(e,{found:t,branch:n,getBaseURLs:r})=>{let{repo:i,repoURL:a=``}=e;if(!t)throw wl(`Failed to retrieve the default branch name.`,`repository_not_found`,{repo:i});if(!n)throw wl(`Failed to retrieve the default branch name.`,`repository_empty`,{repo:i});return Object.assign(e,{branch:n},Fu(r,a,n)),n},Lu=({name:e,base_url:t,api_root:n})=>t??(e===`forgejo`&&n?ku(n):`https://gitea.com`),Ru=[`decap-cms-user`,`netlify-cms-user`],zu=ea({account:void 0});va(()=>{L(()=>{let e=zu.account;(async()=>{try{e?await xu.set(`sveltia-cms.user`,e):e===null&&await xu.delete(`sveltia-cms.user`)}catch{}})()})});var Bu=(e=0)=>new Promise(t=>{globalThis.setTimeout(()=>{t(void 0)},e)}),Vre=/^(.+\.)?localhost$/,Vu=e=>[`127.0.0.1`,`[::1]`].includes(e)||Vre.test(e),Hu=(e,t=globalThis.window?.location?.origin??globalThis.location?.origin??`https://localhost`)=>{try{let{hostname:n,protocol:r}=new URL(e,t);return r===`https:`||Vu(n)}catch{return!1}},Uu=({method:e=`GET`,body:t})=>{if([`GET`,`HEAD`].includes(e.toUpperCase()))return!0;let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return!1}return X(n)&&typeof n.query==`string`&&!/^\s*(?:#[^\n]*\n\s*)*mutation\b/.test(n.query)},Hre=[429,503,504],Ure=1e3,Wre=(e,t)=>{let n=t?.get(`Retry-After`)?.trim();if(n){let e=/^\d+$/.test(n)?Number(n)*1e3:Date.parse(n)-Date.now();if(!Number.isNaN(e))return e>1e4?void 0:Math.max(e,0)}return e===429?void 0:Ure},Wu=async(...e)=>{let t=await fetch(...e);if(!t.ok)throw Error(`HTTP ${t.status}`);return t},Gu=async(e,t={},{responseType:n=`json`,refreshAccessToken:r=void 0,retries:i=1,retryable:a=Uu(t)}={})=>{let o,s=new Headers(t.headers);if(t.cache=`no-cache`,t.headers=s,s.has(`Authorization`)&&!Hu(e))throw Error(`Refusing to send credentials over an insecure connection`);n===`json`&&s.set(`Accept`,`application/json`),X(t.body)&&(s.set(`Content-Type`,`application/json`),t.body=JSON.stringify(t.body));try{o=await fetch(e,t)}catch(e){throw Error(`Failed to send the request`,{cause:e})}let{ok:c,status:l}=o,u=async()=>{let[i]=s.get(`Authorization`)?.split(` `)??[`token`],{token:o}=await r();return s.set(`Authorization`,`${i} ${o}`),Gu(e,t,{responseType:n,retryable:a})},d=i>0&&a&&(l===502||Hre.includes(l)&&Uu(t))?Wre(l,o.headers):void 0,f=d!==void 0,p=async()=>(await Bu(d),Gu(e,t,{responseType:n,refreshAccessToken:r,retries:i-1,retryable:a}));if(n===`raw`)return f?p():l===401&&r?u():o;let m;if(c)try{if(n===`blob`)return await o.blob();if(n===`text`)return await o.text();m=await o.json()}catch(e){throw Error(`Failed to parse the response`,{cause:e})}else try{m=await o.json()}catch{m=void 0}if(c&&!(e.endsWith(`/graphql`)&&X(m)&&m.errors))return m;if(f)return p();if(l===401&&r)return u();if(!X(m))throw Error(`Server responded with an error`,{cause:{status:l}});let h=``;throw typeof m.error==`string`&&(h=m.error),typeof m.message==`string`&&(h=m.message),Array.isArray(m.errors)&&(typeof m.errors[0]==`string`&&(h=m.errors.join(`, `)),X(m.errors[0])&&typeof m.errors[0].message==`string`&&(h=m.errors.map(e=>e.message).join(`, `))),Error(`Server responded with an error`,{cause:{status:l,message:h}})},Ku=async(e,t,{allowNotFound:n=!1}={})=>{if(!e.ok&&!(n&&e.status===404)){let n=await e.text();throw Error(`${t}: ${n}`)}},qu=e=>typeof e==`string`&&!!e.trim(),Ju=e=>typeof e==`string`&&/^https?:\/\//i.test(e.trim())&&Uc(e.trim()),Yu=e=>e.replace(/&(?![a-zA-Z0-9#]+;)/g,`&`).replaceAll(`"`,`"`),Gre={"&":`&`,"<":`<`,">":`>`},Xu=e=>e.replace(/[&<>]/g,e=>Gre[e]),Zu={ALLOWED_TAGS:[`a`],ALLOWED_ATTR:[`href`,`target`,`rel`]},Qu=(e,t)=>ft(e.replace(``,``),Zu),$u=(e,{allowedTags:t=[`strong`,`em`,`del`,`code`,`a`],allowedAttr:n=[`href`]}={})=>ft(pr(e),{ALLOWED_TAGS:t,ALLOWED_ATTR:n}),ed=e=>$u(e.replaceAll(`\\n`,`
    `),{allowedTags:[`strong`,`em`,`del`,`code`,`a`,`br`]}),td={clientId:``,authScope:``,authURL:``,tokenURL:``,authScheme:`token`,restBaseURL:``,graphqlBaseURL:``,includeCredentials:!1},nd={},rd=async(e,t,{includeCredentials:n=!1}={})=>{if(Hu(e))try{return await fetch(e,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify(t),...n&&{credentials:`include`}})}catch{return}},id=new Map,Kre=async({clientId:e,tokenURL:t,refreshToken:n})=>{let r=await rd(t,{grant_type:`refresh_token`,client_id:e,refresh_token:n},{includeCredentials:td.includeCredentials});if(!r?.ok)throw Error(Y(`sign_in_error.TOKEN_REFRESH_FAILED`));let i;try{i=await r.json()}catch{}if(!qu(i?.access_token))throw Error(Y(`sign_in_error.TOKEN_REFRESH_FAILED`));let a=i?.access_token;if(qu(i?.refresh_token)&&(n=i?.refresh_token),zu.account){zu.account={...zu.account,token:a,refreshToken:n};try{await xu.set(`sveltia-cms.user`,zu.account)}catch{}}return{token:a,refreshToken:n}},qre=({clientId:e,tokenURL:t,refreshToken:n})=>{let r=id.get(n);return r||(r=Kre({clientId:e,tokenURL:t,refreshToken:n}).finally(()=>{id.delete(n)}),id.set(n,r)),r},Jre=`sveltia-cms.token-refresh`,Yre=e=>{let t=globalThis.navigator?.locks;return t?t.request(Jre,e):e()},ad=e=>{let{account:t}=zu,n=qu(e?.refreshToken)?e.refreshToken:void 0;if(t&&qu(e?.token)&&e.backendName===t.backendName&&e.id===t.id&&(!t.refreshToken||n))return{token:e.token,refreshToken:n}},Xre=async()=>{try{return ad(await xu.get(`sveltia-cms.user`))}catch{return}},od=(e,{token:t,refreshToken:n})=>!!e?.token&&e.token!==t&&e.refreshToken!==n;globalThis.addEventListener?.(`storage`,({key:e,newValue:t})=>{if(e!==`sveltia-cms.user`||!t)return;let n;try{n=JSON.parse(t)}catch{return}let r=ad(n),{account:i}=zu;r&&(r.token!==i.token||r.refreshToken!==i.refreshToken)&&(zu.account={...i,...r})});var sd=async(e,{method:t=`GET`,headers:n={},body:r=null,isGraphQL:i=!1,responseType:a=`json`,token:o=void 0,refreshToken:s=void 0,retryable:c=void 0}={})=>{let{clientId:l,tokenURL:u,restBaseURL:d,graphqlBaseURL:f,authScheme:p=`token`,includeCredentials:m}=td,h=zu.account,g=i?f:d;o??=h?.token,s??=h?.refreshToken,n.Authorization=`${p} ${o}`;let _=!!h&&o===h.token&&s===h.refreshToken;return Gu(`${g}${e}`,{method:t,headers:n,body:r,...m&&{credentials:`include`}},{responseType:a,retryable:c,refreshAccessToken:s?()=>Yre(async()=>{if(_){let{account:e}=zu;if(e&&od(e,{token:o,refreshToken:s}))return{token:e.token,refreshToken:e.refreshToken};let t=await Xre();if(t&&od(t,{token:o,refreshToken:s}))return zu.account={...zu.account,...t},t}return qre({clientId:l,tokenURL:u,refreshToken:s})}):void 0})},cd=async(e,t={},{retryable:n}={})=>{e=e.replace(/\n\s*/g,` `),Object.entries(nd).forEach(([n,r])=>{e.includes(`$${n}`)&&(t[n]??=r)});let{data:r}=await sd(``,{method:`POST`,body:{query:e,variables:t},isGraphQL:!0,retryable:n});return r},ld=async(...e)=>{try{return await sd(...e)}catch(e){if(e?.cause?.status===404)return;throw e}},ud=al(!1),dd=al(),fd=`sveltia-cms.auth`,pd=`sveltia-cms.auth-popup`,md=e=>`sveltia-cms.auth.${e}`,hd=e=>`authorizing:${e}`,gd=(e,t,n)=>`authorization:${e}:${t}:${JSON.stringify(n)}`,Zre=(e,t)=>t.match(`^authorization:${e}:(success|error):(?.+)`)?.groups?.result,Qre=()=>{try{return window.sessionStorage.getItem(pd)}catch{return null}},_d=e=>{try{e?window.sessionStorage.setItem(pd,e):window.sessionStorage.removeItem(pd)}catch{}},vd=async()=>{_d(),await xu.delete(fd)},yd=()=>Object.assign(Error(`Authentication aborted`),{name:`AbortError`}),bd=({authURL:e})=>{let{availHeight:t,availWidth:n}=window.screen,r=t/2-400,i=n/2-300;return window.open(e,`auth`,`width=600,height=800,top=${r},left=${i}`)},xd=async({backendName:e,authURL:t,popup:n,state:r})=>{let i=n??bd({authURL:t});if(!i)throw yd();return new Promise((n,a)=>{let o=new AbortController,s=e,c=r?new BroadcastChannel(md(r)):void 0,l,u=()=>{o.abort(),clearInterval(l),c?.close(),dd.current=void 0},d=()=>{u(),i.close(),a(yd())};(e===`github`||Sl(e))&&(l=setInterval(()=>{i.closed&&d()},1e3));let f=e=>{let t=Zre(s,e),r;try{r=t?JSON.parse(t):{error:`No data`},X(r)||(r={error:`Malformed data`})}catch{r={error:`Malformed data`}}`token`in r?n(r):a(Error(`Authentication failed`,{cause:Error(r.errorCode?Y(`sign_in_error.${r.errorCode}`,{default:r.error}):r.error)})),u(),i.close()};window.addEventListener(`message`,({origin:e,data:n,source:r})=>{r===i&&e===new URL(t).origin&&typeof n==`string`&&(n===hd(s)?i.postMessage(n,e):f(n))},{signal:o.signal}),c&&(c.onmessage=({data:e})=>{typeof e==`string`&&f(e)}),dd.current=d})},$re=async({backendName:e,siteDomain:t,authURL:n,scope:r})=>{let{hostname:i}=window.location;t??=i===`localhost`?`cms.netlify.com`:i;try{new URL(n).origin===`https://api.netlify.com`&&(t=new URL(`https://${t}`).hostname)}catch{}return xd({backendName:e,authURL:`${n}?${new URLSearchParams({provider:e,site_id:t,scope:r})}`})},eie=async()=>{let e=`${Lc()}${Lc()}`,t=btoa(await Rc(e,{algorithm:`SHA-256`,format:`binary`})).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``);return{csrfToken:Fc().replaceAll(`-`,``),codeVerifier:e,codeChallenge:t}},tie=async({backendName:e,clientId:t,authURL:n,scope:r})=>{let{origin:i,pathname:a}=window.location,o=`${i}${a}`,s=bd({authURL:o});if(!s)throw yd();let{csrfToken:c,codeVerifier:l,codeChallenge:u}=await eie(),d=new URLSearchParams({client_id:t,redirect_uri:o,response_type:`code`,state:c,scope:r,code_challenge:u,code_challenge_method:`S256`});if(await xu.set(fd,{csrfToken:c,codeVerifier:l,realAuthURL:`${n}?${d}`}),await xu.set(`sveltia-cms.user`,{backendName:e}),s.closed)throw yd();try{return await xd({backendName:e,authURL:o,popup:s,state:c})}catch(e){throw await xu.delete(fd),e}},Sd=({provider:e=`unknown`,state:t,token:n,refreshToken:r,error:i,errorCode:a})=>{let o=i?`error`:`success`,s=i?{provider:e,error:i,errorCode:a}:{provider:e,token:n,refreshToken:r};if(!window.opener){if(t){let n=new BroadcastChannel(md(t));n.postMessage(gd(e,o,s)),n.close(),window.close()}return}let c=({data:t,origin:n,source:r})=>{r===window.opener&&n===window.location.origin&&t===hd(e)&&(window.opener?.postMessage(gd(e,o,s),n),window.removeEventListener(`message`,c))};window.addEventListener(`message`,c),window.opener?.postMessage(hd(e),window.location.origin)},nie=async({backendName:e,apiConfig:t,code:n,state:r})=>{let{clientId:i,tokenURL:a,includeCredentials:o=!1}=t,{origin:s,pathname:c}=new URL(window.location.href),{csrfToken:l,codeVerifier:u}=await xu.get(fd)??{},d=e,f=`${s}${c}`;if(await vd(),!l||!u||r!==l)return Sd({provider:d,state:r,error:Y(`sign_in_error.CSRF_DETECTED`),errorCode:`CSRF_DETECTED`});let p=``,m=``,h=``,g=await rd(a,{grant_type:`authorization_code`,client_id:i,code:n,redirect_uri:f,code_verifier:u},{includeCredentials:o});if(!g)return Sd({provider:d,state:r,error:Y(`sign_in_error.TOKEN_REQUEST_FAILED`),errorCode:`TOKEN_REQUEST_FAILED`});try{({access_token:p,refresh_token:m,error:h}=await g.json())}catch{return Sd({provider:d,state:r,error:Y(`sign_in_error.MALFORMED_RESPONSE`),errorCode:`MALFORMED_RESPONSE`})}return Sd({provider:d,state:r,token:p,refreshToken:m,error:h})},rie=async({backendName:e,apiConfig:t})=>{ud.current=!0;let{search:n}=window.location,{code:r,state:i,error:a,error_description:o}=Object.fromEntries(new URLSearchParams(n));if(r&&i)await nie({backendName:e,apiConfig:t,code:r,state:i});else if(a)await vd(),Sd({provider:e,state:i,error:o||a,errorCode:`AUTH_CODE_REQUEST_FAILED`});else{let{csrfToken:e,realAuthURL:t}=await xu.get(fd)??{};t&&(_d(e),window.location.href=t)}},iie=()=>{try{if(window.opener)return window.opener.origin===window.location.origin&&window.name===`auth`}catch{return!1}let e=new URLSearchParams(window.location.search).get(`state`);return!!e&&e===Qre()},aie=async({auto:e,apiConfig:t})=>{let{backend:n}=jl.current,{name:r,site_domain:i,auth_type:a}=n,{clientId:o,authScope:s,authURL:c}=t,l={backendName:r,authURL:c,scope:s};if(Sl(r)||a===`pkce`){let n=iie();return n&&await rie({backendName:r,apiConfig:t}),n||e?void 0:tie({...l,clientId:o})}if(!e)return $re({...l,siteDomain:i})},oie=async({options:{token:e,refreshToken:t,auto:n=!1},apiConfig:r})=>{if(!e){let i=await aie({auto:n,apiConfig:r});if(!i)return;({token:e,refreshToken:t}=i)}return{token:e,refreshToken:t}},Cd=async({options:e,getUserProfile:t})=>{let{token:n,refreshToken:r}=await oie({options:e,apiConfig:td})??{};if(n)return t({token:n,refreshToken:r})},wd=async()=>void 0,sie=[408,413,499,502,504],Td=(e,t=new Set)=>({queue:e.filter(({path:e})=>!t.has(e)).toSorted((e,t)=>Number(typeof e.data==`string`)-Number(typeof t.data==`string`)),addedAgain:e.filter(({path:e})=>t.has(e))}),Ed=(e,t)=>{let n=[],r=0;for(;e.length&&(!n.length||r+e[0].contents.length<=t);){let t=e.shift();n.push(t),r+=t.contents.length}return n},Dd=e=>e.reduce((e,{contents:t})=>e+t.length,0),Od=(e,t)=>Math.max(1,Math.ceil(Dd(e)/t)),kd=e=>e?.message===`Failed to send the request`||sie.includes(e?.cause?.status),Ad=async(e,t,{concurrency:n=10}={})=>{let r=0,i=async()=>{for(;ri()))},jd=async(e,t,n)=>{let r=Array(e.length);return await Ad([...e.keys()],async n=>{r[n]=await t(e[n])},n),r},Md=e=>Array.isArray(e.fields)&&!Array.isArray(e.files),Nd=e=>Array.isArray(e.files),Pd=e=>Nd(e)&&e.name===`_singletons`,Fd=e=>e?._type===`entry`&&!!e._file.arrayFile,cie=(e,{visible:t=void 0,type:n=void 0}={})=>`divider`in e||t&&e.hide?!1:n===`entry`?Md(e):n===`file`?Nd(e):n===`singleton`?Pd(e):Md(e)||Nd(e),Id=e=>!(`divider`in e)&&typeof e.file==`string`&&Array.isArray(e.fields),Ld=e=>e.filter(e=>Id(e)),Rd=[`boolean`,`code`,`color`,`compute`,`datetime`,`file`,`hidden`,`image`,`keyvalue`,`list`,`map`,`markdown`,`number`,`object`,`relation`,`richtext`,`select`,`string`,`text`,`uuid`],zd=[`boolean`,`color`,`compute`,`datetime`,`map`,`markdown`,`number`,`richtext`,`string`,`text`,`uuid`],Bd=zd.filter(e=>![`boolean`,`number`].includes(e)),Vd=[`file`,`image`],Hd=[`richtext`,`markdown`],lie=[`text`,`string`,...Hd],Ud=[...Vd,`relation`,`select`],uie=[...Ud,`datetime`,`keyvalue`,`list`,`number`],die=[`forEach`,`isDisjointFrom`,`isSubsetOf`,`isSupersetOf`],fie=[`difference`,`intersection`,`symmetricDifference`,`union`],pie=!1,mie=class e extends Set{#e=new Map;#t=j(0);#n=j(0);#r=qa||-1;constructor(e){if(super(),e){for(var t of e)super.add(t);this.#n.v=super.size}pie||this.#a()}#i(e){return qa===this.#r?j(e):qi(e)}#a(){pie=!0;var t=e.prototype,n=Set.prototype;for(let e of die)t[e]=function(...t){return z(this.#t),n[e].apply(this,t)};for(let r of fie)t[r]=function(...t){z(this.#t);var i=n[r].apply(this,t);return new e(i)}}has(e){var t=super.has(e),n=this.#e,r=n.get(e);if(r===void 0){if(!t)return z(this.#t),!1;r=this.#i(!0),n.set(e,r)}return z(r),t}add(e){return super.has(e)||(super.add(e),M(this.#n,super.size),Qi(this.#t)),this}delete(e){var t=super.delete(e),n=this.#e,r=n.get(e);return r!==void 0&&(n.delete(e),M(r,!1)),t&&(M(this.#n,super.size),Qi(this.#t)),t}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var t of e.values())M(t,!1);e.clear(),M(this.#n,0),Qi(this.#t)}}keys(){return this.values()}values(){return z(this.#t),super.values()}entries(){return z(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return z(this.#n)}},hie=class extends Map{#e=new Map;#t=j(0);#n=j(0);#r=qa||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return qa===this.#r?j(e):qi(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else return z(this.#t),!1}return z(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else{z(this.#t);return}}return z(n),super.get(e)}getOrInsert(e,t){return super.has(e)||this.set(e,t),this.get(e)}getOrInsertComputed(e,t){return super.has(e)||this.set(e,t(e)),this.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),M(this.#n,super.size),Qi(o);else if(i!==t){Qi(r);var s=o.reactions===null?null:new Set(o.reactions);s!==null&&r.reactions?.every(e=>s.has(e))||Qi(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),M(n,-1)),r&&(M(this.#n,super.size),Qi(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;M(this.#n,0);for(var t of e.values())M(t,-1);Qi(this.#t),e.clear()}}#a(){z(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)z(n)}keys(){return z(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return z(this.#n),super.size}},Wd=new Map,Gd=new hie,Kd=new Map,qd=new Map,Jd=new Set,gie=new Map,Yd=new Map,_ie=new Set,Xd=/(?{let r=t+n;for(;/\s/.test(e[r]??``);)r+=n;return e[r]??``},nf=(e,t,{unescape:n=!0}={})=>{let r=``,i=0;for(;i=e.length){r+=e.slice(a);break}}return r},rf=e=>{let t=[];return{tags:t,literals:nf(e,(e,n)=>(t.push(n),`\0`)).split(`\0`)}},af=e=>{let t=[];return nf(e,(e,n)=>(t.push({tag:e,content:n,name:n.split(`|`)[0].trim()}),e)),t},of=e=>Xd.test(e),sf=e=>e.replace($d,``),bie=(e,t=[])=>{let n=e.split(`/`).pop(),r=n.lastIndexOf(`.`),i=r===-1?``:n.slice(r+1),a=r===-1?n:n.slice(0,r),o=t.find(e=>a.endsWith(`.${e}`));return o&&(a=a.slice(0,-(o.length+1))),{filename:a,extension:i}},xie=({_i18n:e})=>e?.structureMap?.i18nMultiFile?e.allLocales:[],cf=(e,t)=>rf(e).literals.map(zc).join(t),Sie=`_index`,Cie=new WeakMap,lf=e=>{if(!Md(e))return;let{index_file:t}=e;if(t)return(t===!0?void 0:t.name)??Sie},uf=e=>{let t=Cie.get(e);if(t&&t.locale===Ac.current)return t.indexFile;let n=lf(e),r;if(n!==void 0){let{index_file:t}=e,i=t===!0?{}:t;r={...i,name:n,label:i.label||Y(`index_file`),icon:i.icon??`home`}}return Cie.set(e,{locale:Ac.current,indexFile:r}),r},df=(e,t)=>{let n=lf(e);if(n===void 0)return!1;let r=e._file?.fullPathRegEx;return!!r&&t.match(r)?.groups?.subPath===n},ff=(e,t)=>{let n=lf(e);if(n===void 0)return!1;let r=Object.values(t.locales??{})[0]?.path;return r===void 0?t.slug===n:df(e,r)},pf=[`markdown`,`md`,`mdown`,`mdwn`,`mdx`,`mkd`,`mkdn`,`html.md`],wie={raw:`txt`,yaml:`yml`,yml:`yml`,toml:`toml`,json:`json`},mf={yaml:`yaml`,yml:`yaml`,toml:`toml`,json:`json`,astro:`raw`},hf={"json-frontmatter":[`{`,`}`],"toml-frontmatter":[`+++`,`+++`],"yaml-frontmatter":[`---`,`---`]},gf=[`yaml-frontmatter`,`toml-frontmatter`,`json-frontmatter`],Tie=[`yml`,`yaml`,`toml`,`json`,`frontmatter`,...gf,`raw`],Eie=[`toml`,`toml-frontmatter`],Die={yml:`yaml`,yaml:`yaml`,toml:`toml`,json:`json`,frontmatter:`yaml`,"yaml-frontmatter":`yaml`,"toml-frontmatter":`toml`,"json-frontmatter":`json`},_f=e=>Object.hasOwn(Die,e)?Die[e]:void 0,Oie=[`index`,`_index`],kie=[...pf,...Object.keys(mf)],Aie=e=>{if(typeof e!=`string`||!e.trim())return;let t=Vc(e.trim()),{filename:n,extension:r}=qc(t);return r!==void 0&&kie.includes(r)?n:t},vf=al(``),yf=e=>{let t=e;if(!Md(t))return;let{nested:n}=t;if(!n||typeof n!=`object`)return;let{depth:r,summary:i,subfolders:a}=n;return{depth:typeof r==`number`&&r>=1?Math.floor(r):1/0,summary:qu(i)?i:void 0,subfolders:a!==!1}},bf=e=>!!yf(e),xf=e=>{if(!bf(e))return;let t=e.meta?.path;if(t&&typeof t==`object`)return{indexFileName:Aie(t.index_file)}},jie=e=>bf(e)?xf(e)?.indexFileName:void 0,Sf=e=>yf(e)?.subfolders===!1?void 0:xf(e)?.indexFileName,Cf=(e,t)=>{let n=Sf(e);return n&&t.endsWith(`/${n}`)?t.slice(0,-n.length-1):t},wf=({collection:e,isNew:t,originalPath:n,currentPath:r})=>r===void 0?!1:t&&Sf(e)?!0:!!Vc(r)||!!Vc(n??``),Tf=e=>{let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)},Mie=(e,t)=>{let n=t?`${t}/`:``,r=e.startsWith(n)?e.slice(n.length):void 0;return r?.includes(`/`)?void 0:r},Ef=(e,t)=>!e||t.startsWith(`${e}/`),Nie=({collection:e,entries:t,dirPath:n})=>{if(!bf(e))return!1;let r=Vc(n);return!r||t.some(({subPath:e})=>Ef(r,e))},Pie=({collection:e,entries:t,dirPath:n})=>{let r=yf(e);if(!r)return t;let{subfolders:i}=r,a=Vc(n);return t.filter(({subPath:e})=>{if(!Ef(a,e))return!1;let t=(a?e.slice(a.length+1):e).split(`/`).length;return i?a?t===2:t<=2:t===1})},Fie=/(?:^|\/){{locale}}(?:\/|$)/,Df=e=>e.includes(`{{locale}}`),Iie=e=>e.split(`{{locale}}`).length===2&&Fie.test(e),Of=e=>{let t=e.indexOf(`{{locale}}`);if(t===-1)return;let n=e.slice(0,t),r=e.slice(t+10);if(n===``||n.endsWith(`/`))return r.startsWith(`/`)?`${n}${r.slice(1)}`:r===``?n.endsWith(`//`)?void 0:n.length>1?n.slice(0,-1):n:/^\.(?:[^./][^/]*\.|{{)/.test(r)?`${n}${r.slice(1)}`:void 0;if(/[^/]\.$/.test(n)&&/^(?:[./]|$)/.test(r))return`${n.slice(0,-1)}${r}`},Lie=e=>Of(e)!==void 0,Rie=({path:e,locale:t,omitLocale:n=!1})=>(n&&(e=Of(e)??e),e.replaceAll(`{{locale}}`,t)),kf=(e,t)=>`${e}/`.split(`{{locale}}/`).map(zc).join(t),zie=new Map,Bie=(e,t)=>e.replace(Ll(zie,t,()=>RegExp(`^${kf(t,`(?:[^/]+\\/)?`)}`)),``),Vie={type:`language`,languageDisplay:`standard`,style:`short`,fallback:`none`},Af=e=>{let t;if(e!==`_default`)try{[t]=Intl.getCanonicalLocales(e)}catch{}return t},jf=e=>e===`_default`?`auto`:kc(e)?`rtl`:`ltr`,Hie=new Map,Mf=(e,{displayLocale:t=Af(Ac.current??`en`),formatterOptions:n=Vie}={})=>{let r=Af(e);if(!r)return;let i=t?Ll(Hie,t,()=>new Intl.DisplayNames(t,n)):new Intl.DisplayNames(void 0,n);try{let e=i.of(r);if(!e)return;let[n,...a]=e;return[n.toLocaleUpperCase(t),...a].join(``)}catch(e){console.error(e);return}},Uie=new Map,Nf=(e,t={})=>{let n={style:`narrow`,type:`conjunction`,...t};return Ll(Uie,`${e}|${n.style}|${n.type}`,()=>{let t=new Intl.ListFormat(Af(e),n);return{format:e=>t.format([...e].filter(e=>e!=null).map(e=>`${e}`))}})},Pf=({_i18n:e,locale:t,path:n})=>{let{defaultLocale:r,omitDefaultLocaleFromFilePath:i}=e;return Rie({path:n,locale:t,omitLocale:i&&t===r})},Ff=({extension:e,format:t})=>(t?qd.get(t)?.extension:void 0)||e||(t?wie[t]??`md`:`md`),If=({extension:e,format:t})=>t||(pf.includes(e)?`frontmatter`:mf[e]??`yaml-frontmatter`),Wie=({subPath:e,indexFileName:t,nestedDepth:n,entrySuffix:r=``,indexSuffix:i=``})=>{let a=t?zc(t):``,o=!!a&&!!i,s=a&&!o?`|${a}`:``,c;if(!e)c=n===void 0?`[^/]+?`:`[^/]+?(?:\\/[^/]+?)${Number.isFinite(n)?`{0,${Math.max(0,n-1)}}`:`*`}`;else{let t=`${cf(e,`[^/]+?`)}${s}`;if(n===void 0)c=t;else{let r=Number.isFinite(n)?Math.max(0,n-e.split(`/`).length):void 0;c=`${r===void 0?`(?:[^/]+\\/)*`:`(?:[^/]+\\/){0,${r}}`}(?:${t})`}}return o?`(?${`(?!${a}${r})`}(?:${c})${r}|${a}${i})`:`(?${c})`},Gie=({extension:e,format:t,basePath:n,subPath:r,indexFileName:i,indexFileExtension:a,nestedDepth:o,_i18n:s})=>{let{allLocales:c,defaultLocale:l,omitDefaultLocaleFromFilePath:u,structureMap:{i18nMultiFile:d,i18nMultiFolder:f,i18nMultiRootFolder:p}}=s,m=c.map(zc).join(`|`),h=c.filter(e=>e!==l).map(zc).join(`|`),g=`(?${m})`,_=u?`(?:(?${h})\\/)?`:`${g}\\/`,v=u?`(?:\\.(?${h}))?`:`\\.${g}`,y=!!n&&Df(n),b=y?kf(n,_):n?`${zc(n)}\\/`:``,x=Ff({format:t,extension:e}),S=i&&a!==void 0&&a!==x?a:void 0,C=e=>{let t=u?`(?:\\.(?:${h}))?`:`\\.(?:${m})`;return`(?=${d?t:``}\\.${zc(e)}$)`},w=[`^`,p&&!y?_:``,b,f&&!y?_:``,Wie({subPath:r,indexFileName:i,nestedDepth:o,entrySuffix:S?C(x):``,indexSuffix:S?C(S):``}),d?v:``,`\\.`,S?`(?:${zc(x)}|${zc(S)})`:zc(x),`$`].join(``);return new RegExp(w)},Lf=({format:e,delimiter:t})=>qu(t)?[t,t]:Array.isArray(t)&&t.length===2?t:hf[e]??void 0,Kie=({indexFile:e,extension:t,format:n})=>{if(!e)return;let{extension:r,format:i}=e;if(r===void 0&&i===void 0)return;let a=Ff({extension:r,format:i}),o=If({extension:a,format:i}),s=Ff({extension:t,format:n}),c=If({extension:s,format:n});if(a!==s||o!==c)return{extension:a,format:o}},qie=({rawCollection:e,file:t,_i18n:n})=>{let{folder:r,file:i,path:a,extension:o,format:s,frontmatter_delimiter:c,body_field:l,yaml_quote:u}=e,d=Md(e),f=d&&typeof i==`string`,p=t?.file?Vc(t.file):f?Vc(i):void 0,m=p?qc(p).extension:o,h=t?.format??s,g=Ff({format:h,extension:m}),_=If({format:h,extension:g}),v=t?.frontmatter_delimiter??c,y=d&&!f,b=y?Vc(r):void 0,x=y?uf(e):void 0,S=x?.name,C=y?yf(e)?.depth:void 0,w=Kie({indexFile:x,extension:o,format:s}),T={extension:g,format:_,basePath:b,subPath:y?a:void 0,fullPathRegEx:b===void 0?void 0:Gie({extension:g,format:_,basePath:b,subPath:a,indexFileName:S,indexFileExtension:w?.extension,nestedDepth:C,_i18n:n}),fullPath:p?Pf({_i18n:n,locale:n.defaultLocale,path:p}):void 0,fmDelimiters:Lf({format:_,delimiter:v}),bodyField:t?.body_field??l,yamlQuote:!!u};return f&&(T.arrayFile=!0),w&&(T.indexFile={...T,...w,fmDelimiters:Lf({format:w.format,delimiter:v})}),T},Rf=({collection:e,collectionFile:t,isIndexFile:n=!1})=>{let{_file:r}=t??e;return(n?r.indexFile:void 0)??r},zf={SINGLE_FILE:`single_file`,SINGLE_FILE_DEFAULT_ROOT:`single_file_default_root`,MULTIPLE_FILES:`multiple_files`,MULTIPLE_FOLDERS:`multiple_folders`,MULTIPLE_FOLDERS_I18N_ROOT:`multiple_folders_i18n_root`,MULTIPLE_ROOT_FOLDERS:`multiple_root_folders`},Jie=[zf.MULTIPLE_FOLDERS_I18N_ROOT,zf.MULTIPLE_ROOT_FOLDERS],Bf={key:`translationKey`,value:`{{slug}}`},Vf=({cmsConfig:e,collection:t,file:n})=>{let r=e?.i18n;if(!X(r))return;let i=structuredClone(r),{name:a,i18n:o}=t;if(o||a===`_singletons`){if(X(o)&&Object.assign(i,o),n){if(!n.i18n)return;X(n.i18n)&&Object.assign(i,n.i18n)}return i}},Yie=e=>e?.omit_default_locale_from_file_path??e?.omit_default_locale_from_filename??!1,Xie={i18nEnabled:!1,saveAllLocales:!0,allLocales:[`_default`],initialLocales:[`_default`],defaultLocale:`_default`,structure:zf.SINGLE_FILE,structureMap:{i18nSingleFile:!1,i18nSingleFileDefaultRoot:!1,i18nMultiFile:!1,i18nMultiFolder:!1,i18nMultiRootFolder:!1},canonicalSlug:{...Bf},omitDefaultLocaleFromFilePath:!1,omitDefaultLocaleFromPreviewPath:!1},Hf=e=>(e?.collectionFile??e?.collection)?._i18n??Xie,Zie=(e,t,n,r)=>!t&&typeof r!=`string`?typeof n==`string`&&Df(n)?zf.MULTIPLE_FOLDERS:e:t?.file.includes(`{{locale}}`)?zf.MULTIPLE_FILES:e===zf.SINGLE_FILE_DEFAULT_ROOT?zf.SINGLE_FILE_DEFAULT_ROOT:zf.SINGLE_FILE,Qie=(e,t)=>({i18nSingleFile:e&&t===zf.SINGLE_FILE,i18nSingleFileDefaultRoot:e&&t===zf.SINGLE_FILE_DEFAULT_ROOT,i18nMultiFile:e&&t===zf.MULTIPLE_FILES,i18nMultiFolder:e&&t===zf.MULTIPLE_FOLDERS,i18nMultiRootFolder:e&&(t===zf.MULTIPLE_FOLDERS_I18N_ROOT||t===zf.MULTIPLE_ROOT_FOLDERS)}),Uf=({i18nSingleFile:e,i18nSingleFileDefaultRoot:t})=>!!e||!!t,Wf=({i18nMultiFile:e,i18nMultiFolder:t,i18nMultiRootFolder:n})=>!!e||!!t||!!n,$ie=(e,t,n)=>e?n&&t.includes(n)?n:t[0]:`_default`,eae=(e,t,n)=>e===`all`?t:e==="default"?[n]:t.filter(t=>t===n||!Array.isArray(e)||e.includes(t)),tae=(e,t,n)=>e?n?Lie(n.file):Wf(t):!1,Gf=(e,t)=>{let{structure:n=zf.SINGLE_FILE,locales:r=[],default_locale:i,initial_locales:a,save_all_locales:o=!0,canonical_slug:s={key:void 0,value:void 0},omit_default_locale_from_filename:c,omit_default_locale_from_file_path:l=c??!1,omit_default_locale_from_preview_path:u=!1}=Vf({cmsConfig:jl.current,collection:e,file:t})??{},{key:d=Bf.key,value:f=Bf.value}=s,p=r.length>0,m=p?r:[`_default`],h=$ie(p,m,i),{folder:g,file:_}=e,v=Zie(n,t,g,_),y=Qie(p,v),b=!p||o===!0&&a===void 0,x=eae(a,m,h),S=tae(l,y,t);return{i18nEnabled:p,saveAllLocales:b,allLocales:m,defaultLocale:h,initialLocales:x,structure:v,structureMap:y,canonicalSlug:{key:d,value:f},omitDefaultLocaleFromFilePath:S,omitDefaultLocaleFromPreviewPath:u}},nae=e=>{if(!e)return;let t=Object.values(e);if(t.some(e=>e.config?.multiple===!0))return!0;if(t.some(e=>e.config?.multiple===!1))return!1},rae=e=>{if(!e?.config)return;let{multiple:t}=e.config;if(typeof t==`boolean`)return t},Kf=e=>{let t=jl.current;return e.multiple??nae(e.media_libraries)??rae(e.media_library)??nae(t?.media_libraries)??rae(t?.media_library)??!1},qf=al(),Jf=new Map,Yf=({collections:e=jl.current?.collections??[],visible:t,type:n}={})=>e.filter(e=>cie(e,{visible:t,type:n})),iae=()=>Yf({visible:!0})[0],aae=e=>{if(!Md(e))return[];let{fields:t,thumbnail:n=!0}=e;return n===!1?[]:typeof n==`string`?[n]:Array.isArray(n)?n:t?.length?t.filter(({widget:e=`string`})=>Vd.includes(e)).map(e=>Kf(e)?`${e.name}.*`:e.name):[]},oae=(e,t)=>({...e,_i18n:t,_type:`entry`,_file:qie({rawCollection:e,_i18n:t}),_thumbnailFieldNames:aae(e)}),sae=(e,t,n)=>({...e,_i18n:t,_type:Pd(e)?`singleton`:`file`,_fileMap:Object.fromEntries(n.filter(Id).map(t=>{let n=Gf(e,t),r=qie({rawCollection:e,file:t,_i18n:n});return[t.name,{...t,_file:r,_i18n:n}]}))}),cae=()=>{let e=jl.current?.singletons;if(!Array.isArray(e))return;let t=Ld(e).map(e=>({...e,file:Vc(e.file)}));if(!t.length)return;let n={name:`_singletons`,files:t};return sae(n,Gf(n),t)},Xf=e=>{let t=Jf.get(e);if(t)return t;if(e===`_singletons`){let t=cae();return Jf.set(e,t),t}let n=Yf().find(t=>t.name===e);if(!n){Jf.set(e,void 0);return}let r=Md(n)?n:void 0,i=Nd(n)?n:void 0;if(!r&&!i){Jf.set(e,void 0);return}r?(typeof r.folder==`string`&&(r.folder=Vc(r.folder)),typeof r.file==`string`&&(r.file=Vc(r.file))):i?.files.forEach(e=>{e.file&&=Vc(e.file)});let a=Gf(n),o=r?oae(r,a):sae(i,a,i.files);return Jf.set(e,o),o},Zf=(e,{useSingular:t=!1}={})=>{let{_type:n,name:r,label:i,label_singular:a}=e;return n===`singleton`?Y(`files`):t&&a?a:i||r},lae=e=>e?e===`_singletons`?9999999:jl.current?.collections?.findIndex(({name:t})=>t===e)??-1:-1,Qf=al(),$f=sl(()=>!!Qf.current),ep=al(!1),uae=e=>e?.message===`entry_already_published`,tp=e=>e?`${e.owner}/${e.repo}`:``,dae=(e,t)=>{let{repoURL:n,owner:r,repo:i}=e??{};return!t||!n?``:n.slice(0,-`${r}/${i}`.length)+tp(t)},np=al(),fae=async e=>ll(np,{repo:e},!1),pae={create:`Create {{collection}} “{{slug}}”`,update:`Update {{collection}} “{{slug}}”`,delete:`Delete {{collection}} “{{slug}}”`,uploadMedia:`Upload “{{path}}”`,deleteMedia:`Delete “{{path}}”`,openAuthoring:`{{message}}`},mae=/\[(?:skip[ -](?:ci|actions)|(?:ci|actions)[ -]skip|no[ -]ci|cf-pages-skip)\]/i,hae=e=>mae.test(e),rp=(e,t)=>e.replace(/\{\{([\w-]+)\}\}/g,(e,n)=>Object.hasOwn(t,n)?t[n]:e),ip=()=>jl.current?.backend??{},gae=()=>{let{email:e=``,login:t=``,name:n=``}=zu.account;return{"author-email":e,"author-login":t,"author-name":n}},_ae=(e,{commitType:t=`update`,collection:n},r=ip())=>{let{commit_messages:i={}}=r,[a=``]=e.map(e=>e.slug).filter(Boolean),[o,...s]=e.map(({path:e})=>e),c=n?Zf(n,{useSingular:!0}):``,l=i[t]||pae[t]||``,u=gae();return[`create`,`update`,`delete`].includes(t)&&(l=rp(l,{slug:a,collection:c,path:o,...u})),[`uploadMedia`,`deleteMedia`].includes(t)&&(l=rp(l,{path:o,...u})),s.length&&(l+=` +${s.length}`),l},vae=(e,t,n)=>{let r=t?.trim();return r?n===!0?r:n===`prefix`?`${r} ${e}`:n===`suffix`?`${e} ${r}`:e:e},ap=({commitType:e,skipCI:t})=>{let{skip_ci:n,automatic_deployments:r}=ip();return e===`delete`||e===`deleteMedia`||!(t??(n===!0||r===!1))},op=(e,t)=>{let{userMessage:n}=t,r=ip(),{commit_messages:i={},prompt_commit_messages:a}=r,o=vae(_ae(e,t,r),n,a);return $f.current&&(o=rp(i.openAuthoring||pae.openAuthoring,{message:o,...gae()})),ap(t)||(o=`[skip ci] ${o}`),o},yae=/^[A-Za-z0-9-]+:\s*\S/,sp=e=>(e??``).replace(/[\s<>]+/g,` `).trim(),bae=new WeakSet,xae=e=>{if(!ip().signoff_commits)return e;let{account:t}=zu,{email:n,login:r,name:i}=t,a=sp(n);if(!a)return bae.has(t)||(bae.add(t),console.warn("The `signoff_commits` option is enabled, but the Git host doesn’t share your email address, so commits are made without a `Signed-off-by` trailer.")),e;let o=sp(i)||sp(r)||a,s=e.trimEnd(),c=`<${a}>`.toLowerCase();if(s.split(/\r?\n/).some(e=>{let t=e.trim().toLowerCase();return t.startsWith(`signed-off-by:`)&&t.endsWith(c)}))return e;let l=s.split(/\r?\n\s*\r?\n/),u=l.at(-1);return`${s}${l.length>1&&u.split(/\r?\n/).every(e=>yae.test(e))?` `:` `}Signed-off-by: ${o} <${a}>`},Sae=e=>{let t=new Map;return e.forEach(e=>{t.has(e.sha)||t.set(e.sha,e)}),[...t.values()].sort((e,t)=>t.date.getTime()-e.date.getTime())},cp=(e,t)=>wl(`Failed to retrieve the last commit hash.`,e,t),Cae=async(e,t)=>{let n=await t().catch(()=>void 0);if(n&&n.hash!==e)throw wl(`The branch has moved since the site data was loaded.`,`save_conflict.branch_moved`)},wae=async(e,t,n)=>Sae((await jd(e,t)).flat().map(n)),Tae=/netlify|vercel|cloudflare|workers|deploy|preview|pages|render|surge|amplify|firebase/i,Eae=/prod/i,Dae=/canceled|cancelled|skipped|no (?:changes|build)/i,Oae={deployment:2,status:1,check:0},kae=()=>{let{backend:e}=jl.current??{};return(e??{}).preview_context??``},Aae=e=>{if(!e)return;let t;try{t=new URL(e)}catch{return}if(t.protocol===`https:`)return t.href.replace(/\/$/,``)},jae=(e,t)=>{if(!e)return;let n=``;try{n=new URL(t??``).host}catch{}return(e.match(/https:\/\/[^\s"'<>)\]]+/g)??[]).map(e=>Aae(e)).find(e=>!!e&&new URL(e).host!==n)},Mae=(e,t)=>{try{return new URL(e).host===new URL(t).host}catch{return!1}},Nae=({name:e,source:t},n)=>!!n||t===`deployment`||Tae.test(e),Pae=(e,t)=>e.source!==`check`||Nae(e,t),Fae=(e,{kind:t,previewContext:n})=>{let{name:r,url:i,state:a,source:o}=e,s=Eae.test(r);return(Nae(e,n)?0:-64)+(i?32:0)+(a===`ready`?16:0)+Oae[o]*4+(t===`production`===s?2:0)+ +!!Tae.test(r)},Iae=(e,{kind:t,selfURL:n})=>{let r=kae(),i=e;if(r){let e=r.toLowerCase(),t=i.filter(({name:t})=>t.toLowerCase()===e);i=t.length?t:i.filter(({name:t})=>t.toLowerCase().includes(e))}if(i=i.filter(({description:e})=>!e||!Dae.test(e)),i=i.map(e=>({...e,url:e.state===`ready`&&Pae(e,r)&&!Mae(e.url,n)?Aae(e.url):void 0})),!i.length)return{state:`unknown`,checkedTime:Date.now()};let[a]=i.map((e,n)=>({candidate:e,index:n,score:Fae(e,{kind:t,previewContext:r})})).sort((e,t)=>t.score-e.score||t.index-e.index).map(({candidate:e})=>e);return{state:a.state,url:a.url,context:a.name,checkedTime:Date.now()}},lp=(e,t,n,r)=>{t?.forEach(t=>{let i=n(t);i&&e.push({...r(t),state:i})})},Lae=async e=>{try{await e()}catch(e){console.warn(`Failed to fetch the deployment info.`,e)}},Rae=async(e,{collect:t,selfURL:n})=>{let r=e.filter(({sha:e})=>!!e),i=[...new Set(r.map(({sha:e})=>e))];if(!i.length)return{};let a=Object.fromEntries(i.map(e=>[e,[]]));return await t(i,a),Object.fromEntries(r.map(({sha:e,kind:t})=>[e,Iae(a[e],{kind:t,selfURL:n})]))},zae=async(e,t)=>{if(e)return(await sd(t(e)))?.commit?.id??void 0},Bae=4,Vae=/^[\da-f]{40,64}$/,Hae=(e,t)=>{let n=Bl(Bae);return{fetchDirSHA:async(r,i)=>{let a=`${e.owner}/${e.repo}:${r}:${i}`;if(n.has(a))return n.get(a);let o=await t(r,i);return Vae.test(r)&&n.set(a,o),o},resetDirLookups:()=>{n.clear()}}},up=e=>(e.catch(()=>{}),e),dp=al(``),fp={current:0},pp=()=>{let e=fp.current;return()=>e!==fp.current},mp={"application/andrew-inset":[`ez`],"application/appinstaller":[`appinstaller`],"application/applixware":[`aw`],"application/appx":[`appx`],"application/appxbundle":[`appxbundle`],"application/atom+xml":[`atom`],"application/atomcat+xml":[`atomcat`],"application/atomdeleted+xml":[`atomdeleted`],"application/atomsvc+xml":[`atomsvc`],"application/atsc-dwd+xml":[`dwd`],"application/atsc-held+xml":[`held`],"application/atsc-rsat+xml":[`rsat`],"application/automationml-aml+xml":[`aml`],"application/automationml-amlx+zip":[`amlx`],"application/bdoc":[`bdoc`],"application/calendar+xml":[`xcs`],"application/ccxml+xml":[`ccxml`],"application/cdfx+xml":[`cdfx`],"application/cdmi-capability":[`cdmia`],"application/cdmi-container":[`cdmic`],"application/cdmi-domain":[`cdmid`],"application/cdmi-object":[`cdmio`],"application/cdmi-queue":[`cdmiq`],"application/cpl+xml":[`cpl`],"application/cu-seeme":[`cu`],"application/cwl":[`cwl`],"application/dash+xml":[`mpd`],"application/dash-patch+xml":[`mpp`],"application/davmount+xml":[`davmount`],"application/dicom":[`dcm`],"application/docbook+xml":[`dbk`],"application/dssc+der":[`dssc`],"application/dssc+xml":[`xdssc`],"application/ecmascript":[`ecma`],"application/emma+xml":[`emma`],"application/emotionml+xml":[`emotionml`],"application/epub+zip":[`epub`],"application/exi":[`exi`],"application/express":[`exp`],"application/fdf":[`fdf`],"application/fdt+xml":[`fdt`],"application/font-tdpfr":[`pfr`],"application/geo+json":[`geojson`],"application/gml+xml":[`gml`],"application/gpx+xml":[`gpx`],"application/gxf":[`gxf`],"application/gzip":[`gz`],"application/hjson":[`hjson`],"application/hyperstudio":[`stk`],"application/inkml+xml":[`ink`,`inkml`],"application/ipfix":[`ipfix`],"application/its+xml":[`its`],"application/java-archive":[`jar`,`war`,`ear`],"application/java-serialized-object":[`ser`],"application/java-vm":[`class`],"application/javascript":[`*js`],"application/json":[`json`,`map`],"application/json5":[`json5`],"application/jsonml+json":[`jsonml`],"application/ld+json":[`jsonld`],"application/lgr+xml":[`lgr`],"application/lost+xml":[`lostxml`],"application/mac-binhex40":[`hqx`],"application/mac-compactpro":[`cpt`],"application/mads+xml":[`mads`],"application/manifest+json":[`webmanifest`],"application/marc":[`mrc`],"application/marcxml+xml":[`mrcx`],"application/mathematica":[`ma`,`nb`,`mb`],"application/mathml+xml":[`mathml`],"application/mbox":[`mbox`],"application/media-policy-dataset+xml":[`mpf`],"application/mediaservercontrol+xml":[`mscml`],"application/metalink+xml":[`metalink`],"application/metalink4+xml":[`meta4`],"application/mets+xml":[`mets`],"application/mmt-aei+xml":[`maei`],"application/mmt-usd+xml":[`musd`],"application/mods+xml":[`mods`],"application/mp21":[`m21`,`mp21`],"application/mp4":[`*mp4`,`*mpg4`,`mp4s`,`m4p`],"application/msix":[`msix`],"application/msixbundle":[`msixbundle`],"application/msword":[`doc`,`dot`],"application/mxf":[`mxf`],"application/n-quads":[`nq`],"application/n-triples":[`nt`],"application/node":[`cjs`],"application/octet-stream":[`bin`,`dms`,`lrf`,`mar`,`so`,`dist`,`distz`,`pkg`,`bpk`,`dump`,`elc`,`deploy`,`exe`,`dll`,`deb`,`dmg`,`iso`,`img`,`msi`,`msp`,`msm`,`buffer`],"application/oda":[`oda`],"application/oebps-package+xml":[`opf`],"application/ogg":[`ogx`],"application/omdoc+xml":[`omdoc`],"application/onenote":[`onetoc`,`onetoc2`,`onetmp`,`onepkg`,`one`,`onea`],"application/oxps":[`oxps`],"application/p2p-overlay+xml":[`relo`],"application/patch-ops-error+xml":[`xer`],"application/pdf":[`pdf`],"application/pgp-encrypted":[`pgp`],"application/pgp-keys":[`asc`],"application/pgp-signature":[`sig`,`*asc`],"application/pics-rules":[`prf`],"application/pkcs10":[`p10`],"application/pkcs7-mime":[`p7m`,`p7c`],"application/pkcs7-signature":[`p7s`],"application/pkcs8":[`p8`],"application/pkix-attr-cert":[`ac`],"application/pkix-cert":[`cer`],"application/pkix-crl":[`crl`],"application/pkix-pkipath":[`pkipath`],"application/pkixcmp":[`pki`],"application/pls+xml":[`pls`],"application/postscript":[`ai`,`eps`,`ps`],"application/provenance+xml":[`provx`],"application/pskc+xml":[`pskcxml`],"application/raml+yaml":[`raml`],"application/rdf+xml":[`rdf`,`owl`],"application/reginfo+xml":[`rif`],"application/relax-ng-compact-syntax":[`rnc`],"application/resource-lists+xml":[`rl`],"application/resource-lists-diff+xml":[`rld`],"application/rls-services+xml":[`rs`],"application/route-apd+xml":[`rapd`],"application/route-s-tsid+xml":[`sls`],"application/route-usd+xml":[`rusd`],"application/rpki-ghostbusters":[`gbr`],"application/rpki-manifest":[`mft`],"application/rpki-roa":[`roa`],"application/rsd+xml":[`rsd`],"application/rss+xml":[`rss`],"application/rtf":[`rtf`],"application/sbml+xml":[`sbml`],"application/scvp-cv-request":[`scq`],"application/scvp-cv-response":[`scs`],"application/scvp-vp-request":[`spq`],"application/scvp-vp-response":[`spp`],"application/sdp":[`sdp`],"application/senml+xml":[`senmlx`],"application/sensml+xml":[`sensmlx`],"application/set-payment-initiation":[`setpay`],"application/set-registration-initiation":[`setreg`],"application/shf+xml":[`shf`],"application/sieve":[`siv`,`sieve`],"application/smil+xml":[`smi`,`smil`],"application/sparql-query":[`rq`],"application/sparql-results+xml":[`srx`],"application/sql":[`sql`],"application/srgs":[`gram`],"application/srgs+xml":[`grxml`],"application/sru+xml":[`sru`],"application/ssdl+xml":[`ssdl`],"application/ssml+xml":[`ssml`],"application/swid+xml":[`swidtag`],"application/tei+xml":[`tei`,`teicorpus`],"application/thraud+xml":[`tfi`],"application/timestamped-data":[`tsd`],"application/toml":[`toml`],"application/trig":[`trig`],"application/ttml+xml":[`ttml`],"application/ubjson":[`ubj`],"application/urc-ressheet+xml":[`rsheet`],"application/urc-targetdesc+xml":[`td`],"application/voicexml+xml":[`vxml`],"application/wasm":[`wasm`],"application/watcherinfo+xml":[`wif`],"application/widget":[`wgt`],"application/winhlp":[`hlp`],"application/wsdl+xml":[`wsdl`],"application/wspolicy+xml":[`wspolicy`],"application/xaml+xml":[`xaml`],"application/xcap-att+xml":[`xav`],"application/xcap-caps+xml":[`xca`],"application/xcap-diff+xml":[`xdf`],"application/xcap-el+xml":[`xel`],"application/xcap-ns+xml":[`xns`],"application/xenc+xml":[`xenc`],"application/xfdf":[`xfdf`],"application/xhtml+xml":[`xhtml`,`xht`],"application/xliff+xml":[`xlf`],"application/xml":[`xml`,`xsl`,`xsd`,`rng`],"application/xml-dtd":[`dtd`],"application/xop+xml":[`xop`],"application/xproc+xml":[`xpl`],"application/xslt+xml":[`*xsl`,`xslt`],"application/xspf+xml":[`xspf`],"application/xv+xml":[`mxml`,`xhvml`,`xvml`,`xvm`],"application/yang":[`yang`],"application/yin+xml":[`yin`],"application/zip":[`zip`],"application/zip+dotlottie":[`lottie`],"audio/3gpp":[`*3gpp`],"audio/aac":[`adts`,`aac`],"audio/adpcm":[`adp`],"audio/amr":[`amr`],"audio/basic":[`au`,`snd`],"audio/midi":[`mid`,`midi`,`kar`,`rmi`],"audio/mobile-xmf":[`mxmf`],"audio/mp3":[`*mp3`],"audio/mp4":[`m4a`,`mp4a`,`m4b`],"audio/mpeg":[`mpga`,`mp2`,`mp2a`,`mp3`,`m2a`,`m3a`],"audio/ogg":[`oga`,`ogg`,`spx`,`opus`],"audio/s3m":[`s3m`],"audio/silk":[`sil`],"audio/wav":[`wav`],"audio/wave":[`*wav`],"audio/webm":[`weba`],"audio/xm":[`xm`],"font/collection":[`ttc`],"font/otf":[`otf`],"font/ttf":[`ttf`],"font/woff":[`woff`],"font/woff2":[`woff2`],"image/aces":[`exr`],"image/apng":[`apng`],"image/avci":[`avci`],"image/avcs":[`avcs`],"image/avif":[`avif`],"image/bmp":[`bmp`,`dib`],"image/cgm":[`cgm`],"image/dicom-rle":[`drle`],"image/dpx":[`dpx`],"image/emf":[`emf`],"image/fits":[`fits`],"image/g3fax":[`g3`],"image/gif":[`gif`],"image/heic":[`heic`],"image/heic-sequence":[`heics`],"image/heif":[`heif`],"image/heif-sequence":[`heifs`],"image/hej2k":[`hej2`],"image/ief":[`ief`],"image/jaii":[`jaii`],"image/jais":[`jais`],"image/jls":[`jls`],"image/jp2":[`jp2`,`jpg2`],"image/jpeg":[`jpg`,`jpeg`,`jpe`],"image/jph":[`jph`],"image/jphc":[`jhc`],"image/jpm":[`jpm`,`jpgm`],"image/jpx":[`jpx`,`jpf`],"image/jxl":[`jxl`],"image/jxr":[`jxr`],"image/jxra":[`jxra`],"image/jxrs":[`jxrs`],"image/jxs":[`jxs`],"image/jxsc":[`jxsc`],"image/jxsi":[`jxsi`],"image/jxss":[`jxss`],"image/ktx":[`ktx`],"image/ktx2":[`ktx2`],"image/pjpeg":[`jfif`],"image/png":[`png`],"image/sgi":[`sgi`],"image/svg+xml":[`svg`,`svgz`],"image/t38":[`t38`],"image/tiff":[`tif`,`tiff`],"image/tiff-fx":[`tfx`],"image/webp":[`webp`],"image/wmf":[`wmf`],"message/disposition-notification":[`disposition-notification`],"message/global":[`u8msg`],"message/global-delivery-status":[`u8dsn`],"message/global-disposition-notification":[`u8mdn`],"message/global-headers":[`u8hdr`],"message/rfc822":[`eml`,`mime`,`mht`,`mhtml`],"model/3mf":[`3mf`],"model/gltf+json":[`gltf`],"model/gltf-binary":[`glb`],"model/iges":[`igs`,`iges`],"model/jt":[`jt`],"model/mesh":[`msh`,`mesh`,`silo`],"model/mtl":[`mtl`],"model/obj":[`obj`],"model/prc":[`prc`],"model/step":[`step`,`stp`,`stpnc`,`p21`,`210`],"model/step+xml":[`stpx`],"model/step+zip":[`stpz`],"model/step-xml+zip":[`stpxz`],"model/stl":[`stl`],"model/u3d":[`u3d`],"model/vrml":[`wrl`,`vrml`],"model/x3d+binary":[`*x3db`,`x3dbz`],"model/x3d+fastinfoset":[`x3db`],"model/x3d+vrml":[`*x3dv`,`x3dvz`],"model/x3d+xml":[`x3d`,`x3dz`],"model/x3d-vrml":[`x3dv`],"text/cache-manifest":[`appcache`,`manifest`],"text/calendar":[`ics`,`ifb`],"text/coffeescript":[`coffee`,`litcoffee`],"text/css":[`css`],"text/csv":[`csv`],"text/html":[`html`,`htm`,`shtml`],"text/jade":[`jade`],"text/javascript":[`js`,`mjs`],"text/jsx":[`jsx`],"text/less":[`less`],"text/markdown":[`md`,`markdown`],"text/mathml":[`mml`],"text/mdx":[`mdx`],"text/n3":[`n3`],"text/plain":[`txt`,`text`,`conf`,`def`,`list`,`log`,`in`,`ini`],"text/richtext":[`rtx`],"text/rtf":[`*rtf`],"text/sgml":[`sgml`,`sgm`],"text/shex":[`shex`],"text/slim":[`slim`,`slm`],"text/spdx":[`spdx`],"text/stylus":[`stylus`,`styl`],"text/tab-separated-values":[`tsv`],"text/troff":[`t`,`tr`,`roff`,`man`,`me`,`ms`],"text/turtle":[`ttl`],"text/uri-list":[`uri`,`uris`,`urls`],"text/vcard":[`vcard`],"text/vtt":[`vtt`],"text/wgsl":[`wgsl`],"text/xml":[`*xml`],"text/yaml":[`yaml`,`yml`],"video/3gpp":[`3gp`,`3gpp`],"video/3gpp2":[`3g2`],"video/h261":[`h261`],"video/h263":[`h263`],"video/h264":[`h264`],"video/iso.segment":[`m4s`],"video/jpeg":[`jpgv`],"video/jpm":[`*jpm`,`*jpgm`],"video/mj2":[`mj2`,`mjp2`],"video/mp2t":[`ts`,`m2t`,`m2ts`,`mts`],"video/mp4":[`mp4`,`mp4v`,`mpg4`],"video/mpeg":[`mpeg`,`mpg`,`mpe`,`m1v`,`m2v`],"video/ogg":[`ogv`],"video/quicktime":[`qt`,`mov`],"video/webm":[`webm`]};Object.freeze(mp);var hp=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},gp,_p,vp,yp=class{constructor(...e){gp.set(this,new Map),_p.set(this,new Map),vp.set(this,new Map);for(let t of e)this.define(t)}define(e,t=!1){for(let[n,r]of Object.entries(e)){n=n.toLowerCase(),r=r.map(e=>e.toLowerCase());let e=hp(this,vp,`f`).get(n);e||(e=new Set,hp(this,vp,`f`).set(n,e));let i=!0;for(let a of r){let r=a.startsWith(`*`);if(a=r?a.slice(1):a,e.add(a),i&&hp(this,_p,`f`).set(n,a),i=!1,r)continue;let o=hp(this,gp,`f`).get(a);if(o&&o!=n&&!t)throw Error(`"${n} -> ${a}" conflicts with "${o} -> ${a}". Pass \`force=true\` to override this definition.`);hp(this,gp,`f`).set(a,n)}}return this}getType(e){if(typeof e!=`string`)return null;let t=e.replace(/^.*[/\\]/s,``).toLowerCase(),n=t.replace(/^.*\./s,``).toLowerCase(),r=t.length{throw Error(`define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances`)},Object.freeze(this),this}_getTestState(){return{types:hp(this,gp,`f`),extensions:hp(this,_p,`f`)}}};gp=new WeakMap,_p=new WeakMap,vp=new WeakMap,new yp(mp)._freeze();var bp=new yp(mp,{"application/vnd.ms-excel":[`xls`,`xlm`,`xla`,`xlc`,`xlt`,`xlw`],"application/vnd.ms-powerpoint":[`ppt`,`pps`,`pot`],"application/vnd.oasis.opendocument.presentation":[`odp`],"application/vnd.oasis.opendocument.spreadsheet":[`ods`],"application/vnd.oasis.opendocument.text":[`odt`],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[`pptx`],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[`xlsx`],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[`docx`],"audio/vnd.dece.audio":[`uva`,`uvva`],"audio/vnd.digital-winds":[`eol`],"audio/vnd.dra":[`dra`],"audio/vnd.dts":[`dts`],"audio/vnd.dts.hd":[`dtshd`],"audio/vnd.lucent.voice":[`lvp`],"audio/vnd.ms-playready.media.pya":[`pya`],"audio/vnd.nuera.ecelp4800":[`ecelp4800`],"audio/vnd.nuera.ecelp7470":[`ecelp7470`],"audio/vnd.nuera.ecelp9600":[`ecelp9600`],"audio/vnd.rip":[`rip`],"audio/x-aac":[`*aac`],"audio/x-aiff":[`aif`,`aiff`,`aifc`],"audio/x-caf":[`caf`],"audio/x-flac":[`flac`],"audio/x-m4a":[`*m4a`],"audio/x-matroska":[`mka`],"audio/x-mpegurl":[`m3u`],"audio/x-ms-wax":[`wax`],"audio/x-ms-wma":[`wma`],"audio/x-pn-realaudio":[`ram`,`ra`],"audio/x-pn-realaudio-plugin":[`rmp`],"audio/x-realaudio":[`*ra`],"audio/x-wav":[`*wav`],"image/prs.btif":[`btif`,`btf`],"image/prs.pti":[`pti`],"image/vnd.adobe.photoshop":[`psd`],"image/vnd.airzip.accelerator.azv":[`azv`],"image/vnd.blockfact.facti":[`facti`],"image/vnd.dece.graphic":[`uvi`,`uvvi`,`uvg`,`uvvg`],"image/vnd.djvu":[`djvu`,`djv`],"image/vnd.dvb.subtitle":[`*sub`],"image/vnd.dwg":[`dwg`],"image/vnd.dxf":[`dxf`],"image/vnd.fastbidsheet":[`fbs`],"image/vnd.fpx":[`fpx`],"image/vnd.fst":[`fst`],"image/vnd.fujixerox.edmics-mmr":[`mmr`],"image/vnd.fujixerox.edmics-rlc":[`rlc`],"image/vnd.microsoft.icon":[`ico`],"image/vnd.ms-dds":[`dds`],"image/vnd.ms-modi":[`mdi`],"image/vnd.ms-photo":[`wdp`],"image/vnd.net-fpx":[`npx`],"image/vnd.pco.b16":[`b16`],"image/vnd.tencent.tap":[`tap`],"image/vnd.valve.source.texture":[`vtf`],"image/vnd.wap.wbmp":[`wbmp`],"image/vnd.xiff":[`xif`],"image/vnd.zbrush.pcx":[`pcx`],"image/x-3ds":[`3ds`],"image/x-adobe-dng":[`dng`],"image/x-cmu-raster":[`ras`],"image/x-cmx":[`cmx`],"image/x-freehand":[`fh`,`fhc`,`fh4`,`fh5`,`fh7`],"image/x-icon":[`*ico`],"image/x-jng":[`jng`],"image/x-mrsid-image":[`sid`],"image/x-ms-bmp":[`*bmp`],"image/x-pcx":[`*pcx`],"image/x-pict":[`pic`,`pct`],"image/x-portable-anymap":[`pnm`],"image/x-portable-bitmap":[`pbm`],"image/x-portable-graymap":[`pgm`],"image/x-portable-pixmap":[`ppm`],"image/x-rgb":[`rgb`],"image/x-tga":[`tga`],"image/x-xbitmap":[`xbm`],"image/x-xpixmap":[`xpm`],"image/x-xwindowdump":[`xwd`],"text/prs.lines.tag":[`dsc`],"text/vnd.curl":[`curl`],"text/vnd.curl.dcurl":[`dcurl`],"text/vnd.curl.mcurl":[`mcurl`],"text/vnd.curl.scurl":[`scurl`],"text/vnd.dvb.subtitle":[`sub`],"text/vnd.familysearch.gedcom":[`ged`],"text/vnd.fly":[`fly`],"text/vnd.fmi.flexstor":[`flx`],"text/vnd.graphviz":[`gv`],"text/vnd.in3d.3dml":[`3dml`],"text/vnd.in3d.spot":[`spot`],"text/vnd.sun.j2me.app-descriptor":[`jad`],"text/vnd.wap.wml":[`wml`],"text/vnd.wap.wmlscript":[`wmls`],"text/x-asm":[`s`,`asm`],"text/x-c":[`c`,`cc`,`cxx`,`cpp`,`h`,`hh`,`dic`],"text/x-component":[`htc`],"text/x-fortran":[`f`,`for`,`f77`,`f90`],"text/x-handlebars-template":[`hbs`],"text/x-java-source":[`java`],"text/x-lua":[`lua`],"text/x-markdown":[`mkd`],"text/x-nfo":[`nfo`],"text/x-opml":[`opml`],"text/x-org":[`*org`],"text/x-pascal":[`p`,`pas`],"text/x-processing":[`pde`],"text/x-sass":[`sass`],"text/x-scss":[`scss`],"text/x-setext":[`etx`],"text/x-sfv":[`sfv`],"text/x-suse-ymp":[`ymp`],"text/x-uuencode":[`uu`],"text/x-vcalendar":[`vcs`],"text/x-vcard":[`vcf`],"video/vnd.dece.hd":[`uvh`,`uvvh`],"video/vnd.dece.mobile":[`uvm`,`uvvm`],"video/vnd.dece.pd":[`uvp`,`uvvp`],"video/vnd.dece.sd":[`uvs`,`uvvs`],"video/vnd.dece.video":[`uvv`,`uvvv`],"video/vnd.dvb.file":[`dvb`],"video/vnd.fvt":[`fvt`],"video/vnd.mpegurl":[`mxu`,`m4u`],"video/vnd.ms-playready.media.pyv":[`pyv`],"video/vnd.uvvu.mp4":[`uvu`,`uvvu`],"video/vnd.vivo":[`viv`],"video/x-f4v":[`f4v`],"video/x-fli":[`fli`],"video/x-flv":[`flv`],"video/x-m4v":[`m4v`],"video/x-matroska":[`mkv`,`mk3d`,`mks`],"video/x-mng":[`mng`],"video/x-ms-asf":[`asf`,`asx`],"video/x-ms-vob":[`vob`],"video/x-ms-wm":[`wm`],"video/x-ms-wmv":[`wmv`],"video/x-ms-wmx":[`wmx`],"video/x-ms-wvx":[`wvx`],"video/x-msvideo":[`avi`],"video/x-sgi-movie":[`movie`],"video/x-smv":[`smv`]})._freeze(),xp=[`image`,`video`,`audio`],Sp=[`image`,`video`],Cp=e=>/\.pdf$/i.test(e),wp=e=>Sp.includes(e.kind)||Cp(e.name),Uae=[...xp,`document`,`other`],Wae=/\.(?:csv|docx?|odp|ods|odt|pdf|pptx?|rtf|xlsx?)$/i,Gae=/^(?image|video|audio)\//,Tp=e=>xp.includes(e),Ep=(e,t)=>{let n=bp.getType(t);return Tp(e)||n===`application/pdf`||!!n&&Kc(n)},Dp=e=>Ep(e.kind,e.path),Op=e=>{if(!e)return;let[t,n]=e.split(`/`);if(Tp(t)&&n&&!n.startsWith(`x-`))return t},kp=e=>{if(e.startsWith(`data:`))return Op(e.slice(5).split(/[;,]/)[0]);if(Uc(e)){let{hostname:t,pathname:n}=new URL(e);if(t.startsWith(`images.`))return`image`;e=n}return Op(bp.getType(e)??``)},Kae=async e=>{if(typeof e==`string`){if(!e.startsWith(`blob:`))return kp(e);try{return Op((await(await fetch(e)).blob()).type)}catch{return}}if(e instanceof Blob)return Op(e.type)},qae=e=>{let t=bp.getType(e.path);return!!t&&Kc(t)},Ap=e=>bp.getType(e)?.match(Gae)?.groups?.type??(Wae.test(e)?`document`:`other`),jp=al([]),Mp=sl(()=>jp.current.some(({workflow:e})=>e)?jp.current.filter(({workflow:e})=>!e):jp.current),Np=al([]),Jae=sl(()=>new Set(Np.current.map(e=>e.path))),Pp=al(),Yae=sl(()=>Np.current.length?[...Np.current]:Pp.current?[Pp.current]:[]),Fp=al(),Ip=al({folder:void 0,files:[]}),Lp=al(),Rp=al(),zp=/^(?:.+\/)?(\.git(?:attributes|ignore|keep))$/,Bp=al([]),Vp=({arrayIndex:e},t)=>e===void 0?t:`${t}#${e}`,Xae=({entries:e,previous:t,changedPaths:n})=>{if(!t.length)return e;let r=new Map(t.flatMap(e=>Object.values(e.locales).map(({path:t})=>[Vp(e,t),e]))),i=new Set;return e.map(e=>{let t=Object.values(e.locales).map(({path:e})=>e),a=t.map(t=>r.get(Vp(e,t))).find(e=>!!e&&!i.has(e));if(!a)return e;i.add(a);let o=Object.values(a.locales).map(({path:e})=>e);return t.length===o.length&&t.every(e=>o.includes(e)&&!n.has(e))?a:{...e,id:a.id}})},Zae=({assets:e,previous:t,changedPaths:n})=>{if(!t.length)return e;let r=new Map(t.map(e=>[e.path,e])),i=new Set(e.map(({path:e})=>e)),a=(e,t)=>{let{workflow:n}=e;return n.replacedAsset===t?e:{...e,workflow:{...n,replacedAsset:t}}};return[...e.map(e=>{let t=r.get(e.path),i=t?.workflow?t.workflow.replacedAsset:t,o=i&&!n.has(e.path)?i:e;return t?.workflow?a(t,o):o}),...t.filter(({path:e,workflow:t})=>!!t&&!i.has(e)).map(e=>a(e,void 0))]},Hp=al(!1),Up=al(),Wp=al([]),Gp=al([]),Qae=Wl(()=>Gp.current,e=>{let t=new Map;return e.forEach((e,n)=>{Object.values(e.locales).forEach(({path:r})=>{t.has(r)||t.set(r,{entry:e,index:n})})}),t}),Kp=e=>{let t=Qae(),n;return[...e].forEach(e=>{let r=t.get(e);r&&(!n||r.index{let n=typeof e==`string`?Xf(e):e;if(n&&`_fileMap`in n&&Object.hasOwn(n._fileMap,t))return n._fileMap[t]},Yp=(e,t)=>{let n=Xf(e);if(!n)return;let r=t?Jp(n,t):void 0;if(!t||r)return{collection:n,collectionFile:r}},Xp=e=>e.label||e.name,Zp=(e,t)=>`_fileMap`in e?Object.values(e._fileMap).filter(({file:e,_file:n,_i18n:r})=>Object.entries(t.locales).some(([t,{path:i}])=>i===(t===r.defaultLocale?n.fullPath:Pf({_i18n:r,locale:t,path:Vc(e)})))):[],Qp=(e,t)=>{let n=Wp.current.find(({collectionName:n,fileName:r})=>n===e&&r===t);if(n?.filePathMap)return Kp(Object.values(n.filePathMap))},$p=(e,t)=>{if(e&&t){let{collections:n,singletons:r}=jl.current;if(e===`_singletons`)return Array.isArray(r)?Ld(r).findIndex(e=>e.name===t):-1;let i=Yf({collections:n}).find(({name:t})=>t===e);if(i&&`files`in i)return i.files.findIndex(({name:e})=>e===t)}return-1},em=(e,t)=>t&&e[t]?t:Object.keys(e)[0],tm=(e,{locale:t,defaultLocale:n}={})=>(t?e.locales[t]:void 0)??e.locales[em(e.locales,n)],nm=(e,{includePrevious:t=!1}={})=>[...new Set([...Object.values(e.locales).map(({path:e})=>e),...t&&e.workflow?.previousPaths||[]])],rm=(e,{basePath:t,fullPathRegEx:n}={})=>{let r=n?e.match(n)?.groups?.subPath:void 0;if(r!==void 0)return iu(r);let i=Vc(t??``);return iu(Df(i)?Bie(e,i):ou(e,i))},$ae=({collectionName:e,fileName:t})=>{let n=Xf(e),{structureMap:r}=((n&&t?Jp(n,t):void 0)??n)?._i18n??{};return!!(r?.i18nMultiFile||r?.i18nMultiFolder||r?.i18nMultiRootFolder)},eoe=({entryFiles:e,previous:t,changedPaths:n})=>{let r=new Set(e.map(({path:e})=>e)),i=new Map,a=new Set;t.forEach(e=>{nm(e).forEach(t=>{i.has(t)&&a.add(t),i.set(t,e)})});let o=({path:e},t)=>{let o=i.get(e);if(!o||n.has(e)||a.has(e))return;let s=nm(o);if(t||s.length===1&&s[0]===e)return s.every(e=>r.has(e)&&!n.has(e)&&!a.has(e))?o:void 0},s=new Map,c=[],l=new Map,u=new Map;return e.forEach(e=>{let{collectionName:t,fileName:n}=e.folder,r=`${t}\n${n??``}`,i=l.get(r);i===void 0&&(i=$ae(e.folder),l.set(r,i));let a=o(e,i);if(i){let n=u.get(t)??[];n.push({file:e,entry:a}),u.set(t,n)}else a?s.set(e.path,a):c.push(e)}),u.forEach(e=>{e.every(({entry:e})=>!!e)?e.forEach(({file:e,entry:t})=>{s.set(e.path,t)}):c.push(...e.map(({file:e})=>e))}),{reusedEntries:s,dirtyFiles:c}},toe=({entryFiles:e,reusedEntries:t,parsedEntries:n})=>{let r=new Map;n.forEach(e=>{nm(e).forEach(t=>{Ll(r,t,()=>[]).push(e)})});let i=new Set;return e.forEach(({path:e})=>{let n=t.get(e);(n?[n]:r.get(e)??[]).forEach(e=>{i.add(e)})}),[...i]},im=e=>zc(e).replaceAll(`\\*`,`\\d+`),am=(e,t)=>e===t||e.startsWith(`${t}.`),om=new WeakMap,noe=e=>{let t=om.get(e);return t||(t=Object.keys(e).map((e,t)=>[e,t]).sort(([e],[t])=>e{if(n)return Object.keys(e).filter(e=>e.startsWith(t));let r=noe(e),i=0,a=r.length;for(;ie-t).map(([e])=>e)},cm=/\.\d+$/,lm=/^(?.+)\.\d+$/,um=new WeakMap,dm=(e,t,{live:n=!1}={})=>{if(n)return Object.keys(e).filter(e=>e.match(lm)?.groups?.parent===t);let r=um.get(e);return r||(r=new Map,Object.keys(e).forEach(e=>{let{parent:t}=e.match(lm)?.groups??{};if(t===void 0)return;let n=r.get(t);n?n.push(e):r.set(t,[e])}),um.set(e,r)),r.get(t)??[]};function fm(e){return e&&e.constructor&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e)}function pm(e){return e}function roe(e,t){t||={};let n=t.delimiter||`.`,r=t.maxDepth,i=t.transformKey||pm,a={};function o(e,s,c){c||=1,Object.keys(e).forEach(function(l){let u=e[l],d=t.safe&&Array.isArray(u),f=Object.prototype.toString.call(u),p=fm(u),m=f===`[object Object]`||f===`[object Array]`,h=s?s+n+i(l):i(l);if(!d&&!p&&m&&Object.keys(u).length&&(!t.maxDepth||c0&&(l=o(c.shift()),u=o(c[0]))}d[l]=mm(e[s],t)}),a}var ioe=``,aoe=``,ooe=/[.\uE000\uE001]/g,soe=/\uE001([\uE000\uE001])|\uE000/g,hm=/[\uE000\uE001]/,gm=`\0`,_m=/^(?:0|[1-9]\d*)$/,vm=e=>!Number.isNaN(Number(e))&&!_m.test(e),coe=e=>vm(e)?`${gm}${e}`:e,ym=e=>X(e)&&[Object.prototype,null].includes(Object.getPrototypeOf(e)),bm=e=>Array.isArray(e)?(e.forEach((t,n)=>{e[n]=bm(t)}),e):ym(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e.startsWith(gm)?e.slice(1):e,bm(t)])):e,xm=e=>e.includes(`.`)||hm.test(e)?e.replace(ooe,e=>e===`.`?ioe:`${aoe}${e}`):e,Sm=e=>hm.test(e)?e.replace(soe,(e,t)=>t??`.`):e,Cm=e=>[`[object Object]`,`[object Array]`].includes(Object.prototype.toString.call(e))&&!!Object.keys(e).length,loe=e=>Object.prototype.toString.call(e)===`[object Object]`&&Object.keys(e).some(e=>_m.test(e)),uoe=(e,t)=>{let n=`${t}.`;return Object.keys(e).some(e=>e.startsWith(n)&&_m.test(e.slice(n.length).split(`.`)[0]))},wm=(e,t)=>{let n={},r=(e,t)=>{t!==void 0&&loe(e)&&(n[t]={}),Object.entries(e).forEach(([e,i])=>{let a=xm(e),o=t===void 0?a:`${t}.${a}`;Cm(i)?r(i,o):n[o]=i})};return Cm(e)?r(e,t):t!==void 0&&(n[t]=e),n},doe=e=>coe(Sm(e)),Tm=e=>{let t=Object.entries(e);return t.some(([,e])=>Cm(e))?Tm(Object.fromEntries(t.flatMap(([e,t])=>Cm(t)?Object.entries(wm(t,e)):[[e,t]]))):t.some(([e])=>hm.test(e)||e.split(`.`).some(vm))?bm(mm(e,{transformKey:doe})):mm(e)},Em=e=>e?Tm(Object.fromEntries(Object.entries(e).sort(([e],[t])=>Wc(e,t)))):mm(e),Dm=e=>e==null||e===``||Array.isArray(e)&&!e.length||ym(e)&&!Object.keys(e).length,Om=e=>Array.isArray(e)&&!e.length||X(e)&&!Object.keys(e).length,km=(e,t)=>({[e]:Array.isArray(t)?[]:{},...wm(t,e)}),Am=(e,t,{live:n=!1}={})=>{let r=sm(e,`${t}.`,{live:n});if(!r.length)return;let i=r.map(n=>[`_${n.slice(t.length)}`,e[n]]),a=e[t];return Om(a)&&i.push([`_`,a]),Em(Object.fromEntries(i))._},foe=e=>typeof e==`object`&&e?Array.isArray(e)?`\0[]`:`\0{}`:e,jm=(e,t,n)=>{let r=sm(t,`${n}.`),i=[...r,n].map(e=>foe(t[e])),a=e.keys,o=e.values;return e.keyPath===n&&a.length===r.length&&r.every((e,t)=>e===a[t])&&i.every((e,t)=>e===o[t])||Object.assign(e,{keyPath:n,keys:r,values:i,subtree:Am(t,n)}),e.subtree},Mm=(e,t)=>{Object.keys(e).forEach(n=>{am(n,t)&&delete e[n]})},poe=(e,t,n)=>{Mm(e,t),Object.assign(e,km(t,n))},Nm=e=>!!e&&`type`in e&&e.type===`inline`,moe=({source:e,flags:t})=>new RegExp(e.startsWith(`^`)?e.slice(1):e,t.replace(/[gy]/g,``)),hoe=e=>{let{id:t,label:n,icon:r,pattern:i,trigger:a,toPreview:o,onInsert:s,onEdit:c}=e,{fromBlock:l,toBlock:u}=e,d=e.fromInline??l,f=e.toInline??u;return{id:t,label:n,icon:r,fields:[],pattern:moe(i),fromBlock:d,toBlock:f,toPreview:o,inlinePattern:{trigger:a||void 0,onInsert:s,onEdit:c}}},goe=new WeakMap,_oe=(e,t)=>{let n=t?`sticky`:`global`,r=Ll(goe,e,()=>({}));return r[n]??=new RegExp(e.source,`${e.flags}${t?`y`:`g`}`),r[n]},Pm=(e,t,{trigger:n}={},r=1/0)=>{let i=_oe(t,!!n),a=[],o=n?e.indexOf(n):0;for(;o!==-1&&a.lengthObject.assign(new RegExp(e),{[Symbol.match]:n=>Pm(n,e,t,1)[0]??null}),Fm=e=>e.startsWith(`__sc_`),Im=({multiline:e,dotAll:t,source:n})=>e||t||n.includes(`[\\s\\S]`)||n.includes(`[\\S\\s]`),Lm=({pattern:e,inlinePattern:t})=>!!t||!Im(e),yoe=e=>{let t=[],n=0,r=``,i=0,a=!1;return[...e,`,`].forEach((o,s)=>{r?o===r&&(r=``):n===0&&o===`,`?(t.push(e.slice(i,s).trim()),i=s+1,a=!1):n===0&&/[\s>+~]/.test(o)?a=!0:(a&&=(i=s,!1),o===`"`||o===`'`?r=o:o===`(`||o===`[`?n+=1:(o===`)`||o===`]`)&&--n)}),t},Rm=e=>{let t=yoe(e).map(e=>/^[a-z][a-z\d-]*(?![\w-])/i.exec(e)?.[0].toLowerCase()??``);return t.every(Boolean)?[...new Set(t)]:void 0},boe=e=>{try{return document.createDocumentFragment().querySelector(e),!0}catch{return!1}},zm=({htmlSelector:e,fromBlockHTML:t,toBlockHTML:n})=>typeof e==`string`&&typeof t==`function`&&typeof n==`function`,Bm=e=>Tm(Object.fromEntries(Object.entries(wm(e)).filter(([e])=>!Fm(e.split(`.`).pop())))),xoe=e=>{let t=e?.parentElement?.closest(`[data-component-path]`);return t?JSON.parse(t.dataset.componentPath):[]},Soe=(e,t)=>{let n=e?.closest(`[role="textbox"]`);if(!n)return;let r=()=>{t(n.getAttribute(`aria-readonly`)===`true`)},i=new MutationObserver(r);return r(),i.observe(n,{attributes:!0,attributeFilter:[`aria-readonly`]}),i},Vm=(e,t)=>{let n,r=window.requestAnimationFrame(()=>{n=Soe(e,t)});return()=>{window.cancelAnimationFrame(r),n?.disconnect()}},Hm=e=>e.replace(/\\([!-/:-@[-`{-~])/g,`$1`),Coe=e=>e.replace(/\\(?=[!-/:-@[-`{-~]|$)/g,`\\\\`).replace(/"/g,`\\"`),woe=e=>e.replace(/\\(?=[!-/:-@[-`{-~]|$)/g,`\\\\`).replace(/[[\]]/g,`\\$&`),Toe=[String.raw`(?:[^\][\\!]|\\(?!!\[).|!(?!\[)`,String.raw`|\[(?:[^\][\\!]|\\(?!!\[).|!(?!\[))*\])*`].join(``),Eoe=[String.raw`(?:[^"()\\!]|\\(?!!\[).|!(?!\[)`,String.raw`|\((?:[^)!]|!(?!\[))*\)|"(?:[^"!]|!(?!\[))*")*?`].join(``),Um=e=>String.raw`(?:[^${e}\\!]|\\(?!!\[).|!(?!\[))*`,Wm=(e=``)=>[String.raw`!\[(?${Toe})\]\((?${Eoe})`,String.raw`(?:(?${Um(`"`)})"`,String.raw`|'(?${Um(`'`)})'))?\)`].join(``),Gm=new RegExp(Wm()),Km=new RegExp(String.raw`\[${Wm(`2`)}\](?:\((?[^()]*(?:\([^)]*\)[^)]*|\([^)]*)?)\))`),qm=RegExp(`${Gm.source}|${Km.source}`),Jm=String.raw`(?:\s+[^\s"'<>=/]+(?:="[^"]*")?)*\s*`,Ym=String.raw``,Doe=({linked:e=!1}={})=>{let t=e?String.raw`(?:${Ym}<\/a>|${Ym})`:Ym;return[String.raw`
    (?${t})`,String.raw`
    (?(?:[^<\n]|<(?!\/fig(?:caption|ure)>))*)<\/figcaption>`,String.raw`<\/figure>`].join(``)},Ooe={ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|blob):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i,ADD_TAGS:[`iframe`],ADD_ATTR:[`allow`,`allowfullscreen`,`referrerpolicy`,`sandbox`],FORBID_TAGS:[`style`,`form`,`input`,`button`,`textarea`,`select`,`option`]},koe=[`color`,`background-color`,`font-style`,`font-weight`,`text-decoration`,`text-decoration-line`,`text-decoration-style`,`text-decoration-color`,`text-decoration-thickness`,`text-align`,`text-align-all`,`text-align-last`,`width`,`height`,`max-width`,`max-height`],Aoe=e=>{let{style:t}=e;Array.from(t).filter(e=>!koe.includes(e)).forEach(e=>{t.removeProperty(e)}),t.length||e.removeAttribute(`style`)},joe=[`allow-forms`,`allow-orientation-lock`,`allow-pointer-lock`,`allow-popups`,`allow-presentation`,`allow-same-origin`,`allow-scripts`,`allow-storage-access-by-user-activation`],Moe=[`accelerometer`,`autoplay`,`clipboard-write`,`encrypted-media`,`fullscreen`,`gyroscope`,`picture-in-picture`,`web-share`],Noe=e=>{let t=e.getAttribute(`allow`);if(t===null)return;let n=t.split(`;`).map(e=>e.trim()).filter(e=>Moe.includes(e.split(/\s+/)[0].toLowerCase()));n.length?e.setAttribute(`allow`,n.join(`; `)):e.removeAttribute(`allow`)},Poe=e=>{let t=e.getAttribute(`src`)?.trim()||``;if(!t.startsWith(`https://`))return!1;try{let e=new URL(t),n=typeof window<`u`&&window.location?window.location.origin:``;if(n&&e.origin===n)return!1}catch{return!1}let n=e.getAttribute(`sandbox`)||``,r=new Set(n.toLowerCase().split(/\s+/).filter(e=>joe.includes(e)));return r.add(`allow-scripts`),r.add(`allow-same-origin`),e.setAttribute(`sandbox`,Array.from(r).join(` `)),Noe(e),!0},Xm=(e,t={})=>{let n=ft(e,{...Ooe,...t,RETURN_DOM:!0});return Array.from(n.querySelectorAll(`iframe`)).forEach(e=>{Poe(e)||e.remove()}),n.querySelectorAll(`[style]`).forEach(e=>{Aoe(e)}),n.innerHTML},Zm=e=>({src:e.getAttribute(`src`)??``,alt:e.getAttribute(`alt`)??``,title:e.getAttribute(`title`)??``}),Foe=({src:e=``,alt:t=``,title:n=``})=>{if(!e)return``;let r=document.createElement(`img`);return r.setAttribute(`src`,e),r.setAttribute(`alt`,t),n&&r.setAttribute(`title`,n),r},Ioe=({src:e=``,alt:t=``,title:n=``})=>e?`![${woe(t)}](${e}${n?` "${Coe(n)}"`:``})`:``,Loe=({src:e=``,alt:t=``,title:n=``})=>`${Yu(t)}`,Qm=(e,{linked:t=!1}={})=>{let[n,r,...i]=e.children,a=[...e.childNodes].some(e=>e.nodeType===Node.TEXT_NODE&&!!e.textContent?.trim());if(!n||r?.localName!==`figcaption`||i.length||a)return;let o=t&&n.localName===`a`&&n.children.length===1&&!n.textContent?.trim()?n:void 0,s=o?o.children[0]:n;if(s.localName!==`img`)return;let c={...Zm(s),caption:r.innerHTML.trim()};return t?{...c,link:o?.getAttribute(`href`)??``}:c},Roe=(e,t,{linked:n=!1}={})=>{if(e.groups?.figureContent===void 0)return t(e);let{body:r}=new DOMParser().parseFromString(e[0],`text/html`);return{...Qm(r.firstElementChild,{linked:n}),caption:e.groups.caption}},$m=({src:e=``,alt:t=``,title:n=``,link:r=``,caption:i=``})=>{let a=`${Yu(t)}`;return[`
    `,r?`${a}`:a,`
    ${String(i).replace(/\s*\n\s*/g,` `)}
    `,`
    `].join(``)},zoe=(e,t)=>{let n=document.createElement(`figure`),r=document.createElement(`figcaption`),i=document.createElement(`template`);return i.innerHTML=Xm(t),r.append(i.content),n.append(e,r),n},Boe={image:`Image`,src:`Source`,alt:`Alt Text`,title:`Title`,link:`Link`,caption:`Caption`},Voe=({groups:e})=>{let{src:t,alt:n,title:r=e?.singleQuotedTitle}=e??{};return{src:t,alt:n&&Hm(n),title:r&&Hm(r)}},Hoe=({groups:e})=>{let{src:t,alt:n,title:r,singleQuotedTitle:i,src2:a,alt2:o,title2:s,singleQuotedTitle2:c,link:l}=e??{};return{src:(t||a||``).trim(),alt:Hm(n||o||``).trim(),title:Hm(r||i||s||c||``).trim(),link:(l||``).trim()}},eh=({linked:e,getLabel:t})=>({id:e?`linked-image`:`image`,label:t(`image`),fields:[{name:`src`,label:t(`src`),widget:`image`},{name:`alt`,label:t(`alt`),required:!1},{name:`title`,label:t(`title`),required:!1},...e?[{name:`link`,label:t(`link`),required:!1}]:[],{name:`caption`,label:t(`caption`),required:!1}],pattern:new RegExp([Doe({linked:e}),(e?qm:Gm).source].join(`|`)),fromBlock:t=>Roe(t,e?Hoe:Voe,{linked:e}),toBlock:t=>{let n=e?t.link??``:``,r=Ioe(t);return r&&t.caption?$m({...t,link:n}):r&&n?`[${r}](${n})`:r},toPreview:t=>{let n=e?t.link??``:``;if(t.src&&t.caption)return $m({...t,link:n});let r=Loe(t);return n?`${r}`:r},htmlSelector:e?`figure, a:has(> img:only-child), img`:`figure, img`,fromBlockHTML:t=>{if(t.localName===`figure`)return Qm(t,{linked:e});if(t.localName===`img`)return e?{...Zm(t),link:``}:Zm(t);if(!t.textContent?.trim())return{...Zm(t.querySelector(`img`)),link:t.getAttribute(`href`)??``}},toBlockHTML:t=>{let n=e?t.link??``:``,r=Foe(t);if(!r)return r;let i=r;return n&&(i=document.createElement(`a`),i.setAttribute(`href`,n),i.append(r)),t.caption?zoe(i,t.caption):i}}),th=e=>Boe[e];eh({linked:!1,getLabel:th}),eh({linked:!0,getLabel:th});var Uoe=e=>Y(`editor_components.${e}`),Woe=()=>[!1,!0].map(e=>({...eh({linked:e,getLabel:Uoe}),icon:`image`,trigger:`button`,createMarkdown:()=>`![]()`})),nh=e=>{if(!e)return;if(Wd.has(e))return e;let t=e.replace(/^x-/,``);return t!==e&&Wd.has(t)?t:void 0},rh=e=>{let t=nh(e);if(t){let e=Wd.get(t),n=Nm(e)?hoe(e):e;return{...n,id:`x-${t}`,label:n.label??t}}return Woe().find(({id:t})=>t===e)},Goe=/^\d+$/,ih=e=>Goe.test(e),ah=e=>Number.isInteger(e)?e:Number(e.toPrecision(15)),oh=(e,t)=>{let[n,r=`0`]=String(e).split(`e`);return Number(`${n}e${Number(r)+t}`)},sh=(e,t)=>{if(typeof e!=`number`)return NaN;if(!Number.isFinite(e))return e;let n=Math.abs(ah(e)),r=oh(Math.round(oh(n,t)),-t);return Math.sign(e)*r+0},Koe=/^(.*?)<([^>]+)>(.*)$/,ch=new Map,lh=(e,t)=>{if(e.length!==1)return!1;let[n]=e;return n.widget===t&&`root`in n&&n.root===!0},uh=e=>{let t=e.widget??`string`;return Vd.includes(t)?Kf(e):Ud.includes(t)?!!e.multiple:!1},dh=e=>{let t=e.match(Koe);if(!t)return{cleanKey:e};let[,n,r,i]=t;return i?{cleanKey:e}:{cleanKey:n||``,typeName:r}},qoe=({field:e,key:t,keyPathArray:n,segmentIndex:r,pendingExplicitType:i,valueMap:a})=>{let{cleanKey:o,typeName:s}=dh(t),{widget:c=`text`}=e,l=s??i,u=ih(o),d=o===`*`;if((u||d)&&Ud.includes(c))return{field:uh(e)?e:void 0,explicitType:l};let{field:f}=e,{fields:p}=e,{types:m,typeKey:h=`type`}=e;if(f){let e=u||d?n[r+1]:void 0;return{field:!e||f.name===e||f.widget===`object`&&`fields`in f&&f.fields?.some(t=>t.name===e)?f:void 0,explicitType:l}}if(p&&(u||d))return{field:e,explicitType:l};if(p&&!u&&o!==``)return{field:p.find(({name:e})=>e===o),explicitType:l};if(m&&(u||d)){let e=l??a[[n.slice(0,r).join(`.`),o,h].join(`.`)];return{field:m.find(({name:t})=>t===e),explicitType:d?void 0:l}}if(m&&t!==h&&o!==h&&o!==``){let e=l??a[[n.slice(0,r).join(`.`),h].join(`.`)];return{field:m.find(({name:t})=>t===e)?.fields?.find(({name:e})=>e===o),explicitType:void 0}}return{field:void 0,explicitType:l}},fh=({collectionName:e,fileName:t,isIndexFile:n},r={})=>({collectionName:e,fileName:t,isIndexFile:n,...r}),ph=e=>{let{collectionName:t,fileName:n=void 0,componentName:r=void 0,valueMap:i={},keyPath:a,isIndexFile:o=!1}=e,s=[t,n??``,r??``,a,o?`1`:`0`].join(`|`);if(ch.has(s))return ch.get(s);let c=Xf(t),l=c&&n?Jp(c,n):void 0;if(!c||n&&c?._type!==`entry`&&!l){ch.set(s,void 0);return}let{fields:u=[]}=l??c,d=o?uf(c):void 0,f=r?rh(r)?.fields??[]:d?.fields??u,p=a.split(`.`),m,h,g=!1;if(p.forEach((e,t)=>{if(t===0){let{cleanKey:t,typeName:n}=dh(e);m=f.find(({name:e})=>e===t),!m&&d?.fields&&(m=u.find(({name:e})=>e===t)),n&&(h=n)}else if(m){let n=qoe({field:m,key:e,keyPathArray:p,segmentIndex:t,pendingExplicitType:h,valueMap:i});m=n.field,h=n.explicitType}m&&`types`in m&&(g=!0)}),h&&m&&`types`in m){let{types:e}=m;m=e.find(({name:e})=>e===h)}return g||ch.set(s,m),m},mh=({keyPath:e,valueMap:t={},...n})=>{let r=e.split(`.`);return r.map((e,i)=>{let a=r.slice(0,i).join(`.`),o=i?`${a}.${e}`:e;if(ih(e)){let e=ph({...n,valueMap:t,keyPath:a}),{widget:r=`text`}=e??{};if(Ud.includes(r))return;let{field:i}=e??{},{types:s,typeKey:c=`type`}=e??{};if(i)return`*.${i.name}`;let l=s?t[`${o}.${c}`]:void 0;return l?`*<${l}>`:`*`}let s=ph({...n,valueMap:t,keyPath:o}),{types:c,typeKey:l=`type`}=s??{},u=s?.widget===`object`&&c?t[`${o}.${l}`]:void 0;return u?`${e}<${u}>`:e}).filter(e=>e!==void 0).join(`.`)},hh=e=>{let t=e.widget??`string`;return Rd.includes(t)?`builtin`:Kd.has(t)?`custom`:`unknown`},gh=({fieldConfig:{required:e=!0},locale:t})=>Array.isArray(e)?e.includes(t):!!e,_h=({valueMap:e,keyPath:t,isList:n,isCustomFieldType:r=!1})=>{let i=e[t];if(!n&&!r)return X(i)?Am(e,t)??i:i;let a=dm(e,t);return a.length?a.map(t=>e[t]).filter(e=>e!==void 0):r?i===void 0||X(i)?Am(e,t)??i:i:[]},vh=(e,t,n)=>{let{fields:r,types:i,typeKey:a=`type`}=e;return r??i?.find(({name:e})=>e===t[`${n}.${a}`])?.fields},yh=(e,t)=>{let n=e.find(({name:e})=>e===t);return n?n.fields??[]:void 0},bh=({value:e,fields:t,types:n,typeKey:r=`type`})=>t??(n?yh(n,e?.[r]):void 0)??[],xh=(e,t,n,r)=>{let{widget:i}=t,{field:a}=t,{fields:o,types:s,typeKey:c}=t;return i===`object`?n(e,bh({value:e,fields:o,types:s,typeKey:c})):i!==`list`||!Array.isArray(e)?e:e.map((e,t)=>a?r(e,a,t):n(e,bh({value:e,fields:o,types:s,typeKey:c}),t))},Sh=e=>{let{field:t,fields:n=[],types:r=[]}=e;return[...t?[t]:[],...n,...r.flatMap(e=>e.fields??[])]},Ch=(e,t,n,r=!1)=>{let{widget:i,field:a,fields:o,types:s}=e;if(i!==`object`&&i!==`list`)return;let c=i===`list`?`${t}.*`:t,l=(e,t)=>{Array.isArray(e)&&e.forEach(e=>n(e,`${t}.${e?.name}`))};i===`list`&&a&&n(a,c),l(o,c),Array.isArray(s)&&s.forEach(e=>l(e?.fields,r?`${c}<${e?.name}>`:c))},wh=(e,t,n)=>{let r=n?.get(e);if(r!==void 0)return r;let i=t(e)||Sh(e).some(e=>wh(e,t,n));return n?.set(e,i),i},Joe=/^(?:0|[1-9]\d*)$/,Yoe=/^(.+)\.\d+\.([^.]+)$/,Th=e=>{if(e.widget!==`list`||!(`fields`in e||`types`in e))return;let{map_key_field:t}=e;return typeof t==`string`&&t?t:void 0},Xoe=e=>Joe.test(e)&&Number(e)<2**32-1,Zoe=(e,t)=>!X(e)||!Object.values(e).every(e=>e===null||X(e))?e:Object.entries(e).map(([e,n])=>({...n,[t]:e})),Qoe=(e,t)=>Array.isArray(e)?Object.fromEntries(e.map(e=>{let{[t]:n=``,...r}=X(e)?e:{};return[String(n),r]})):e,$oe=new WeakMap,ese=e=>wh(e,e=>!!Th(e),$oe),Eh=(e,t,n)=>{if(!ese(t))return e;let r=Th(t),i=r&&n?Zoe(e,r):e,a=xh(i,t,(e,t)=>Dh(e,t,n),(e,t)=>Eh(e,t,n)),o=Array.isArray(a)&&a.every((e,t)=>e===i[t])?i:a;return r&&!n?Qoe(o,r):o},Dh=(e,t,n)=>{if(!X(e))return e;let r=e;return t.forEach(t=>{let{name:i}=t;if(!Object.hasOwn(e,i))return;let a=Eh(e[i],t,n);a!==e[i]&&(r===e&&(r={...e}),r[i]=a)}),r},Oh=e=>{if(e.componentName)return;let[,t,n]=e.keyPath.match(Yoe)??[];if(!t)return;let r=ph({...e,keyPath:t});if(r&&Th(r)===n)return{listKeyPath:t,keyField:n}},kh=({valueMap:e,listKeyPath:t,keyField:n})=>{let r=`${t}.`,i=`.${n}`;return Object.keys(e).filter(e=>e.startsWith(r)&&e.endsWith(i)&&ih(e.slice(r.length,-i.length)))},tse=({valueMap:e,keyPath:t,listKeyPath:n,keyField:r,value:i})=>kh({valueMap:e,listKeyPath:n,keyField:r}).some(n=>n!==t&&e[n]!==void 0&&e[n]!==null&&String(e[n])===String(i)),Ah=Symbol.for(`yaml.alias`),jh=Symbol.for(`yaml.document`),Mh=Symbol.for(`yaml.map`),Nh=Symbol.for(`yaml.pair`),Ph=Symbol.for(`yaml.scalar`),Fh=Symbol.for(`yaml.seq`),Ih=Symbol.for(`yaml.node.type`),Lh=e=>!!e&&typeof e==`object`&&e[Ih]===Ah,Rh=e=>!!e&&typeof e==`object`&&e[Ih]===jh,zh=e=>!!e&&typeof e==`object`&&e[Ih]===Mh,Bh=e=>!!e&&typeof e==`object`&&e[Ih]===Nh,Vh=e=>!!e&&typeof e==`object`&&e[Ih]===Ph,Hh=e=>!!e&&typeof e==`object`&&e[Ih]===Fh;function Uh(e){if(e&&typeof e==`object`)switch(e[Ih]){case Mh:case Fh:return!0}return!1}function Wh(e){if(e&&typeof e==`object`)switch(e[Ih]){case Ah:case Mh:case Ph:case Fh:return!0}return!1}var Gh=e=>(Vh(e)||Uh(e))&&!!e.anchor,Kh=Symbol(`break visit`),nse=Symbol(`skip children`),qh=Symbol(`remove node`);function Jh(e,t){let n=rse(t);Rh(e)?Yh(null,e.contents,n,Object.freeze([e]))===qh&&(e.contents=null):Yh(null,e,n,Object.freeze([]))}Jh.BREAK=Kh,Jh.SKIP=nse,Jh.REMOVE=qh;function Yh(e,t,n,r){let i=ise(e,t,n,r);if(Wh(i)||Bh(i))return ase(e,r,i),Yh(e,i,n,r);if(typeof i!=`symbol`){if(Uh(t)){r=Object.freeze(r.concat(t));for(let e=0;ee.replace(/[!,[\]{}]/g,e=>ose[e]),Xh=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+sse(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&Wh(e.contents)){let t={};Jh(e.contents,(e,n)=>{Wh(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||e&&!r.some(e=>e.startsWith(a))||t.push(`%TAG ${i} ${a}`);return t.join(` `)}};Xh.defaultYaml={explicit:!1,version:`1.2`},Xh.defaultTags={"!!":`tag:yaml.org,2002:`};function Zh(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function Qh(e){let t=new Set;return Jh(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function $h(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function cse(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=Qh(e);let a=$h(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Vh(t.node)||Uh(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function eg(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;ttg(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Gh(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var ng=class{constructor(e){Object.defineProperty(this,Ih,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Rh(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=tg(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?eg(i,{"":o},``,o):o}},rg=class extends ng{constructor(e){super(Ah),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Jh(e,{Node:(e,t)=>{(Lh(t)||Gh(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(tg(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=ig(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Zh(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function ig(e,t,n){if(Lh(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(Uh(t)){let r=0;for(let i of t.items){let t=ig(e,i,n);t>r&&(r=t)}return r}if(Bh(t)){let r=ig(e,t.key,n),i=ig(e,t.value,n);return Math.max(r,i)}return 1}var ag=e=>!e||typeof e!=`function`&&typeof e!=`object`,og=class extends ng{constructor(e){super(Ph),this.value=e}toJSON(e,t){return t?.keep?this.value:tg(this.value,e,t)}toString(){return String(this.value)}};og.BLOCK_FOLDED=`BLOCK_FOLDED`,og.BLOCK_LITERAL=`BLOCK_LITERAL`,og.PLAIN=`PLAIN`,og.QUOTE_DOUBLE=`QUOTE_DOUBLE`,og.QUOTE_SINGLE=`QUOTE_SINGLE`;var lse=`tag:yaml.org,2002:`;function use(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function sg(e,t,n){if(Rh(e)&&(e=e.contents),Wh(e))return e;if(Bh(e)){let t=n.schema[Mh].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new rg(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=lse+t.slice(2));let l=use(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new og(e);return c&&(c.node=t),t}l=e instanceof Map?o[Mh]:Symbol.iterator in Object(e)?o[Fh]:o[Mh]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new og(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function cg(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return sg(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var lg=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,ug=class extends ng{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>Wh(t)||Bh(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(lg(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(Uh(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,cg(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(Uh(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&Vh(i)?i.value:i:Uh(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Bh(t))return!1;let n=t.value;return n==null||e&&Vh(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return Uh(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(Uh(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,cg(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},dse=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function dg(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var fg=(e,t,n)=>e.endsWith(` `)?dg(n,t):n.includes(` `)?` `+dg(n,t):(e.endsWith(` `)?``:` `)+n;function pg(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;ii-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=mg(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===` `)n===`block`&&(h=mg(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==` `&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==` `&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),gg=e=>/^(%|---|\.\.\.)/m.test(e);function fse(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;tr)return!0;if(n=t+1,i-n<=r)return!1}return!0}function _g(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(gg(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length `;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==` `&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(` `);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===` `&&(p=p.slice(0,-1)),p.replace(bg,`$&${l}`));let h=!1,g,_=-1;for(g=0;g{i=!0});let s=pg(`${v}${e}${p}`,l,`block`,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function pse(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(` `)||u&&/[[\]{},]/.test(a))return yg(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(` `)?yg(a,t):xg(e,t,n,r);if(!s&&!u&&i!==og.PLAIN&&a.includes(` `))return xg(e,t,n,r);if(gg(a)){if(c===``)return t.forceBlockIndent=!0,xg(e,t,n,r);if(s&&c===l)return yg(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return yg(a,t)}return s?d:pg(d,c,`flow`,hg(t,!1))}function Sg(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==og.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=og.QUOTE_DOUBLE);let c=e=>{switch(e){case og.BLOCK_FOLDED:case og.BLOCK_LITERAL:return i||a?yg(o.value,t):xg(o,t,n,r);case og.QUOTE_DOUBLE:return _g(o.value,t);case og.QUOTE_SINGLE:return vg(o.value,t);case og.PLAIN:return pse(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function Cg(e,t){let n=Object.assign({blockQuote:!0,commentString:dse,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function mse(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(Vh(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function hse(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(Vh(e)||Uh(e))&&e.anchor;a&&Zh(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function wg(e,t,n,r){if(Bh(e))return e.toString(t,n,r);if(Lh(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=Wh(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=mse(t.doc.schema.tags,a);let o=hse(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):Vh(a)?Sg(a,t,n,r):a.toString(t,n,r);return o?Vh(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function gse({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=Wh(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(Uh(e)||!Wh(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||Uh(e)||(Vh(e)?e.type===og.BLOCK_FOLDED||e.type===og.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=wg(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=fg(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=fg(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=fg(g,n.indent,l(f))));let _,v,y;Wh(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&Vh(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Hh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=wg(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?` `:``,v){let e=l(v);S+=`\n${dg(e,n.indent)}`}x===``&&!n.inFlow?S===` `&&y&&(S=` `):S+=`\n${n.indent}`}else if(!p&&Uh(t)){let e=x[0],r=x.indexOf(` `),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&ne===Eg||typeof e==`symbol`&&e.description===Eg,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new og(Symbol(Eg)),{addToJSMap:Og}),stringify:()=>Eg},_se=(e,t)=>(Dg.identify(t)||Vh(t)&&(!t.type||t.type===og.PLAIN)&&Dg.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===Dg.tag&&e.default);function Og(e,t,n){let r=Ag(e,n);if(Hh(r))for(let n of r.items)kg(e,t,n);else if(Array.isArray(r))for(let n of r)kg(e,t,n);else kg(e,t,r)}function kg(e,t,n){let r=Ag(e,n);if(!zh(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function Ag(e,t){return e&&Lh(t)?t.resolve(e.doc,e):t}function jg(e,t,{key:n,value:r}){if(Wh(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(_se(e,n))Og(e,t,r);else{let i=tg(n,``,e);if(t instanceof Map)t.set(i,tg(r,i,e));else if(t instanceof Set)t.add(i);else{let a=vse(n,i,e),o=tg(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function vse(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(Wh(e)&&n?.doc){let t=Cg(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),Tg(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Mg(e,t,n){return new Ng(sg(e,void 0,n),sg(t,void 0,n))}var Ng=class e{constructor(e,t=null){Object.defineProperty(this,Ih,{value:Nh}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return Wh(n)&&(n=n.clone(t)),Wh(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return jg(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?gse(this,e,t,n):JSON.stringify(this)}};function Pg(e,t,n){return(t.inFlow??e.flow?bse:yse)(e,t,n)}function yse({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;eo=null,()=>d=!0);o&&(s+=fg(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;ea=null);l||=d.length>u||o.includes(` `),n0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=fg(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:` `;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function Fg({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=dg(t(r),e);n.push(i.trimStart())}}function Ig(e,t){let n=Vh(t)?t.value:t;for(let r of e)if(Bh(r)&&(r.key===t||r.key===n||Vh(r.key)&&r.key.value===n))return r}var Lg=class extends ug{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(Mh,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(Mg(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=Bh(e)?e:!e||typeof e!=`object`||!(`key`in e)?new Ng(e,e?.value):new Ng(e.key,e.value);let r=Ig(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);Vh(r.value)&&ag(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=Ig(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=Ig(this.items,e)?.value;return(!t&&Vh(n)?n.value:n)??void 0}has(e){return!!Ig(this.items,e)}set(e,t){this.add(new Ng(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)jg(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!Bh(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Pg(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},Rg={collection:`map`,default:!0,nodeClass:Lg,tag:`tag:yaml.org,2002:map`,resolve(e,t){return zh(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>Lg.from(e,t,n)},zg=class extends ug{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(Fh,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Bg(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=Bg(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&Vh(r)?r.value:r}has(e){let t=Bg(e);return typeof t==`number`&&t=0?t:null}var Vg={collection:`seq`,default:!0,nodeClass:zg,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Hh(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>zg.from(e,t,n)},Hg={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Sg(e,t,n,r)}},Ug={identify:e=>e==null,createNode:()=>new og(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new og(null),stringify:({source:e},t)=>typeof e==`string`&&Ug.test.test(e)?e:t.options.nullStr},Wg={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new og(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&Wg.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function Gg({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var Kg={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:Gg},qg={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Gg(e)}},Jg={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new og(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:Gg},Yg=e=>typeof e==`bigint`||Number.isInteger(e),Xg=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function Zg(e,t,n){let{value:r}=e;return Yg(r)&&r>=0?n+r.toString(t):Gg(e)}var Qg={identify:e=>Yg(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>Xg(e,2,8,n),stringify:e=>Zg(e,8,`0o`)},$g={identify:Yg,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Xg(e,0,10,n),stringify:Gg},e_={identify:e=>Yg(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Xg(e,2,16,n),stringify:e=>Zg(e,16,`0x`)},xse=[Rg,Vg,Hg,Ug,Wg,Qg,$g,e_,Kg,qg,Jg];function t_(e){return typeof e==`bigint`||Number.isInteger(e)}var n_=({value:e})=>JSON.stringify(e),Sse=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:n_},{identify:e=>e==null,createNode:()=>new og(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:n_},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:n_},{identify:t_,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>t_(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:n_}],Cse=[Rg,Vg].concat(Sse,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),r_={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new Ng(new og(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=Bh(r)?r:new Ng(r)}}else t(`Expected a sequence for this tag`);return e}function a_(e,t,n){let{replacer:r}=n,i=new zg(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(Mg(o,s,n))}return i}var o_={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:i_,createNode:a_},s_=class e extends zg{constructor(){super(),this.add=Lg.prototype.add.bind(this),this.delete=Lg.prototype.delete.bind(this),this.get=Lg.prototype.get.bind(this),this.has=Lg.prototype.has.bind(this),this.set=Lg.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(Bh(e)?(r=tg(e.key,``,t),i=tg(e.value,r,t)):r=tg(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=a_(e,t,n),i=new this;return i.items=r.items,i}};s_.tag=`tag:yaml.org,2002:omap`;var c_={collection:`seq`,identify:e=>e instanceof Map,nodeClass:s_,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=i_(e,t),r=[];for(let{key:e}of n.items)Vh(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new s_,n)},createNode:(e,t,n)=>s_.from(e,t,n)};function l_({value:e,source:t},n){return t&&(e?u_:d_).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var u_={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new og(!0),stringify:l_},d_={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new og(!1),stringify:l_},wse={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:Gg},Tse={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():Gg(e)}},Ese={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new og(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:Gg},f_=e=>typeof e==`bigint`||Number.isInteger(e);function p_(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function m_(e,t,n){let{value:r}=e;if(f_(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return Gg(e)}var Dse={identify:f_,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>p_(e,2,2,n),stringify:e=>m_(e,2,`0b`)},Ose={identify:f_,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>p_(e,1,8,n),stringify:e=>m_(e,8,`0`)},kse={identify:f_,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>p_(e,0,10,n),stringify:Gg},Ase={identify:f_,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>p_(e,2,16,n),stringify:e=>m_(e,16,`0x`)},h_=class e extends Lg{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=Bh(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new Ng(e.key,null):new Ng(e,null),Ig(this.items,t.key)||this.items.push(t)}get(e,t){let n=Ig(this.items,e);return!t&&Bh(n)?Vh(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Ig(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Ng(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(Mg(e,null,n));return i}};h_.tag=`tag:yaml.org,2002:set`;var g_={collection:`map`,identify:e=>e instanceof Set,nodeClass:h_,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>h_.from(e,t,n),resolve(e,t){if(zh(e)){if(e.hasAllNullValues(!0))return Object.assign(new h_,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function __(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function v_(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Gg(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var y_={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>__(e,n),stringify:v_},b_={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>__(e,!1),stringify:v_},x_={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(x_.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=__(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},S_=[Rg,Vg,Hg,Ug,u_,d_,Dse,Ose,kse,Ase,wse,Tse,Ese,r_,Dg,c_,o_,g_,y_,b_,x_],C_=new Map([[`core`,xse],[`failsafe`,[Rg,Vg,Hg]],[`json`,Cse],[`yaml11`,S_],[`yaml-1.1`,S_]]),w_={binary:r_,bool:Wg,float:Jg,floatExp:qg,floatNaN:Kg,floatTime:b_,int:$g,intHex:e_,intOct:Qg,intTime:y_,map:Rg,merge:Dg,null:Ug,omap:c_,pairs:o_,seq:Vg,set:g_,timestamp:x_},jse={"tag:yaml.org,2002:binary":r_,"tag:yaml.org,2002:merge":Dg,"tag:yaml.org,2002:omap":c_,"tag:yaml.org,2002:pairs":o_,"tag:yaml.org,2002:set":g_,"tag:yaml.org,2002:timestamp":x_};function T_(e,t,n){let r=C_.get(t);if(r&&!e)return n&&!r.includes(Dg)?r.concat(Dg):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(C_.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(Dg)),i.reduce((e,t)=>{let n=typeof t==`string`?w_[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(w_).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var Mse=(e,t)=>e.keyt.key),Nse=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?T_(e,`compat`):e?T_(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?jse:{},this.tags=T_(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,Mh,{value:Rg}),Object.defineProperty(this,Ph,{value:Hg}),Object.defineProperty(this,Fh,{value:Vg}),this.sortMapEntries=typeof a==`function`?a:a===!0?Mse:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function Pse(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=Cg(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(dg(t,``))}let o=!1,s=null;if(e.contents){if(Wh(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(dg(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=wg(e.contents,i,()=>s=null,t);s&&(c+=fg(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(wg(e.contents,i));if(e.directives?.docEnd){if(e.comment){let t=a(e.comment);t.includes(` `)?(n.push(`...`),n.push(dg(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(dg(a(t),``)))}return n.join(` `)+` `}var E_=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ih,{value:jh});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Xh({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[Ih]:{value:jh}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Wh(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){D_(this.contents)&&this.contents.add(e)}addIn(e,t){D_(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=Qh(this);e.anchor=!t||n.has(t)?$h(t||`a`,n):t}return new rg(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=cse(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=sg(e,l,p);return o&&Uh(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new Ng(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return D_(this.contents)?this.contents.delete(e):!1}deleteIn(e){return lg(e)?this.contents!=null&&(this.contents=null,!0):D_(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Uh(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return lg(e)?!t&&Vh(this.contents)?this.contents.value:this.contents:Uh(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Uh(this.contents)?this.contents.has(e):!1}hasIn(e){return lg(e)?this.contents!==void 0:Uh(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=cg(this.schema,[e],t):D_(this.contents)&&this.contents.set(e,t)}setIn(e,t){lg(e)?this.contents=t:this.contents==null?this.contents=cg(this.schema,Array.from(e),t):D_(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new Xh({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new Xh({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Nse(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=tg(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?eg(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return Pse(this,e)}};function D_(e){if(Uh(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var O_=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},k_=class extends O_{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Fse=class extends O_{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},A_=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`… `),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function j_(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:b&&n===`seq-item-ind`||(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function M_(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(` `))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(M_(t.key)||M_(t.value))return!0}return!1;default:return!0}}function N_(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&M_(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function P_(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||Vh(e)&&Vh(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var F_=`All mapping items must start at the same column`;function Ise({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??Lg)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=j_(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,F_)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=` `+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||M_(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,F_);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&N_(r.indent,u,i),n.atKey=!1,P_(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=j_(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&N_(r.indent,f,i),s=c.range[2];let l=new Ng(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=` `+_.comment:g.comment=_.comment);let e=new Ng(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&ce&&(e.type===`block-map`||e.type===`block-seq`);function Rse({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?Lg:zg))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a0){let e=I_(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=` `+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function z_(e,t,n,r,i,a){let o=n.type===`block-map`?Ise(e,t,n,r,a):n.type===`block-seq`?Lse(e,t,n,r,a):Rse(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function zse(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offsete.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),z_(e,t,n,i,o)}let l=z_(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=Wh(u)?u:new og(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function Bse(e,t,n){let r=t.offset,i=Vse(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?og.BLOCK_FOLDED:og.BLOCK_LITERAL,o=t.source?Hse(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?` `.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;tc&&(c=r.length);else{r.length=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;ec||r[0]===` `?(f===` `?f=` `:!p&&f===` `&&(f=` `),d+=f+t.slice(c)+r,f=` `,p=!0):r===``?f===` `?d+=` `:f=` `:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;en(r+e,t,i);switch(i){case`scalar`:s=og.PLAIN,c=Wse(a,l);break;case`single-quoted-scalar`:s=og.QUOTE_SINGLE,c=Gse(a,l);break;case`double-quoted-scalar`:s=og.QUOTE_DOUBLE,c=Kse(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=I_(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function Wse(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),B_(e)}function Gse(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),B_(e.slice(1,-1)).replace(/''/g,`'`)}function B_(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function qse(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===` `||r===`\r`)&&(r!==`\r`||e[t+2]===` `);)r===` `&&(n+=` `),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var Jse={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:` `,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function Yse(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function V_(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?Bse(e,t,r):Use(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[Ph]:c?Xse(e.schema,i,c,n,r):t.type===`scalar`?Zse(e,i,t,r):e.schema[Ph];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=Vh(a)?a:new og(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new og(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function Xse(e,t,n,r,i){if(n===`!`)return e[Ph];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[Ph])}function Zse({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[Ph];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[Ph];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function Qse(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var $se={composeNode:H_,composeEmptyNode:U_};function H_(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=ece(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=V_(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=zse($se,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=U_(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!Vh(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function U_(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=V_(e,{type:`scalar`,offset:Qse(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function ece({options:e},{offset:t,source:n,end:r},i){let a=new rg(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=I_(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function tce(e,t,{offset:n,start:r,value:i,end:a},o){let s=new E_(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=j_(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?H_(c,i,l,o):U_(c,l.end,r,null,l,o);let u=s.contents.range[2],d=I_(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function W_(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function G_(e){let t=``,n=!1,r=!1;for(let i=0;i{let i=W_(e);r?this.warnings.push(new Fse(i,t,n)):this.errors.push(new k_(i,t,n))},this.directives=new Xh({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=G_(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(Uh(i)&&!i.flow&&i.items.length>0){let e=i.items[0];Bh(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t{let i=W_(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=tce(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new k_(W_(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new k_(W_(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=I_(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new k_(W_(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new E_(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},K_=Symbol(`break visit`),rce=Symbol(`skip children`),q_=Symbol(`remove item`);function J_(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),Y_(Object.freeze([]),e,t)}J_.BREAK=K_,J_.SKIP=rce,J_.REMOVE=q_,J_.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},J_.parentCollection=(e,t)=>{let n=J_.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function Y_(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t`:return`block-scalar-header`}return null}function X_(e){switch(e){case void 0:case` `:case` `:case`\r`:case` `:return!0;default:return!1}}var Z_=new Set(`0123456789ABCDEFabcdef`),ace=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),Q_=new Set(`,[]{}`),oce=new Set(` ,[]{} \r `),$_=e=>!e||oce.has(e),sce=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===` `||t===`\r`&&this.buffer[e+1]===` `}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===` `||!t&&!this.atEnd)return e+n+1}return t===` `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&X_(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&ethis.indentValue&&!X_(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&X_(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil($_),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>X_(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case` `:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===` `)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(` `,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===` `;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===` `&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(X_(r)||e&&Q_.has(r))break;t=n}else if(X_(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===` `?(n+=1,r=` `,i=this.buffer[n+1]):t=n),i===`#`||e&&Q_.has(i))break;if(r===` `){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&Q_.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil($_),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(X_(n)||t&&Q_.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!X_(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(ace.has(t))t=this.buffer[++e];else if(t===`%`&&Z_.has(this.buffer[e+1])&&Z_.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===` `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===` `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},cce=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t>1;this.lineStarts[r]=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function av(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&ov(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&tv(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;re.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(ev(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=iv(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ev(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(nv(t.key)&&!ev(t.sep,`newline`)){let e=iv(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):ev(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!ev(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){av(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||ev(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=iv(rv(t));ov(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(` `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(` `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=iv(rv(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=iv(rv(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function uce(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new cce||null,prettyErrors:t}}function sv(e,t={}){let{lineCounter:n,prettyErrors:r}=uce(t),i=new lce(n?.addNewLine),a=new nce(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new k_(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(A_(e,n)),o.warnings.forEach(A_(e,n))),o}function dce(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=sv(e,n);if(!i)return null;if(i.warnings.forEach(e=>Tg(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function fce(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return Rh(e)&&!r?e.toString(n):new E_(e,r,n).toString(n)}var cv=new Map,lv=(e,t)=>{let n=Object.entries(t).filter(([,e])=>e!==void 0);n.length?cv.set(e,Object.fromEntries(n)):cv.delete(e)},uv=(e,t)=>{lv(e,{...cv.get(e),...t})},pce=({previousPath:e,path:t})=>{let n=e?cv.get(e):void 0;return n?cv.set(t,n):cv.delete(t),n??{}},mce=/(?:^|[^\d])\.0|\d\.0*(?!\d)|\d[eE][-+]?\d/,hce=/^[-+]?(?:\d+|0o[0-7]+|0x[\da-fA-F]+)$/,gce=/^[-+]?(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][-+]?\d+)?$/,_ce=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][-+]?\d+)?$/,dv=/^-?\d+$/,fv=e=>mce.test(e),pv=e=>typeof e==`number`&&Number.isInteger(e),mv=e=>{let t=Object.is(e,-0)?`-0`:String(e);return/[.e]/.test(t)?t:`${t}.0`},hv=(e,t,n)=>{let r=e.get(t);e.set(t,r===void 0||r===n?n:null)},gv=(e,t)=>{let n=String(t).replace(/[\\.]/g,`\\$&`);return e?`${e}.${n}`:n},vce=e=>{let t={},n=(e,r)=>{if(Vh(e)){let{value:n,source:i,tag:a}=e;r&&pv(n)&&(!a||a===`tag:yaml.org,2002:float`)&&typeof i==`string`&&!hce.test(i)&&(t[r]={value:n,source:i})}else zh(e)?e.items.forEach(({key:e,value:t})=>{Vh(e)&&n(t,gv(r,String(e.value)))}):Hh(e)&&e.items.forEach((e,t)=>{n(e,gv(r,t))})};return n(e.contents,``),t},_v=class{constructor(e,t){this.value=e,this.source=t}toJSON(){return this.value}},yce=(e,t,n)=>{let r=n?.source;return pv(t)&&typeof r==`string`&&!dv.test(r)?new _v(t,r):t},bce=e=>{let t={},n=(e,r)=>e instanceof _v?(r&&(t[r]={value:e.value,source:e.source}),e.value):((Array.isArray(e)||X(e))&&Object.entries(e).forEach(([t,i])=>{e[t]=n(i,gv(r,t))}),e);return{value:n(e,``),sourceMap:t}},vv=(e,t)=>{Object.keys(t).length&&uv(e,{valueSources:t})},xce=(e,t)=>{let n=new Map;return Object.entries(e).forEach(([e,t])=>{let[r,...i]=e.split(`.`);n.has(r)||n.set(r,[]),n.get(r).push([i.join(`.`),t])}),Object.fromEntries(t.flatMap((e,t)=>e===void 0?[]:(n.get(String(e))??[]).map(([e,n])=>[e?`${t}.${e}`:String(t),n])))},Sce=(e,{value:t,source:n})=>typeof e==`number`&&e===t?new _v(e,n):void 0,yv=(e,t,n=Sce,r=``)=>{let i=r&&Object.hasOwn(t,r)?t[r]:void 0,a=i?n(e,i):void 0;return a===void 0?Array.isArray(e)?e.map((e,i)=>yv(e,t,n,gv(r,i))):ym(e)?Object.fromEntries(Object.entries(e).map(([e,i])=>[e,yv(i,t,n,gv(r,e))])):e:a},bv=(e,t,n)=>n.test(e)&&/[.eE]/.test(e)&&Number(e.replaceAll(`_`,``))===t,Cce=({value:e,source:t})=>bv(t,e,_ce)?t:void 0,wce={identify:e=>e instanceof _v,default:!0,tag:`tag:yaml.org,2002:float`,resolve:e=>Number(e),stringify:({value:e})=>{let{value:t,source:n}=e;return bv(n,t,gce)?n:mv(t)}},xv=new Map,Tce=/\d{16}/,Sv=e=>Tce.test(e),Cv=(e,t)=>{hv(xv,e,t)},wv=e=>{let t=Number(e);return Number.isSafeInteger(t)||Cv(t,String(e)),t},Tv=e=>typeof e==`bigint`?wv(e):Number.isInteger(e)&&!Number.isSafeInteger(e)?(Cv(e,String(BigInt(e))),e):((Array.isArray(e)||X(e))&&Object.entries(e).forEach(([t,n])=>{e[t]=Tv(n)}),e),Ev=(e,t,n)=>{let r=n?.source;return typeof t==`number`&&!Number.isSafeInteger(t)&&typeof r==`string`&&dv.test(r)?wv(BigInt(r)):t},Dv=e=>typeof e==`number`&&!Number.isSafeInteger(e)?xv.get(e)??void 0:void 0,Ece=()=>xv.size>0,Ov=e=>{let t=Dv(e);return t===void 0?Array.isArray(e)?e.map(Ov):ym(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Ov(t)])):e:BigInt(t)}; /*! * Copyright (c) Squirrel Chat et al., All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ function Dce(e,t){let n=e.slice(0,t).split(/\r?\n/);return[n.length,n.pop().length+1]}function Oce(e,t,n){let r=e.split(/\r?\n/),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=` `,e===t&&(i+=` `.repeat(a+n+2),i+=`^ `))}return i}var kv=class e extends Error{line;column;codeblock;constructor(e,t){let[n,r]=Dce(t.toml,t.ptr),i=Oce(t.toml,n,r);super(`Invalid TOML document: ${e}\n\n${i}`,t),this.line=n,this.column=r,this.codeblock=i}static x(t,n,r){throw new e(t,{toml:n.s,ptr:r??n.p})}}; /*! * Copyright (c) Squirrel Chat et al., All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ function Av(e){let t=e.p,n=e.s.charCodeAt(e.p++),r=n,i=n===39,a=n===e.s.charCodeAt(e.p)&&n===e.s.charCodeAt(e.p+1);a&&((n=e.s.charCodeAt(e.p+=2))===10?e.p++:n===13&&e.s.charCodeAt(e.p+1)===10&&(e.p+=2));let o=``,s=e.p,c=0;for(;e.p=48&&t<=57?t-48:t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:-1;n<0&&kv.x(`invalid non-hex character in unicode escape`,e),r=r<<4|n}(r<0||r>1114111||r>=55296&&r<=57343)&&kv.x(`invalid unicode escape`,e,t),o+=String.fromCodePoint(r),s=e.p--,c=0}else a&&(n===32||n===9)?c=2:(n===98?o+=`\b`:n===116?o+=` `:n===110?o+=` `:n===102?o+=`\f`:n===114?o+=`\r`:n===101?o+=`\x1B`:n===34?o+=`"`:n===92?o+=`\\`:kv.x(`unrecognised escape sequence`,e),s=e.p+1,c=0)}else n!==32&&n!==9&&(c===2&&kv.x(`invalid escape: only line-ending whitespace may be escaped`,e,s),c=+(!i&&n===92),s=e.p);kv.x(`unfinished string`,e,t)} /*! * Copyright (c) Squirrel Chat et al., All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ var kce=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i,jv=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e,t,n){let r=!0,i=!0,a=`Z`,o;if(typeof e==`string`){if(t)prep:{if(t<3){if(+e.slice(11,13)>23){e=``;break prep}t===2?(a=null,e+=`Z`):(o=e.charCodeAt(e.length-1))!==90&&o!==122&&(a=e.slice(e.length-6)),n&&(e=e.slice(0,10)+`T`+e.slice(11))}else t===4&&(e=+e.slice(0,2)>23?``:`0000-01-01T${e}Z`);r=t!==4,i=t!==3}else{let t=e.match(kce);t?(t[1]||(r=!1,e=`0000-01-01T${e}`),i=!!t[2],i&&e[10]===` `&&(e=e.replace(` `,`T`)),t[2]&&+t[2]>23?e=``:(a=t[3]||null,!a&&i&&(e+=`Z`))):e=``}}super(e),isNaN(this.getTime())||(this.#e=r,this.#t=i,this.#n=a)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`||this.#n===`z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}}; /*! * Copyright (c) Squirrel Chat et al., All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ function Mv(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+t}function Nv(e,t){return e===32||e===9||e===10||e===13||t&&(e===t||e===44)||e===35}function Pv(e,t){let n=e.p,r=e.s.charCodeAt(e.p);if(r===91||r===123){e.d--||kv.x(`document contains excessively nested structures. aborting.`,e);let t=r===91?Pce(e):Nce(e);return e.d++,t}return r===34||r===39?Av(e):r===116?((e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)&&kv.x(`invalid value`,e,n),e.p++,!0):r===102?((e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)&&kv.x(`invalid value`,e,n),e.p++,!1):r===43||r===45?Fv(e,e.p,e.s.charCodeAt(++e.p),44-r,t):e.s.charCodeAt(e.p+4)===45&&e.s.charCodeAt(e.p+7)===45?Ace(e,r,t):e.s.charCodeAt(e.p+2)===58?jce(e,r,t):Fv(e,e.p,r,0,t)}function Fv(e,t,n,r,i){let a=n,o=0,s=!1;if(a===105)return(e.s.charCodeAt(++e.p)!==110||e.s.charCodeAt(++e.p)!==102)&&kv.x(`invalid value`,e,t),e.p++,(r||1)/0;if(a===110)return(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==110)&&kv.x(`invalid value`,e,t),e.p++,NaN;if(a===48){if(++e.p>=e.s.length||Nv(a=e.s.charCodeAt(e.p),i))return e.bi===!0?0n:0;if(!r){if(a===120)return Iv(e,t,16,i);if(a===98)return Iv(e,t,2,i);if(a===111)return Iv(e,t,8,i)}a===46?o=2:a===101||a===69?o=4:kv.x(`illegal leading zero`,e,t)}else Mv(a)||kv.x(`invalid value`,e,t);for(;++e.p9?o-=11:o&1||o++:kv.x(`illegal character in numeric literal`,e);if(!o){let t=(n-48)*(r||1);return e.bi===!0?BigInt(t):t}o&1||kv.x(`unfinished numeric value`,e,t);let c=e.s.slice(t,e.p);return s&&(c=c.replaceAll(`_`,``)),o>1?parseFloat(c):Lv(e,c,10,t)}function Iv(e,t,n,r){let i,a=1;for(;++e.p=e.s.length||((t=e.s.charCodeAt(e.p))!==32||(i=!0,!Mv(e.s.charCodeAt(e.p+1))))&&t!==84&&t!==116)return Rv(e,e.s.slice(r,e.p),3,!1,r);if(e.s.charCodeAt(e.p+=3)!==58&&kv.x(`invalid date-time: time part is malformed`,e,r),e.s.charCodeAt(e.p+=3)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;Mv(e.s.charCodeAt(++e.p)););if(t=e.s.charCodeAt(e.p)){if(t===90||t===122)return Rv(e,e.s.slice(r,++e.p),1,i,r,`[+00:00]`);if(t===43||t===45)return Rv(e,e.s.slice(r,e.p+=6),1,i,r,!e.ld&&`[`+e.s.slice(e.p-6,e.p)+`]`)}return Rv(e,e.s.slice(r,e.p),2,i,r)}function jce(e,t,n){let r=e.p;if(!Mv(t)||!Mv(e.s.charCodeAt(++e.p)))return Fv(e,--e.p,t,0,n);if(e.s.charCodeAt(e.p+=4)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;Mv(e.s.charCodeAt(++e.p)););return Rv(e,e.s.slice(r,e.p),4,!1,r)}function Rv(e,t,n,r,i,a){if(e.ld){let a=new jv(t,n,r);return a.isValid()||kv.x(`invalid date`,e,i),a}try{switch(a&&(t+=a),n){case 1:return Temporal.ZonedDateTime.from(t);case 2:return Temporal.PlainDateTime.from(t);case 3:return Temporal.PlainDate.from(t);case 4:return Temporal.PlainTime.from(t)}}catch(t){kv.x(t instanceof Error?t.message:``+t,e,i)}} /*! * Copyright (c) Squirrel Chat et al., All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ function Mce(e){for(;e.p57&&o<65||o>90&&o<97&&o!==95||o>122?kv.x(`illegal character in key`,e):r||(r=1,a=e.p);while(o=e.s.charCodeAt(++e.p));kv.x(`incomplete key-value: cannot find end of key`,e,n)}function Nce(e){let t=e.p++,n=Object.create(null),r=new Set,i;for(;e.p{if(!e.trimStart().startsWith(`#`))return;let[t]=e.match(Uce);return(t.length===e.length?e:t.match(/^[\s\S]*\n[ \t]*\n/)?.[0]??``).trim()||void 0},Gce=(e,t)=>{let n=Wce(t);(n||cv.get(e)?.leadingComment)&&uv(e,{leadingComment:n})},Kce=(e,t)=>t?e?`${t}\n\n${e}`:t:e,qce=/(?{let n=bv(t,e,Xce)?t:mv(e);return Object.assign(new Date(0),{toISOString:()=>n})},$ce=e=>{let t=new Map,n=new Set;return e.replace(Yce,` `).match(Jce)?.forEach(e=>{let r=!/^[-+]?0[xob]/.test(e)&&/[.eE]/.test(e),i=Number(e.replaceAll(`_`,``));r?Number.isInteger(i)&&hv(t,i,e):n.add(i)}),n.forEach(e=>{t.delete(e)}),t},ele=e=>{let t=new Map;return e.match(qce)?.forEach(e=>{let n=new jv(e);n.isValid()&&hv(t,n.toISOString(),e)}),t},tle=(e,t)=>{let n={},r,i,a=(t,o)=>{if(t instanceof jv){let i=t.toISOString();r??=ele(e),n[o]={value:i,source:r.get(i)??i}}else Number.isInteger(t)?(i??=fv(e)?$ce(e):new Map,i.has(t)&&(n[o]={value:t,source:i.get(t)??mv(t)})):(Array.isArray(t)||X(t))&&Object.entries(t).forEach(([e,t])=>{a(t,gv(o,e))})};return a(t,``),n},nle=({path:e,str:t,parsed:n})=>{vv(e,tle(t,n))},rle=(e,t)=>e===t||e instanceof jv&&e.toISOString()===t,ile=(e,{value:t,source:n})=>typeof t==`number`?e===t?Qce(t,n):void 0:rle(e,t)?new Zce(t,n):void 0,ale=(e,t)=>yv(e,t,ile),ole=(e,t,n)=>yce(e,Ev(e,t,n),n),Yv=(e,t)=>{if(t===void 0||!fv(e))return Sv(e)?JSON.parse(e,Ev):JSON.parse(e);let{value:n,sourceMap:r}=bce(JSON.parse(e,ole));return vv(t,r),n},Xv=(e,t)=>{let n=Tv(Fce(e,{integersAsBigInt:`asNeeded`}));return t!==void 0&&nle({path:t,str:e,parsed:n}),Mc(n)},sle=(e,t,n)=>{let r=sv(e,t);if(r.warnings.forEach(e=>console.warn(e)),r.errors.length)throw r.errors[0];return vv(n,vce(r)),r.toJS(t)},Zv=(e,t,n)=>{let r=Sv(e),i=r?{...t,intAsBigInt:!0}:t,a=n!==void 0&&fv(e)?sle(e,i,n):dce(e,i);return r?Tv(a):a},cle=e=>{let t=e.split(` `,1)[0].trim();return gf.find(e=>t===hf[e][0])??`yaml-frontmatter`},lle=/^\{\n(?\{[\s\S]*?\})\n\}(?:\n\n(?[\s\S]*))?$/,ule=(e,t)=>{let n=e.trim();return Yv(n.startsWith(`{`)?n:`{${n}}`,t)},Qv=e=>(t,n)=>{let r=e(t,n);return n!==void 0&&Gce(n,t),r},$v={yaml:Qv((e,t)=>Zv(e,void 0,t)),toml:Qv(Xv),json:Yv},dle={...$v,json:ule},fle=new Map,ple=({collection:e,collectionFile:t,isIndexFile:n,format:r,text:i,path:a})=>{let{format:o,fmDelimiters:s,bodyField:{key:c=`body`,inline:l=!1}={}}=Rf({collection:e,collectionFile:t,isIndexFile:n}),[u,d]=(o===`frontmatter`?Lf({format:r,delimiter:s}):s)??hf[`yaml-frontmatter`],f=zc(u),p=zc(d),m=Ll(fle,`${f}|${p}`,()=>RegExp(`^${f}[ \t]*\n(?:(?[\\s\\S]*?)\n)?${p}[ \t]*(?:\n(?[\\s\\S]*))?$`,`s`)),h=i.trimStart(),g=(r===`json-frontmatter`&&u===`{`&&d===`}`?h.match(lle)?.groups:void 0)??h.match(m)?.groups;if(!g)return{content:{[c]:i},hasFrontMatter:!1};let{head:_=``,body:v}=g,y=gf.includes(r)?_f(r):void 0,b=y?dle[y](_,a):{};return i!==h&&_.trim()&&b!=null&&(typeof b!=`object`||Array.isArray(b))?{content:{[c]:i},hasFrontMatter:!1}:((!b||typeof b!=`object`||Array.isArray(b))&&(b={}),{content:{...b,...!Object.hasOwn(b,c)&&(!l||v?.trim())?{[c]:v?.replace(/^\n/,``)}:{}},hasFrontMatter:!0})},ey=({path:e,folder:{collectionName:t,fileName:n}})=>{let r=Xf(t),i=r&&n?Jp(r,n):void 0;if(!r)throw Error(`Collection not found`);if(n&&!i)throw Error(`Collection file not found`);let a=!i&&df(r,e),{format:o}=Rf({collection:r,collectionFile:i,isIndexFile:a});return{collection:r,collectionFile:i,isIndexFile:a,format:o}},mle=e=>{try{return!!qd.get(ey(e).format)?.parser}catch{return!1}},hle=async({text:e=``,path:t,folder:n})=>{let r=ey({path:t,folder:n}),{collection:i,collectionFile:a,isIndexFile:o}=r,{format:s}=r;cv.delete(t),e=e.trimEnd().replace(/\r\n?/g,` `);let c=e.trimStart(),l=qd.get(s)?.parser;if(l)return l(c);if(s===`raw`)return{body:e};try{let n=s===`frontmatter`;if(n&&(s=cle(c)),gf.includes(s)){let{content:r,hasFrontMatter:c}=ple({collection:i,collectionFile:a,isIndexFile:o,format:s,text:e,path:t});return n&&c&&uv(t,{format:s}),r}let r=_f(s);if(r)return $v[r](c,t)}catch(e){throw Error(`${t} could not be parsed due to ${e.name}: ${e.message}`)}throw qd.has(s)?Error(`${t} could not be parsed, as no \`fromFile\` method was registered for the custom “${s}” format with \`CMS.registerCustomFormat()\``):Error(`${t} could not be parsed due to an unknown format: ${s}`)},gle=async()=>{let{scheduler:e}=globalThis;typeof e?.yield==`function`?await e.yield():await Bu()},_le=async(e,t,{budget:n=50}={})=>{let r=performance.now();for(let i=0;i=n&&(await gle(),r=performance.now()),await t(e[i])},ty=()=>{let e=0;return{next:()=>{e+=1;let t=e;return()=>t===e}}},ny=(e,{lastInFirstOut:t=!1}={})=>{let n=0,r=[];return Object.assign(async(i,{key:a=void 0}={})=>{n>=e?await new Promise(e=>{r.push({start:e,key:a})}):n+=1;try{return await i()}finally{let e=t?r.pop():r.shift();e?e.start():--n}},{prioritize:e=>{let n=e===void 0?-1:r.findIndex(t=>t.key===e);if(n>-1){let[e]=r.splice(n,1);t?r.push(e):r.unshift(e)}}})},ry=e=>/\/_index(?:\.[\w-]+)?\.md$/.test(e),vle=/{{([^]*?)}}/,yle=new Map,iy=({subPath:e,subPathTemplate:t})=>{if(t?.includes(`{{slug}}`)){let n=Ll(yle,t,()=>{let e=t.split(vle).map((e,t)=>t%2==0?zc(e):e===`slug`?`([^/]+)`:`[^/]+?`).join(``);return RegExp(`^${e}$`)}),[,r]=e.match(n)??[];if(r)return r}return e},ay=(e,t=new Set)=>{if(typeof e!=`object`||!e)return!1;if(t.has(e))return!0;t.add(e);let n=Object.values(e).some(e=>ay(e,t));return t.delete(e),n},ble=()=>`0.266.0\n${Nl.current}`,xle=({parsedFileMap:e,path:t,key:n,content:r})=>{try{e.set(t,{key:n,content:structuredClone(r),...cv.get(t)})}catch{}},Sle=async(e,t,n)=>{let{path:r,parsed:i}=e,a=ble(),o=mle(e);if(i?.key===a&&!o){let{key:e,content:t,...n}=i;return lv(r,n),t}try{if(e.text===void 0)throw Error(`${r} could not be read.`);let t=await hle(e);if(ay(t))throw Error(`${r} could not be parsed, as it contains a circular reference.`);return n&&!o&&!Sv(e.text)&&xle({parsedFileMap:n,path:r,key:a,content:t}),t}catch(e){console.error(e),t.push(e);return}},oy=({rawContent:e,fields:t,i18nSingleFile:n,validate:r})=>{let i=t[0].name;if(n)return!X(e)||!Object.values(e).every(r)?void 0:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{[i]:t}]));if(r(e))return{[i]:e}},sy=(e,t,n)=>{if(!X(e))return;let r=t.filter(e=>e!==n),i=Object.fromEntries(Object.entries(e).filter(([e])=>!r.includes(e))),a={[n]:i};return r.forEach(t=>{X(e[t])&&(a[t]=e[t])}),a},Cle=(e,t,n)=>{let r={rawContent:e,fields:t,i18nSingleFile:n};return lh(t,`list`)?oy({...r,validate:Th(t[0])?e=>X(e)||Array.isArray(e):Array.isArray}):lh(t,`keyvalue`)?oy({...r,validate:e=>X(e)&&Object.values(e).every(e=>typeof e==`string`)}):X(e)?e:void 0},cy=(e,t,n)=>{let r=Cle(e,t,n);if(r)return n?Object.fromEntries(Object.entries(r).map(([e,n])=>[e,Dh(n,t,!0)])):Dh(r,t,!0)},wle=(e,t,n,r,i)=>r?.split(`/`).pop()===`_index`&&/\/_index(?:\.[\w-]+)?\.[\w]+$/.test(e)&&i!==`md`?!0:ry(e)?!(t||uf(n)?.name===`_index`||r?.split(`/`).pop()===`_index`&&i===`md`||jie(n)===`_index`):!1,Tle=({file:e,fileName:t,fullPathRegEx:n,defaultLocale:r,isMultiFileStructure:i})=>{let{path:a,folder:{filePathMap:o}}=e;if(t){if(i){let[e,t]=Object.entries(o??{}).find(([,e])=>e===a)??[];return{subPath:t,locale:e}}return{subPath:a,locale:void 0}}if(!n)return{subPath:void 0,locale:void 0};let s=a.match(n);if(!s?.groups)return{subPath:void 0,locale:void 0};let{subPath:c,locale:l=r}=s.groups;return{subPath:c,locale:l}},ly=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a})=>{let o=r||iy({subPath:i,subPathTemplate:a});e.slug=o,e.locales._default={slug:o,path:n,content:wm(t)}},uy=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a,allLocales:o})=>{let s=r||iy({subPath:i,subPathTemplate:a});e.slug=s,e.locales=Object.fromEntries(o.filter(e=>X(t[e])).map(e=>[e,{slug:s,path:n,content:wm(t[e])}]))},Ele=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a,locale:o,defaultLocale:s,collectionName:c,canonicalSlugKey:l,entryMap:u})=>{let d=l&&typeof t[l]==`string`?t[l]:void 0,f=r||iy({subPath:i,subPathTemplate:a}),p={slug:f,path:n,content:wm(t)},m=`${c}/${r||(d??i)}`,h=u.get(m);return h?(h.locales[o]=p,o!==s&&h.slug||(h.slug=f,h.subPath=i),!0):(e.id=m,e.locales[o]=p,e.slug=f,u.set(m,e),!1)},dy=new Map,fy=({collection:e,item:t,index:n,path:r,meta:i={}})=>{let{fields:a,_i18n:{i18nEnabled:o,allLocales:s,defaultLocale:c,structureMap:{i18nSingleFileDefaultRoot:l}}}=e,u=l?sy(t,s,c):t,d=u?cy(u,a,o):void 0;if(!d)return;let f=String(n),p={id:``,slug:``,subPath:f,locales:{},arrayIndex:n,...i};return o?uy({entry:p,rawContent:d,path:r,subPath:f,allLocales:s}):ly({entry:p,rawContent:d,path:r,subPath:f}),Object.keys(p.locales).length?p:void 0},Dle=({collection:e,file:t,rawContent:n,entries:r,errors:i})=>{let{path:a,meta:o={}}=t;Array.isArray(n)?(dy.set(a,n),n.forEach((t,n)=>{let i=fy({collection:e,item:t,index:n,path:a,meta:o});i&&r.push(i)})):(dy.set(a,null),i.push(Error(`${a} could not be parsed, as it doesn’t contain an array.`)))},Ole=async({file:e,entries:t,entryMap:n,errors:r,parsedFileMap:i})=>{let a=await Sle(e,r,i),{path:o,meta:s={},folder:{collectionName:c,fileName:l}}=e,{collection:u,collectionFile:d}=Yp(c,l)??{},f=!d&&u?._type===`entry`&&u._file.arrayFile;if(!a){f&&dy.set(o,null);return}if(!u)return;if(f){Dle({collection:u,file:e,rawContent:a,entries:t,errors:r});return}let{fields:p=[],_file:{fullPathRegEx:m,subPath:h,extension:g},_i18n:{i18nEnabled:_,allLocales:v,defaultLocale:y,structureMap:b,canonicalSlug:{key:x}}}=d??u,S=!d&&df(u,o)&&uf(u)?.fields||p,C=b.i18nSingleFileDefaultRoot?sy(a,v,y):a;if(!C)return;let w=Uf(b),T=cy(C,S,w);if(!T||wle(o,l,u,h,g))return;let ee=Wf(b),{subPath:E,locale:te}=Tle({file:e,fileName:l,fullPathRegEx:m,defaultLocale:y,isMultiFileStructure:ee});if(!E||ee&&!te)return;let ne={id:``,slug:``,subPath:E,locales:{},...s},re={entry:ne,rawContent:T,path:o,fileName:l,subPath:E,subPathTemplate:h};if(!_)ly(re);else if(w)uy({...re,allLocales:v});else if(Ele({...re,locale:te,defaultLocale:y,collectionName:c,canonicalSlugKey:x,entryMap:n}))return;t.push(ne)},py=async(e,{parsedFileMap:t}={})=>{let n=[],r=new Map,i=[];return await _le(e,async e=>{try{await Ole({file:e,entries:n,entryMap:r,errors:i,parsedFileMap:t})}catch(e){console.error(e),i.push(e)}}),{entries:n.filter(e=>(e.id=Fc(),!!e.slug&&!!Object.keys(e.locales).length)),errors:i}},my=({fileInfo:e,fetchedFileMap:t})=>{let{meta:n,size:r,text:i}=t[e.path]??{};return{...e,size:e.size??r,text:e.text??i,meta:e.meta??n}},hy=e=>{let{name:t,meta:n={},...r}=e,i=Ap(t);return{...r,...n,name:t,kind:i}},kle=e=>`locales`in e?Object.values(e.locales).map(({path:e})=>e):[e.path],Ale=({entries:e,assets:t,configFiles:n,errors:r=[],changedPaths:i})=>{let a=i??new Set([...e,...t].flatMap(kle));Gp.current=Xae({entries:e,previous:Gp.current,changedPaths:a}),jp.current=Zae({assets:t,previous:jp.current,changedPaths:a}),Bp.current=n,qp.current=r,Hp.current=!0},jle=({fetchedFileMap:e,metadataMap:t})=>{Object.entries(t).forEach(([t,n])=>{e[t]&&(e[t].meta=n)});let n=!1,r=!1,i=Gp.current.map(e=>{if(e.commitDate)return e;let r=Object.values(e.locales).map(({path:e})=>t[e]).find(Boolean);return r?(n=!0,{...e,...r}):e}),a=jp.current.map(e=>{let n=e.commitDate?void 0:t[e.path];return n?(r=!0,{...e,...n}):e});n&&(Gp.current=i),r&&(jp.current=a)},Mle=async({entryFiles:e,changedPaths:t,parsedFileMap:n})=>{let r=Gp.current;if(!t||!r.length)return py(e,{parsedFileMap:n});let{reusedEntries:i,dirtyFiles:a}=eoe({entryFiles:e,previous:r,changedPaths:t}),{entries:o,errors:s}=await py(a,{parsedFileMap:n});return{entries:toe({entryFiles:e,reusedEntries:i,parsedEntries:o}),errors:s}},Nle=async({fileList:{entryFiles:e,assetFiles:t,configFiles:n},fetchedFileMap:r,changedPaths:i,parsedFileMap:a})=>{let{entries:o,errors:s}=await Mle({entryFiles:e.map(e=>my({fileInfo:e,fetchedFileMap:r})),changedPaths:i,parsedFileMap:a});return{entries:o,errors:s,assets:t.map(e=>hy(my({fileInfo:e,fetchedFileMap:r}))),configFiles:n.map(e=>my({fileInfo:e,fetchedFileMap:r}))}},gy=(e,{sha:t=``,size:n=0,...r}={})=>({path:e,name:qc(e).basename,sha:t,size:n,...r}),_y=e=>e.filter(({type:e})=>e===`blob`).map(({path:e,sha:t,size:n})=>gy(e,{sha:t,size:n})),vy=[`admin`,`cms`],yy=[``,`static`,`public`],by=e=>Vc(e).normalize().toLowerCase(),Ple=e=>vy.includes(by(e)),Fle=(e,t)=>{if(typeof e!=`string`||typeof t!=`string`)return;let n=Vc(e).replace(/^\.(?:\/|$)/,``),r=Vc(t);if(!(of(n)||of(r)||/^[.@]/.test(r)))return!r||n===r?r?``:n:n.endsWith(`/${r}`)?n.slice(0,-r.length-1):void 0},xy=e=>{let t=e.split(`/`).filter(Boolean);t.at(-1)?.includes(`.`)&&t.pop();try{let e=t.map(decodeURIComponent);return e.map((t,n)=>e.slice(n).join(`/`))}catch{return[]}},Sy,Ile=()=>{let{media_folder:e,public_folder:t}=Al.current??{},n=globalThis.location?.pathname??``,r=JSON.stringify([e,t,n]);if(Sy?.key!==r){let i=Fle(e,t),a=i===void 0?yy:[...yy,i],o=[...vy,...xy(n)];Sy={key:r,paths:a.flatMap(e=>o.map(t=>by(`${e}/${t}`)))}}return Sy.paths},Cy=e=>{let t=by(e);return Ile().some(e=>t===e||t.startsWith(`${e}/`))},Lle=/^(?:index\.html|config\.(?:ya?ml|toml|json))$/,Rle=(e,t)=>{if(!Lle.test(by(t)))return!1;let n=[...vy,...xy(globalThis.location?.pathname??``).slice(-1).map(by)];return by(e).split(`/`).some(e=>n.includes(e))},wy=e=>{let t=e.lastIndexOf(`/`),n=e.slice(0,Math.max(t,0));return Cy(n)||Rle(n,e.slice(t+1))},Ty=e=>{if(e.some(wy))throw Error(`Cannot change a file in a folder the CMS is served from`)},Ey=al([]),Dy=sl(()=>Ey.current.find(({collectionName:e,componentName:t,typedKeyPath:n,internalPath:r})=>e===void 0&&t===void 0&&n===void 0&&r!==void 0)),Oy=al(),ky=sl(()=>{let{current:e}=Oy;return e?.internalPath===void 0?Dy.current:e}),Ay=e=>{let t=`typedKeyPath`in e?e.typedKeyPath?.match(/[^:]+$/)?.[0]:e.typedKeyPath;return Ey.current.find(n=>(`typedKeyPath`in e?n.typedKeyPath===t:!n.typedKeyPath)?e.componentName?n.componentName===(nh(e.componentName)??e.componentName):n.collectionName===e.collectionName&&n.fileName===e.fileName&&!!n.isIndexFile==!!e.isIndexFile:!1)},zle=({internalPath:e,internalSubPath:t,localeFolderNames:n})=>{let r=n?.length?`(?:(?:${n.map(zc).join(`|`)})\\/)?`:``,i=e;if(Df(i))return RegExp(`^${kf(i,r)}`);if(i)return RegExp(`^${r}${zc(i)}\\/`);let a=t,[o]=a.split(`/`);if(!o||o===`..`||of(o))return/(?!)/;let s=cf(a,`[^/]+`);return RegExp(`^${r}${s}\\/`)},Ble=Wl(()=>Ey.current,e=>{let t=[],n=[];return e.forEach(e=>{let{internalPath:r,entryRelative:i}=e;if(r!==void 0){if(i)n.push({folder:e,regex:zle(e)});else{let n=cf(r,`.+?`);t.push({folder:e,regexSub:RegExp(`^${n}${r?`(?=\\/|$)`:`$`}`),regexExact:RegExp(`^${n}$`)})}}}),{items:t,entryRelative:n}}),jy=(e,{matchSubFolders:t=!0}={})=>{let{filename:n,dirname:r}=qc(e);if(n.startsWith(`+`))return[];let{items:i,entryRelative:a}=Ble(),o=r??``;return[...a.filter(({regex:t})=>t.test(e)).map(({folder:e})=>e),...i.filter(({regexSub:e,regexExact:n})=>(t?e:n).test(o)).map(({folder:e})=>e)].sort((e,t)=>t.internalPath.localeCompare(e.internalPath))},Vle=({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i,internalPath:a,internalSubPath:o,publicPath:s})=>JSON.stringify([e,t,n,r,i,a,o,s]),My=e=>!!e&&!e.entryRelative&&!e.hasTemplateTags&&!e.readonly,Ny=sl(()=>$f.current||!!ml.current),Hle=Wl(()=>Ey.current,e=>new Set(e.filter(({readonly:e,entryRelative:t})=>e&&!t).map(({internalPath:e})=>e))),Py=e=>e.some(({folder:e,path:t})=>!!e?.readonly||!e?.entryRelative&&Hle().has(e?.internalPath)||wy(t)),Ule=Wl(()=>Wp.current,e=>{let t=new Map,n=[];return e.forEach(e=>{e.filePathMap?[...new Set(Object.values(e.filePathMap))].forEach(n=>{Ll(t,n,()=>[]).push(e)}):n.push([e,Xf(e.collectionName)?._file?.fullPathRegEx])}),{fileMap:t,regexFolders:n}}),Fy=e=>{let{fileMap:t,regexFolders:n}=Ule();return t.get(e)||n.filter(([,t])=>t?.test(e)).map(([e])=>e).sort((e,t)=>(t.folderPath??``).localeCompare(e.folderPath??``))},Iy=e=>{let t=[],n=[],r=[],i=new Set;e.forEach(e=>{let{path:a,name:o}=e;if(o.startsWith(`.`))zp.test(o)&&r.push({...e,type:`config`});else{let[r]=Fy(a);if(r){t.push({...e,type:`entry`,folder:r}),i.add(a);return}if(i.has(a)||ry(a))return;let[o]=jy(a);o&&n.push({...e,type:`asset`,folder:o})}});let a=[...t,...n,...r];return{entryFiles:t,assetFiles:n,configFiles:r,allFiles:a,count:a.length}},Ly=({entryFiles:e,assetFiles:t,configFiles:n})=>`${e.length} entry files, ${t.length} asset files, ${n.length} config files`,Wle=async({metaEntries:e,lastCommitHash:t,cachedFileEntries:n,fetchFileList:r,log:i})=>{let a=Nl.current,{last_config_hash:o,last_commit_hash:s,git_config_fetched:c}=Object.fromEntries(e);if(o&&o===a&&s&&s===t&&c&&n.length){let e=Iy(n.map(([e,t])=>gy(e,t)));return i(`Restored the file list from the cache: ${Ly(e)}`),e}let l=Iy(await r(t));return i(`Fetched the file list: ${Ly(l)}`),l},Gle=async({metaDB:e,lastConfigHash:t,lastCommitHash:n})=>{await e.saveEntries(Object.entries({last_config_hash:t,last_commit_hash:n,git_config_fetched:!0}))},Kle=async({databaseName:e},t,n)=>{dp.current=n;try{let r=new yu(e,`meta`);await r.get(`last_commit_hash`)===t&&await r.set(`last_commit_hash`,n)}catch(e){console.error(`Failed to update the file cache.`,e)}},qle=({allFiles:e,cachedFiles:t})=>{e.forEach(({sha:n,path:r},i)=>{t[r]?.sha===n&&Object.assign(e[i],t[r])})},Jle=({parsedFileMap:e,fetchedFileMap:t,cachedFiles:n})=>{let r={};return e.forEach((e,i)=>{t[i]?t[i].parsed=e:n[i]&&(r[i]={...n[i],parsed:e})}),r},Ry=async({cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a={}})=>{let o=new Set(t.map(({path:e})=>e)),s=Object.keys(n).filter(e=>!o.has(e)),c=[...r.length?Object.entries(i):[],...Object.entries(a)];await Promise.all([c.length?e.saveEntries(c):void 0,s.length?e.deleteEntries(s):void 0])},Yle=({metaDB:e,cacheDB:t})=>up((async()=>{try{let n=await t.entries();return{metaEntries:await e.entries(),cachedFileEntries:n}}catch(e){return console.error(`Failed to read the file cache.`,e),{metaEntries:[],cachedFileEntries:[]}}})()),Xle=async({cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a,fetchFileMetadata:o,log:s})=>{let c={cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a},l=!0;if(o&&r.length){try{await Ry(c),s(`Cached the contents of ${r.length} files`)}catch(e){console.error(`Failed to cache the contents.`,e)}try{jle({fetchedFileMap:i,metadataMap:await o(r)}),s(`Fetched the commit metadata of ${r.length} files`)}catch(e){console.error(`Failed to fetch the commit metadata.`,e),l=!1}}await Ry(c),s(l?`Cached ${r.length} files with their metadata`:`Cached ${r.length} files without their metadata; they are fetched again next time`)},Zle=async({metaDB:e,lastConfigHash:t,lastCommitHash:n,cacheUpdate:r})=>{try{await r,await Gle({metaDB:e,lastConfigHash:t,lastCommitHash:n})}catch(e){console.error(`Failed to update the file cache.`,e)}},zy=(e,t)=>((...n)=>{let r=mu();return r?t(r,...n):e(...n)}),By=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[t(e),n])),Vy=(e,t)=>({...e,path:t(e.path),...e.previousPath!==void 0&&{previousPath:t(e.previousPath)}}),Hy=(e,t)=>({...e,files:e.files.map(e=>Vy(e,t))}),Uy=(e,t)=>({...e,files:By(e.files,e=>gu(e,t))}),Qle=({repository:e,fetchFileList:t,fetchFileContents:n,fetchFileMetadata:r})=>{let i=(e,t)=>e.map(e=>({...e,path:hu(e.path,t)}));return{fetchFileList:zy(t,async(n,r)=>{let i=(await t(r)).flatMap(e=>{let t=gu(e.path,n);return _u(t)?[{...e,path:t}]:[]});if(!i.length)throw wl(`Failed to list the files.`,`root_dir_not_found`,{repo:`${e.owner}/${e.repo}`,dir:n});return i}),fetchFileContents:zy(n,async(e,t,r)=>By(await n(i(t,e),r),t=>gu(t,e))),fetchFileMetadata:r&&zy(r,async(e,t)=>By(await r(i(t,e)),t=>gu(t,e)))}},$le=e=>{let t=(e,t)=>Hy(e,e=>hu(e,t)),n=(e,t)=>Hy(e,e=>gu(e,t));return{...e,fetchPullRequests:zy(e.fetchPullRequests,async t=>(await e.fetchPullRequests()).map(e=>n(e,t))),savePullRequest:zy(e.savePullRequest,async(r,i)=>{let{commit:a,pullRequest:o}=await e.savePullRequest({...i,changes:vu(i.changes),pullRequest:i.pullRequest&&t(i.pullRequest,r)});return{commit:Uy(a,r),pullRequest:n(o,r)}}),updateStatus:zy(e.updateStatus,async(r,i,a)=>n(await e.updateStatus(t(i,r),a),r)),fetchMergeState:zy(e.fetchMergeState,async(n,r)=>{let i=await e.fetchMergeState(t(r,n)),a=i.files.some(({path:e,previousPath:t})=>[e,t].some(e=>e!==void 0&&e.split(`/`).some(e=>e===`.`||e===`..`)));return{...i,files:i.files.map(e=>Vy(e,e=>gu(e,n))),...a&&{complete:!1}}}),fetchUnchangedPaths:zy(e.fetchUnchangedPaths,async(t,{headSHA:n,paths:r})=>(await e.fetchUnchangedPaths({headSHA:n,paths:r.map(e=>hu(e,t))})).map(e=>gu(e,t))),publish:zy(e.publish,(n,r)=>e.publish(t(r,n))),discard:zy(e.discard,(n,r)=>e.discard(t(r,n)))}},Wy=e=>{let{fetchBlob:t,commitChanges:n,fetchFileCommits:r,workflow:i}=e;return{...e,fetchBlob:t&&zy(t,(e,n)=>t({...n,path:hu(n.path,e)})),commitChanges:zy(n,async(e,t,r)=>Uy(await n(vu(t),r),e)),fetchFileCommits:r&&zy(r,(e,t)=>r(t.map(t=>hu(t,e)))),workflow:i&&$le(i)}},Gy=al({}),Ky=al(``),qy=al({published:!0,time:0}),Jy=al(!1),eue=e=>{let t=e.filter(e=>!!e);t.length&&(Gy.current=Object.fromEntries(Object.entries(Gy.current).filter(([e])=>!t.includes(e))))},tue=()=>{Gy.current={},Ky.current=``,Jy.current=!1,qy.current={published:!0,time:0}},Yy=e=>{qy.current={published:e,time:Date.now()}},Xy=e=>{let t=performance.now(),n=t;return(r,...i)=>{let a=performance.now(),o=Math.round(a-n),s=Math.round(a-t);n=a,console.debug(`[${e}] ${r} (+${o} ms, ${s} ms total)`,...i)}},Zy,nue=e=>`${e}\n${Nl.current}`,rue=async({repository:e,accessPromise:t,fetchDefaultBranchName:n,fetchLastCommit:r,lastCommit:i,log:a})=>{let{branch:o}=e;if(o&&i)return await t,i;if(!o){let r=up(n());await t,o=await r,e.branch=o,a(`Fetched the default branch name: ${o}`)}let s=up(r());await t;let c=await s;return a(`Fetched the last commit on ${o}: ${c.hash}`),c},iue=async({fileList:{allFiles:e},lastCommitHash:t,cachedFileEntries:n,fetchFileContents:r,fetchFileMetadata:i,log:a})=>{let o=Object.fromEntries(n);qle({allFiles:e,cachedFiles:o});let s=new Set(e.filter(({path:e,sha:t})=>o[e]?.sha!==t).map(({path:e})=>e)),c=e.filter(({meta:e})=>!e),l=i?c.filter(({type:e,text:t})=>e!==`asset`&&t===void 0):c,u=Object.fromEntries(c.map(({path:e,sha:t,size:n,text:r})=>[e,{sha:t,size:n,text:r,meta:void 0}]));return a(`Restored ${e.length-c.length} files from the cache; fetching ${c.length} files`),l.length&&(Object.assign(u,await r(l,t)),a(`Fetched the contents of ${l.filter(({type:e})=>e!==`asset`).length} files`)),{cachedFiles:o,changedPaths:s,fetchingFiles:c,fetchedFileMap:u}},Qy=async({data:e,isStale:t,parseKey:n,metaDB:r,lastConfigHash:i,lastCommitHash:a,startCacheUpdate:o,log:s,readyMessage:c})=>{t()?s(`Discarded: the site data was reset while loading`):(Ale(e),Zy=n,dp.current=a,s(c),await Zle({metaDB:r,lastConfigHash:i,lastCommitHash:a,cacheUpdate:o()}))},aue=async({repository:e,checkAccess:t,checkBranchAccess:n,fetchDefaultBranchName:r,fetchLastCommit:i,lastCommit:a,...o})=>{let{service:s,owner:c,repo:l,databaseName:u}=e,{fetchFileList:d,fetchFileContents:f,fetchFileMetadata:p}=Qle({repository:e,...o}),m=Xy(`Loading site data`);m(`Started: ${s} ${c}/${l}`);let h=nue(u),g=pp(),_=!!dp.current&&Zy===h,v=new yu(u,`meta`),y=new yu(u,`file-cache`),b=!dp.current,x=t&&b?up(t()):void 0,S=Yle({metaDB:v,cacheDB:y}),{hash:C,message:w}=await rue({repository:e,accessPromise:x,fetchDefaultBranchName:r,fetchLastCommit:i,lastCommit:a,log:m}),T=n&&b?n():void 0,{metaEntries:ee,cachedFileEntries:E}=await S;m(`Read the file cache: ${E.length} files`);let te=Nl.current,ne=await Wle({metaEntries:ee,lastCommitHash:C,cachedFileEntries:E,fetchFileList:d,log:m});Yy(!hae(w)),await T;let re={isStale:g,parseKey:h,metaDB:v,lastConfigHash:te,lastCommitHash:C,log:m};if(!ne.count){await Qy({...re,data:{entries:[],assets:[],configFiles:[]},readyMessage:`The site data is ready: no files to load`,startCacheUpdate:()=>Ry({cacheDB:y,allFiles:[],cachedFiles:Object.fromEntries(E),fetchingFiles:[],fetchedFileMap:{}})});return}let{cachedFiles:ie,changedPaths:ae,fetchingFiles:oe,fetchedFileMap:se}=await iue({fileList:ne,lastCommitHash:C,cachedFileEntries:E,fetchFileContents:f,fetchFileMetadata:p,log:m}),ce=new Map,{entries:le,errors:ue,assets:de,configFiles:fe}=await Nle({fileList:ne,fetchedFileMap:se,changedPaths:_?ae:void 0,parsedFileMap:ce}),pe=Jle({parsedFileMap:ce,fetchedFileMap:se,cachedFiles:ie});m(`Parsed ${le.length} entries (${ue.length} errors)`),await Qy({...re,data:{entries:le,assets:de,configFiles:fe,errors:ue,changedPaths:ae},readyMessage:`The site data is ready`,startCacheUpdate:()=>Xle({cacheDB:y,allFiles:ne.allFiles,cachedFiles:ie,fetchingFiles:oe,fetchedFileMap:se,reparsedFileMap:pe,fetchFileMetadata:p,log:m})})},$y=async({isOpenAuthoringConfigured:e,initOpenAuthoring:t,checkAccess:n,checkBranchAccess:r,...i})=>{let a=e();a&&!ep.current&&await t(),await aue({...i,checkAccess:a?void 0:n,checkBranchAccess:Qf.current?void 0:r})},eb={attempts:10,interval:1e3},tb=async(e,t,{attempts:n,interval:r})=>{let i=await e();return t(i)||n<=1?i:(await Bu(r),tb(e,t,{attempts:n-1,interval:r}))},oue=/\s*/g,sue=//,nb=e=>``,cue=e=>e?`Automatically generated by Sveltia CMS\n\n${nb(e)}`:`Automatically generated by Sveltia CMS`,rb=({description:e})=>e?.match(sue)?.[1],lue=(e,t)=>{let n=e.replace(oue,``);return t?[n,nb(t)].filter(Boolean).join(` `):n},uue=({regex:e,prefix:t})=>({strip:t=>{let n=t;for(;e.test(n);)n=n.replace(e,``);return n},format:(e,n)=>n?`${t}${e}`:e}),ib=(e,{removedStatus:t})=>e.map(({filename:e,status:n,previous_filename:r})=>({path:e,sha:``,size:0,deleted:n===t,previousPath:r||void 0})),ab=({login:e,name:t,email:n,id:r})=>e?{name:t||e,email:n??``,id:r,login:e}:void 0,ob=(e,t)=>({number:e.number,nodeId:String(e.id),url:e.html_url,headSHA:e.head?.sha,createdDate:new Date(e.created_at),updatedDate:new Date(e.updated_at),files:[],...t}),sb={interval:1e3,attempts:30},cb=e=>{let{backend:t}=jl.current??{};return!!t&&(Array.isArray(e)?e:[e]).includes(t.name)&&`open_authoring`in t&&t.open_authoring===!0},lb=({owner:e,repo:t})=>Qf.current??{owner:e,repo:t},due=async({repoPath:e,allowForking:t})=>{if(!t)throw wl(`The repository does not allow forking`,`open_authoring.forking_disabled`,{repo:e});if(!await fae(e))throw wl(`Permission to fork the repository was declined`,`open_authoring.fork_declined`)},ub=(e,t)=>(console.error(`Failed to fork the repository.`,t),wl(`Failed to fork the repository.`,`open_authoring.fork_failed`,{repo:e})),fue=async({repoPath:e,requestFork:t,requestRenamedFork:n,conflictStatuses:r,isNameTaken:i})=>{try{return await t()}catch(t){if(!r.includes(t.cause?.status)||!await i())throw ub(e,t)}try{return await n()}catch(t){throw ub(e,t)}},db=async({repoPath:e,checkFork:t,attemptsLeft:n=sb.attempts})=>{let r=await tb(t,e=>e!==`pending`,{...sb,attempts:n});if(r!==`ready`)throw wl(r===`failed`?`The fork could not be created.`:`Timed out waiting for the fork to be created.`,`open_authoring.fork_failed`,{repo:e})},fb=async e=>{Qf.current=void 0,ep.current=!1,await e(),ep.current=!0},pb=async e=>{let{repository:t,fetchAccess:n,fetchFork:r,prepareFork:i,fetchForkingAllowed:a}=e,o=await n();if(o.canWrite)return;t.branch||await e.fetchDefaultBranchName?.();let s=await r();s?(await i?.(s),Qf.current=s):(await due({repoPath:`${t.owner}/${t.repo}`,allowForking:await a(o)}),Qf.current=await e.createFork())},mb=()=>{if($f.current)throw wl(`Cannot publish as an Open Authoring contributor`,`open_authoring.publish_unsupported`)},hb=({branch:e})=>{if($f.current&&!e)throw wl(`Cannot commit directly to the configured repository`,`open_authoring.direct_commit_unsupported`)},pue=e=>{if(e===`pending_publish`)throw wl(`Cannot mark an entry ready to publish as an Open Authoring contributor`,`open_authoring.publish_unsupported`)},mue=async({branch:e,mergedSHA:t,fetchBranchHead:n,deleteBranch:r})=>{let i=await n(e);if(!(i&&i!==t))throw i&&await r(e),wl(`entry_already_published`,`open_authoring.entry_already_published`)},hue=(e,t)=>{console.warn(`Failed to sync the ${tp(e)} fork with the upstream repository.`,t)},gb=e=>{console.warn(`The ${tp(e)} fork could not be fast-forwarded to the upstream repository.`)},_b=async(e,t,n)=>{let r;try{r=await(n?n():sd(`${Au(e)}/merge-upstream`,{method:`POST`,body:{branch:t},responseType:`raw`}))}catch(t){hue(e,t);return}r&&!r.ok&&gb(e)},vb=async(e,t)=>{let n=zu.account?.login,r=await ld(Au({owner:n,repo:e.repo}),t);return r?.fork&&Mu(r.parent?.full_name,e)&&r.owner?.login?.toLowerCase()===n.toLowerCase()?ju(r.full_name):void 0},yb=async(e,t,n)=>{let r=[],i=[];return e.forEach((e,n)=>{let a=t(e,n);`leftover`in a?r.push(a.leftover):i.push(a.pending)}),await Ad(r,n),i},bb=async e=>{let{pullRequest:t,status:n,requestKey:r,createRequest:i,fetchRequest:a,applyStatus:o}=e,{fetchBranchHead:s,deleteBranch:c}=e;pue(n);let{branch:l,title:u}=t;if(t[r]===void 0)return n===`draft`?{...t,status:n,updatedDate:new Date}:i({branch:l,title:u,status:n,description:`Automatically generated by Sveltia CMS`});let d=await a(t);if(d){let{merged:n,isEntryRequest:r,getMergedSHA:i}=d;if(n&&r&&await mue({branch:l,mergedSHA:await i(),fetchBranchHead:s,deleteBranch:c}),n||!r)return bb({...e,pullRequest:{...t,number:void 0,nodeId:void 0,url:void 0}})}return await o({pullRequest:t,status:n,state:d?.state,draft:d?.draft}),{...t,status:n,updatedDate:new Date}},gue=({commit:e,branch:t,title:n})=>({title:n,branch:t,status:`draft`,createdDate:e.date,updatedDate:e.date,files:[],canMerge:!1}),xb=(e,{authRoot:t,authPath:n,tokenPath:r,api:i,...a})=>{let o=`${Vc(t)}/${Vc(n)}`;return Bre(e,a),Object.assign(td,{...i,authURL:o,tokenURL:o.replace(`/authorize`,r)}),e},_ue=e=>{let t=e.split(`/`),n=t.findIndex(e=>e.includes(`{{`));return(n===-1?t:t.slice(0,n)).join(`/`)},Sb=(e,t)=>e===t||e.startsWith(`${t}/`),Cb=()=>{let e=[],t=[];return Wp.current.forEach(({filePathMap:n,folderPathMap:r})=>{n?e.push(...Object.values(n)):t.push(...Object.values(r??{}))}),Ey.current.forEach(({internalPath:e})=>{e!==void 0&&t.push(e)}),{filePaths:e,folderPaths:t}},vue=()=>{let{filePaths:e,folderPaths:t}=Cb(),n=e.filter(e=>!e.includes(`{{`)),r=[...e.filter(e=>e.includes(`{{`)),...t].map(e=>_ue(Vc(e)));if(r.some(e=>!e))return;let i=[...new Set(r)].filter(e=>!e.startsWith(`../`)).sort().filter((e,t,n)=>!n.slice(0,t).some(t=>Sb(e,t)));return{dirs:i,files:[...new Set(n.map(e=>Vc(e)))].filter(e=>!e.startsWith(`../`)&&!i.some(t=>Sb(e,t)))}},yue=10,wb=e=>{let t=Math.max(100/(Math.max(e,1)*yue)*100,.1),n=0;Up.current=n;let r=window.setInterval(()=>{n=Math.min(n+t,99),Up.current=n},100);return()=>{window.clearInterval(r),Up.current=void 0}},Tb=(e,t)=>async()=>{try{return t(await Gu(e))??`unknown`}catch{return`unknown`}},Eb=(e,t)=>{let{databaseName:n}=e??{};return n?new yu(n,t):void 0},Db=async e=>{try{return new Map(await e?.entries()??[])}catch(e){return console.error(e),new Map}},Ob=async(e,t,n)=>{if(e)try{t.size&&await e.saveEntries([...t]),n.length&&await e.deleteEntries(n)}catch(e){console.error(e)}},bue=async({repository:e,roots:t,fetchTreeListing:n,cacheable:r,concurrency:i})=>{let a=Eb(e,`tree-cache`),o=await Db(a),s=new Map,c=new Map,l=new Set,u=[],d=!1,f=async({path:e,sha:t})=>t?(l.add(t),o.get(t)||(c.has(t)||c.set(t,n(e).then(e=>(r&&(e.trees.length||e.blobs.length)&&s.set(t,e),e))),c.get(t))):n(e);try{let e=t;for(;e.length;){let t=await jd(e,f,{concurrency:i}),n=e;e=t.flatMap(({trees:e,blobs:t},r)=>{let{path:i}=n[r],a=i?`${i}/`:``;return t.forEach(([e,t])=>{u.push({type:`blob`,path:`${a}${e}`,sha:t})}),e.map(([e,t])=>({path:`${a}${e}`,sha:t}))})}d=!0}finally{await Ob(a,s,d?[...o.keys()].filter(e=>!l.has(e)):[])}return u},kb=async({token:e,refreshToken:t},n,r)=>{let i=zu.account?.token,a=await sd(`/user`,{token:e,refreshToken:t}),o=zu.account;return o?.token&&o.token!==e&&o.token!==i&&(e=o.token,t=o.refreshToken),{backendName:n,id:a.id,name:a[r.name],login:a[r.login],email:a.email,avatarURL:a.avatar_url,profileURL:a[r.profileURL],bot:a.bot??!1,token:e,refreshToken:t}},Ab=()=>{let{backend:e}=jl.current??{};return e&&`squash_merges`in e?!!e.squash_merges:!1},jb=async({branch:e,path:t,goneStatuses:n})=>{try{await sd(t,{method:`DELETE`,responseType:`text`})}catch(t){if(n.includes(t.cause?.status))return;console.warn(`Failed to delete the ${e} branch.`,t)}},xue=async({commit:e,branch:t,title:n,status:r,deletionGroup:i,createPullRequest:a})=>$f.current&&r===`draft`?gue({commit:e,branch:t,title:n}):a({branch:t,title:n,status:r,description:cue(i)}),Mb=async({changes:e,options:t,branch:n,title:r,status:i,pullRequest:a,deletionGroup:o},{commitToNewBranch:s,commitToExistingBranch:c,createPullRequest:l,updateDescription:u})=>{if(a){let r=rb(a)===o?a:{...a,description:await u(a,e=>lue(e,o))};return{commit:await c(e,{...t,branch:n},a),pullRequest:r}}let d=await s(e,{...t,branch:n});return{commit:d,pullRequest:await xue({commit:d,branch:n,title:r,status:i,deletionGroup:o,createPullRequest:l})}},Sue=async({branch:e,branchExistsStatus:t,commitFromStart:n,commitOnBranch:r,findOpenPullRequest:i,inUseMessage:a,deleteBranch:o})=>{try{return await n()}catch(e){if(e.cause?.status!==t)throw e}if($f.current)return r();let s=await i();if(s)throw wl(a,`workflow.branch_in_use`,{number:s});return await o(e),n()},Nb=(e,t)=>wl(`Failed to save the changes.`,`branch_not_found`,{repo:t.repo,branch:e}),Cue=async({branch:e,headSHA:t,fetchBranchHead:n,getWorkflowRepository:r})=>{let i=await n(e);if(i===void 0)throw Nb(e,r());if(!t||i!==t)throw wl(`The workflow branch has moved since the entry was loaded.`,`save_conflict.branch_moved`);return t},Pb=async(e,t,{updateForkStatus:n,updateLabels:r,updateDraftState:i})=>{if($f.current)return n(e,t);let a=t===`draft`;return await r(e,t),a!==(e.status===`draft`)&&await i(e,a),{...e,status:t,updatedDate:new Date}},Fb=e=>[...new Set(e.map(e=>e.slice(0,Math.max(e.lastIndexOf(`/`),0))))],Ib=async(e,{statusMap:t,headSHA:n,fetchFileModes:r})=>{let i=e.map(({filename:e,status:n,previous_filename:r})=>({path:e,status:t[n]??`modified`,previousPath:r||void 0})),a=await r({headSHA:n,paths:i.filter(({status:e})=>e!==`removed`).map(({path:e})=>e)});return i.map(e=>({...e,mode:a.get(e.path)}))},Lb=(e,t)=>t===e.headSHA?void 0:{headSHA:t,onConfiguredBranches:!0,files:[],complete:!0},Rb=async({pullRequest:e,headSHA:t,onConfiguredBranches:n,listChangedFiles:r})=>!t||!n?{headSHA:t,onConfiguredBranches:!1,files:[],complete:!1}:Lb(e,t)||{headSHA:t,onConfiguredBranches:n,...await r(t)},wue=async(e,t)=>(await sd(`${Nu(e,t)}/merge`,{responseType:`raw`})).ok,Tue=async(e,t)=>{await sd(Nu(e,t),{method:`PATCH`,body:{state:`open`}})},zb=async(e,t,n)=>{let r=Nu(e,t.number),{body:i}=await sd(r),a=n(i??``);return await sd(r,{method:`PATCH`,body:{body:a}}),a},Bb=async(e,t,n)=>{await sd(`${Nu(e,t.number)}/reviews`,{method:`POST`,body:{event:n,commit_id:t.headSHA}})},Vb=e=>e.filter(({state:e,dismissed:t,user:n})=>e===`APPROVED`&&!t&&n?.login===zu.account?.login),Hb=async(e,t,{deleteBranch:n,closedStatuses:r=[]})=>{if(t.number!==void 0)try{await sd(Nu(e,t.number),{method:`PATCH`,body:{state:`closed`}})}catch(e){if(!r.includes(e.cause?.status))throw e}await n(t.branch)},Ub=async({pullRequest:e,status:t,state:n,draft:r},{repository:i,updateDraftState:a})=>{let o=n?.toLowerCase();t===`draft`?o===`open`&&!r&&await a(e,!0):(o===`closed`&&await Tue(i,e.number),r&&await a(e,!1))},Wb={interval:1e4,maxDuration:36e5},Eue=e=>{let t=e?.cause?.status;return typeof t==`number`&&t>=400&&t<500&&t!==429},Gb=async e=>{let{read:t,check:n,cancel:r,label:i,deadline:a=Date.now()+Wb.maxDuration}=e,o=async()=>{try{await r()}catch(e){console.warn(`Failed to cancel the auto-merge on ${i}.`,e)}};if(Date.now()>=a)throw await o(),Error(`Timed out waiting for ${i} to be merged`);await Bu(Wb.interval);let s;try{s={item:await t()}}catch(e){if(Eue(e))throw e;console.warn(`Failed to read ${i}, still waiting.`,e)}if(s){let{merged:e,failure:t,armed:r}=n(s.item);if(e)return;if(t)throw r&&await o(),Error(`${i[0].toUpperCase()}${i.slice(1)} was not merged: ${t}`)}await Gb({...e,deadline:a})},Kb=(e,t,n,r=(e,t)=>e===t)=>{let i=e.some(e=>r(e,t));return n&&!i?[...e,t]:!n&&i?e.filter(e=>!r(e,t)):e},qb=(e,t)=>Array.from({length:Math.ceil(e.length/t)},(n,r)=>e.slice(r*t,(r+1)*t)),Jb=(e,{maxItems:t,maxSize:n,getSize:r})=>{let i=[],a=[],o=0;return e.forEach(e=>{let s=r(e);a.length&&(a.length===t||o+s>n)&&(i.push(a),a=[],o=0),a.push(e),o+=s}),a.length&&i.push(a),i},Due=`cms`,Oue=200,kue=244,Aue=32,Yb=new TextEncoder,jue=new Intl.Segmenter,Xb=e=>{let t=Qf.current;return[Due,t?.owner,t?.repo,e].filter(Boolean).map(e=>`${e}/`).join(``)},Zb=()=>Xb(mu()),Qb=()=>Xb(``),$b=e=>e.replaceAll(`%`,`%25`).replaceAll(`/`,`%2F`),Mue=e=>e.replaceAll(`%2F`,`/`).replaceAll(`%25`,`%`),ex=e=>Yb.encode($b(e)).length,Nue=({collectionName:e,dirPath:t})=>{let n=`${Zb()}${e}/`,r=t?ex(`${t}/`):0,i=kue-Yb.encode(n).length-r;return Math.max(Math.min(Oue,i),Aue)},tx=(e,t)=>{let n=Array.from(jue.segment(e),({segment:e})=>e),r=0,i=n.findIndex(e=>(r+=ex(e),r>t));return i===-1?e:n.slice(0,i).join(``)},Pue=({collectionName:e,slug:t})=>`${Zb()}${e}/${$b(t)}`,nx=e=>{let t=Zb(),n=Qb(),r=!e.startsWith(t);if(r&&(t===n||!e.startsWith(n)))return;let i=e.slice(r?n.length:t.length),a=i.indexOf(`/`);if(!(a<1||a===i.length-1))return{collectionName:i.slice(0,a),slug:Mue(i.slice(a+1)),...r&&{legacy:r}}},Fue=({branch:e,collectionName:t,slug:n})=>{let r=nx(e);return r?.collectionName===t&&r.slug===n},Iue=[`netlify-cms/`,`decap-cms/`],rx=[`draft`,`pending_review`,`pending_publish`],ix=[`draft`,`pending_review`],ax=[...rx,`pending_deletion`],ox={draft:`status.draft`,pending_review:`status.in_review`,pending_publish:`status.ready`,pending_deletion:`status.pending_deletion`},sx=[`preview`,`editorial_workflow`],cx=e=>typeof e==`string`?e?{type:e}:{}:X(e)?e:{},Lue=e=>Array.isArray(e)?rx.filter(t=>t===`draft`||e.includes(t)):rx,lx=({cmsConfig:e,collection:t})=>{let{type:n,stages:r,direct_publish:i=!1,allow_incomplete_drafts:a=!0}={...cx(e?.publish_mode),...cx(t?.publish_mode)},o=n&&sx.includes(n)?n:`simple`;return{type:o,stages:o===`preview`?[`draft`]:Lue(r),directPublish:o!==`simple`&&i===!0,allowIncompleteDrafts:a!==!1}},ux=({cmsConfig:e,collection:t})=>lx({cmsConfig:e,collection:t}).type,dx=e=>sx.includes(e),fx=e=>[void 0,...Array.isArray(e?.collections)?e.collections.filter(e=>X(e)&&!(`divider`in e)):[]],px=e=>fx(e).some(t=>dx(ux({cmsConfig:e,collection:t}))),mx=()=>{let{backend:e}=jl.current??{};return(e&&`cms_label_prefix`in e?e.cms_label_prefix:void 0)||`sveltia-cms/`},hx=()=>[...new Set([mx(),`sveltia-cms/`,...Iue])],gx=e=>`${mx()}${e}`,_x=()=>hx().flatMap(e=>ax.map(t=>`${e}${t}`)),vx=(e,t)=>{let n=_x();return[...e.filter(e=>!n.includes(e)),gx(t)]},yx=e=>{let t;return hx().some(n=>(t=ax.find(t=>e.includes(`${n}${t}`)),!!t)),t},Rue=[[Y],[Pc],[mre,Yc,qc,Kc],[X],[Vc],[Qc],[gl],[bl,yl],[Lu],[`Gitea / Forgejo`,`gitea`,xl,`https://gitea.com/api/v1`,`login/oauth/authorize`,`Forgejo`,`forgejo`,12,1.24,Sl],[ld],[td,sd,cd,nd],[Cd,wd],[Od,Dd,kd,Td,Ed],[100,Cae,op,cp,wae,xae],[jd,Ad],[lp,Lae,zae,Rae],[Hae],[wl,El,Dl,Ol],[$y],[hb,mb,vb,cb,db,yb,fue,lb,fb,pb,_b,bb,gb],[dp],[xb],[vue],[eb,tb],[wb],[uue,ib,ob,ab],[Ou,Iu,Pu,Nu,Au,zre,Mu,ju],[Tb],[bue],[_y],[kb],[Ub,Bb,Cue,Sue,jb,Hb,Vb,Lb,Fb,wue,Ab,Rb,Mb,Ib,Pb,zb,Gb],[mu,hu],[jl],[Fy],[Up],[zu],[qb,Jb],[Ul],[fu],[bp],[Ku,Gu],[sh],[Xl],[Qb],[px],[_x,yx,gx,vx],[Qf,$f]],zue=[`getBackend`,`getCustomFormats`,`getCustomFormatsExtensions`,`getCustomFormatsFormatters`,`getEditorComponents`,`getEventListeners`,`getLocale`,`getMediaLibrary`,`getPreviewStyles`,`getPreviewTemplate`,`getRemarkPlugins`,`getWidgetValueSerializer`,`getWidgets`,`invokeEvent`,`moment`,`registerBackend`,`registerMediaLibrary`,`registerWidgetValueSerializer`,`removeEventListener`,`resolveWidget`,`registerLocale`,`registerRemarkPlugin`];typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var Bue=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`name`]),Vue=B(` `),Hue={hash:`svelte-1wxeykp`,code:`.icon.small-arrow.svelte-1wxeykp {overflow:hidden;width:12px;text-indent:-6px;}`};function bx(e,t){K(e,Hue);let n=Ss(t,Bue);var r=Vue();gs(r,()=>({...n,class:`sui icon material-symbols-outlined ${t.class??``}`,"aria-hidden":!(`aria-label`in n)}),void 0,void 0,void 0,`svelte-1wxeykp`);var i=F(r,!0);R(()=>W(i,t.name)),U(e,r)}var Uue=B(` `,1),Wue={hash:`svelte-8cur61`,code:`.status-label.svelte-8cur61 {position:absolute;overflow:hidden;clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;}`};function xx(e,t){O(t,!0),K(e,Wue);let n=J(t,`children`,3,void 0),r=J(t,`icon`,3,void 0);var i=Uue(),a=P(i),o=e=>{var t=H();Eo(P(t),r),U(e,t)},s=e=>{{let n=A(()=>t.status===`success`?`check_circle`:t.status);bx(e,{get name(){return z(n)}})}};G(a,e=>{r()?e(o):e(s,-1)});var c=I(a,2),l=F(c,!0);Eo(I(c,2),()=>n()??Er),R(e=>W(l,e),[()=>Y(`_sui.alert.${t.status}`)]),U(e,i),k()}var Sx=e=>e===`error`||e===`warning`?`alert`:`status`,Cx=(e,t)=>t??(e===`alert`?`assertive`:`polite`),Gue=new Set([`$$slots`,`$$events`,`$$legacy`,`status`,`ariaLive`,`children`,`icon`]),Kue=B(`
    `),que={hash:`svelte-t1jvd5`,code:`.alert.svelte-t1jvd5 {display:flex;align-items:center;gap:var(--gap, 8px);padding:var(--padding, 8px);border-width:var(--border-width, var(--sui-control-medium-border-width));border-style:var(--border-style, solid);border-radius:var(--border-radius, var(--sui-control-medium-border-radius));font-size:var(--font-size, var(--sui-font-size-default));}.alert.error.svelte-t1jvd5 {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);background-color:var(--sui-error-background-color);}.alert.warning.svelte-t1jvd5 {border-color:var(--sui-warning-border-color);color:var(--sui-warning-foreground-color);background-color:var(--sui-warning-background-color);}.alert.info.svelte-t1jvd5 {border-color:var(--sui-info-border-color);color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);}.alert.success.svelte-t1jvd5 {border-color:var(--sui-success-border-color);color:var(--sui-success-foreground-color);background-color:var(--sui-success-background-color);}`};function wx(e,t){O(t,!0),K(e,que);let n=J(t,`ariaLive`,3,void 0),r=Ss(t,Gue),i=A(()=>Sx(t.status));var a=Kue();gs(a,e=>({...r,role:z(i),class:`sui alert ${t.status??``}`,"aria-live":e}),[()=>Cx(z(i),n())],void 0,void 0,`svelte-t1jvd5`),xx(N(a),{get status(){return t.status},get children(){return t.children},get icon(){return t.icon}}),D(a),U(e,a),k()}var Tx,Ex=()=>(Tx??=navigator.userAgentData?.platform===`macOS`||navigator.platform.startsWith(`Mac`),Tx),Jue=new Set([`Ctrl`,`Meta`,`Alt`,`Shift`]),Yue=new Set([`Control`,`Meta`,`Alt`,`Shift`]),Xue=new Set([`Space`,`Enter`,`Escape`,`Tab`,`Backspace`,`Delete`,`Insert`,`Home`,`End`,`PageUp`,`PageDown`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,...Array.from({length:24},(e,t)=>`F${t+1}`)]),Zue=e=>{if(/^\d$/.test(e)){let t=`Digit${e}`;return({code:e})=>e===t}if(Xue.has(e)){let t=e===`Space`?` `:e;return({key:n,code:r})=>r===e||n===t}let t=e.toLowerCase();if(/^[a-z]$/i.test(e)){let n=`Key${e.toUpperCase()}`;return e=>{let{key:r,code:i}=e;return(r===`Dead`||r.length===1&&r.charCodeAt(0)>127)&&(Ex()||!e.getModifierState?.(`AltGraph`))?i===n:t===r.toLowerCase()}}return({key:e})=>t===e.toLowerCase()},Dx=e=>e.replace(/\bAccel\b/g,Ex()?`Meta`:`Ctrl`),Ox=new Map,kx=e=>{let t=Ox.get(e);return t||(t=Dx(e).trim().split(/\s+/).filter(Boolean).map(e=>{let t=e.split(`+`).map(e=>e===`Control`?`Ctrl`:e);return{ctrl:t.includes(`Ctrl`),meta:t.includes(`Meta`),alt:t.includes(`Alt`),shift:t.includes(`Shift`),matchers:t.filter(e=>!Jue.has(e)).map(Zue)}}),Ox.set(e,t)),t},Ax=(e,t)=>{let{ctrlKey:n,metaKey:r,altKey:i,shiftKey:a,key:o,code:s}=e;return!o&&!s||e.isComposing||e.keyCode===229?!1:t.some(({ctrl:t,meta:s,alt:c,shift:l,matchers:u})=>t===n&&s===r&&c===i&&l===a&&(u.length?u.every(t=>t(e)):Yue.has(o)))},jx=(e,t)=>Ax(e,kx(t)),Mx=new Map,Que=(e,t)=>{let{disabled:n}=e;if(!e.getClientRects().length)return;let{top:r,left:i}=e.getBoundingClientRect();n&&e.style.setProperty(`pointer-events`,`auto`);let a=document.elementsFromPoint(i+4,r+4).includes(e);n&&e.style.removeProperty(`pointer-events`),a&&(t.preventDefault(),n||(e.focus(),e.click()))},$ue=new Set([`button`,`checkbox`,`color`,`file`,`hidden`,`image`,`radio`,`range`,`reset`,`submit`]),ede=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&!$ue.has(e.type)),tde=e=>Ex()&&e.altKey&&!e.ctrlKey&&!e.metaKey&&ede(e.composedPath()[0]),Nx=e=>{tde(e)||[...Mx.keys()].forEach(t=>{Mx.get(t)?.some(({parsedShortcuts:t})=>Ax(e,t))&&Que(t,e)})},Px=(e,t)=>{t.length?e.setAttribute(`aria-keyshortcuts`,[...new Set(t.flatMap(({label:e})=>e.split(` `)))].join(` `)):e.removeAttribute(`aria-keyshortcuts`)},Fx=(e=``)=>{let t=Dx(e).trim().replace(/\s+/g,` `).replace(/\bCtrl\b/g,`Control`);if(!t)return()=>()=>{};let n=kx(e);return e=>{Mx.size||globalThis.addEventListener(`keydown`,Nx,{capture:!0});let r={parsedShortcuts:n,label:t},i=Mx.get(e)??[];return i.push(r),Mx.set(e,i),Px(e,i),()=>{let t=i.indexOf(r);t!==-1&&(i.splice(t,1),Px(e,i),i.length||Mx.delete(e),Mx.size||globalThis.removeEventListener(`keydown`,Nx,{capture:!0}))}}},Ix=e=>e===null?`null`:typeof e,nde=(e,t)=>{if(t===`number`){let t=Number(e);return Number.isNaN(t)?null:t}return t===`boolean`?e===`true`:t===`null`?null:t===`string`?e?String(e):``:e},rde=B(``),ide={hash:`svelte-zoz5la`,code:`.truncated-text.svelte-zoz5la {display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;white-space:normal;overflow-wrap:anywhere;}`};function Lx(e,t){K(e,ide);let n=J(t,`lines`,3,1),r=J(t,`children`,3,void 0);var i=rde();let a;Eo(N(i),()=>r()??Er),D(i),R(()=>a=os(i,``,a,{"-webkit-line-clamp":n(),"line-clamp":n()})),U(e,i)}var Rx=new WeakMap,zx,Bx=(e=`e`,t=7)=>[e,Fc(t)].join(`-`),Vx=e=>{Rx.delete(e),zx?.unobserve(e)},ade=()=>{if(`IntersectionObserver`in globalThis)return zx||(zx=new IntersectionObserver(e=>{e.forEach(({isIntersecting:e,target:t})=>{if(!e||!(t instanceof HTMLElement))return;let n=Rx.get(t);n&&(n(),Vx(t))})}),zx)},Hx=new Map,ode=e=>{if(!(`IntersectionObserver`in globalThis))return;let t=Hx.get(e);if(!t){let n=new Map,r=new Map;t={observer:new IntersectionObserver(e=>{e.forEach(({isIntersecting:e,target:t})=>{let i=n.get(t);i&&(r.set(t,e),[...i].forEach(t=>{i.has(t)&&t(e)}))})},{rootMargin:e}),listeners:n,states:r},Hx.set(e,t)}return t},Ux=(e,t,{rootMargin:n=`0px`}={})=>{let r=ode(n);if(!r)return()=>{};let{observer:i,listeners:a,states:o}=r,s=a.get(e)??new Set;return s.size?o.has(e)&&!s.has(t)&&queueMicrotask(()=>{s.has(t)&&a.get(e)===s&&t(o.get(e))}):(a.set(e,s),i.observe(e)),s.add(t),()=>{s.delete(t),!s.size&&a.get(e)===s&&(a.delete(e),o.delete(e),i.unobserve(e))}},Wx=(e,t,{delay:n=100,...r}={})=>{if(!(`IntersectionObserver`in globalThis)){let e=!1;return queueMicrotask(()=>{e||t()}),()=>{e=!0}}let i,a=Ux(e,e=>{clearTimeout(i),e&&(i=setTimeout(()=>{a(),t()},n))},r);return()=>{clearTimeout(i),a()}},sde=e=>{let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=globalThis;return r>0&&i>0&&t{`requestAnimationFrame`in globalThis?globalThis.requestAnimationFrame(e):globalThis.setTimeout(e,16)},Gx=e=>{let t=ade();if(t)return sde(e)?Promise.resolve(void 0):new Promise(n=>{let r=Rx.get(e);Rx.set(e,r?()=>{r(),n()}:n),cde(()=>{Rx.has(e)&&t.observe(e)})})},lde=e=>{let t=e;return t.endsWith(`-left`)?t=t.replace(`-left`,`-right`):t.endsWith(`-right`)&&(t=t.replace(`-right`,`-left`)),t.startsWith(`left-`)?t=t.replace(`left-`,`right-`):t.startsWith(`right-`)&&(t=t.replace(`right-`,`left-`)),t},ude=(e,t)=>{let n=Math.max(e.top,0),r=Math.max(e.left,0),i=Math.min(e.right,t.width),a=Math.min(e.bottom,t.height);return{top:n,left:r,right:i,bottom:a,width:Math.max(0,i-r),height:Math.max(0,a-n)}},Kx=({position:e,from:t,to:n,size:r,room:i,otherRoom:a})=>r<=i?{position:e,cap:void 0}:a>i?{position:e.replace(t,n),cap:a}:{position:e,cap:i},qx=({position:e,sides:t,size:n,rooms:r})=>{let i=t=>t.endsWith(`-`)?e.startsWith(t):e.endsWith(t),[a,o]=t,[s,c]=r;return i(a)?Kx({position:e,from:a,to:o,size:n,room:s,otherRoom:c}):i(o)?Kx({position:e,from:o,to:a,size:n,room:c,otherRoom:s}):{position:e,cap:void 0}},dde=({position:e,anchorRect:t,viewport:n,contentWidth:r,contentHeight:i})=>{let a=ude(t,n),o=a.top-8,s=n.height-a.bottom-8,c=a.left-8,l=n.width-a.right-8,u=n.height-a.top-8,d=a.bottom-8,f=e,p,m=(e,t)=>{let n=qx({position:f,sides:e,size:i,rooms:t});f=n.position,p=n.cap??p};return m([`bottom-`,`top-`],[s,o]),m([`-top`,`-bottom`],[u,d]),{position:f}=qx({position:f,sides:[`-left`,`-right`],size:r,rooms:[n.width-a.left-8,a.right-8]}),{position:f}=qx({position:f,sides:[`right-`,`left-`],size:r,rooms:[l,c]}),{inset:[f.startsWith(`bottom-`)?`${Math.round(a.bottom)}px`:f.endsWith(`-top`)?`${Math.round(a.top)}px`:`auto`,f.startsWith(`left-`)?`${Math.round(n.width-a.left)}px`:f.endsWith(`-right`)?`${Math.round(n.width-a.right)}px`:`auto`,f.startsWith(`top-`)?`${Math.round(n.height-a.top)}px`:f.endsWith(`-bottom`)?`${Math.round(n.height-a.bottom)}px`:`auto`,f.startsWith(`right-`)?`${Math.round(a.right)}px`:f.endsWith(`-left`)?`${Math.round(a.left)}px`:`auto`].join(` `),zIndex:1e3,minWidth:`${Math.round(a.width)}px`,maxWidth:f.startsWith(`right-`)?`${Math.round(l)}px`:f.startsWith(`left-`)?`${Math.round(c)}px`:f.endsWith(`-left`)?`${Math.round(n.width-a.left-8)}px`:`${Math.round(a.right-8)}px`,height:p?`${Math.round(p)}px`:void 0}},fde=(e,t)=>{let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.hasOwn(t,n)&&e[n]===t[n])},pde=class{#e=j(!1);get open(){return z(this.#e)}set open(e){M(this.#e,e,!0),e?this.checkPosition():this.anchorElement.getAttribute(`aria-expanded`)===`true`&&window.requestAnimationFrame(()=>{let{activeElement:e}=document;(!e||e===document.body||this.popupElement?.contains(e))&&this.anchorElement.focus()}),this.anchorElement.setAttribute(`aria-expanded`,String(e))}#t=j(ea({inset:void 0,zIndex:void 0,minWidth:void 0,maxWidth:void 0,height:void 0}));get style(){return z(this.#t)}set style(e){M(this.#t,e,!0)}popupElement=void 0;contentElement=void 0;nested=!1;#n=void 0;#r=[];_rafId=0;constructor(e,t,n,r){this.anchorElement=e,this.position=n,this.positionBaseElement=r??e,this.id=Bx(`popup`),this.anchorElement.setAttribute(`aria-expanded`,`false`);let i=uo(e,`click`,t=>{!this.isDisabled&&!this.isReadOnly&&(this.open=t.detail&&e.matches(`[role="menuitem"]`)?!0:!this.open)}),a=uo(e,`keydown`,t=>{let{key:n,ctrlKey:r,metaKey:i,shiftKey:a,altKey:o}=t,s=a||o||r||i;this.isDisabled||this.isReadOnly||([`Enter`,` `].includes(n)&&!s?(t.preventDefault(),t.stopPropagation(),this.open=!this.open):![`ArrowDown`,`ArrowUp`].includes(n)||a||r||i||o&&n!==`ArrowDown`||![`listbox`,`menu`].includes(e.getAttribute(`aria-haspopup`)??``)||e.matches(`[role^="menuitem"]`)||this.open||(t.preventDefault(),t.stopPropagation(),this.open=!0))}),o=uo(e,`transitionstart`,()=>{this.anchorElement.closest(`.hiding, .hidden, [hidden]`)&&this.hideImmediately()});this.#r=[i,a,o],this.intersectionObserver=new IntersectionObserver(e=>{!e.at(-1)?.isIntersecting&&this.open&&this.hideImmediately()}),this.intersectionObserver.observe(this.anchorElement),this.resizeObserver=new ResizeObserver(()=>{cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>this.checkPosition())}),this.resizeObserver.observe(this.positionBaseElement),this.viewportResizeObserver=new ResizeObserver(()=>{this.open&&this.checkPosition()}),t&&this.attachPopupElement(t)}attachPopupElement(e,t,{nested:n=!1}={}){if(this.popupElement===e&&this.contentElement===t)return;this.detachPopupElement(),this.popupElement=e,this.contentElement=t,this.nested=n,this.viewportResizeObserver.observe(e);let r=t??e;r.id=this.id,this.anchorElement.setAttribute(`aria-controls`,this.id);let i=uo(e,`click`,e=>{e.stopPropagation();let t=e.target;this.open&&(t===this.popupElement||t.matches(`[role^="menuitem"], [role="option"]`))&&(this.open=!1)}),a=uo(e,`keydown`,e=>{let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e;t===`Escape`&&!(i||a||n||r)&&(e.preventDefault(),e.stopPropagation(),this.open=!1)});this.#n=()=>{i(),a()}}detachPopupElement(){this.#n?.(),this.#n=void 0,this.popupElement&&this.viewportResizeObserver.unobserve(this.popupElement),this.anchorElement.getAttribute(`aria-controls`)===this.id&&this.anchorElement.removeAttribute(`aria-controls`),this.popupElement=void 0,this.contentElement=void 0}get isDisabled(){return this.anchorElement.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.anchorElement.matches(`[aria-readonly="true"]`)}checkPosition(){if(!this.popupElement)return;let e=this.contentElement??this.popupElement?.querySelector(`.content`)??null;if(!e)return;let t=this.positionBaseElement.getBoundingClientRect(),{maxHeight:n,maxWidth:r}=e.style;e.style.maxHeight=``,e.style.maxWidth=``;let{scrollHeight:i,scrollWidth:a}=e;e.style.maxHeight=n,e.style.maxWidth=r;let o=dde({position:kc()?lde(this.position):this.position,anchorRect:t,viewport:{width:window.innerWidth,height:window.innerHeight},contentWidth:a,contentHeight:i});fde(o,this.style)||(this.style=o)}async hideImmediately(){let e=this.nested?this.contentElement:this.popupElement;e&&(e.hidden=!0),this.open=!1,await Bu(50),e?.isConnected&&(e.hidden=!1)}destroy(){this.detachPopupElement(),this.#r.forEach(e=>e()),this.#r=[],this.intersectionObserver?.disconnect(),this.resizeObserver?.disconnect(),this.viewportResizeObserver?.disconnect(),this._rafId&&cancelAnimationFrame(this._rafId)}},mde=(...e)=>new pde(...e),Jx=e=>Math.max(0,...e.split(`,`).map(e=>Number.parseFloat(e)||0))*1e3,hde=({transitionDuration:e,transitionDelay:t})=>Jx(e)+Jx(t)+100;function Yx(e,t){var n=H();Eo(P(n),()=>t.children??Er),U(e,n)}var Xx=Symbol(`sui-modal-retainer`),gde=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`dialog`,`class`,`role`,`modal`,`showBackdrop`,`lightDismiss`,`escapeDismiss`,`keepContent`,`restoreFocus`,`children`,`extraContent`,`onOpening`,`onOpen`,`onClosing`,`onOk`,`onCancel`,`onClose`]),_de=B(` `),vde={hash:`svelte-6rdytg`,code:`dialog.svelte-6rdytg {position:fixed;inset:0;z-index:9999999;display:flex;justify-content:center;align-items:center;overflow:hidden;outline:0;margin:0;border:0;padding:0;width:100dvw;max-width:100dvw;height:100dvh;max-height:100dvh;color:var(--sui-primary-foreground-color);background:transparent;-webkit-user-select:none;user-select:none;touch-action:none;pointer-events:all;cursor:default;}dialog.svelte-6rdytg::backdrop {background:transparent;}dialog.backdrop.svelte-6rdytg {background-color:var(--sui-popup-backdrop-color);}dialog.non-modal.svelte-6rdytg {pointer-events:none;}dialog.non-modal.active.svelte-6rdytg > * {pointer-events:auto;}dialog.open.svelte-6rdytg {transition-duration:50ms;opacity:1;}dialog.svelte-6rdytg:not(.open) {transition-duration:400ms;opacity:0;}dialog[hidden].svelte-6rdytg {transition-duration:1ms !important;}dialog.svelte-6rdytg:not(.active) {pointer-events:none !important;}dialog.svelte-6rdytg:not(.active) * {transition-duration:0ms !important;pointer-events:none !important;}`};function Zx(e,t){O(t,!0),K(e,vde);let n=e=>{var n=H(),u=P(n),d=e=>{var n=_de(),u=({target:e})=>{T=e},d=({target:e})=>{let t=T;T=void 0,t&&t!==i()||c()&&e?.matches(`dialog`)&&h(`cancel`)},p=e=>{o()||e.key!==`Escape`||e.isComposing||e.defaultPrevented||(e.preventDefault(),l()&&h(`cancel`))},v=e=>{e.preventDefault(),l()&&h(`cancel`)},y=()=>{S&&i()?.isConnected&&!i().open&&(l()?r(!1):m())};gs(n,()=>({tabindex:`-1`,...f,inert:!z(g),role:a(),class:`sui modal ${t.class??``}`,onpointerdown:u,onclick:d,onkeydown:p,oncancel:v,onclose:y,[fs]:{backdrop:s(),"non-modal":!o(),open:z(g),active:z(_)}}),void 0,void 0,void 0,`svelte-6rdytg`);var b=N(n);Eo(b,()=>t.extraContent??Er),Eo(I(b,2),()=>t.children??Er),D(n),bs(n,e=>i(e),()=>i()),U(e,n)};G(u,e=>{z(x)&&e(d)}),U(e,n)},r=J(t,`open`,15,!1),i=J(t,`dialog`,15),a=J(t,`role`,3,`dialog`),o=J(t,`modal`,3,!0),s=J(t,`showBackdrop`,3,!1),c=J(t,`lightDismiss`,3,!1),l=J(t,`escapeDismiss`,3,!0),u=J(t,`keepContent`,3,!1),d=J(t,`restoreFocus`,3,!0),f=Ss(t,gde),p=()=>{i()?.focus()},m=()=>{o()?i()?.showModal():i()?.show()},h=e=>{i()&&(i(i().returnValue=e,!0),r(!1))},g=j(!1),_=j(!1),v=j(!1),y=j(0),b=ii(Xx);ai(Xx,{retain:()=>{ao(()=>{M(y,z(y)+1)})},release:()=>{ao(()=>{M(y,z(y)-1)})}});let x=A(()=>u()||z(v)||z(y)>0),S=!1,C=0,w,T,ee,E=()=>{let e=w;w=void 0,d()&&e&&(ee=window.setTimeout(()=>{let{activeElement:t}=document;e.isConnected&&(!t||t===document.body||i()?.contains(t))&&e.focus()}))},te=async()=>{if(await no(),!i())return;let e=hde(getComputedStyle(i())),t=new AbortController,{signal:n}=t;i().addEventListener(`transitionend`,e=>{e.target===i()&&t.abort()},{signal:n});let r=window.setTimeout(()=>t.abort(),e);await new Promise(e=>{n.addEventListener(`abort`,()=>e(void 0))}),window.clearTimeout(r)},ne=async()=>{if(S)return;S=!0,C+=1;let e=C,{activeElement:n}=document;window.clearTimeout(ee),w=n instanceof HTMLElement?n:void 0,t.onOpening?.(new CustomEvent(`Opening`)),M(v,!0),await no(),e===C&&i()&&!i().open&&(m(),t.onOpen?.(new CustomEvent(`Open`)),i().getBoundingClientRect(),M(g,!0),await no(),e===C&&i()&&(i().contains(document.activeElement)||p(),await te(),e===C&&M(_,!0)))},re=async()=>{if(!S)return;S=!1,C+=1;let e=C,n=z(g),r=i()?.returnValue??``;t.onClosing?.(new CustomEvent(`Closing`)),i()?.open&&(document.body.inert=!0,i().close(),document.body.inert=!1),E(),M(_,!1),M(g,!1),n&&await te(),e===C&&(M(v,!1),r===`ok`&&t.onOk?.(new CustomEvent(`Ok`)),r===`cancel`&&t.onCancel?.(new CustomEvent(`Cancel`)),t.onClose?.(new CustomEvent(`Close`,{detail:{returnValue:r}})),i()&&i(i().returnValue=``,!0))},ie=Iee();return Do(()=>{let e=xo(Yx,{target:document.querySelector(`.sui.app-shell`)??document.body,props:{children:n},context:ie});return()=>{window.clearTimeout(ee),i()?.close(),wo(e)}}),L(()=>{r()?ne():re()}),L(()=>{if(z(v))return b?.retain(),()=>{b?.release()}}),k({focus:p,close:h})}var yde=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`hovered`,`content`,`class`,`showBackdrop`,`anchor`,`position`,`positionBaseElement`,`parentDialogElement`,`touchOptimized`,`children`,`onOpen`]),bde=B(`
    `),xde={hash:`svelte-1aawl8x`,code:`.content.svelte-1aawl8x {position:absolute;overflow-y:auto;outline-width:0 !important;width:auto;transition-property:opacity, transform;color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);}.content.menu.svelte-1aawl8x {border-width:var(--sui-menu-border-width, 1px);border-style:var(--sui-menu-border-style, solid);border-color:var(--sui-menu-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-menu-border-radius, 4px);padding:var(--sui-menu-padding, 4px);}.content.menu.svelte-1aawl8x .sui.menu {border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.listbox.svelte-1aawl8x {border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);}.content.listbox.svelte-1aawl8x .sui.listbox {border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.tree.svelte-1aawl8x {border-width:var(--sui-tree-border-width, 1px);border-style:var(--sui-tree-border-style, solid);border-color:var(--sui-tree-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-tree-border-radius, 4px);padding:var(--sui-tree-padding, 4px);}.content.tree.svelte-1aawl8x .sui.tree {margin:0;border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.combobox.svelte-1aawl8x {display:flex;flex-direction:column;overflow:hidden;}.content.touch.svelte-1aawl8x {position:static;border-width:0 !important;border-radius:4px !important;padding:8px;min-width:320px !important;max-width:calc(100dvw - 32px) !important;max-height:calc(100dvh - 32px) !important;}dialog.open .content.touch.svelte-1aawl8x {transform:scale(100%) !important;}dialog:not(.open) .content.touch.svelte-1aawl8x {transform:scale(90%);}.content.touch.combobox.svelte-1aawl8x .sui.listbox {gap:4px;padding:8px 4px !important;}dialog.open .content.svelte-1aawl8x {transition-duration:50ms;opacity:1;transform:translateY(2px);}dialog:not(.open) .content.svelte-1aawl8x {transition-duration:300ms;opacity:0;transform:translateY(-8px);}.content.nested.menu.svelte-1aawl8x {margin-block:calc(-1 * (var(--sui-menu-border-width, 1px) + var(--sui-menu-padding, 4px)));}dialog.open .content.nested.menu.svelte-1aawl8x {transform:none;}`};function Qx(e,t){O(t,!0),K(e,xde);let n=e=>{var n=bde();let o,s;Eo(N(n),()=>t.children??Er),D(n),bs(n,e=>a(e),()=>a()),R(()=>{q(n,`hidden`,!r()),o=is(n,1,`content ${t.class??``} ${z(m)??``}`,`svelte-1aawl8x`,o,{touch:z(v),nested:!!l()}),s=os(n,``,s,{inset:z(h)?.style.inset,"z-index":z(h)?.style.zIndex,"min-width":z(h)?.style.minWidth,"max-width":z(h)?.style.maxWidth,"max-height":z(h)?.style.height,visibility:z(h)?.style.inset?void 0:`hidden`})}),fo(`mouseenter`,n,()=>{i(!0),l()&&window.clearTimeout(g)}),fo(`mouseleave`,n,()=>{i(!1),l()&&(g=window.setTimeout(()=>{r(!1)},200))}),U(e,n)},r=J(t,`open`,15,!1),i=J(t,`hovered`,15,!1),a=J(t,`content`,15,void 0),o=J(t,`showBackdrop`,3,void 0),s=J(t,`position`,3,`bottom-left`),c=J(t,`positionBaseElement`,3,void 0),l=J(t,`parentDialogElement`,3,void 0),u=J(t,`touchOptimized`,3,!1),d=Ss(t,yde),f=j(void 0),p=j(!1),m=j(void 0),h=j(void 0),g=0,_=({tabStopOnly:e=!1}={})=>{if(!a())return!1;let t=[...a().querySelectorAll(`[tabindex="0"]:not([aria-disabled="true"])`),...e?[]:a().querySelectorAll(`[tabindex]:not([aria-disabled="true"])`)].some(e=>(e.focus(),document.activeElement===e));return!t&&!e&&(a(a().tabIndex=-1,!0),a().focus()),t};L(()=>{z(h)&&r(z(h).open)}),L(()=>{z(h)&&z(h).open!==r()&&(z(h).open=r())}),L(()=>{l()&&!z(f)&&a()&&(M(f,l()),z(f).append(a()))}),L(()=>{t.anchor&&!z(h)&&(M(h,mde(t.anchor,void 0,s(),c()),!0),M(m,t.anchor.getAttribute(`aria-haspopup`)??void 0,!0))}),L(()=>{if(z(h)&&z(f)&&a())return z(h).attachPopupElement(z(f),a(),{nested:!!l()}),()=>{z(h)?.detachPopupElement()}}),L(()=>{r()&&z(f)&&z(h)?.checkPosition()});let v=A(()=>u()&&z(p));Do(()=>(M(p,globalThis.matchMedia(`(pointer: coarse)`).matches,!0),()=>{z(h)?.destroy?.(),globalThis.clearTimeout(g)}));var y=H(),b=P(y),x=e=>{n(e)},S=e=>{{let i=A(()=>o()??z(v));Zx(e,Cs(()=>d,{role:`none`,class:`popup`,get showBackdrop(){return z(i)},lightDismiss:!0,onOpen:async e=>{t.onOpen?.(e),await no(),a()&&!_({tabStopOnly:!0})&&(await Bu(100),a()&&!a().contains(document.activeElement)&&_())},get dialog(){return z(f)},set dialog(e){M(f,e,!0)},get open(){return r()},set open(e){r(e)},children:(e,t)=>{n(e)},$$slots:{default:!0}}))}};G(b,e=>{l()?e(x):e(S,-1)}),U(e,y),k()}var Sde=new Set(`$$slots.$$events.$$legacy.element.class.type.role.name.value.valueType.hidden.disabled.readonly.pressed.keyShortcuts.label.labelDir.lines.variant.size.iconic.pill.flex.popupPosition.showPopupBackdrop.children.startIcon.endIcon.popup`.split(`.`)),$x=B(``),Cde=B(` `,1),wde=B(` `,1),Tde={hash:`svelte-6408uz`,code:`button.svelte-6408uz {flex:none;display:inline-flex;align-items:center;gap:4px;margin:var(--sui-focus-ring-width);border-width:0;border-style:solid;border-color:transparent;padding:0;color:var(--sui-control-foreground-color, inherit);background-color:transparent;box-shadow:none;font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);font-weight:var(--sui-font-weight-normal, normal);text-align:start;cursor:pointer;transition:all 200ms;}button[hidden].svelte-6408uz {display:none !important;}button.svelte-6408uz:not(:disabled):focus-visible {z-index:1;}button.svelte-6408uz:is(.primary:where(.svelte-6408uz), .secondary:where(.svelte-6408uz), .tertiary:where(.svelte-6408uz), .ghost:where(.svelte-6408uz)) {justify-content:center;border-width:1px;}button.svelte-6408uz:is(.primary:where(.svelte-6408uz), .secondary:where(.svelte-6408uz), .tertiary:where(.svelte-6408uz), .ghost:where(.svelte-6408uz)) .label:where(.svelte-6408uz):only-child {padding:0 4px;}button.primary.svelte-6408uz {border-width:var(--sui-button-primary-border-width, 1px);border-style:var(--sui-button-primary-border-style, solid);border-color:var(--sui-button-primary-border-color, var(--sui-primary-accent-color));color:var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted));background-color:var(--sui-button-primary-background-color, var(--sui-primary-accent-color));font-weight:var(--sui-button-primary-font-weight, var(--sui-font-weight-normal, normal));}button.primary.svelte-6408uz:is(:where(.svelte-6408uz):hover, :where(.svelte-6408uz):focus-visible, [aria-expanded=true]:where(.svelte-6408uz)) {color:var(--sui-button-primary-foreground-color-focus, var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted)));background-color:var(--sui-button-primary-background-color-focus, var(--sui-primary-accent-color-light));}button.primary.svelte-6408uz:active {color:var(--sui-button-primary-foreground-color-active, var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted)));background-color:var(--sui-button-primary-background-color-active, var(--sui-primary-accent-color-dark));}button.secondary.svelte-6408uz {border-width:var(--sui-button-secondary-border-width, 1px);border-style:var(--sui-button-secondary-border-style, solid);border-color:var(--sui-button-secondary-border-color, var(--sui-primary-accent-color));color:var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text));background-color:var(--sui-button-secondary-background-color, var(--sui-button-background-color));font-weight:var(--sui-button-secondary-font-weight, var(--sui-font-weight-normal, normal));}button.secondary.svelte-6408uz:is(:where(.svelte-6408uz):hover, :where(.svelte-6408uz):focus-visible, [aria-expanded=true]:where(.svelte-6408uz)) {color:var(--sui-button-secondary-foreground-color-focus, var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text)));background-color:var(--sui-button-secondary-background-color-focus, var(--sui-hover-background-color));}button.secondary.svelte-6408uz:active {color:var(--sui-button-secondary-foreground-color-active, var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text)));background-color:var(--sui-button-secondary-background-color-active, var(--sui-active-background-color));}button.secondary[aria-pressed=true].svelte-6408uz {color:var(--sui-button-secondary-foreground-color-pressed);background-color:var(--sui-button-secondary-background-color-pressed, var(--sui-primary-accent-color));}button.tertiary.svelte-6408uz {border-width:var(--sui-button-tertiary-border-width, 1px);border-style:var(--sui-button-tertiary-border-style, solid);border-color:var(--sui-button-tertiary-border-color, var(--sui-button-border-color));color:var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color));background-color:var(--sui-button-tertiary-background-color, var(--sui-button-background-color));font-weight:var(--sui-button-tertiary-font-weight, var(--sui-font-weight-normal, normal));}button.tertiary.svelte-6408uz:is(:where(.svelte-6408uz):hover, :where(.svelte-6408uz):focus-visible, [aria-expanded=true]:where(.svelte-6408uz)) {color:var(--sui-button-tertiary-foreground-color-focus, var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color)));background-color:var(--sui-button-tertiary-background-color-focus, var(--sui-hover-background-color));}button.tertiary.svelte-6408uz:active {color:var(--sui-button-tertiary-foreground-color-active, var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color)));background-color:var(--sui-button-tertiary-background-color-active, var(--sui-active-background-color));}button.tertiary[aria-pressed=true].svelte-6408uz {color:var(--sui-button-tertiary-foreground-color-pressed);background-color:var(--sui-button-tertiary-background-color-pressed, var(--sui-selected-background-color));}button.ghost.svelte-6408uz {font-weight:var(--sui-button-ghost-font-weight, var(--sui-font-weight-normal, normal));}button.ghost.svelte-6408uz:is(:where(.svelte-6408uz):hover, :where(.svelte-6408uz):focus-visible, [aria-expanded=true]:where(.svelte-6408uz)) {color:var(--sui-button-ghost-foreground-color-focus);background-color:var(--sui-button-ghost-background-color-focus, var(--sui-hover-background-color));}button.ghost.svelte-6408uz:active {color:var(--sui-button-ghost-foreground-color-active);background-color:var(--sui-button-ghost-background-color-active, var(--sui-active-background-color));}button.ghost[aria-pressed=true].svelte-6408uz {color:var(--sui-button-ghost-foreground-color-pressed);background-color:var(--sui-button-ghost-background-color-pressed, var(--sui-selected-background-color));}button.link.svelte-6408uz {margin:0;padding:0 !important;height:auto !important;color:var(--sui-button-link-foreground-color, var(--sui-primary-accent-color-text));}button.link.svelte-6408uz:hover .label:where(.svelte-6408uz) {outline:none !important;text-decoration:underline;}button.link.svelte-6408uz .label:where(.svelte-6408uz) {padding:0;line-height:var(--sui-line-height-compact);text-decoration:var(--sui-button-link-text-decoration, none);text-underline-offset:2px;white-space:normal;}:is(:root, :host)[data-underline-links='true'] button.link.svelte-6408uz .label:where(.svelte-6408uz) {text-decoration:underline;}button.small.svelte-6408uz {border-radius:var(--sui-button-small-border-radius);padding:var(--sui-button-small-padding);height:var(--sui-button-small-height);font-size:var(--sui-button-small-font-size, var(--sui-font-size-small));}button.small.svelte-6408uz .icon {font-size:var(--sui-font-size-large);}button.medium.svelte-6408uz {border-radius:var(--sui-button-medium-border-radius);padding:var(--sui-button-medium-padding);height:var(--sui-button-medium-height);font-size:var(--sui-button-medium-font-size, var(--sui-font-size-default));}button.large.svelte-6408uz {border-radius:var(--sui-button-large-border-radius);padding:var(--sui-button-large-padding);height:var(--sui-button-large-height);font-size:var(--sui-button-large-font-size, var(--sui-font-size-large));}button.pill.svelte-6408uz {border-radius:80px;padding:var(--sui-button-medium-pill-padding, 0 12px);}button.flex.svelte-6408uz:not([hidden]) {display:inline-flex;flex:auto;width:-moz-available;width:-webkit-fill-available;width:stretch;}button.iconic.svelte-6408uz {justify-content:center;padding:0;aspect-ratio:1/1;}button.danger.svelte-6408uz {background-color:var(--sui-error-background-color);}button.svelte-6408uz .label:where(.svelte-6408uz) {padding:0 4px;}button.svelte-6408uz > * {pointer-events:none;}`};function eS(e,t){O(t,!0),K(e,Tde);let n=e=>{var t=$x();Lx(N(t),{get lines(){return _()},children:(e,t)=>{qr();var n=V();R(()=>W(n,h())),U(e,n)},$$slots:{default:!0}}),D(t),R(()=>{q(t,`dir`,g()),t.dir=t.dir}),U(e,t)},r=J(t,`element`,15),i=J(t,`class`,3,``),a=J(t,`type`,3,`button`),o=J(t,`role`,3,`button`),s=J(t,`name`,3,void 0),c=J(t,`value`,3,void 0),l=J(t,`valueType`,19,()=>Ix(c())),u=J(t,`hidden`,3,!1),d=J(t,`disabled`,3,!1),f=J(t,`readonly`,3,!1),p=J(t,`pressed`,3,void 0),m=J(t,`keyShortcuts`,3,void 0),h=J(t,`label`,3,``),g=J(t,`labelDir`,3,void 0),_=J(t,`lines`,3,1),v=J(t,`variant`,3,void 0),y=J(t,`size`,3,`medium`),b=J(t,`iconic`,3,!1),x=J(t,`pill`,3,!1),S=J(t,`flex`,3,!1),C=J(t,`popupPosition`,3,`bottom-left`),w=J(t,`showPopupBackdrop`,3,!1),T=Ss(t,Sde);var ee=wde(),E=P(ee);gs(E,()=>({...T,class:[`sui`,`button`,v(),y(),i()],type:a(),name:s(),value:c(),hidden:u(),disabled:d(),role:o(),"aria-hidden":u(),"aria-disabled":d(),"aria-readonly":f()||void 0,"aria-pressed":p(),"data-type":l(),"data-name":s(),"data-label":h(),"data-value":c(),[fs]:{iconic:b(),pill:x(),flex:S()}}),void 0,void 0,void 0,`svelte-6408uz`);var te=N(E);Eo(te,()=>t.startIcon??Er);var ne=I(te,2),re=e=>{var r=H(),i=P(r),a=e=>{n(e)},o=e=>{var n=$x();Eo(N(n),()=>t.children??Er),D(n),U(e,n)};G(i,e=>{h()?e(a):e(o,-1)}),U(e,r)},ie=e=>{var r=Cde(),i=P(r),a=e=>{n(e)};G(i,e=>{h()&&e(a)}),Eo(I(i,2),()=>t.children??Er),U(e,r)};G(ne,e=>{v()===`link`?e(re):e(ie,-1)}),Eo(I(ne,2),()=>t.endIcon??Er),D(E),bs(E,e=>r(e),()=>r()),Qo(E,()=>m()&&Fx(m()));var ae=I(E,2),oe=e=>{Qx(e,{get anchor(){return r()},get position(){return C()},get showBackdrop(){return w()},touchOptimized:!0,children:(e,n)=>{var r=H();Eo(P(r),()=>t.popup),U(e,r)},$$slots:{default:!0}})};G(ae,e=>{t.popup&&e(oe)}),U(e,ee),k()}var Ede=B(`
    `),Dde=B(`
    `),Ode={hash:`svelte-19p6mta`,code:`.infobar.svelte-19p6mta {flex:none;display:flex;align-items:center;gap:var(--sui-infobar-gap, 8px);border-width:var(--sui-infobar-border-width, 0 0 1px);border-style:var(--sui-infobar-border-style, solid);padding:var(--sui-infobar-padding, 0);min-height:var(--sui-infobar-min-height, 32px);font-size:var(--sui-infobar-font-size, var(--sui-font-size-small));}.infobar.info.svelte-19p6mta {border-color:var(--sui-info-border-color);color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);}.infobar.warning.svelte-19p6mta {border-color:var(--sui-warning-border-color);color:var(--sui-warning-foreground-color);background-color:var(--sui-warning-background-color);}.infobar.error.svelte-19p6mta {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);background-color:var(--sui-error-background-color);}.infobar.success.svelte-19p6mta {border-color:var(--sui-success-border-color);color:var(--sui-success-foreground-color);background-color:var(--sui-success-background-color);}.message.svelte-19p6mta {flex:auto;display:flex;align-items:center;justify-content:var(--sui-infobar-message-justify-content, start);gap:var(--sui-infobar-message-gap, 6px);padding:var(--sui-infobar-message-padding, 6px);}.message.svelte-19p6mta button {font-size:inherit !important;}.message.svelte-19p6mta .icon {font-size:16px; /* !hardcoded */}`};function tS(e,t){O(t,!0),K(e,Ode);let n=J(t,`show`,15,!0),r=J(t,`dismissible`,3,!0),i=J(t,`status`,3,`info`),a=J(t,`ariaLive`,3,void 0),o=J(t,`children`,3,void 0),s=J(t,`icon`,3,void 0),c=A(()=>Sx(i()));var l=H(),u=P(l),d=e=>{var l=Dde(),u=N(l);xx(N(u),{get status(){return i()},get children(){return o()},get icon(){return s()}}),D(u);var d=I(u,2),f=e=>{var r=Ede(),i=N(r);{let e=A(()=>Y(`_sui.dismiss`));eS(i,{iconic:!0,size:`small`,variant:`ghost`,get"aria-label"(){return z(e)},onclick:()=>{n(!1),t.onDismiss?.()},children:(e,t)=>{bx(e,{name:`close`})},$$slots:{default:!0}})}D(r),U(e,r)};G(d,e=>{r()&&e(f)}),D(l),R(e=>{is(l,1,es([`infobar`,i()]),`svelte-19p6mta`),q(u,`role`,z(c)),q(u,`aria-live`,e)},[()=>Cx(z(c),a())]),U(e,l)};G(u,e=>{n()&&e(d)}),U(e,l),k()}var kde=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`children`]),Ade=B(`
    `),jde={hash:`svelte-6zligd`,code:`.bottom-navigation.svelte-6zligd {height:var(--sui-bottom-navigation-height, var(--sui-primary-toolbar-size));border-top-width:var(--sui-bottom-navigation-border-color, 1px);border-top-style:var(--sui-bottom-navigation-border-style, solid);border-top-color:var(--sui-bottom-navigation-border-color, var(--sui-secondary-border-color));}.bottom-navigation.svelte-6zligd:is([inert]:where(.svelte-6zligd), [hidden]:where(.svelte-6zligd)) {display:none;}.bottom-navigation.svelte-6zligd .buttons {flex:auto;display:flex;align-items:center;justify-content:space-evenly;}`};function Mde(e,t){K(e,jde);let n=Ss(t,kde);var r=Ade();gs(r,()=>({role:`none`,class:`sui bottom-navigation ${t.class??``}`,...n}),void 0,void 0,void 0,`svelte-6zligd`),Eo(N(r),()=>t.children??Er),D(r),U(e,r)}var Nde=B(`
    `),Pde={hash:`svelte-y7nbhn`,code:`.floating-action-button-wrapper.svelte-y7nbhn {display:contents;} @media (width < 768px) {.floating-action-button-wrapper.svelte-y7nbhn {display:block;position:fixed;inset-inline-end:16px;inset-block-end:72px;z-index:100;}.floating-action-button-wrapper.svelte-y7nbhn button {border-radius:50%;height:56px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.4);}.floating-action-button-wrapper.svelte-y7nbhn button .icon {font-size:32px;} }`};function nS(e,t){K(e,Pde);let n=J(t,`children`,3,void 0);var r=Nde();Eo(N(r),()=>n()??Er),D(r),U(e,r)}var rS=e=>{try{e.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`auto`})}catch{e.scrollIntoView(!0)}},iS=Symbol(`sui-option-registry`),Fde=class{#e=j(!1);get expanded(){return z(this.#e)}set expanded(e){M(this.#e,e,!0)}#t=new Set;#n=j(0);#r=[];#i=-1;get#a(){return this.#i!==z(this.#n)&&(this.#r=[...this.#t],this.#i=z(this.#n)),this.#r}get count(){return this.#a.length}get entries(){return this.#a}get selectedEntry(){return this.#a.find(e=>e.selected)}register(e){return this.#t.add(e),M(this.#n,z(this.#n)+1),()=>{this.#t.delete(e),M(this.#n,z(this.#n)+1)}}find(e){return this.#a.find(t=>t.value===e)}selectOnly(e){this.#a.forEach(t=>{let n=t.value===e;t.selected!==n&&(t.selected=n)})}},Ide=()=>ai(iS,new Fde),Lde=()=>ii(iS),aS=e=>{let{type:t=`string`,name:n,label:r}=e.dataset;return{target:e,type:t,name:n,label:r,value:nde(e.dataset.value,t)}},Rde=/\p{Diacritic}/gu,oS=e=>e.normalize(`NFD`).replace(Rde,``).toLocaleLowerCase(),sS=e=>oS(e.trim()),cS=(e,t)=>e===`horizontal`?t?{prevKey:`ArrowRight`,nextKey:`ArrowLeft`}:{prevKey:`ArrowLeft`,nextKey:`ArrowRight`}:{prevKey:`ArrowUp`,nextKey:`ArrowDown`},zde=({key:e,index:t,count:n,prevKey:r,nextKey:i})=>e===r?t>0?t-1:n-1:e===i?t{let o=n-1,s=e===`ArrowUp`||e===i,c=e===`ArrowDown`||e===a;return t===-1?c?0:s?o:-1:s&&t>0?e===`ArrowUp`?Math.max(t-r,0):t-1:c&&t{this.#e=``},500),this.#e}reset(){globalThis.clearTimeout(this.#t),this.#e=``}},uS=(e,t,n)=>{if(!t)return-1;let r=t.length>1&&[...t].every(e=>e===t[0]),i=r?t[0]:t,a=t.length===1||r?n+1:Math.max(n,0),{length:o}=e;for(let t=0;tn=>{e.activate(),t(n)},fS=async(e,t)=>{await Bu(100),t()||e.activate()},pS=`[aria-disabled="true"], [aria-hidden="true"]`,mS=(e,t)=>{e.getAttribute(`tabindex`)!==String(t)&&(e.tabIndex=t)},Vde={grid:{orientation:`vertical`,childRoles:[`row`],childSelectedAttr:`aria-selected`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},listbox:{orientation:`vertical`,childRoles:[`option`],childSelectedAttr:`aria-selected`,focusChild:!1,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},menu:{orientation:`vertical`,childRoles:[`menuitem`,`menuitemcheckbox`,`menuitemradio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`first`},menubar:{orientation:`horizontal`,childRoles:[`menuitem`,`menuitemcheckbox`,`menuitemradio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`first`},radiogroup:{orientation:`horizontal`,childRoles:[`radio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},tablist:{orientation:`horizontal`,childRoles:[`tab`],childSelectedAttr:`aria-selected`,focusChild:!0,selectFirst:!0,controlsPanel:!0,rovingTabStop:`selected`}},Hde=`a[href], button, input, select, textarea, summary, [tabindex]`,Ude=(e,t)=>{let n=[...document.querySelectorAll(Hde)].filter(t=>t===e||t.tabIndex>=0&&!t.matches(`:disabled, [aria-disabled="true"], [hidden], [inert], [inert] *`)),r=n.indexOf(e);if(r===-1)return;let i=t?-1:1;for(let e=r+i;e>=0&&e{let t=e;for(;t;){if(t.id){let e=document.querySelector(`[aria-haspopup="menu"][aria-controls="${CSS.escape(t.id)}"]`);if(e)return e}t=t.parentElement}return null},gS=(e,t=e.getAttribute(`role`))=>t!==`menuitem`&&e.dataset.selectable!==`false`,Wde=class{activated=!1;selectionObserver=void 0;#e=!1;#t=void 0;#n=void 0;#r=new WeakMap;#i=new WeakMap;#a=new lS;#o=!1;#s(e){let t=e.dataset.searchValue??e.dataset.label??e.querySelector(`.label`)?.textContent??e.textContent,n=this.#r.get(e);if(n?.raw===t)return n.normalized;let r=sS(t);return this.#r.set(e,{raw:t,normalized:r}),r}#c(e){let t=this.controlsPanel?e.getAttribute(`aria-controls`):null;return t?document.getElementById(t):null}#l(e,t){e.inert=!t,e.setAttribute(`aria-hidden`,String(!t))}constructor(e,{clickToSelect:t=!0}={}){e.dispatchEvent(new CustomEvent(`Initializing`)),this.parent=e,this.role=e.getAttribute(`role`),this.multi=this.parent.getAttribute(`aria-multiselectable`)===`true`,this.id=Bx(this.role),this.parentGroupSelector=`[role="group"], [role="${this.role}"]`,this.clickToSelect=t,this._onClick=dS(this,e=>this.onClick(e)),this._onKeyDown=dS(this,e=>this.onKeyDown(e));let{orientation:n,childRoles:r,childSelectedAttr:i,focusChild:a,selectFirst:o,controlsPanel:s,rovingTabStop:c}=Vde[this.role];this.orientation=this.grid?`horizontal`:this.parent.getAttribute(`aria-orientation`)??n,this.childRoles=r,this.childSelectedAttr=i,this.childSelectedProp=i.replace(`aria-`,``),this.focusChild=a,this.selectFirst=o,this.controlsPanel=s,this.rovingTabStop=c,this.parent.tabIndex=a?-1:0,this.observer=new globalThis.MutationObserver(e=>{this.#d(e)&&(this.#n=void 0,this.activated&&e.some(({type:e})=>e===`childList`)&&this.updateTabStop())}),this.observer.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`aria-disabled`,`aria-hidden`]}),(s||a&&c===`selected`)&&(this.selectionObserver=new globalThis.MutationObserver(()=>{this.activated&&this.syncSelection()}),this.selectionObserver.observe(e,{subtree:!0,attributes:!0,attributeFilter:[i]})),e.addEventListener(`click`,this._onClick),e.addEventListener(`keydown`,this._onKeyDown),fS(this,()=>this.#e)}activate(){if(this.activated)return;let{parent:e,allMembers:t,selected:n}=this;this.activated=!0,t.forEach((e,t)=>{let r=e.getAttribute(this.childSelectedAttr)===`true`||(n?e===n:this.selectFirst&&t===0),i=this.#c(e);e.id||=`${this.id}-item-${t+1}`,gS(e)&&e.setAttribute(this.childSelectedAttr,String(r)),i&&(i.setAttribute(`aria-labelledby`,e.id),this.#l(i,r),r&&globalThis.setTimeout(()=>{rS(i)},300))}),this.updateTabStop(),e.dispatchEvent(new CustomEvent(`Initialized`))}updateTabStop(){let{allMembers:e,activeMembers:t}=this;if(!this.focusChild){e.forEach(e=>{e.tabIndex=-1});return}let{activeElement:n}=document,r=t.find(e=>e===n||e.contains(n)),i=t.filter(e=>e.getAttribute(`tabindex`)===`0`),a=r??(i.length===1?i[0]:(this.rovingTabStop===`selected`?this.selected:void 0)??t.find(e=>e.dataset.selectable!==`false`)??t[0]);e.forEach(e=>{mS(e,e===a?0:-1)})}syncSelection(){let{allMembers:e,parent:t}=this;if(this.controlsPanel&&e.forEach(e=>{let t=this.#c(e);t&&this.#l(t,e.getAttribute(this.childSelectedAttr)===`true`)}),this.focusChild&&!t.contains(document.activeElement)){let{selected:t}=this;t&&e.forEach(e=>{mS(e,e===t?0:-1)})}}get columnCount(){let e=this.allMembers.filter(e=>e.getClientRects().length),t=e[0]?.getBoundingClientRect().top,n=e.findIndex(e=>Math.abs(e.getBoundingClientRect().top-t)>1);return Math.max(1,n===-1?e.length:n)}get selector(){return this.childRoles.map(e=>`[role="${e}"]`).join(`,`)}get#u(){if(this.#d(this.observer.takeRecords())&&(this.#n=void 0),!this.#n){let e=[...this.parent.querySelectorAll(this.selector)];this.#n={all:e,active:e.filter(e=>!e.matches(pS))}}return this.#n}#d(e){let{selector:t}=this,n=e=>e instanceof Element&&(e.matches(t)||!!e.querySelector(t));return e.some(({type:e,target:r,addedNodes:i,removedNodes:a})=>e===`attributes`?r instanceof Element&&r.matches(t):[...i].some(n)||[...a].some(n))}get allMembers(){return this.#u.all}get activeMembers(){return this.#u.active}get opener(){return hS(this.parent)}get parentMenuItem(){let{opener:e}=this;return e?.matches(`[role^="menuitem"]`)?e:null}closeMenuChain(){let{opener:e}=this,t=e,n=null;for(let e=0;e<10&&t;e+=1){n=t,t.getAttribute(`aria-expanded`)===`true`&&t.click();let e=t.closest(`[role="menu"], [role="menubar"]`);t=e?hS(e):null}return n}async leaveMenu(e){let t=this.closeMenuChain();t&&(t.focus(),await Bu(50),Ude(t,e))}async enterSubmenu(e){let t=e.getAttribute(`aria-controls`);if(!t)return;e.getAttribute(`aria-expanded`)!==`true`&&e.click();let n=document.getElementById(t);for(let e=0;e<20;e+=1){let e=[...n?.querySelectorAll(this.selector)??[]].find(e=>!e.matches(pS));if(e?.focus(),e&&document.activeElement===e)return;await Bu(20)}}leaveSubmenu(e){e.getAttribute(`aria-expanded`)===`true`&&e.click(),e.focus()}get selected(){return this.activeMembers.find(e=>e.getAttribute(this.childSelectedAttr)===`true`)}get isDisabled(){return this.parent.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.parent.matches(`[aria-readonly="true"]`)}get grid(){return this.role===`grid`||this.role===`listbox`&&this.parent.matches(`.grid`)}#f(e,t){e.setAttribute(this.childSelectedAttr,String(t)),e.dispatchEvent(new CustomEvent(`Change`,{detail:{[this.childSelectedProp]:t}}))}#p(e){this.#o=!0;try{e.click()}finally{this.#o=!1}}#m(e,t,{role:n,isTarget:r,targetSelectable:i,selecting:a}){let o=n===`menuitemradio`,s=gS(t,n),c=s&&(n===`menuitemcheckbox`||this.multi),l=s&&i&&(o||!c),u=t.getAttribute(this.childSelectedAttr)===`true`,d=!1;return n===`menuitem`&&r&&a&&(d=!0,t.dispatchEvent(new CustomEvent(`Select`))),c&&r&&a&&(d=!0,this.#f(t,!u),u||t.dispatchEvent(new CustomEvent(`Select`))),l&&u!==r&&(!o||a)&&(d=!0,this.#f(t,r),r&&(e.type===`keydown`&&n===`radio`&&this.#p(t),t.dispatchEvent(new CustomEvent(`Select`)))),d}#h(e,t,n){let r=this.#c(e);this.focusChild||(e.classList.toggle(`focused`,t),t&&e.dispatchEvent(new CustomEvent(`Focus`))),r&&(this.#l(r,t),t&&n.push(r)),t&&(this.parent.setAttribute(`aria-activedescendant`,e.id),n.push(e))}#g(e,t,n){e.forEach(e=>{mS(e,e===t?0:-1)}),n&&(t.focus(),t.dispatchEvent(new CustomEvent(`Focus`)))}selectTarget(e,t){if(this.isDisabled||this.isReadOnly){e.preventDefault();return}let n=t.getAttribute(`role`),r=t.closest(this.parentGroupSelector),i=gS(t,n),a=e.type===`click`||e.type===`keydown`&&e.key===` `,o=[],s=!1,c=[],l=!1;this.activeMembers.forEach(u=>{let d=u.getAttribute(`role`);if((d===`menuitemcheckbox`||d===`menuitemradio`)&&(d!==n||u.closest(this.parentGroupSelector)!==r))return;let f=u===t;o.push(u),s||=f,this.#m(e,u,{role:d,isTarget:f,targetSelectable:i,selecting:a})&&(l=!0),this.#h(u,f,c)}),c.length&&this.scrollIntoViewLater(c),this.focusChild&&this.#g(o,t,s),l&&this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:aS(t)}))}scrollIntoViewLater(e){globalThis.clearTimeout(this.#t),this.#t=globalThis.setTimeout(()=>{this.#t=void 0,e.forEach(rS)},300)}onClick(e){let t=e.target,n=t.matches(this.selector)?t:t.closest(this.selector);!n||e.button!==0||!this.clickToSelect||this.#o||(this.selectTarget(e,n),!this.focusChild&&document.activeElement!==this.parent&&n.contains(document.activeElement)&&this.parent.focus({preventScroll:!0}))}onKeyDown(e){let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e,o=i||a||n||r,s=this.childRoles.includes(`menuitem`);if(t===`Tab`&&s&&!n&&!r&&!a){e.preventDefault(),this.leaveMenu(i);return}if(o)return;let c=e.target,{activeMembers:l}=this;if(c!==this.parent&&c.matches(`input, textarea, select, [contenteditable]:not([contenteditable="false"])`)&&t!==`Escape`&&t!==`Tab`)return;let u=this.#_(c);[`Enter`,` `,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`].includes(t)&&e.preventDefault();let d=c===this.parent||c.matches(this.selector);if(t===`Home`||t===`End`){if(!d)return;e.preventDefault();let n=l[t===`Home`?0:l.length-1];n&&n!==u&&this.selectTarget(e,n);return}if(t.length===1&&t!==` `&&d&&(this.role===`listbox`||s)){e.preventDefault();let n=this.#v(t,u);n&&n!==u&&this.selectTarget(e,n);return}if(t===`Enter`){u?.click();return}if(t===` `){u&&this.selectTarget(e,u);return}if(t===`Escape`&&s){let{parentMenuItem:t}=this;if(t){e.preventDefault(),e.stopPropagation(),this.leaveSubmenu(t);return}}let f=kc();if(this.orientation===`vertical`&&s){let{prevKey:e,nextKey:n}=cS(`horizontal`,f);if(t===n&&u?.getAttribute(`aria-haspopup`)===`menu`){this.enterSubmenu(u);return}if(t===e){let{parentMenuItem:e}=this;if(e){this.leaveSubmenu(e);return}}}let p=this.#y(t,u,f);p&&p!==u&&this.selectTarget(e,p)}#_(e){if(!this.focusChild)return this.activeMembers.find(e=>e.matches(`.focused`));let t=e.closest(this.selector);return t&&this.parent.contains(t)?t:void 0}#v(e,t){let{activeMembers:n}=this,r=uS(n.map(e=>sS(e.dataset.label??e.querySelector(`.label`)?.textContent??e.textContent??``)),this.#a.push(e),t?n.indexOf(t):-1);return r===-1?void 0:n[r]}#y(e,t,n){let{allMembers:r,activeMembers:i}=this;if(!this.grid){let r=t?i.indexOf(t):-1,a=cS(this.orientation,n);return i[zde({key:e,index:r,count:i.length,...a})]}let{columnCount:a}=this,o=r.filter(e=>e.getAttribute(`aria-hidden`)!==`true`),s=t?o.indexOf(t):-1,c=s===-1?i:o,l=cS(`horizontal`,n),u=c[Bde({key:e,index:s,count:c.length,columnCount:a,...l})];return u?.matches(`[aria-disabled="true"]`)?void 0:u}destroy(){this.#e=!0,globalThis.clearTimeout(this.#t),this.#a.reset(),this.observer.disconnect(),this.selectionObserver?.disconnect(),this.parent.removeEventListener(`click`,this._onClick),this.parent.removeEventListener(`keydown`,this._onKeyDown)}onUpdate({searchTerms:e}){let t=sS(e),n=t?t.split(/\s+/):[],{allMembers:r,parent:i}=this,a=r.map(e=>{let t=this.#s(e),r=!n.every(e=>t.includes(e));return this.#i.get(e)!==r&&(this.#i.set(e,r),e.dispatchEvent(new CustomEvent(`Toggle`,{detail:{hidden:r}}))),r}).filter(e=>!e).length;i.dispatchEvent(new CustomEvent(`Filter`,{detail:{matched:a,total:r.length}}))}},_S=e=>t=>{let n=typeof e==`function`,r=new Wde(t,n?ao(()=>e()):e);return n&&L(()=>{r.onUpdate(e())}),()=>{r.destroy()}},Gde=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`]),Kde=B(`
    `),qde={hash:`svelte-1dmdir4`,code:`.select-button-group.svelte-1dmdir4 {flex:none;display:inline-flex;align-items:center;margin:var(--sui-focus-ring-width);}.select-button-group.svelte-1dmdir4:focus-visible {outline-width:0 !important;}.select-button-group.svelte-1dmdir4 button {margin:0 !important;border-radius:0 !important;color:var(--sui-primary-foreground-color);}.select-button-group.svelte-1dmdir4 button:first-child {border-start-start-radius:4px !important;border-end-start-radius:4px !important;}.select-button-group.svelte-1dmdir4 button:not(:first-child) {border-inline-start-width:0;}.select-button-group.svelte-1dmdir4 button:last-child {border-start-end-radius:4px !important;border-end-end-radius:4px !important;}.select-button-group.svelte-1dmdir4 button[aria-checked=true] {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}.select-button-group[aria-invalid=true].svelte-1dmdir4 button {border-color:var(--sui-error-border-color);}.select-button-group[aria-disabled=false].svelte-1dmdir4 button[aria-disabled='true'] {filter:grayscale(0) opacity(1);}.select-button-group[aria-disabled=false].svelte-1dmdir4 button[aria-disabled='true'] * {filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}.select-button-group[aria-readonly=true].svelte-1dmdir4 button {pointer-events:none;}.inner.svelte-1dmdir4 {display:contents;}`};function vS(e,t){O(t,!0),K(e,qde);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`readonly`,3,!1),a=J(t,`required`,3,!1),o=J(t,`invalid`,3,!1),s=J(t,`ariaLabel`,3,void 0),c=Ss(t,Gde);var l=Kde();gs(l,()=>({...c,role:`radiogroup`,class:`sui select-button-group ${t.class??``}`,hidden:n(),tabindex:`-1`,"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-label":s()}),void 0,void 0,void 0,`svelte-1dmdir4`);var u=N(l);Eo(N(u),()=>t.children??Er),D(u),D(l),Qo(l,_S),R(()=>u.inert=r()),U(e,l),k()}var Jde=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`class`,`onChange`]);function yS(e,t){O(t,!0);let n=J(t,`selected`,15,!1),r=Ss(t,Jde);eS(e,Cs(()=>r,{role:`radio`,get class(){return`sui select-button ${t.class??``}`},get"aria-checked"(){return n()},onChange:e=>{n(e.detail.checked),t.onChange?.(e)}})),k()}var Yde=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`popupPosition`,`popupPositionBaseElement`,`showPopupBackdrop`,`label`,`variant`,`size`,`iconic`,`children`,`startIcon`,`endIcon`,`popup`]),Xde=B(` `,1);function bS(e,t){O(t,!0);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`popupPosition`,3,`bottom-left`),a=J(t,`popupPositionBaseElement`,3,void 0),o=J(t,`showPopupBackdrop`,3,!1),s=J(t,`label`,3,``),c=J(t,`variant`,3,void 0),l=J(t,`size`,3,`medium`),u=J(t,`iconic`,3,!1),d=Ss(t,Yde),f=j(void 0);var p={focus:()=>{z(f)?.focus()}},m=Xde(),h=P(m);return eS(h,Cs(()=>d,{get class(){return`sui menu-button ${t.class??``}`},get hidden(){return n()},get disabled(){return r()},get label(){return s()},get variant(){return c()},get size(){return l()},get iconic(){return u()},"aria-haspopup":`menu`,get element(){return z(f)},set element(e){M(f,e,!0)},startIcon:e=>{var n=H();Eo(P(n),()=>t.startIcon??Er),U(e,n)},children:e=>{var n=H();Eo(P(n),()=>t.children??Er),U(e,n)},endIcon:e=>{var n=H(),r=P(n),i=e=>{var n=H();Eo(P(n),()=>t.endIcon),U(e,n)},a=e=>{bx(e,{name:`more_vert`})},o=e=>{bx(e,{name:`arrow_drop_down`,class:`small-arrow`})};G(r,e=>{t.endIcon?e(i):u()?e(a,1):e(o,-1)}),U(e,n)},$$slots:{startIcon:!0,default:!0,endIcon:!0}})),Qx(I(h,2),{get anchor(){return z(f)},get position(){return i()},get positionBaseElement(){return a()},get showBackdrop(){return o()},children:(e,n)=>{var r=H();Eo(P(r),()=>t.popup??Er),U(e,r)},$$slots:{default:!0}}),U(e,m),k(p)}var Zde=new Set([`$$slots`,`$$events`,`$$legacy`,`hidden`,`disabled`,`label`,`variant`,`size`,`popupPosition`,`showPopupBackdrop`,`chevronIcon`,`popup`]),Qde=B(`
    `),$de={hash:`svelte-e2utpw`,code:`.split-button.svelte-e2utpw {flex:none;display:inline-flex;margin:var(--sui-focus-ring-width);}.split-button.svelte-e2utpw button {margin:0;}.split-button.svelte-e2utpw button.menu-button {border-inline-start-width:0;border-start-start-radius:0;border-end-start-radius:0;aspect-ratio:3/4;}.split-button.svelte-e2utpw button:not(.menu-button) {border-start-end-radius:0;border-end-end-radius:0;}`};function xS(e,t){O(t,!0),K(e,$de);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`label`,3,``),a=J(t,`variant`,3,void 0),o=J(t,`size`,3,`medium`),s=J(t,`popupPosition`,3,`bottom-left`),c=J(t,`showPopupBackdrop`,3,!1),l=Ss(t,Zde),u=j(void 0);var d=Qde(),f=N(d);eS(f,Cs(()=>l,{get hidden(){return n()},get disabled(){return r()},get label(){return i()},get variant(){return a()},get size(){return o()}}));var p=I(f,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Eo(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{bx(e,{name:`arrow_drop_down`,class:`small-arrow`})};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),U(e,n)},i=e=>{var n=H();Eo(P(n),()=>t.popup??Er),U(e,n)},l=A(()=>Y(`_sui.split_button.more_options`));bS(p,{iconic:!0,get hidden(){return n()},get disabled(){return r()},get variant(){return a()},get size(){return o()},get"aria-label"(){return z(l)},get popupPosition(){return s()},get popupPositionBaseElement(){return z(u)},get showPopupBackdrop(){return c()},endIcon:e,popup:i,$$slots:{endIcon:!0,popup:!0}})}D(d),bs(d,e=>M(u,e),()=>z(u)),R(e=>{q(d,`hidden`,n()),q(d,`aria-hidden`,n()),q(d,`aria-disabled`,r()),q(d,`aria-label`,e)},[()=>Y(`_sui.split_button.x_options`,{values:{name:i()}})]),U(e,d),k()}var efe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`ariaLabel`,`children`]),tfe=B(`
    `),nfe={hash:`svelte-1q8o22f`,code:`.checkbox-group.svelte-1q8o22f {display:inline-flex;}.checkbox-group.horizontal.svelte-1q8o22f {gap:8px;align-items:center;flex-wrap:wrap;}.checkbox-group.vertical.svelte-1q8o22f {gap:4px;flex-direction:column;} @media (pointer: coarse) {.checkbox-group.vertical.svelte-1q8o22f {gap:8px;} }.inner.svelte-1q8o22f {display:contents;}`};function rfe(e,t){O(t,!0),K(e,nfe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`orientation`,3,`horizontal`),a=J(t,`ariaLabel`,3,void 0),o=Ss(t,efe);var s=tfe();gs(s,e=>({...o,role:`group`,class:[`sui`,`checkbox-group`,t.class,i()],hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-roledescription":e,"aria-label":a()}),[()=>Y(`_sui.role_descriptions.checkbox_group`)],void 0,void 0,`svelte-1q8o22f`);var c=N(s);Eo(N(c),()=>t.children??Er),D(c),D(s),R(()=>c.inert=r()),U(e,s),k()}var SS=({id:e,ariaLabel:t,hasVisibleLabel:n})=>({"aria-label":t||void 0,"aria-labelledby":!t&&n?`${e}-label`:void 0}),ife=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`class`,`name`,`value`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`label`,`ariaLabel`,`group`,`onChange`,`children`,`checkIcon`]),afe=B(``),ofe=B(`
    `),sfe={hash:`svelte-1sjuhwp`,code:`.checkbox.svelte-1sjuhwp {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);min-width:24px;min-height:24px;color:var(--sui-control-foreground-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);cursor:pointer;-webkit-user-select:none;user-select:none;}.checkbox.svelte-1sjuhwp:hover button {background-color:var(--sui-hover-background-color);}.checkbox.svelte-1sjuhwp:hover button[aria-checked=true] {background-color:var(--sui-primary-accent-color-light);}.checkbox.svelte-1sjuhwp:active button {background-color:var(--sui-active-background-color);}.checkbox.svelte-1sjuhwp:active button[aria-checked=true] {background-color:var(--sui-primary-accent-color-dark);}.checkbox.svelte-1sjuhwp button {flex:none;align-items:center;justify-content:center;overflow:hidden;margin:0 !important;border-width:var(--sui-checkbox-border-width, 1.5px);border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-border-radius);padding:0;width:var(--sui-checkbox-height);height:var(--sui-checkbox-height);color:var(--sui-primary-accent-text-color);background-color:var(--sui-checkbox-background-color);transition:all 200ms;}.checkbox.svelte-1sjuhwp button[aria-checked=true] {border-color:var(--sui-checkbox-border-color-checked, var(--sui-primary-accent-color));color:var(--sui-checkbox-foreground-color-checked, var(--sui-primary-accent-color-inverted));background-color:var(--sui-checkbox-background-color-checked, var(--sui-primary-accent-color));}.checkbox.svelte-1sjuhwp button[aria-invalid=true] {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);}.checkbox.svelte-1sjuhwp button[aria-checked=true][aria-invalid=true] {background-color:var(--sui-checkbox-background-color);}.checkbox.svelte-1sjuhwp button .icon {font-size:calc(var(--sui-checkbox-height) - 2px);}.checkbox.svelte-1sjuhwp label:where(.svelte-1sjuhwp) {cursor:inherit;}.checkbox.readonly.svelte-1sjuhwp {cursor:default;}.checkbox.readonly.svelte-1sjuhwp button, .checkbox.readonly.svelte-1sjuhwp:is(:where(.svelte-1sjuhwp):hover, :where(.svelte-1sjuhwp):active) button {background-color:var(--sui-checkbox-background-color);}.checkbox.readonly.svelte-1sjuhwp button[aria-checked='true']:not([aria-invalid='true']), .checkbox.readonly.svelte-1sjuhwp:is(:where(.svelte-1sjuhwp):hover, :where(.svelte-1sjuhwp):active) button[aria-checked='true']:not([aria-invalid='true']) {border-color:var(--sui-readonly-accent-color);color:var(--sui-readonly-accent-color-inverted);background-color:var(--sui-readonly-accent-color);}.inner.svelte-1sjuhwp {display:contents;}`};function CS(e,t){let n=yo();O(t,!0),K(e,sfe);let r=J(t,`checked`,15,!1),i=J(t,`name`,3,void 0),a=J(t,`value`,3,void 0),o=J(t,`hidden`,3,!1),s=J(t,`disabled`,3,!1),c=J(t,`readonly`,3,!1),l=J(t,`required`,3,!1),u=J(t,`invalid`,3,!1),d=J(t,`label`,3,void 0),f=J(t,`ariaLabel`,3,void 0),p=J(t,`group`,15),m=Ss(t,ife),h=j(void 0),g=A(()=>!!(t.children||d())),_=A(()=>SS({id:n,ariaLabel:f()??m[`aria-label`],hasVisibleLabel:z(g)})),v=A(()=>r()===`mixed`);L(()=>{Array.isArray(p())&&(p().includes(a())?r()!==!0&&r(!0):r()!==!1&&r(!1))});var y=ofe();let b;var x=N(y),S=N(x);eS(S,Cs(()=>m,{role:`checkbox`,get id(){return n},get name(){return i()},get value(){return a()},get hidden(){return o()},get disabled(){return s()},get readonly(){return c()},get"aria-required"(){return l()},get"aria-invalid"(){return u()},get"aria-checked"(){return r()}},()=>z(_),{onclick:e=>{e.preventDefault(),e.stopPropagation(),s()||c()||(r(z(v)?!0:!r()),Array.isArray(p())&&(r()?p().includes(a())||p([...p(),a()]):p().includes(a())&&p(p().filter(e=>e!==a()))),t.onChange?.(new CustomEvent(`Change`,{detail:{checked:r()}})))},get element(){return z(h)},set element(e){M(h,e,!0)},startIcon:e=>{var n=H(),i=P(n),a=e=>{var n=H();Eo(P(n),()=>t.checkIcon),U(e,n)},o=e=>{bx(e,{name:`remove`})},s=e=>{bx(e,{name:`check`})};G(i,e=>{t.checkIcon?e(a):z(v)?e(o,1):r()&&e(s,2)}),U(e,n)},$$slots:{startIcon:!0}}));var C=I(S,2),w=e=>{var r=afe(),i=N(r),a=e=>{var n=H();Eo(P(n),()=>t.children),U(e,n)},o=e=>{var t=V();R(()=>W(t,d())),U(e,t)};G(i,e=>{t.children?e(a):e(o,-1)}),D(r),R(()=>q(r,`id`,`${n}-label`)),U(e,r)};G(C,e=>{z(g)&&e(w)}),D(x),D(y),R(()=>{b=is(y,1,`sui checkbox ${t.class??``}`,`svelte-1sjuhwp`,b,{checked:r(),indeterminate:z(v),disabled:s(),readonly:c()}),q(y,`hidden`,o()),x.inert=s()}),po(`click`,y,e=>{e.preventDefault(),e.stopPropagation(),e.target.matches(`button`)||z(h)?.click()}),U(e,y),k()}mo([`click`]);var cfe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`flex`]),lfe=B(`
    `),ufe={hash:`svelte-633w0c`,code:`.spacer.flex.svelte-633w0c:not([hidden]) {display:block;flex:auto;}.spacer.svelte-633w0c:not(.flex) {width:8px;height:8px;}`};function wS(e,t){K(e,ufe);let n=J(t,`flex`,3,!1),r=Ss(t,cfe);var i=lfe();gs(i,()=>({...r,role:`none`,class:`sui spacer ${t.class??``}`,[fs]:{flex:n()}}),void 0,void 0,void 0,`svelte-633w0c`),U(e,i)}function TS(e,t){O(t,!0);let n=J(t,`class`,3,void 0),r=J(t,`closeIcon`,3,void 0);{let i=e=>{var t=H(),n=P(t),i=e=>{var t=H();Eo(P(t),r),U(e,t)},a=e=>{bx(e,{name:`close`})};G(n,e=>{r()?e(i):e(a,-1)}),U(e,t)},a=A(()=>Y(`_sui.close`));eS(e,{variant:`ghost`,iconic:!0,get class(){return n()},get"aria-label"(){return z(a)},get"aria-controls"(){return t.controls},onclick:()=>{t.onClose()},startIcon:i,$$slots:{startIcon:!0}})}k()}var ES=(e,t,n)=>Math.min(Math.max(e,-t),Math.max(n,0)),dfe=new Set(`$$slots.$$events.$$legacy.open.value.title.ariaLabelledby.role.size.modal.showBackdrop.movable.class.showClose.showOk.showCancel.okLabel.okShortcuts.okDisabled.cancelLabel.cancelShortcuts.cancelDisabled.focusInput.children.header.headerExtra.footer.footerExtra.closeIcon.input`.split(`.`)),ffe=B(`
    `,1),pfe=B(`
    `),mfe=B(` `,1),hfe=B(``),gfe=B(`
    `),_fe={hash:`svelte-vcbvkj`,code:`.content.svelte-vcbvkj {position:relative;display:flex;flex-direction:column;overflow:hidden;border-width:var(--sui-dialog-content-border-width, var(--sui-modal-border-width, 0));border-style:solid;border-color:var(--sui-dialog-content-border-color, var(--sui-primary-border-color));border-radius:var(--sui-dialog-content-border-radius, 4px);max-width:calc(100dvw - var(--sui-dialog-content-margin, 16px) * 2);background-color:var(--sui-dialog-content-background-color, var(--sui-secondary-background-color-translucent));box-shadow:var(--sui-dialog-content-box-shadow, 0 8px 16px var(--sui-popup-shadow-color));-webkit-backdrop-filter:var(--sui-dialog-content-backdrop-filter, blur(16px));backdrop-filter:var(--sui-dialog-content-backdrop-filter, blur(16px));transition-property:transform;}dialog.open .content.svelte-vcbvkj {transition-duration:150ms;transform:scale(100%);}dialog:not(.open) .content.svelte-vcbvkj {transition-duration:300ms;transform:scale(90%);}.content.x-small.svelte-vcbvkj {width:var(--sui-dialog-x-small-content-width, var(--sui-dialog-content-width, 300px));max-height:var(--sui-dialog-x-small-content-max-height, var(--sui-dialog-content-max-height, 300px));--sui-textbox-singleline-min-width: 0;} @media (max-height: 300px) {.content.x-small.svelte-vcbvkj {max-height:calc(100dvh - 32px);} }.content.small.svelte-vcbvkj {width:var(--sui-dialog-small-content-width, var(--sui-dialog-content-width, 400px));max-height:var(--sui-dialog-small-content-max-height, var(--sui-dialog-content-max-height, 400px));} @media (max-height: 400px) {.content.small.svelte-vcbvkj {max-height:calc(100dvh - 32px);} }.content.medium.svelte-vcbvkj {width:var(--sui-dialog-medium-content-width, var(--sui-dialog-content-width, 600px));max-height:var(--sui-dialog-medium-content-max-height, var(--sui-dialog-content-max-height, 600px));} @media (max-height: 600px) {.content.medium.svelte-vcbvkj {max-height:calc(100dvh - 32px);} }.content.large.svelte-vcbvkj {width:var(--sui-dialog-large-content-width, var(--sui-dialog-content-width, 800px));max-height:var(--sui-dialog-large-content-max-height, var(--sui-dialog-content-max-height, 800px));} @media (max-height: 800px) {.content.large.svelte-vcbvkj {max-height:calc(100dvh - 32px);} }.content.x-large.svelte-vcbvkj {width:var(--sui-dialog-x-large-content-width, var(--sui-dialog-content-width, 1000px));max-height:var(--sui-dialog-x-large-content-max-height, var(--sui-dialog-content-max-height, 1000px));} @media (max-height: 1000px) {.content.x-large.svelte-vcbvkj {max-height:calc(100dvh - 32px);} }:is(.header.svelte-vcbvkj, .footer.svelte-vcbvkj) {display:flex;align-items:center;gap:4px;}.header.svelte-vcbvkj {box-sizing:content-box;margin:var(--sui-dialog-header-margin, 0 16px);border-width:var(--sui-dialog-header-border-width, 0 0 1px);border-color:var(--sui-dialog-header-border-color, var(--sui-secondary-border-color));padding:var(--sui-dialog-header-padding, 16px 8px);height:var(--sui-dialog-header-height, 32px);}.header.movable.svelte-vcbvkj {cursor:move;}.header.svelte-vcbvkj .title:where(.svelte-vcbvkj) {font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-bold);}.footer.svelte-vcbvkj {margin:var(--sui-dialog-footer-margin, 0 24px 24px);} @media (width < 768px) {.footer.svelte-vcbvkj {margin:var(--sui-dialog-footer-margin, 0 16px 16px);} }.body.svelte-vcbvkj {overflow:auto;padding:var(--sui-dialog-body-padding, var(--sui-dialog-body-margin, 24px 24px));white-space:normal;line-height:var(--sui-line-height-compact);} @media (width < 768px) {.body.svelte-vcbvkj {padding:var(--sui-dialog-body-padding, var(--sui-dialog-body-margin, 16px 16px));} }`};function DS(e,t){let n=yo();O(t,!0),K(e,_fe);let r=J(t,`open`,15,!1);J(t,`value`,11,``);let i=J(t,`ariaLabelledby`,3,void 0),a=J(t,`role`,3,`dialog`),o=J(t,`size`,3,`medium`),s=J(t,`modal`,3,!0),c=J(t,`showBackdrop`,3,void 0),l=J(t,`movable`,3,!1),u=J(t,`showClose`,3,!1),d=J(t,`showOk`,3,!0),f=J(t,`showCancel`,3,!0),p=J(t,`okLabel`,3,``),m=J(t,`okShortcuts`,3,void 0),h=J(t,`okDisabled`,3,!1),g=J(t,`cancelLabel`,3,``),_=J(t,`cancelShortcuts`,3,void 0),v=J(t,`cancelDisabled`,3,!1),y=J(t,`focusInput`,3,!0),b=Ss(t,dfe),x=A(()=>i()??(!t.header&&t.title?`${n}-title`:void 0)),S=A(()=>z(x)?void 0:t.title||void 0),C=j(void 0),w=j(void 0),T=j(ea({x:0,y:0})),ee,E=()=>{M(T,{x:0,y:0},!0),ee=void 0};L(()=>{if(r()&&(E(),l()))return window.addEventListener(`resize`,E),()=>{window.removeEventListener(`resize`,E)}});let te=e=>{let{button:t,pointerId:n,clientX:r,clientY:i,currentTarget:a,target:o}=e,s=a,c=o.closest(`button, input, select, textarea, a, [tabindex]`);t!==0||c&&s.contains(c)||(e.preventDefault(),s.setPointerCapture(n),ee={pointerId:n,x:r,y:i,offset:{...z(T)},rect:z(w).getBoundingClientRect()})},ne=({pointerId:e,buttons:t,clientX:n,clientY:r})=>{if(!ee||ee.pointerId!==e)return;if(t%2==0){ee=void 0;return}let{x:i,y:a,offset:o,rect:s}=ee;M(T,{x:o.x+ES(n-i,s.left,window.innerWidth-s.right),y:o.y+ES(r-a,s.top,window.innerHeight-s.bottom)},!0)},re=({pointerId:e})=>{ee?.pointerId===e&&(ee=void 0)},ie={onpointerdown:te,onpointermove:ne,onpointerup:re,onpointercancel:re};L(()=>{if(r()&&z(w)){let e=!1;return(async()=>{if(await Bu(50),e||z(w)?.contains(document.activeElement))return;let t=y()?z(w)?.querySelector(`input, button.primary`):null;t?(t.focus(),t instanceof HTMLInputElement&&t.select()):z(C)?.focus()})(),()=>{e=!0}}});{let i=A(()=>c()??s());bs(Zx(e,Cs(()=>b,{get role(){return a()},get id(){return n},class:`dialog`,get"aria-label"(){return z(S)},get"aria-labelledby"(){return z(x)},get"aria-describedby"(){return`${n}-body`},get modal(){return s()},get showBackdrop(){return z(i)},get open(){return r()},set open(e){r(e)},children:(e,r)=>{var i=gfe();let a;var s=N(i),c=e=>{var r=pfe();gs(r,()=>({role:`none`,class:`header`,...l()?ie:{},[fs]:{movable:l()}}),void 0,void 0,void 0,`svelte-vcbvkj`);var i=N(r),a=e=>{var n=H();Eo(P(n),()=>t.header),U(e,n)},o=e=>{var r=ffe(),i=P(r),a=F(i,!0),o=I(i,2);wS(o,{flex:!0});var s=I(o,2);Eo(s,()=>t.headerExtra??Er);var c=I(s,2),l=e=>{TS(e,{get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{z(C)?.close(`close`)}})};G(c,e=>{u()&&e(l)}),R(()=>{q(i,`id`,`${n}-title`),W(a,t.title)}),U(e,r)};G(i,e=>{t.header?e(a):e(o,-1)}),D(r),U(e,r)};G(s,e=>{(t.title||u()||t.header||t.headerExtra)&&e(c)});var y=I(s,2);Eo(N(y),()=>t.children??Er),D(y);var b=I(y,2),x=e=>{var n=hfe(),r=N(n),i=e=>{var n=H();Eo(P(n),()=>t.footer??Er),U(e,n)},a=e=>{var n=mfe(),r=P(n);Eo(r,()=>t.footerExtra??Er);var i=I(r,2);wS(i,{flex:!0});var a=I(i,2),o=e=>{{let t=A(()=>p()||Y(`_sui.ok`));eS(e,{variant:`primary`,get label(){return z(t)},get keyShortcuts(){return m()},get disabled(){return h()},onclick:()=>{z(C)?.close(`ok`)}})}};G(a,e=>{d()&&e(o)});var s=I(a,2),c=e=>{{let t=A(()=>g()||Y(`_sui.cancel`));eS(e,{variant:`secondary`,get label(){return z(t)},get keyShortcuts(){return _()},get disabled(){return v()},onclick:()=>{z(C)?.close(`cancel`)}})}};G(s,e=>{f()&&e(c)}),U(e,n)};G(r,e=>{t.footer?e(i):e(a,-1)}),D(n),U(e,n)};G(b,e=>{(d()||f()||t.footer||t.footerExtra)&&e(x)}),D(i),bs(i,e=>M(w,e),()=>z(w)),R(()=>{is(i,1,es([`content`,t.class,o()]),`svelte-vcbvkj`),a=os(i,``,a,{translate:l()?`${z(T).x}px ${z(T).y}px`:void 0}),q(y,`id`,`${n}-body`)}),U(e,i)},$$slots:{default:!0}})),e=>M(C,e,!0),()=>z(C))}k()}var vfe=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function OS(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=Ss(t,vfe);DS(e,Cs(()=>r,{role:`alertdialog`,showCancel:!1,get open(){return n()},set open(e){n(e)}})),k()}var yfe=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function kS(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=Ss(t,yfe);DS(e,Cs(()=>r,{role:`alertdialog`,get open(){return n()},set open(e){n(e)}})),k()}var bfe=`boxSizing.width.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.paddingTop.paddingRight.paddingBottom.paddingLeft.fontFamily.fontSize.fontStretch.fontStyle.fontVariant.fontWeight.letterSpacing.lineHeight.tabSize.textAlign.textIndent.textTransform.wordBreak.wordSpacing.overflowWrap.direction`.split(`.`),xfe=(e,t,n)=>{let r=e.getBoundingClientRect();if(!r.width&&!r.height)return;let i=globalThis.getComputedStyle(e),a=e.tagName===`INPUT`,o=document.createElement(`div`),s=document.createElement(`span`);bfe.forEach(e=>{o.style[e]=i[e]}),Object.assign(o.style,{position:`absolute`,top:`0`,left:`0`,height:`auto`,minHeight:`0`,maxHeight:`none`,overflow:`hidden`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:a?`pre`:`pre-wrap`}),o.setAttribute(`aria-hidden`,`true`),o.textContent=e.value.slice(0,t),s.textContent=e.value.slice(t,n)||`​`,o.append(s),document.body.append(o);let c=o.getBoundingClientRect(),l=s.getClientRects(),u=l[l.length-1]??s.getBoundingClientRect(),d=u.top-c.top,f=u.left-c.left,p=u.right-c.left,m=u.height||Number.parseFloat(i.lineHeight)||0;o.remove();let h=r.top+d-e.scrollTop,g=r.left+f-e.scrollLeft,_=r.left+p-e.scrollLeft;return{top:h,bottom:h+m,left:g,right:_}},Sfe=/(?<=^|[\s([{"'«])(?::)(?[a-zA-Z0-9_+-]{1,64})$/,AS=/[-_]/,jS,Cfe=e=>e.split(` `).map(e=>{let[t,n,r=``]=e.split(` `),[i,...a]=n.split(` `);return{emoji:t,name:i,aliases:[...a,...r?r.split(` `):[]]}}),MS=(e,t)=>{let n=e.split(AS);return e===t?0:e.startsWith(t)&&AS.test(e.charAt(t.length))?1:n.includes(t)?2:e.startsWith(t)||n.some(e=>e.startsWith(t))?4:9},wfe=(e,t)=>e.includes(t)?3:e.some(e=>e.startsWith(t))?5:9,Tfe=({name:e,aliases:t},n)=>{let r=MS(e,n),i=wfe(t,n);return{rank:Math.min(r,i),nameRank:r}},Efe=({name:e,aliases:t},n)=>{if(MS(e,n)<9)return e.split(AS).length;let r=t.findIndex(e=>e===n||e.startsWith(n));return(r>-1?r:t.length)*100+t.length},Dfe=e=>{let t=e.toLowerCase();return t?(jS??=Cfe(`😀 grinning face 😃 smiley smiling face open mouth 😄 smile smiling face open mouth eyes 😁 grin grinning face smiling eyes 😆 laughing satisfied smiling face open mouth tightly-closed eyes 😅 sweat_smile smiling face open mouth cold 🤣 rolling_on_the_floor_laughing 😂 joy face tears 🙂 slightly_smiling_face 🙃 upside_down_face upside-down 🫠 melting_face 😉 wink winking face 😊 blush smiling face eyes 😇 innocent smiling face halo 🥰 smiling_face_with_3_hearts eyes three 😍 heart_eyes smiling face heart-shaped 🤩 star-struck grinning_face_with_star_eyes 😘 kissing_heart face throwing kiss 😗 kissing face ☺️ relaxed white smiling face 😚 kissing_closed_eyes face 😙 kissing_smiling_eyes face 🥲 smiling_face_with_tear 😋 yum face savouring delicious food 😛 stuck_out_tongue face stuck-out 😜 stuck_out_tongue_winking_eye face stuck-out 🤪 zany_face grinning_face_with_one_large_and_one_small_eye 😝 stuck_out_tongue_closed_eyes face stuck-out tightly-closed 🤑 money_mouth_face money-mouth 🤗 hugging_face 🤭 face_with_hand_over_mouth smiling_face_with_smiling_eyes_and_hand_covering_mouth 🫢 face_with_open_eyes_and_hand_over_mouth 🫣 face_with_peeking_eye 🤫 shushing_face face_with_finger_covering_closed_lips 🤔 thinking_face 🫡 saluting_face 🤐 zipper_mouth_face zipper-mouth 🤨 face_with_raised_eyebrow face_with_one_eyebrow_raised 😐 neutral_face 😑 expressionless face 😶 no_mouth face without 🫥 dotted_line_face 😶‍🌫️ face_in_clouds 😏 smirk smirking face 😒 unamused face 🙄 face_with_rolling_eyes 😬 grimacing face 😮‍💨 face_exhaling 🤥 lying_face 🫨 shaking_face 🙂‍↔️ head_shaking_horizontally 🙂‍↕️ head_shaking_vertically 😌 relieved face 😔 pensive face 😪 sleepy face 🤤 drooling_face 😴 sleeping face 🫩 face_with_bags_under_eyes 😷 mask face medical 🤒 face_with_thermometer 🤕 face_with_head_bandage head-bandage 🤢 nauseated_face 🤮 face_vomiting face_with_open_mouth_vomiting 🤧 sneezing_face 🥵 hot_face overheated 🥶 cold_face freezing 🥴 woozy_face uneven eyes wavy mouth 😵 dizzy_face 😵‍💫 face_with_spiral_eyes 🤯 exploding_head shocked_face_with_exploding_head 🤠 face_with_cowboy_hat 🥳 partying_face party horn hat 🥸 disguised_face 😎 sunglasses smiling face 🤓 nerd_face 🧐 face_with_monocle 😕 confused face 🫤 face_with_diagonal_mouth 😟 worried face 🙁 slightly_frowning_face ☹️ white_frowning_face 😮 open_mouth face 😯 hushed face 😲 astonished face 😳 flushed face 🥺 pleading_face eyes 🥹 face_holding_back_tears 😦 frowning face open mouth 😧 anguished face 😨 fearful face 😰 cold_sweat face open mouth 😥 disappointed_relieved but face 😢 cry crying face 😭 sob loudly crying face 😱 scream face screaming fear 😖 confounded face 😣 persevere persevering face 😞 disappointed face 😓 sweat face cold 😩 weary face 😫 tired_face 🥱 yawning_face 😤 triumph face look 😡 rage pouting face 😠 angry face 🤬 face_with_symbols_on_mouth serious_face_with_symbols_covering_mouth 😈 smiling_imp face horns 👿 imp 💀 skull ☠️ skull_and_crossbones 💩 hankey poop shit pile poo 🤡 clown_face 👹 japanese_ogre 👺 japanese_goblin 👻 ghost 👽 alien extraterrestrial 👾 space_invader alien monster 🤖 robot_face 😺 smiley_cat smiling face open mouth 😸 smile_cat grinning face smiling eyes 😹 joy_cat face tears 😻 heart_eyes_cat smiling face heart-shaped 😼 smirk_cat face wry smile 😽 kissing_cat face closed eyes 🙀 scream_cat weary face 😿 crying_cat_face 😾 pouting_cat face 🙈 see_no_evil see-no-evil monkey 🙉 hear_no_evil hear-no-evil monkey 🙊 speak_no_evil speak-no-evil monkey 💌 love_letter 💘 cupid heart arrow 💝 gift_heart ribbon 💖 sparkling_heart 💗 heartpulse growing heart 💓 heartbeat beating heart 💞 revolving_hearts 💕 two_hearts 💟 heart_decoration ❣️ heavy_heart_exclamation_mark_ornament 💔 broken_heart ❤️‍🔥 heart_on_fire ❤️‍🩹 mending_heart ❤️ heart heavy black 🩷 pink_heart 🧡 orange_heart 💛 yellow_heart 💚 green_heart 💙 blue_heart 🩵 light_blue_heart 💜 purple_heart 🤎 brown_heart 🖤 black_heart 🩶 grey_heart 🤍 white_heart 💋 kiss mark 💯 100 hundred points symbol 💢 anger symbol 💥 boom collision symbol 💫 dizzy symbol 💦 sweat_drops splashing symbol 💨 dash symbol 🕳️ hole 💬 speech_balloon 👁️‍🗨️ eye-in-speech-bubble 🗨️ left_speech_bubble 🗯️ right_anger_bubble 💭 thought_balloon 💤 zzz sleeping symbol 👋 wave waving hand sign 🤚 raised_back_of_hand 🖐️ raised_hand_with_fingers_splayed ✋ hand raised_hand 🖖 spock-hand raised part between middle ring fingers 🫱 rightwards_hand 🫲 leftwards_hand 🫳 palm_down_hand 🫴 palm_up_hand 🫷 leftwards_pushing_hand 🫸 rightwards_pushing_hand 👌 ok_hand sign 🤌 pinched_fingers 🤏 pinching_hand ✌️ v victory hand 🤞 crossed_fingers hand_with_index_and_middle_fingers_crossed 🫰 hand_with_index_finger_and_thumb_crossed 🤟 i_love_you_hand_sign 🤘 the_horns sign_of_the_horns 🤙 call_me_hand 👈 point_left white pointing backhand index 👉 point_right white pointing backhand index 👆 point_up_2 white pointing backhand index 🖕 middle_finger reversed_hand_with_middle_finger_extended 👇 point_down white pointing backhand index ☝️ point_up white pointing index 🫵 index_pointing_at_the_viewer 👍 +1 thumbsup thumbs up sign 👎 -1 thumbsdown thumbs down sign ✊ fist raised 👊 facepunch punch fisted hand sign 🤛 left-facing_fist left-facing 🤜 right-facing_fist right-facing 👏 clap clapping hands sign 🙌 raised_hands person raising both celebration 🫶 heart_hands 👐 open_hands sign 🤲 palms_up_together 🤝 handshake 🙏 pray person folded hands ✍️ writing_hand 💅 nail_care polish 🤳 selfie 💪 muscle flexed biceps 🦾 mechanical_arm 🦿 mechanical_leg 🦵 leg 🦶 foot 👂 ear 🦻 ear_with_hearing_aid 👃 nose 🧠 brain 🫀 anatomical_heart 🫁 lungs 🦷 tooth 🦴 bone 👀 eyes 👁️ eye 👅 tongue 👄 lips mouth 🫦 biting_lip 👶 baby 🧒 child 👦 boy 👧 girl 🧑 adult 👱 person_with_blond_hair 👨 man 🧔 bearded_person 🧔‍♂️ man_with_beard 🧔‍♀️ woman_with_beard 👨‍🦰 red_haired_man hair 👨‍🦱 curly_haired_man hair 👨‍🦳 white_haired_man hair 👨‍🦲 bald_man 👩 woman 👩‍🦰 red_haired_woman hair 🧑‍🦰 red_haired_person hair 👩‍🦱 curly_haired_woman hair 🧑‍🦱 curly_haired_person hair 👩‍🦳 white_haired_woman hair 🧑‍🦳 white_haired_person hair 👩‍🦲 bald_woman 🧑‍🦲 bald_person 👱‍♀️ blond-haired-woman hair 👱‍♂️ blond-haired-man hair 🧓 older_adult 👴 older_man 👵 older_woman 🙍 person_frowning 🙍‍♂️ man-frowning 🙍‍♀️ woman-frowning 🙎 person_with_pouting_face 🙎‍♂️ man-pouting 🙎‍♀️ woman-pouting 🙅 no_good face gesture 🙅‍♂️ man-gesturing-no 🙅‍♀️ woman-gesturing-no 🙆 ok_woman face gesture 🙆‍♂️ man-gesturing-ok 🙆‍♀️ woman-gesturing-ok 💁 information_desk_person 💁‍♂️ man-tipping-hand 💁‍♀️ woman-tipping-hand 🙋 raising_hand happy person one 🙋‍♂️ man-raising-hand 🙋‍♀️ woman-raising-hand 🧏 deaf_person 🧏‍♂️ deaf_man 🧏‍♀️ deaf_woman 🙇 bow person bowing deeply 🙇‍♂️ man-bowing 🙇‍♀️ woman-bowing 🤦 face_palm 🤦‍♂️ man-facepalming 🤦‍♀️ woman-facepalming 🤷 shrug 🤷‍♂️ man-shrugging 🤷‍♀️ woman-shrugging 🧑‍⚕️ health_worker 👨‍⚕️ male-doctor man health worker 👩‍⚕️ female-doctor woman health worker 🧑‍🎓 student 👨‍🎓 male-student man 👩‍🎓 female-student woman 🧑‍🏫 teacher 👨‍🏫 male-teacher man 👩‍🏫 female-teacher woman 🧑‍⚖️ judge 👨‍⚖️ male-judge man 👩‍⚖️ female-judge woman 🧑‍🌾 farmer 👨‍🌾 male-farmer man 👩‍🌾 female-farmer woman 🧑‍🍳 cook 👨‍🍳 male-cook man 👩‍🍳 female-cook woman 🧑‍🔧 mechanic 👨‍🔧 male-mechanic man 👩‍🔧 female-mechanic woman 🧑‍🏭 factory_worker 👨‍🏭 male-factory-worker man 👩‍🏭 female-factory-worker woman 🧑‍💼 office_worker 👨‍💼 male-office-worker man 👩‍💼 female-office-worker woman 🧑‍🔬 scientist 👨‍🔬 male-scientist man 👩‍🔬 female-scientist woman 🧑‍💻 technologist 👨‍💻 male-technologist man 👩‍💻 female-technologist woman 🧑‍🎤 singer 👨‍🎤 male-singer man 👩‍🎤 female-singer woman 🧑‍🎨 artist 👨‍🎨 male-artist man 👩‍🎨 female-artist woman 🧑‍✈️ pilot 👨‍✈️ male-pilot man 👩‍✈️ female-pilot woman 🧑‍🚀 astronaut 👨‍🚀 male-astronaut man 👩‍🚀 female-astronaut woman 🧑‍🚒 firefighter 👨‍🚒 male-firefighter man 👩‍🚒 female-firefighter woman 👮 cop police officer 👮‍♂️ male-police-officer man 👮‍♀️ female-police-officer woman 🕵️ sleuth_or_spy detective 🕵️‍♂️ male-detective man 🕵️‍♀️ female-detective woman 💂 guardsman 💂‍♂️ male-guard man 💂‍♀️ female-guard woman 🥷 ninja 👷 construction_worker 👷‍♂️ male-construction-worker man 👷‍♀️ female-construction-worker woman 🫅 person_with_crown 🤴 prince 👸 princess 👳 man_with_turban 👳‍♂️ man-wearing-turban 👳‍♀️ woman-wearing-turban 👲 man_with_gua_pi_mao 🧕 person_with_headscarf 🤵 person_in_tuxedo man 🤵‍♂️ man_in_tuxedo 🤵‍♀️ woman_in_tuxedo 👰 bride_with_veil 👰‍♂️ man_with_veil 👰‍♀️ woman_with_veil 🤰 pregnant_woman 🫃 pregnant_man 🫄 pregnant_person 🤱 breast-feeding 👩‍🍼 woman_feeding_baby 👨‍🍼 man_feeding_baby 🧑‍🍼 person_feeding_baby 👼 angel baby 🎅 santa father christmas 🤶 mrs_claus mother_christmas 🧑‍🎄 mx_claus 🦸 superhero 🦸‍♂️ male_superhero man 🦸‍♀️ female_superhero woman 🦹 supervillain 🦹‍♂️ male_supervillain man 🦹‍♀️ female_supervillain woman 🧙 mage 🧙‍♂️ male_mage man 🧙‍♀️ female_mage woman 🧚 fairy 🧚‍♂️ male_fairy man 🧚‍♀️ female_fairy woman 🧛 vampire 🧛‍♂️ male_vampire man 🧛‍♀️ female_vampire woman 🧜 merperson 🧜‍♂️ merman 🧜‍♀️ mermaid 🧝 elf 🧝‍♂️ male_elf man 🧝‍♀️ female_elf woman 🧞 genie 🧞‍♂️ male_genie man 🧞‍♀️ female_genie woman 🧟 zombie 🧟‍♂️ male_zombie man 🧟‍♀️ female_zombie woman 🧌 troll 💆 massage face 💆‍♂️ man-getting-massage 💆‍♀️ woman-getting-massage 💇 haircut 💇‍♂️ man-getting-haircut 💇‍♀️ woman-getting-haircut 🚶 walking pedestrian 🚶‍♂️ man-walking 🚶‍♀️ woman-walking 🚶‍➡️ person_walking_facing_right 🚶‍♀️‍➡️ woman_walking_facing_right 🚶‍♂️‍➡️ man_walking_facing_right 🧍 standing_person 🧍‍♂️ man_standing 🧍‍♀️ woman_standing 🧎 kneeling_person 🧎‍♂️ man_kneeling 🧎‍♀️ woman_kneeling 🧎‍➡️ person_kneeling_facing_right 🧎‍♀️‍➡️ woman_kneeling_facing_right 🧎‍♂️‍➡️ man_kneeling_facing_right 🧑‍🦯 person_with_probing_cane white 🧑‍🦯‍➡️ person_with_white_cane_facing_right 👨‍🦯 man_with_probing_cane white 👨‍🦯‍➡️ man_with_white_cane_facing_right 👩‍🦯 woman_with_probing_cane white 👩‍🦯‍➡️ woman_with_white_cane_facing_right 🧑‍🦼 person_in_motorized_wheelchair 🧑‍🦼‍➡️ person_in_motorized_wheelchair_facing_right 👨‍🦼 man_in_motorized_wheelchair 👨‍🦼‍➡️ man_in_motorized_wheelchair_facing_right 👩‍🦼 woman_in_motorized_wheelchair 👩‍🦼‍➡️ woman_in_motorized_wheelchair_facing_right 🧑‍🦽 person_in_manual_wheelchair 🧑‍🦽‍➡️ person_in_manual_wheelchair_facing_right 👨‍🦽 man_in_manual_wheelchair 👨‍🦽‍➡️ man_in_manual_wheelchair_facing_right 👩‍🦽 woman_in_manual_wheelchair 👩‍🦽‍➡️ woman_in_manual_wheelchair_facing_right 🏃 runner running 🏃‍♂️ man-running 🏃‍♀️ woman-running 🏃‍➡️ person_running_facing_right 🏃‍♀️‍➡️ woman_running_facing_right 🏃‍♂️‍➡️ man_running_facing_right 💃 dancer 🕺 man_dancing 🕴️ man_in_business_suit_levitating person 👯 dancers woman bunny ears 👯‍♂️ men-with-bunny-ears-partying man-with-bunny-ears-partying 👯‍♀️ women-with-bunny-ears-partying woman-with-bunny-ears-partying 🧖 person_in_steamy_room 🧖‍♂️ man_in_steamy_room 🧖‍♀️ woman_in_steamy_room 🧗 person_climbing 🧗‍♂️ man_climbing 🧗‍♀️ woman_climbing 🤺 fencer 🏇 horse_racing ⛷️ skier 🏂 snowboarder 🏌️ golfer person golfing 🏌️‍♂️ man-golfing 🏌️‍♀️ woman-golfing 🏄 surfer 🏄‍♂️ man-surfing 🏄‍♀️ woman-surfing 🚣 rowboat 🚣‍♂️ man-rowing-boat 🚣‍♀️ woman-rowing-boat 🏊 swimmer 🏊‍♂️ man-swimming 🏊‍♀️ woman-swimming ⛹️ person_with_ball bouncing ⛹️‍♂️ man-bouncing-ball ⛹️‍♀️ woman-bouncing-ball 🏋️ weight_lifter person lifting weights 🏋️‍♂️ man-lifting-weights 🏋️‍♀️ woman-lifting-weights 🚴 bicyclist 🚴‍♂️ man-biking 🚴‍♀️ woman-biking 🚵 mountain_bicyclist 🚵‍♂️ man-mountain-biking 🚵‍♀️ woman-mountain-biking 🤸 person_doing_cartwheel 🤸‍♂️ man-cartwheeling 🤸‍♀️ woman-cartwheeling 🤼 wrestlers 🤼‍♂️ man-wrestling men 🤼‍♀️ woman-wrestling women 🤽 water_polo 🤽‍♂️ man-playing-water-polo 🤽‍♀️ woman-playing-water-polo 🤾 handball 🤾‍♂️ man-playing-handball 🤾‍♀️ woman-playing-handball 🤹 juggling 🤹‍♂️ man-juggling 🤹‍♀️ woman-juggling 🧘 person_in_lotus_position 🧘‍♂️ man_in_lotus_position 🧘‍♀️ woman_in_lotus_position 🛀 bath 🛌 sleeping_accommodation 🧑‍🤝‍🧑 people_holding_hands 👭 two_women_holding_hands women_holding_hands 👫 man_and_woman_holding_hands woman_and_man_holding_hands couple 👬 two_men_holding_hands men_holding_hands 💏 couplekiss kiss 👩‍❤️‍💋‍👨 woman-kiss-man 👨‍❤️‍💋‍👨 man-kiss-man 👩‍❤️‍💋‍👩 woman-kiss-woman 💑 couple_with_heart 👩‍❤️‍👨 woman-heart-man couple 👨‍❤️‍👨 man-heart-man couple 👩‍❤️‍👩 woman-heart-woman couple 👨‍👩‍👦 man-woman-boy family 👨‍👩‍👧 man-woman-girl family 👨‍👩‍👧‍👦 man-woman-girl-boy family 👨‍👩‍👦‍👦 man-woman-boy-boy family 👨‍👩‍👧‍👧 man-woman-girl-girl family 👨‍👨‍👦 man-man-boy family 👨‍👨‍👧 man-man-girl family 👨‍👨‍👧‍👦 man-man-girl-boy family 👨‍👨‍👦‍👦 man-man-boy-boy family 👨‍👨‍👧‍👧 man-man-girl-girl family 👩‍👩‍👦 woman-woman-boy family 👩‍👩‍👧 woman-woman-girl family 👩‍👩‍👧‍👦 woman-woman-girl-boy family 👩‍👩‍👦‍👦 woman-woman-boy-boy family 👩‍👩‍👧‍👧 woman-woman-girl-girl family 👨‍👦 man-boy family 👨‍👦‍👦 man-boy-boy family 👨‍👧 man-girl family 👨‍👧‍👦 man-girl-boy family 👨‍👧‍👧 man-girl-girl family 👩‍👦 woman-boy family 👩‍👦‍👦 woman-boy-boy family 👩‍👧 woman-girl family 👩‍👧‍👦 woman-girl-boy family 👩‍👧‍👧 woman-girl-girl family 🗣️ speaking_head_in_silhouette 👤 bust_in_silhouette 👥 busts_in_silhouette 🫂 people_hugging 👪 family 🧑‍🧑‍🧒 family_adult_adult_child 🧑‍🧑‍🧒‍🧒 family_adult_adult_child_child 🧑‍🧒 family_adult_child 🧑‍🧒‍🧒 family_adult_child_child 👣 footprints 🫆 fingerprint 🐵 monkey_face 🐒 monkey 🦍 gorilla 🦧 orangutan 🐶 dog face 🐕 dog2 dog 🦮 guide_dog 🐕‍🦺 service_dog 🐩 poodle 🐺 wolf face 🦊 fox_face 🦝 raccoon 🐱 cat face 🐈 cat2 cat 🐈‍⬛ black_cat 🦁 lion_face 🐯 tiger face 🐅 tiger2 tiger 🐆 leopard 🐴 horse face 🫎 moose 🫏 donkey 🐎 racehorse horse 🦄 unicorn_face 🦓 zebra_face 🦌 deer 🦬 bison 🐮 cow face 🐂 ox 🐃 water_buffalo 🐄 cow2 cow 🐷 pig face 🐖 pig2 pig 🐗 boar 🐽 pig_nose 🐏 ram 🐑 sheep 🐐 goat 🐪 dromedary_camel 🐫 camel bactrian 🦙 llama 🦒 giraffe_face 🐘 elephant 🦣 mammoth 🦏 rhinoceros 🦛 hippopotamus 🐭 mouse face 🐁 mouse2 mouse 🐀 rat 🐹 hamster face 🐰 rabbit face 🐇 rabbit2 rabbit 🐿️ chipmunk 🦫 beaver 🦔 hedgehog 🦇 bat 🐻 bear face 🐻‍❄️ polar_bear 🐨 koala 🐼 panda_face 🦥 sloth 🦦 otter 🦨 skunk 🦘 kangaroo 🦡 badger 🐾 feet paw_prints 🦃 turkey 🐔 chicken 🐓 rooster 🐣 hatching_chick 🐤 baby_chick 🐥 hatched_chick front-facing baby 🐦 bird 🐧 penguin 🕊️ dove_of_peace 🦅 eagle 🦆 duck 🦢 swan 🦉 owl 🦤 dodo 🪶 feather 🦩 flamingo 🦚 peacock 🦜 parrot 🪽 wing 🐦‍⬛ black_bird 🪿 goose 🐦‍🔥 phoenix 🐸 frog face 🐊 crocodile 🐢 turtle 🦎 lizard 🐍 snake 🐲 dragon_face 🐉 dragon 🦕 sauropod 🦖 t-rex 🐳 whale spouting 🐋 whale2 whale 🐬 dolphin flipper 🦭 seal 🐟 fish 🐠 tropical_fish 🐡 blowfish 🦈 shark 🐙 octopus 🐚 shell spiral 🪸 coral 🪼 jellyfish 🦀 crab 🦞 lobster 🦐 shrimp 🦑 squid 🦪 oyster 🐌 snail 🦋 butterfly 🐛 bug 🐜 ant 🐝 bee honeybee 🪲 beetle 🐞 ladybug lady_beetle 🦗 cricket 🪳 cockroach 🕷️ spider 🕸️ spider_web 🦂 scorpion 🦟 mosquito 🪰 fly 🪱 worm 🦠 microbe 💐 bouquet 🌸 cherry_blossom 💮 white_flower 🪷 lotus 🏵️ rosette 🌹 rose 🥀 wilted_flower 🌺 hibiscus 🌻 sunflower 🌼 blossom 🌷 tulip 🪻 hyacinth 🌱 seedling 🪴 potted_plant 🌲 evergreen_tree 🌳 deciduous_tree 🌴 palm_tree 🌵 cactus 🌾 ear_of_rice 🌿 herb ☘️ shamrock 🍀 four_leaf_clover 🍁 maple_leaf 🍂 fallen_leaf 🍃 leaves leaf fluttering wind 🪹 empty_nest 🪺 nest_with_eggs 🍄 mushroom 🪾 leafless_tree 🍇 grapes 🍈 melon 🍉 watermelon 🍊 tangerine 🍋 lemon 🍋‍🟩 lime 🍌 banana 🍍 pineapple 🥭 mango 🍎 apple red 🍏 green_apple 🍐 pear 🍑 peach 🍒 cherries 🍓 strawberry 🫐 blueberries 🥝 kiwifruit 🍅 tomato 🫒 olive 🥥 coconut 🥑 avocado 🍆 eggplant aubergine 🥔 potato 🥕 carrot 🌽 corn ear maize 🌶️ hot_pepper 🫑 bell_pepper 🥒 cucumber 🥬 leafy_green 🥦 broccoli 🧄 garlic 🧅 onion 🥜 peanuts 🫘 beans 🌰 chestnut 🫚 ginger_root 🫛 pea_pod 🍄‍🟫 brown_mushroom 🫜 root_vegetable 🍞 bread 🥐 croissant 🥖 baguette_bread 🫓 flatbread 🥨 pretzel 🥯 bagel 🥞 pancakes 🧇 waffle 🧀 cheese_wedge 🍖 meat_on_bone 🍗 poultry_leg 🥩 cut_of_meat 🥓 bacon 🍔 hamburger 🍟 fries french 🍕 pizza slice 🌭 hotdog hot dog 🥪 sandwich 🌮 taco 🌯 burrito 🫔 tamale 🥙 stuffed_flatbread 🧆 falafel 🥚 egg 🍳 fried_egg cooking 🥘 shallow_pan_of_food 🍲 stew pot food 🫕 fondue 🥣 bowl_with_spoon 🥗 green_salad 🍿 popcorn 🧈 butter 🧂 salt shaker 🥫 canned_food 🍱 bento box 🍘 rice_cracker 🍙 rice_ball 🍚 rice cooked 🍛 curry rice 🍜 ramen steaming bowl 🍝 spaghetti 🍠 sweet_potato roasted 🍢 oden 🍣 sushi 🍤 fried_shrimp 🍥 fish_cake swirl design 🥮 moon_cake 🍡 dango 🥟 dumpling 🥠 fortune_cookie 🥡 takeout_box 🍦 icecream soft ice cream 🍧 shaved_ice 🍨 ice_cream 🍩 doughnut 🍪 cookie 🎂 birthday cake 🍰 cake shortcake 🧁 cupcake 🥧 pie 🍫 chocolate_bar 🍬 candy 🍭 lollipop 🍮 custard 🍯 honey_pot 🍼 baby_bottle 🥛 glass_of_milk ☕ coffee hot beverage 🫖 teapot 🍵 tea teacup without handle 🍶 sake bottle cup 🍾 champagne bottle popping cork 🍷 wine_glass 🍸 cocktail glass 🍹 tropical_drink 🍺 beer mug 🍻 beers clinking beer mugs 🥂 clinking_glasses 🥃 tumbler_glass 🫗 pouring_liquid 🥤 cup_with_straw 🧋 bubble_tea 🧃 beverage_box 🧉 mate_drink 🧊 ice_cube 🥢 chopsticks 🍽️ knife_fork_plate 🍴 fork_and_knife 🥄 spoon 🔪 hocho knife 🫙 jar 🏺 amphora 🌍 earth_africa globe europe-africa 🌎 earth_americas globe 🌏 earth_asia globe asia-australia 🌐 globe_with_meridians 🗺️ world_map 🗾 japan silhouette 🧭 compass 🏔️ snow_capped_mountain snow-capped ⛰️ mountain 🌋 volcano 🗻 mount_fuji 🏕️ camping 🏖️ beach_with_umbrella 🏜️ desert 🏝️ desert_island 🏞️ national_park 🏟️ stadium 🏛️ classical_building 🏗️ building_construction 🧱 bricks brick 🪨 rock 🪵 wood 🛖 hut 🏘️ house_buildings houses 🏚️ derelict_house_building 🏠 house building 🏡 house_with_garden 🏢 office building 🏣 post_office japanese 🏤 european_post_office 🏥 hospital 🏦 bank 🏨 hotel 🏩 love_hotel 🏪 convenience_store 🏫 school 🏬 department_store 🏭 factory 🏯 japanese_castle 🏰 european_castle 💒 wedding 🗼 tokyo_tower 🗽 statue_of_liberty ⛪ church 🕌 mosque 🛕 hindu_temple 🕍 synagogue ⛩️ shinto_shrine 🕋 kaaba ⛲ fountain ⛺ tent 🌁 foggy 🌃 night_with_stars 🏙️ cityscape 🌄 sunrise_over_mountains 🌅 sunrise 🌆 city_sunset cityscape at dusk 🌇 city_sunrise sunset over buildings 🌉 bridge_at_night ♨️ hotsprings hot springs 🎠 carousel_horse 🛝 playground_slide 🎡 ferris_wheel 🎢 roller_coaster 💈 barber pole 🎪 circus_tent 🚂 steam_locomotive 🚃 railway_car 🚄 bullettrain_side high-speed train 🚅 bullettrain_front high-speed train bullet nose 🚆 train2 train 🚇 metro 🚈 light_rail 🚉 station 🚊 tram 🚝 monorail 🚞 mountain_railway 🚋 train tram car 🚌 bus 🚍 oncoming_bus 🚎 trolleybus 🚐 minibus 🚑 ambulance 🚒 fire_engine 🚓 police_car 🚔 oncoming_police_car 🚕 taxi 🚖 oncoming_taxi 🚗 car red_car automobile 🚘 oncoming_automobile 🚙 blue_car recreational vehicle 🛻 pickup_truck 🚚 truck delivery 🚛 articulated_lorry 🚜 tractor 🏎️ racing_car 🏍️ racing_motorcycle 🛵 motor_scooter 🦽 manual_wheelchair 🦼 motorized_wheelchair 🛺 auto_rickshaw 🚲 bike bicycle 🛴 scooter 🛹 skateboard 🛼 roller_skate 🚏 busstop bus stop 🛣️ motorway 🛤️ railway_track 🛢️ oil_drum ⛽ fuelpump fuel pump 🛞 wheel 🚨 rotating_light police cars revolving 🚥 traffic_light horizontal 🚦 vertical_traffic_light 🛑 octagonal_sign 🚧 construction sign ⚓ anchor 🛟 ring_buoy ⛵ boat sailboat 🛶 canoe 🚤 speedboat 🛳️ passenger_ship ⛴️ ferry 🛥️ motor_boat 🚢 ship ✈️ airplane 🛩️ small_airplane 🛫 airplane_departure 🛬 airplane_arriving 🪂 parachute 💺 seat 🚁 helicopter 🚟 suspension_railway 🚠 mountain_cableway 🚡 aerial_tramway 🛰️ satellite 🚀 rocket 🛸 flying_saucer 🛎️ bellhop_bell 🧳 luggage ⌛ hourglass ⏳ hourglass_flowing_sand ⌚ watch ⏰ alarm_clock ⏱️ stopwatch ⏲️ timer_clock 🕰️ mantelpiece_clock 🕛 clock12 clock face twelve oclock 🕧 clock1230 clock face twelve-thirty 🕐 clock1 clock face one oclock 🕜 clock130 clock face one-thirty 🕑 clock2 clock face two oclock 🕝 clock230 clock face two-thirty 🕒 clock3 clock face three oclock 🕞 clock330 clock face three-thirty 🕓 clock4 clock face four oclock 🕟 clock430 clock face four-thirty 🕔 clock5 clock face five oclock 🕠 clock530 clock face five-thirty 🕕 clock6 clock face six oclock 🕡 clock630 clock face six-thirty 🕖 clock7 clock face seven oclock 🕢 clock730 clock face seven-thirty 🕗 clock8 clock face eight oclock 🕣 clock830 clock face eight-thirty 🕘 clock9 clock face nine oclock 🕤 clock930 clock face nine-thirty 🕙 clock10 clock face ten oclock 🕥 clock1030 clock face ten-thirty 🕚 clock11 clock face eleven oclock 🕦 clock1130 clock face eleven-thirty 🌑 new_moon symbol 🌒 waxing_crescent_moon symbol 🌓 first_quarter_moon symbol 🌔 moon waxing_gibbous_moon symbol 🌕 full_moon symbol 🌖 waning_gibbous_moon symbol 🌗 last_quarter_moon symbol 🌘 waning_crescent_moon symbol 🌙 crescent_moon 🌚 new_moon_with_face 🌛 first_quarter_moon_with_face 🌜 last_quarter_moon_with_face 🌡️ thermometer ☀️ sunny black sun rays 🌝 full_moon_with_face 🌞 sun_with_face 🪐 ringed_planet ⭐ star white medium 🌟 star2 glowing star 🌠 stars shooting star 🌌 milky_way ☁️ cloud ⛅ partly_sunny sun behind cloud ⛈️ thunder_cloud_and_rain lightning 🌤️ mostly_sunny sun_small_cloud behind 🌥️ barely_sunny sun_behind_cloud large 🌦️ partly_sunny_rain sun_behind_rain_cloud 🌧️ rain_cloud 🌨️ snow_cloud 🌩️ lightning lightning_cloud 🌪️ tornado tornado_cloud 🌫️ fog 🌬️ wind_blowing_face 🌀 cyclone 🌈 rainbow 🌂 closed_umbrella ☂️ umbrella ☔ umbrella_with_rain_drops ⛱️ umbrella_on_ground ⚡ zap high voltage sign ❄️ snowflake ☃️ snowman ⛄ snowman_without_snow ☄️ comet 🔥 fire 💧 droplet 🌊 ocean water wave 🎃 jack_o_lantern jack-o-lantern 🎄 christmas_tree 🎆 fireworks 🎇 sparkler firework 🧨 firecracker ✨ sparkles 🎈 balloon 🎉 tada party popper 🎊 confetti_ball 🎋 tanabata_tree 🎍 bamboo pine decoration 🎎 dolls japanese 🎏 flags carp streamer 🎐 wind_chime 🎑 rice_scene moon viewing ceremony 🧧 red_envelope gift 🎀 ribbon 🎁 gift wrapped present 🎗️ reminder_ribbon 🎟️ admission_tickets 🎫 ticket 🎖️ medal military 🏆 trophy 🏅 sports_medal 🥇 first_place_medal 🥈 second_place_medal 🥉 third_place_medal ⚽ soccer ball ⚾ baseball 🥎 softball 🏀 basketball hoop 🏐 volleyball 🏈 football american 🏉 rugby_football 🎾 tennis racquet ball 🥏 flying_disc 🎳 bowling 🏏 cricket_bat_and_ball 🏑 field_hockey_stick_and_ball 🏒 ice_hockey_stick_and_puck 🥍 lacrosse stick ball 🏓 table_tennis_paddle_and_ball 🏸 badminton_racquet_and_shuttlecock 🥊 boxing_glove 🥋 martial_arts_uniform 🥅 goal_net ⛳ golf flag hole ⛸️ ice_skate 🎣 fishing_pole_and_fish 🤿 diving_mask 🎽 running_shirt_with_sash 🎿 ski boot 🛷 sled 🥌 curling_stone 🎯 dart direct hit 🪀 yo-yo 🪁 kite 🔫 gun pistol 🎱 8ball billiards 🔮 crystal_ball 🪄 magic_wand 🎮 video_game 🕹️ joystick 🎰 slot_machine 🎲 game_die 🧩 jigsaw puzzle piece 🧸 teddy_bear 🪅 pinata 🪩 mirror_ball 🪆 nesting_dolls ♠️ spades black spade suit ♥️ hearts black heart suit ♦️ diamonds black diamond suit ♣️ clubs black club suit ♟️ chess_pawn 🃏 black_joker playing card 🀄 mahjong tile red dragon 🎴 flower_playing_cards 🎭 performing_arts 🖼️ frame_with_picture framed 🎨 art artist palette 🧵 thread spool 🪡 sewing_needle 🧶 yarn ball 🪢 knot 👓 eyeglasses 🕶️ dark_sunglasses 🥽 goggles 🥼 lab_coat 🦺 safety_vest 👔 necktie 👕 shirt tshirt t-shirt 👖 jeans 🧣 scarf 🧤 gloves 🧥 coat 🧦 socks 👗 dress 👘 kimono 🥻 sari 🩱 one-piece_swimsuit one-piece 🩲 briefs 🩳 shorts 👙 bikini 👚 womans_clothes 🪭 folding_hand_fan 👛 purse 👜 handbag 👝 pouch 🛍️ shopping_bags 🎒 school_satchel 🩴 thong_sandal 👞 mans_shoe shoe 👟 athletic_shoe 🥾 hiking_boot 🥿 womans_flat_shoe 👠 high_heel high-heeled shoe 👡 sandal womans 🩰 ballet_shoes 👢 boot womans boots 🪮 hair_pick 👑 crown 👒 womans_hat 🎩 tophat top hat 🎓 mortar_board graduation cap 🧢 billed_cap 🪖 military_helmet ⛑️ helmet_with_white_cross rescue worker s 📿 prayer_beads 💄 lipstick 💍 ring 💎 gem stone 🔇 mute speaker cancellation stroke 🔈 speaker 🔉 sound speaker one wave 🔊 loud_sound speaker three waves 📢 loudspeaker public address 📣 mega cheering megaphone 📯 postal_horn 🔔 bell 🔕 no_bell cancellation stroke 🎼 musical_score 🎵 musical_note 🎶 notes multiple musical 🎙️ studio_microphone 🎚️ level_slider 🎛️ control_knobs 🎤 microphone 🎧 headphones headphone 📻 radio 🎷 saxophone 🪗 accordion 🎸 guitar 🎹 musical_keyboard 🎺 trumpet 🎻 violin 🪕 banjo 🥁 drum_with_drumsticks 🪘 long_drum 🪇 maracas 🪈 flute 🪉 harp 📱 iphone mobile phone 📲 calling mobile phone rightwards arrow at left ☎️ phone telephone black 📞 telephone_receiver 📟 pager 📠 fax machine 🔋 battery 🪫 low_battery 🔌 electric_plug 💻 computer personal 🖥️ desktop_computer 🖨️ printer ⌨️ keyboard 🖱️ three_button_mouse computer 🖲️ trackball 💽 minidisc 💾 floppy_disk 💿 cd optical disc 📀 dvd 🧮 abacus 🎥 movie_camera 🎞️ film_frames 📽️ film_projector 🎬 clapper board 📺 tv television 📷 camera 📸 camera_with_flash 📹 video_camera 📼 vhs videocassette 🔍 mag left-pointing magnifying glass 🔎 mag_right right-pointing magnifying glass 🕯️ candle 💡 bulb electric light 🔦 flashlight electric torch 🏮 izakaya_lantern lantern 🪔 diya_lamp 📔 notebook_with_decorative_cover 📕 closed_book 📖 book open_book 📗 green_book 📘 blue_book 📙 orange_book 📚 books 📓 notebook 📒 ledger 📃 page_with_curl 📜 scroll 📄 page_facing_up 📰 newspaper 🗞️ rolled_up_newspaper rolled-up 📑 bookmark_tabs 🔖 bookmark 🏷️ label 💰 moneybag money bag 🪙 coin 💴 yen banknote sign 💵 dollar banknote sign 💶 euro banknote sign 💷 pound banknote sign 💸 money_with_wings 💳 credit_card 🧾 receipt 💹 chart upwards trend yen sign ✉️ email envelope 📧 e-mail symbol 📨 incoming_envelope 📩 envelope_with_arrow downwards above 📤 outbox_tray 📥 inbox_tray 📦 package 📫 mailbox closed raised flag 📪 mailbox_closed lowered flag 📬 mailbox_with_mail open raised flag 📭 mailbox_with_no_mail open lowered flag 📮 postbox 🗳️ ballot_box_with_ballot ✏️ pencil2 pencil ✒️ black_nib 🖋️ lower_left_fountain_pen 🖊️ lower_left_ballpoint_pen 🖌️ lower_left_paintbrush 🖍️ lower_left_crayon 📝 memo pencil 💼 briefcase 📁 file_folder 📂 open_file_folder 🗂️ card_index_dividers 📅 date calendar 📆 calendar tear-off 🗒️ spiral_note_pad notepad 🗓️ spiral_calendar_pad 📇 card_index 📈 chart_with_upwards_trend 📉 chart_with_downwards_trend 📊 bar_chart 📋 clipboard 📌 pushpin 📍 round_pushpin 📎 paperclip 🖇️ linked_paperclips 📏 straight_ruler 📐 triangular_ruler ✂️ scissors black 🗃️ card_file_box 🗄️ file_cabinet 🗑️ wastebasket 🔒 lock 🔓 unlock open lock 🔏 lock_with_ink_pen 🔐 closed_lock_with_key 🔑 key 🗝️ old_key 🔨 hammer 🪓 axe ⛏️ pick ⚒️ hammer_and_pick 🛠️ hammer_and_wrench 🗡️ dagger_knife ⚔️ crossed_swords 💣 bomb 🪃 boomerang 🏹 bow_and_arrow 🛡️ shield 🪚 carpentry_saw 🔧 wrench 🪛 screwdriver 🔩 nut_and_bolt ⚙️ gear 🗜️ compression clamp ⚖️ scales balance scale 🦯 probing_cane 🔗 link symbol ⛓️‍💥 broken_chain ⛓️ chains 🪝 hook 🧰 toolbox 🧲 magnet 🪜 ladder 🪏 shovel ⚗️ alembic 🧪 test_tube 🧫 petri_dish 🧬 dna double helix 🔬 microscope 🔭 telescope 📡 satellite_antenna 💉 syringe 🩸 drop_of_blood 💊 pill 🩹 adhesive_bandage 🩼 crutch 🩺 stethoscope 🩻 x-ray 🚪 door 🛗 elevator 🪞 mirror 🪟 window 🛏️ bed 🛋️ couch_and_lamp 🪑 chair 🚽 toilet 🪠 plunger 🚿 shower 🛁 bathtub 🪤 mouse_trap 🪒 razor 🧴 lotion_bottle 🧷 safety_pin 🧹 broom 🧺 basket 🧻 roll_of_paper 🪣 bucket 🧼 soap bar 🫧 bubbles 🪥 toothbrush 🧽 sponge 🧯 fire_extinguisher 🛒 shopping_trolley 🚬 smoking symbol ⚰️ coffin 🪦 headstone ⚱️ funeral_urn 🧿 nazar_amulet 🪬 hamsa 🗿 moyai 🪧 placard 🪪 identification_card 🏧 atm automated teller machine 🚮 put_litter_in_its_place symbol 🚰 potable_water symbol ♿ wheelchair symbol 🚹 mens symbol 🚺 womens symbol 🚻 restroom 🚼 baby_symbol 🚾 wc water closet 🛂 passport_control 🛃 customs 🛄 baggage_claim 🛅 left_luggage ⚠️ warning sign 🚸 children_crossing ⛔ no_entry 🚫 no_entry_sign 🚳 no_bicycles 🚭 no_smoking symbol 🚯 do_not_litter symbol 🚱 non-potable_water non-potable symbol 🚷 no_pedestrians 📵 no_mobile_phones 🔞 underage no one under eighteen symbol ☢️ radioactive_sign ☣️ biohazard_sign ⬆️ arrow_up upwards black ↗️ arrow_upper_right north east ➡️ arrow_right black rightwards ↘️ arrow_lower_right south east ⬇️ arrow_down downwards black ↙️ arrow_lower_left south west ⬅️ arrow_left leftwards black ↖️ arrow_upper_left north west ↕️ arrow_up_down ↔️ left_right_arrow ↩️ leftwards_arrow_with_hook ↪️ arrow_right_hook rightwards ⤴️ arrow_heading_up pointing rightwards then curving upwards ⤵️ arrow_heading_down pointing rightwards then curving downwards 🔃 arrows_clockwise downwards upwards open circle 🔄 arrows_counterclockwise anticlockwise downwards upwards open circle 🔙 back leftwards arrow above 🔚 end leftwards arrow above 🔛 on exclamation mark left right arrow above 🔜 soon rightwards arrow above 🔝 top upwards arrow above 🛐 place_of_worship ⚛️ atom_symbol 🕉️ om_symbol ✡️ star_of_david ☸️ wheel_of_dharma ☯️ yin_yang ✝️ latin_cross ☦️ orthodox_cross ☪️ star_and_crescent ☮️ peace_symbol 🕎 menorah_with_nine_branches 🔯 six_pointed_star middle dot 🪯 khanda ♈ aries ♉ taurus ♊ gemini ♋ cancer ♌ leo ♍ virgo ♎ libra ♏ scorpius ♐ sagittarius ♑ capricorn ♒ aquarius ♓ pisces ⛎ ophiuchus 🔀 twisted_rightwards_arrows 🔁 repeat clockwise rightwards leftwards open circle arrows 🔂 repeat_one clockwise rightwards leftwards open circle arrows circled overlay ▶️ arrow_forward black right-pointing triangle ⏩ fast_forward black right-pointing double triangle ⏭️ black_right_pointing_double_triangle_with_vertical_bar next track button ⏯️ black_right_pointing_triangle_with_double_vertical_bar play pause button ◀️ arrow_backward black left-pointing triangle ⏪ rewind black left-pointing double triangle ⏮️ black_left_pointing_double_triangle_with_vertical_bar last track button 🔼 arrow_up_small up-pointing red triangle ⏫ arrow_double_up black up-pointing triangle 🔽 arrow_down_small down-pointing red triangle ⏬ arrow_double_down black down-pointing triangle ⏸️ double_vertical_bar pause button ⏹️ black_square_for_stop button ⏺️ black_circle_for_record button ⏏️ eject button 🎦 cinema 🔅 low_brightness symbol 🔆 high_brightness symbol 📶 signal_strength antenna bars 🛜 wireless 📳 vibration_mode 📴 mobile_phone_off ♀️ female_sign ♂️ male_sign ⚧️ transgender_symbol ✖️ heavy_multiplication_x ➕ heavy_plus_sign ➖ heavy_minus_sign ➗ heavy_division_sign 🟰 heavy_equals_sign ♾️ infinity ‼️ bangbang double exclamation mark ⁉️ interrobang exclamation question mark ❓ question black mark ornament ❔ grey_question white mark ornament ❕ grey_exclamation white mark ornament ❗ exclamation heavy_exclamation_mark symbol 〰️ wavy_dash 💱 currency_exchange 💲 heavy_dollar_sign ⚕️ medical_symbol staff_of_aesculapius ♻️ recycle black universal recycling symbol ⚜️ fleur_de_lis fleur-de-lis 🔱 trident emblem 📛 name_badge 🔰 beginner japanese symbol ⭕ o heavy large circle ✅ white_check_mark heavy ☑️ ballot_box_with_check ✔️ heavy_check_mark ❌ x cross mark ❎ negative_squared_cross_mark ➰ curly_loop ➿ loop double curly 〽️ part_alternation_mark ✳️ eight_spoked_asterisk ✴️ eight_pointed_black_star ❇️ sparkle ©️ copyright sign ®️ registered sign ™️ tm trade mark sign 🫟 splatter #️⃣ hash key *️⃣ keycap_star 0️⃣ zero keycap 0 1️⃣ one keycap 1 2️⃣ two keycap 2 3️⃣ three keycap 3 4️⃣ four keycap 4 5️⃣ five keycap 5 6️⃣ six keycap 6 7️⃣ seven keycap 7 8️⃣ eight keycap 8 9️⃣ nine keycap 9 🔟 keycap_ten 🔠 capital_abcd input symbol latin letters 🔡 abcd input symbol latin small letters 🔢 1234 input symbol numbers 🔣 symbols input symbol 🔤 abc input symbol latin letters 🅰️ a negative squared latin capital letter 🆎 ab negative squared 🅱️ b negative squared latin capital letter 🆑 cl squared 🆒 cool squared 🆓 free squared ℹ️ information_source 🆔 id squared Ⓜ️ m circled latin capital letter 🆕 new squared 🆖 ng squared 🅾️ o2 negative squared latin capital letter o 🆗 ok squared 🅿️ parking negative squared latin capital letter p 🆘 sos squared 🆙 up squared exclamation mark 🆚 vs squared 🈁 koko squared katakana 🈂️ sa squared katakana 🈷️ u6708 squared cjk unified ideograph-6708 🈶 u6709 squared cjk unified ideograph-6709 🈯 u6307 squared cjk unified ideograph-6307 🉐 ideograph_advantage circled 🈹 u5272 squared cjk unified ideograph-5272 🈚 u7121 squared cjk unified ideograph-7121 🈲 u7981 squared cjk unified ideograph-7981 🉑 accept circled ideograph 🈸 u7533 squared cjk unified ideograph-7533 🈴 u5408 squared cjk unified ideograph-5408 🈳 u7a7a squared cjk unified ideograph-7a7a ㊗️ congratulations circled ideograph congratulation ㊙️ secret circled ideograph 🈺 u55b6 squared cjk unified ideograph-55b6 🈵 u6e80 squared cjk unified ideograph-6e80 🔴 red_circle large 🟠 large_orange_circle 🟡 large_yellow_circle 🟢 large_green_circle 🔵 large_blue_circle 🟣 large_purple_circle 🟤 large_brown_circle ⚫ black_circle medium ⚪ white_circle medium 🟥 large_red_square 🟧 large_orange_square 🟨 large_yellow_square 🟩 large_green_square 🟦 large_blue_square 🟪 large_purple_square 🟫 large_brown_square ⬛ black_large_square ⬜ white_large_square ◼️ black_medium_square ◻️ white_medium_square ◾ black_medium_small_square ◽ white_medium_small_square ▪️ black_small_square ▫️ white_small_square 🔶 large_orange_diamond 🔷 large_blue_diamond 🔸 small_orange_diamond 🔹 small_blue_diamond 🔺 small_red_triangle up-pointing 🔻 small_red_triangle_down down-pointing 💠 diamond_shape_with_a_dot_inside 🔘 radio_button 🔳 white_square_button 🔲 black_square_button 🏁 checkered_flag chequered 🚩 triangular_flag_on_post 🎌 crossed_flags 🏴 waving_black_flag 🏳️ waving_white_flag 🏳️‍🌈 rainbow-flag 🏳️‍⚧️ transgender_flag 🏴‍☠️ pirate_flag 🇦🇨 flag-ac ascension island 🇦🇩 flag-ad andorra 🇦🇪 flag-ae united arab emirates 🇦🇫 flag-af afghanistan 🇦🇬 flag-ag antigua barbuda 🇦🇮 flag-ai anguilla 🇦🇱 flag-al albania 🇦🇲 flag-am armenia 🇦🇴 flag-ao angola 🇦🇶 flag-aq antarctica 🇦🇷 flag-ar argentina 🇦🇸 flag-as american samoa 🇦🇹 flag-at austria 🇦🇺 flag-au australia 🇦🇼 flag-aw aruba 🇦🇽 flag-ax land islands 🇦🇿 flag-az azerbaijan 🇧🇦 flag-ba bosnia herzegovina 🇧🇧 flag-bb barbados 🇧🇩 flag-bd bangladesh 🇧🇪 flag-be belgium 🇧🇫 flag-bf burkina faso 🇧🇬 flag-bg bulgaria 🇧🇭 flag-bh bahrain 🇧🇮 flag-bi burundi 🇧🇯 flag-bj benin 🇧🇱 flag-bl st barth lemy 🇧🇲 flag-bm bermuda 🇧🇳 flag-bn brunei 🇧🇴 flag-bo bolivia 🇧🇶 flag-bq caribbean netherlands 🇧🇷 flag-br brazil 🇧🇸 flag-bs bahamas 🇧🇹 flag-bt bhutan 🇧🇻 flag-bv bouvet island 🇧🇼 flag-bw botswana 🇧🇾 flag-by belarus 🇧🇿 flag-bz belize 🇨🇦 flag-ca canada 🇨🇨 flag-cc cocos keeling islands 🇨🇩 flag-cd congo - kinshasa 🇨🇫 flag-cf central african republic 🇨🇬 flag-cg congo - brazzaville 🇨🇭 flag-ch switzerland 🇨🇮 flag-ci c te d ivoire 🇨🇰 flag-ck cook islands 🇨🇱 flag-cl chile 🇨🇲 flag-cm cameroon 🇨🇳 cn flag-cn china 🇨🇴 flag-co colombia 🇨🇵 flag-cp clipperton island 🇨🇶 flag-sark 🇨🇷 flag-cr costa rica 🇨🇺 flag-cu cuba 🇨🇻 flag-cv cape verde 🇨🇼 flag-cw cura ao 🇨🇽 flag-cx christmas island 🇨🇾 flag-cy cyprus 🇨🇿 flag-cz czechia 🇩🇪 de flag-de germany 🇩🇬 flag-dg diego garcia 🇩🇯 flag-dj djibouti 🇩🇰 flag-dk denmark 🇩🇲 flag-dm dominica 🇩🇴 flag-do dominican republic 🇩🇿 flag-dz algeria 🇪🇦 flag-ea ceuta melilla 🇪🇨 flag-ec ecuador 🇪🇪 flag-ee estonia 🇪🇬 flag-eg egypt 🇪🇭 flag-eh western sahara 🇪🇷 flag-er eritrea 🇪🇸 es flag-es spain 🇪🇹 flag-et ethiopia 🇪🇺 flag-eu european union 🇫🇮 flag-fi finland 🇫🇯 flag-fj fiji 🇫🇰 flag-fk falkland islands 🇫🇲 flag-fm micronesia 🇫🇴 flag-fo faroe islands 🇫🇷 fr flag-fr france 🇬🇦 flag-ga gabon 🇬🇧 gb uk flag-gb united kingdom 🇬🇩 flag-gd grenada 🇬🇪 flag-ge georgia 🇬🇫 flag-gf french guiana 🇬🇬 flag-gg guernsey 🇬🇭 flag-gh ghana 🇬🇮 flag-gi gibraltar 🇬🇱 flag-gl greenland 🇬🇲 flag-gm gambia 🇬🇳 flag-gn guinea 🇬🇵 flag-gp guadeloupe 🇬🇶 flag-gq equatorial guinea 🇬🇷 flag-gr greece 🇬🇸 flag-gs south georgia sandwich islands 🇬🇹 flag-gt guatemala 🇬🇺 flag-gu guam 🇬🇼 flag-gw guinea-bissau 🇬🇾 flag-gy guyana 🇭🇰 flag-hk hong kong sar china 🇭🇲 flag-hm heard mcdonald islands 🇭🇳 flag-hn honduras 🇭🇷 flag-hr croatia 🇭🇹 flag-ht haiti 🇭🇺 flag-hu hungary 🇮🇨 flag-ic canary islands 🇮🇩 flag-id indonesia 🇮🇪 flag-ie ireland 🇮🇱 flag-il israel 🇮🇲 flag-im isle man 🇮🇳 flag-in india 🇮🇴 flag-io british indian ocean territory 🇮🇶 flag-iq iraq 🇮🇷 flag-ir iran 🇮🇸 flag-is iceland 🇮🇹 it flag-it italy 🇯🇪 flag-je jersey 🇯🇲 flag-jm jamaica 🇯🇴 flag-jo jordan 🇯🇵 jp flag-jp japan 🇰🇪 flag-ke kenya 🇰🇬 flag-kg kyrgyzstan 🇰🇭 flag-kh cambodia 🇰🇮 flag-ki kiribati 🇰🇲 flag-km comoros 🇰🇳 flag-kn st kitts nevis 🇰🇵 flag-kp north korea 🇰🇷 kr flag-kr south korea 🇰🇼 flag-kw kuwait 🇰🇾 flag-ky cayman islands 🇰🇿 flag-kz kazakhstan 🇱🇦 flag-la laos 🇱🇧 flag-lb lebanon 🇱🇨 flag-lc st lucia 🇱🇮 flag-li liechtenstein 🇱🇰 flag-lk sri lanka 🇱🇷 flag-lr liberia 🇱🇸 flag-ls lesotho 🇱🇹 flag-lt lithuania 🇱🇺 flag-lu luxembourg 🇱🇻 flag-lv latvia 🇱🇾 flag-ly libya 🇲🇦 flag-ma morocco 🇲🇨 flag-mc monaco 🇲🇩 flag-md moldova 🇲🇪 flag-me montenegro 🇲🇫 flag-mf st martin 🇲🇬 flag-mg madagascar 🇲🇭 flag-mh marshall islands 🇲🇰 flag-mk north macedonia 🇲🇱 flag-ml mali 🇲🇲 flag-mm myanmar burma 🇲🇳 flag-mn mongolia 🇲🇴 flag-mo macao sar china 🇲🇵 flag-mp northern mariana islands 🇲🇶 flag-mq martinique 🇲🇷 flag-mr mauritania 🇲🇸 flag-ms montserrat 🇲🇹 flag-mt malta 🇲🇺 flag-mu mauritius 🇲🇻 flag-mv maldives 🇲🇼 flag-mw malawi 🇲🇽 flag-mx mexico 🇲🇾 flag-my malaysia 🇲🇿 flag-mz mozambique 🇳🇦 flag-na namibia 🇳🇨 flag-nc new caledonia 🇳🇪 flag-ne niger 🇳🇫 flag-nf norfolk island 🇳🇬 flag-ng nigeria 🇳🇮 flag-ni nicaragua 🇳🇱 flag-nl netherlands 🇳🇴 flag-no norway 🇳🇵 flag-np nepal 🇳🇷 flag-nr nauru 🇳🇺 flag-nu niue 🇳🇿 flag-nz new zealand 🇴🇲 flag-om oman 🇵🇦 flag-pa panama 🇵🇪 flag-pe peru 🇵🇫 flag-pf french polynesia 🇵🇬 flag-pg papua new guinea 🇵🇭 flag-ph philippines 🇵🇰 flag-pk pakistan 🇵🇱 flag-pl poland 🇵🇲 flag-pm st pierre miquelon 🇵🇳 flag-pn pitcairn islands 🇵🇷 flag-pr puerto rico 🇵🇸 flag-ps palestinian territories 🇵🇹 flag-pt portugal 🇵🇼 flag-pw palau 🇵🇾 flag-py paraguay 🇶🇦 flag-qa qatar 🇷🇪 flag-re r union 🇷🇴 flag-ro romania 🇷🇸 flag-rs serbia 🇷🇺 ru flag-ru russia 🇷🇼 flag-rw rwanda 🇸🇦 flag-sa saudi arabia 🇸🇧 flag-sb solomon islands 🇸🇨 flag-sc seychelles 🇸🇩 flag-sd sudan 🇸🇪 flag-se sweden 🇸🇬 flag-sg singapore 🇸🇭 flag-sh st helena 🇸🇮 flag-si slovenia 🇸🇯 flag-sj svalbard jan mayen 🇸🇰 flag-sk slovakia 🇸🇱 flag-sl sierra leone 🇸🇲 flag-sm san marino 🇸🇳 flag-sn senegal 🇸🇴 flag-so somalia 🇸🇷 flag-sr suriname 🇸🇸 flag-ss south sudan 🇸🇹 flag-st s o tom pr ncipe 🇸🇻 flag-sv el salvador 🇸🇽 flag-sx sint maarten 🇸🇾 flag-sy syria 🇸🇿 flag-sz eswatini 🇹🇦 flag-ta tristan da cunha 🇹🇨 flag-tc turks caicos islands 🇹🇩 flag-td chad 🇹🇫 flag-tf french southern territories 🇹🇬 flag-tg togo 🇹🇭 flag-th thailand 🇹🇯 flag-tj tajikistan 🇹🇰 flag-tk tokelau 🇹🇱 flag-tl timor-leste 🇹🇲 flag-tm turkmenistan 🇹🇳 flag-tn tunisia 🇹🇴 flag-to tonga 🇹🇷 flag-tr t rkiye 🇹🇹 flag-tt trinidad tobago 🇹🇻 flag-tv tuvalu 🇹🇼 flag-tw taiwan 🇹🇿 flag-tz tanzania 🇺🇦 flag-ua ukraine 🇺🇬 flag-ug uganda 🇺🇲 flag-um u s outlying islands 🇺🇳 flag-un united nations 🇺🇸 us flag-us united states 🇺🇾 flag-uy uruguay 🇺🇿 flag-uz uzbekistan 🇻🇦 flag-va vatican city 🇻🇨 flag-vc st vincent grenadines 🇻🇪 flag-ve venezuela 🇻🇬 flag-vg british virgin islands 🇻🇮 flag-vi u s virgin islands 🇻🇳 flag-vn vietnam 🇻🇺 flag-vu vanuatu 🇼🇫 flag-wf wallis futuna 🇼🇸 flag-ws samoa 🇽🇰 flag-xk kosovo 🇾🇪 flag-ye yemen 🇾🇹 flag-yt mayotte 🇿🇦 flag-za south africa 🇿🇲 flag-zm zambia 🇿🇼 flag-zw zimbabwe 🏴󠁧󠁢󠁥󠁮󠁧󠁿 flag-england 🏴󠁧󠁢󠁳󠁣󠁴󠁿 flag-scotland 🏴󠁧󠁢󠁷󠁬󠁳󠁿 flag-wales`),jS.map(e=>{let{rank:n,nameRank:r}=Tfe(e,t);return{entry:e,rank:n,nameRank:r,centrality:Efe(e,t)}}).filter(({rank:e})=>e<9).sort((e,t)=>e.rank-t.rank||e.nameRank-t.nameRank||e.centrality-t.centrality).slice(0,50).map(({entry:e})=>e)):[]},NS=(e,t)=>/^\s/.test(t)?e:`${e} `,PS=e=>e.match(Sfe)?.groups?.query,FS=({anchorRect:e,listMaxHeight:t,viewport:n,rtl:r,listWidth:i=280})=>{let{width:a,height:o}=n,s=o-e.bottom,c=e.top,l=ss,u=r?e.right-i:e.left;return{top:l?void 0:`${Math.round(e.bottom+4)}px`,bottom:l?`${Math.round(o-e.top+4)}px`:void 0,left:`${Math.round(Math.max(8,Math.min(u,a-i-8)))}px`,maxHeight:`${Math.round(Math.min(t,(l?c:s)-4-8))}px`}},Ofe=B(`
    `),kfe=B(`
    `),Afe={hash:`svelte-1o09xgh`,code:`.emoji-suggestions.svelte-1o09xgh {position:fixed;inset:auto;z-index:1000;display:flex;flex-direction:column;overflow-y:auto;margin:0;padding:var(--sui-listbox-padding, 4px);width:280px;font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);-webkit-user-select:none;user-select:none;border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);}.option.svelte-1o09xgh {flex:none;display:flex;align-items:center;gap:8px;border-radius:var(--sui-option-border-radius);padding:var(--sui-option-padding);min-height:var(--sui-option-height);cursor:default;}.option[aria-selected=true].svelte-1o09xgh {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.option.svelte-1o09xgh .emoji:where(.svelte-1o09xgh) {flex:none;width:1.5em;font-size:var(--sui-font-size-large);text-align:center;}.option.svelte-1o09xgh .name:where(.svelte-1o09xgh) {flex:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}`};function IS(e,t){let n=yo();O(t,!0),K(e,Afe);let r=J(t,`ariaOwner`,3,void 0),i=j(void 0),a=j(ea([])),o=j(0),s=j(void 0),c=j(void 0),l=j(void 0),u=A(()=>!!z(i)&&!!z(a).length),d=j(0),f=j(0),p=A(()=>z(d)?z(d)*5+z(f):180),m=A(()=>z(s)?FS({anchorRect:z(s),listMaxHeight:z(p),viewport:{width:window.innerWidth,height:window.innerHeight},rtl:kc()}):void 0),h=()=>z(u),g=(e=!1)=>{ao(()=>{M(l,e&&z(i)?z(i).id:void 0,!0),M(i,void 0),M(a,[],!0),M(o,0),M(s,void 0)})},_=e=>{if(!e){(z(i)||z(l))&&g();return}if(z(l)===e.id)return;let{id:n,query:r}=e;M(l,void 0),M(s,t.getAnchorRect(e),!0),z(i)?.id===n&&z(i).query===r?M(i,e,!0):(M(i,e,!0),M(a,Dfe(r),!0),M(o,0))},v=e=>{let{length:t}=z(a);t&&M(o,(z(o)+e+t)%t)},y=()=>{let e=z(a)[z(o)];e&&z(i)&&t.onSelect(e,z(i)),g()},b=e=>{let{key:t,altKey:n,ctrlKey:r,metaKey:i,shiftKey:a}=e;if(!z(u)||n||r||i)return!1;if(t===`ArrowDown`||t===`ArrowUp`)v(t===`ArrowDown`?1:-1);else if((t===`Enter`||t===`Tab`)&&!a)y();else if(t===`Escape`)g(!0);else return!1;return e.preventDefault(),!0};L(()=>{if(z(a),!z(c))return;z(c).matches(`:popover-open`)||z(c).showPopover?.();let e=z(c).querySelector(`.option`);if(e){let{paddingTop:t,paddingBottom:n,borderTopWidth:r,borderBottomWidth:i}=getComputedStyle(z(c));M(d,e.getBoundingClientRect().height,!0),M(f,Number.parseFloat(t)+Number.parseFloat(n)+Number.parseFloat(r)+Number.parseFloat(i))}}),L(()=>{if(!r())return;let e=r();return e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-haspopup`,`listbox`),()=>{e.removeAttribute(`aria-autocomplete`),e.removeAttribute(`aria-haspopup`)}}),L(()=>{if(!r())return;let e=r();return z(u)?(e.setAttribute(`aria-controls`,n),e.setAttribute(`aria-activedescendant`,`${n}-option-${z(o)}`)):(e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-activedescendant`)),()=>{e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-activedescendant`)}}),L(()=>{z(o),z(c)?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`,behavior:`instant`})}),Do(()=>{let e=()=>{z(i)&&M(s,t.getAnchorRect(z(i)),!0)},n=({target:e})=>{let t=e;!z(u)||z(c)?.contains(t)||r()?.contains(t)||g()};return window.addEventListener(`scroll`,e,{capture:!0,passive:!0}),window.addEventListener(`resize`,e,{passive:!0}),document.addEventListener(`pointerdown`,n,{capture:!0}),()=>{window.removeEventListener(`scroll`,e,{capture:!0}),window.removeEventListener(`resize`,e),document.removeEventListener(`pointerdown`,n,{capture:!0})}});var x={isOpen:h,close:g,update:_,moveSelection:v,selectHighlighted:y,handleKeyDown:b},S=H(),C=P(S),w=e=>{var t=kfe();let r;Ro(t,23,()=>z(a),e=>e.emoji,(e,t,r)=>{var i=Ofe(),a=N(i),s=F(a,!0),c=F(I(a,2),!0);D(i),R(()=>{q(i,`id`,`${n}-option-${z(r)}`),q(i,`aria-selected`,z(r)===z(o)),W(s,z(t).emoji),W(c,`:${z(t).name}:`)}),fo(`mouseenter`,i,()=>{M(o,z(r),!0)}),po(`mousedown`,i,e=>{e.preventDefault(),M(o,z(r),!0),y()}),U(e,i)}),D(t),bs(t,e=>M(c,e),()=>z(c)),R(e=>{q(t,`id`,n),q(t,`aria-label`,e),r=os(t,``,r,{top:z(m).top,bottom:z(m).bottom,left:z(m).left,"max-height":z(m).maxHeight})},[()=>Y(`_sui.emoji_suggestions`)]),U(e,t)};return G(C,e=>{z(u)&&z(m)&&e(w)}),U(e,S),k(x)}mo([`mousedown`]);function LS(e,t){O(t,!0);let n=J(t,`element`,3,void 0),r=j(void 0),i=()=>{if(!n()||n().disabled||n().readOnly)return;let{value:e,selectionStart:t,selectionEnd:r}=n();if(t===null||t!==r)return;let i=PS(e.slice(0,t));if(i===void 0)return;let a=t-i.length-1;return{id:String(a),query:i,start:a,end:t}},a=e=>{let{start:t,end:r}=e;return n()?xfe(n(),t,r):void 0},o=(e,t)=>{let{query:r,start:i,end:a}=t;if(!n()||n().value.slice(i,a)!==`:${r}`)return;let o=NS(e.emoji,n().value.slice(a));n().focus(),n().setSelectionRange(i,a);let s=!1;try{s=document.execCommand(`insertText`,!1,o)}catch{s=!1}s||(n().setRangeText(o,i,a,`end`),n().dispatchEvent(new Event(`input`,{bubbles:!0})))},s=e=>{z(r)?.handleKeyDown(e)};L(()=>{if(!n()||!z(r))return;let e=n(),t=()=>{z(r)?.update(i())},a=()=>{z(r)?.close()};return e.addEventListener(`keydown`,s),e.addEventListener(`keyup`,t),e.addEventListener(`input`,t),e.addEventListener(`mouseup`,t),e.addEventListener(`blur`,a),()=>{e.removeEventListener(`keydown`,s),e.removeEventListener(`keyup`,t),e.removeEventListener(`input`,t),e.removeEventListener(`mouseup`,t),e.removeEventListener(`blur`,a),z(r)?.close()}}),bs(IS(e,{getAnchorRect:a,onSelect:o,get ariaOwner(){return n()}}),e=>M(r,e,!0),()=>z(r)),k()}var jfe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`role`,`keyShortcuts`,`dir`,`name`,`showInlineLabel`,`inputmode`,`flex`,`monospace`,`debounce`,`useEmojiAutocomplete`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`,`oninput`]),Mfe=B(``),Nfe=B(`
    `),Pfe={hash:`svelte-1wg3odr`,code:`.text-input.svelte-1wg3odr {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.text-input.flex.svelte-1wg3odr:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.text-input.monospace.svelte-1wg3odr {--sui-textbox-font-family: var(--sui-font-family-monospace, monospace);}input.svelte-1wg3odr:is(:where(.svelte-1wg3odr):-webkit-autofill, :where(.svelte-1wg3odr):-webkit-autofill:focus) {transition:background-color 0s 600000s, color 0s 600000s;}input.svelte-1wg3odr {display:inline-block;flex:auto;min-width:0;height:var(--sui-textbox-height);border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-singleline-padding);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-singleline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));letter-spacing:var(--sui-textbox-letter-spacing, normal);transition:all 200ms;text-align:var(--sui-textbox-text-align, start);text-indent:var(--sui-textbox-text-indent, 0);text-transform:var(--sui-textbox-text-transform, none);word-spacing:var(--sui-word-spacing-normal, normal);}input.svelte-1wg3odr:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}input[aria-invalid=true].svelte-1wg3odr {border-color:var(--sui-error-border-color);}input.svelte-1wg3odr:read-only {color:var(--sui-secondary-foreground-color);border-color:var(--sui-textbox-border-color) !important;}input.svelte-1wg3odr:is(:where(.svelte-1wg3odr):disabled, :where(.svelte-1wg3odr):read-only) {background-color:var(--sui-disabled-background-color);}input.svelte-1wg3odr ~ button {flex:none;margin-inline-start:-1px;border-width:1px;border-color:var(--sui-textbox-border-color);height:var(--sui-textbox-height);aspect-ratio:1/1;}input.svelte-1wg3odr ~ button:last-child {border-start-start-radius:0;border-start-end-radius:4px;border-end-end-radius:4px;border-end-start-radius:0;}input.svelte-1wg3odr ~ button .icon {font-size:var(--sui-font-size-xx-large);}.label.svelte-1wg3odr {position:absolute;inset:var(--sui-textbox-singleline-padding);z-index:2;display:flex;align-items:center;justify-content:var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));pointer-events:none;}.label.hidden.svelte-1wg3odr {opacity:0;}input.svelte-1wg3odr:focus + .label:where(.svelte-1wg3odr) {opacity:0;}input.svelte-1wg3odr::placeholder, .label.svelte-1wg3odr {color:var(--sui-textbox-placeholder-foreground-color, var(--sui-textbox-foreground-color));opacity:var(--sui-textbox-placeholder-opacity, 0.5);font-family:var(--sui-textbox-placeholder-font-family, var(--sui-textbox-font-family));font-size:var(--sui-textbox-placeholder-font-size, var(--sui-textbox-font-size));line-height:var(--sui-textbox-placeholder-singleline-line-height, var(--sui-textbox-singleline-line-height));font-weight:var(--sui-textbox-placeholder-font-weight, var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal)));text-align:var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));text-indent:var(--sui-textbox-placeholder-text-indent, var(--sui-textbox-text-indent, 0));letter-spacing:var(--sui-textbox-placeholder-letter-spacing, var(--sui-textbox-letter-spacing, normal));}`};function RS(e,t){let n=yo();O(t,!0),K(e,Pfe);let r=J(t,`value`,15),i=J(t,`element`,15),a=J(t,`role`,3,`textbox`),o=J(t,`keyShortcuts`,3,void 0),s=J(t,`dir`,3,void 0),c=J(t,`name`,3,void 0),l=J(t,`showInlineLabel`,3,!1),u=J(t,`inputmode`,3,`text`),d=J(t,`flex`,3,!1),f=J(t,`monospace`,3,!1),p=J(t,`debounce`,3,!1),m=J(t,`useEmojiAutocomplete`,3,!1),h=J(t,`hidden`,3,!1),g=J(t,`disabled`,3,!1),_=J(t,`readonly`,3,!1),v=J(t,`required`,3,!1),y=J(t,`invalid`,3,!1),b=J(t,`ariaLabel`,3,void 0),x=Ss(t,jfe),S=A(()=>typeof p()==`number`?p():300),C=A(()=>b()??x[`aria-label`]),w=0;L(()=>()=>{clearTimeout(w)});let T=e=>{r(i()?.value),t.oninput?.(e)},ee=e=>{let t=e;p()?(clearTimeout(w),w=setTimeout(()=>{T(t)},z(S))):T(t)};var E=Nfe();let te;var ne=N(E);gs(ne,()=>({type:`text`,...x,value:r(),role:a(),dir:s(),name:c(),tabindex:g()?-1:0,disabled:g()||void 0,readonly:_()||void 0,inputmode:u(),"aria-label":z(C),"aria-hidden":h(),"aria-disabled":g(),"aria-readonly":_(),"aria-required":v(),"aria-invalid":y(),oninputcapture:ee}),void 0,void 0,void 0,`svelte-1wg3odr`,!0),bs(ne,e=>i(e),()=>i()),Qo(ne,()=>Fx(o()));var re=I(ne,2),ie=e=>{LS(e,{get element(){return i()}})};G(re,e=>{m()&&!g()&&!_()&&e(ie)});var ae=I(re,2),oe=e=>{var t=Mfe();let i;Lx(N(t),{children:(e,t)=>{qr();var n=V();R(()=>W(n,z(C))),U(e,n)},$$slots:{default:!0}}),D(t),R(()=>{q(t,`id`,`${n}-label`),i=is(t,1,`label svelte-1wg3odr`,null,i,{hidden:!!r()})}),U(e,t)};G(ae,e=>{z(C)&&l()&&e(oe)}),D(E),R(()=>{te=is(E,1,`sui text-input ${t.class??``}`,`svelte-1wg3odr`,te,{flex:d(),monospace:f(),disabled:g(),readonly:_()}),q(E,`hidden`,h()),ne.dir=ne.dir}),U(e,E),k()}var Ffe=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`value`,`title`,`textboxAttrs`,`children`,`input`,`onkeydown`,`onkeyup`,`onkeypress`,`oninput`]),Ife=B(`
    `,1),Lfe={hash:`svelte-jdntpg`,code:`.input-outer.svelte-jdntpg {margin:12px 0 0;}`};function zS(e,t){O(t,!0),K(e,Lfe);let n=J(t,`open`,15,!1),r=J(t,`value`,15,``),i=J(t,`textboxAttrs`,19,()=>({})),a=Ss(t,Ffe);DS(e,Cs(()=>a,{get title(){return t.title},role:`alertdialog`,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var a=Ife(),o=P(a);Eo(o,()=>t.children??Er);var s=I(o,2),c=N(s),l=e=>{var n=H();Eo(P(n),()=>t.input),U(e,n)},u=e=>{{let n=A(()=>`aria-labelledby`in i()?void 0:t.title);RS(e,Cs({dir:`auto`,flex:!0,autofocus:!0,get"aria-label"(){return z(n)}},i,{get onkeydown(){return t.onkeydown},get onkeyup(){return t.onkeyup},get onkeypress(){return t.onkeypress},get oninput(){return t.oninput},get value(){return r()},set value(e){r(e)}}))}};G(c,e=>{t.input?e(l):e(u,-1)}),D(s),U(e,a)},$$slots:{default:!0}})),k()}var Rfe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`orientation`,`ariaLabel`]),zfe=B(`
    `),Bfe={hash:`svelte-1jh0ljl`,code:`.divider.svelte-1jh0ljl {flex:none;background-color:var(--sui-secondary-border-color);}.divider[aria-orientation=horizontal].svelte-1jh0ljl {margin:8px 0;width:100%;height:1px;}.divider[aria-orientation=vertical].svelte-1jh0ljl {margin:0 8px;width:1px;height:100%;}`};function BS(e,t){K(e,Bfe);let n=J(t,`hidden`,3,!1),r=J(t,`orientation`,3,`horizontal`),i=J(t,`ariaLabel`,3,void 0),a=Ss(t,Rfe);var o=zfe();gs(o,()=>({...a,role:`separator`,class:`sui divider ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-orientation":r(),"aria-label":i()}),void 0,void 0,void 0,`svelte-1jh0ljl`),U(e,o)}var Vfe=(e,t)=>e===`top`||e===`bottom`?{axis:`Y`,sign:e===`bottom`?1:-1}:{axis:`X`,sign:e===`right`===t?-1:1},Hfe=(e,t)=>Math.max(0,e*t),VS=(e,t)=>[...e.filter(({time:e})=>t.time-e<=100),t],Ufe=e=>{let t=e[0],n=e[e.length-1];return!t||!n||n.time<=t.time?0:(n.offset-t.offset)/(n.time-t.time)},Wfe=({offset:e,size:t,velocity:n})=>e>0&&(e>=t*.3||e>=16&&n>=.5),Gfe=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`class`,`title`,`ariaLabelledby`,`position`,`size`,`showClose`,`swipeDismiss`,`children`,`header`,`headerExtra`,`footer`,`closeIcon`]),HS=B(`
    `),Kfe=B(`
    `),qfe=B(``),Jfe=B(`
    `),Yfe={hash:`svelte-3nf8k9`,code:`.content.svelte-3nf8k9 {position:absolute;display:flex;flex-direction:column;max-width:100dvw;max-height:100dvh;border-width:var(--sui-drawer-content-border-width, var(--sui-modal-border-width, 0));border-style:solid;border-color:var(--sui-drawer-content-border-color, var(--sui-primary-border-color));background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);transition-property:transform;}.content.svelte-3nf8k9 .extra-control:where(.svelte-3nf8k9) {position:absolute;}.content.svelte-3nf8k9 .extra-control:where(.svelte-3nf8k9) button.close {margin:8px;}dialog.open .content.svelte-3nf8k9 {transition-duration:150ms;transform:translateX(0%);}dialog:not(.open) .content.svelte-3nf8k9 {transition-duration:300ms;}.content.right.svelte-3nf8k9 {inset-block:var(--sui-drawer-right-content-inset-block, 0);inset-inline:var(--sui-drawer-right-content-inset-inline, auto 0);border-start-start-radius:var(--sui-drawer-right-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 4px));border-start-end-radius:var(--sui-drawer-right-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 0));border-end-end-radius:var(--sui-drawer-right-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 0));border-end-start-radius:var(--sui-drawer-right-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 4px));}.content.right.full.svelte-3nf8k9 {border-radius:var(--sui-drawer-right-full-content-border-radius, var(--sui-drawer-right-content-border-radius, 0));}.content.right.svelte-3nf8k9 .extra-control:where(.svelte-3nf8k9) {inset-block-start:0;inset-inline-end:100%;}dialog:not(.open) .content.right.svelte-3nf8k9:dir(ltr) {transform:translateX(105%);}dialog:not(.open) .content.right.svelte-3nf8k9:dir(rtl) {transform:translateX(-105%);}.content.left.svelte-3nf8k9 {inset-block:var(--sui-drawer-left-content-inset-block, 0);inset-inline:var(--sui-drawer-left-content-inset-inline, 0 auto);border-start-start-radius:var(--sui-drawer-left-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 0));border-start-end-radius:var(--sui-drawer-left-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 4px));border-end-end-radius:var(--sui-drawer-left-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 4px));border-end-start-radius:var(--sui-drawer-left-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 0));}.content.left.full.svelte-3nf8k9 {border-radius:var(--sui-drawer-left-full-content-border-radius, var(--sui-drawer-left-content-border-radius, 0));}.content.left.svelte-3nf8k9 .extra-control:where(.svelte-3nf8k9) {inset-block-start:0;inset-inline-start:100%;}dialog:not(.open) .content.left.svelte-3nf8k9:dir(ltr) {transform:translateX(-105%);}dialog:not(.open) .content.left.svelte-3nf8k9:dir(rtl) {transform:translateX(105%);}dialog.open .content.vertical.svelte-3nf8k9 {transform:translateX(0%);}.content.vertical.small.svelte-3nf8k9 {width:var(--sui-drawer-vertical-small-width, var(--sui-drawer-vertical-width, 400px));max-width:var(--sui-drawer-vertical-small-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-small-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.medium.svelte-3nf8k9 {width:var(--sui-drawer-vertical-medium-width, var(--sui-drawer-vertical-width, 600px));max-width:var(--sui-drawer-vertical-medium-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-medium-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.large.svelte-3nf8k9 {width:var(--sui-drawer-vertical-large-width, var(--sui-drawer-vertical-width, 800px));max-width:var(--sui-drawer-vertical-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-large-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.x-large.svelte-3nf8k9 {width:var(--sui-drawer-vertical-x-large-width, var(--sui-drawer-vertical-width, 1000px));max-width:var(--sui-drawer-vertical-x-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-x-large-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.full.svelte-3nf8k9 {width:100dvw;max-width:100dvw;height:100dvh;}.content.top.svelte-3nf8k9 {inset-block-start:var(--sui-drawer-top-content-inset-block, 0);inset-inline:var(--sui-drawer-top-content-inset-inline, 0 0);border-start-start-radius:var(--sui-drawer-top-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 0));border-start-end-radius:var(--sui-drawer-top-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 0));border-end-end-radius:var(--sui-drawer-top-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 4px));border-end-start-radius:var(--sui-drawer-top-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 4px));}.content.top.full.svelte-3nf8k9 {border-radius:var(--sui-drawer-top-full-content-border-radius, var(--sui-drawer-top-content-border-radius, 0));}.content.top.svelte-3nf8k9 .extra-control:where(.svelte-3nf8k9) {inset-block-start:100%;inset-inline-end:0;}dialog:not(.open) .content.top.svelte-3nf8k9 {transform:translateY(-105%);}.content.bottom.svelte-3nf8k9 {inset-block:var(--sui-drawer-bottom-content-inset-block, auto 0);inset-inline:var(--sui-drawer-bottom-content-inset-inline, 0);border-start-start-radius:var(--sui-drawer-bottom-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 4px));border-start-end-radius:var(--sui-drawer-bottom-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 4px));border-end-end-radius:var(--sui-drawer-bottom-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 0));border-end-start-radius:var(--sui-drawer-bottom-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 0));}.content.bottom.full.svelte-3nf8k9 {border-radius:var(--sui-drawer-bottom-full-content-border-radius, var(--sui-drawer-bottom-content-border-radius, 0));}.content.bottom.svelte-3nf8k9 .extra-control:where(.svelte-3nf8k9) {inset-block-end:100%;inset-inline-end:0;}dialog:not(.open) .content.bottom.svelte-3nf8k9 {transform:translateY(105%);}dialog.open .content.horizontal.svelte-3nf8k9 {transform:translateY(0%);}.content.horizontal.small.svelte-3nf8k9 {width:var(--sui-drawer-horizontal-small-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-small-height, var(--sui-drawer-horizontal-height, 400px));max-height:var(--sui-drawer-horizontal-small-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.medium.svelte-3nf8k9 {width:var(--sui-drawer-horizontal-medium-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-medium-height, var(--sui-drawer-horizontal-height, 600px));max-height:var(--sui-drawer-horizontal-medium-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.large.svelte-3nf8k9 {width:var(--sui-drawer-horizontal-large-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-large-height, var(--sui-drawer-horizontal-height, 800px));max-height:var(--sui-drawer-horizontal-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.x-large.svelte-3nf8k9 {width:var(--sui-drawer-horizontal-x-large-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-x-large-height, var(--sui-drawer-horizontal-height, 1000px));max-height:var(--sui-drawer-horizontal-x-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.full.svelte-3nf8k9 {width:100dvw;height:100dvh;max-height:100dvh;}.content.swipe-dismiss.svelte-3nf8k9 > :not(.main, .footer, .extra-control) {touch-action:none;user-select:none;}.content.swipe-dismiss.swiping.svelte-3nf8k9, .content.swipe-dismiss.swiping.svelte-3nf8k9 .handle:where(.svelte-3nf8k9) {cursor:grabbing;}.handle.svelte-3nf8k9 {flex:none;display:flex;justify-content:center;padding:8px 0;cursor:grab;}.handle.svelte-3nf8k9::before {content:"";border-radius:2px;width:32px;height:4px;background-color:var(--sui-drawer-handle-color, var(--sui-secondary-foreground-color));opacity:0.5;}:is(.header.svelte-3nf8k9, .footer.svelte-3nf8k9) {display:flex;align-items:center;gap:8px;}.header.svelte-3nf8k9 {flex-direction:var(--sui-drawer-header-flex-direction, row);box-sizing:content-box;margin:var(--sui-drawer-header-margin, 0 16px);border-width:var(--sui-drawer-header-border-width, 0 0 1px);border-color:var(--sui-drawer-header-border-color, var(--sui-secondary-border-color));padding:var(--sui-drawer-header-padding, 16px 8px);height:var(--sui-drawer-header-height, 32px);}.header.svelte-3nf8k9 .title:where(.svelte-3nf8k9) {font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-bold);}.footer.svelte-3nf8k9 {margin:0 24px 24px;}.main.svelte-3nf8k9 {flex:auto;overflow:auto;padding:var(--sui-drawer-main-padding, 24px);white-space:normal;}`};function Xfe(e,t){let n=yo();O(t,!0),K(e,Yfe);let r=J(t,`open`,15,!1),i=J(t,`title`,3,``),a=J(t,`ariaLabelledby`,3,void 0),o=J(t,`position`,3,`right`),s=J(t,`size`,3,`small`),c=J(t,`showClose`,3,`outside`),l=J(t,`swipeDismiss`,3,!1),u=Ss(t,Gfe),d=j(void 0),f=A(()=>o()===`right`||o()===`left`?`vertical`:`horizontal`),p=j(void 0),m=j(void 0),h=j(0),g=e=>{let{button:t,isPrimary:n,pointerId:r,target:i,clientX:a,clientY:s}=e;if(!l()||!z(p)||z(m)||t!==0||!n)return;let c=i.closest(`.main, .footer, .extra-control, a, button, input, select, textarea, [contenteditable], [tabindex]`);if(c&&z(p).contains(c))return;let{axis:u,sign:d}=Vfe(o(),z(p).matches(`:dir(rtl)`));M(m,{pointerId:r,axis:u,sign:d,start:u===`Y`?s:a,samples:[]}),M(h,0),z(p).setPointerCapture(r)},_=e=>{let{pointerId:t,clientX:n,clientY:r,timeStamp:i}=e;z(m)&&t===z(m).pointerId&&(M(h,Hfe((z(m).axis===`Y`?r:n)-z(m).start,z(m).sign),!0),z(m).samples=VS(z(m).samples,{offset:z(h),time:i}))},v=e=>{if(!z(m)||!z(p)||e.pointerId!==z(m).pointerId)return;let{width:t,height:n}=z(p).getBoundingClientRect(),r=VS(z(m).samples,{offset:z(h),time:e.timeStamp}),i=e.type===`pointerup`&&Wfe({offset:z(h),size:z(m).axis===`Y`?n:t,velocity:Ufe(r)});M(m,void 0),M(h,0),i&&z(d)?.close(`close`)};L(()=>{r()||ao(()=>{M(m,void 0),M(h,0)})});let y=A(()=>a()??(!t.header&&i()?`${n}-title`:void 0)),b=A(()=>z(y)?void 0:i()||void 0);bs(Zx(e,Cs(()=>u,{get id(){return n},class:`drawer`,get"aria-label"(){return z(b)},get"aria-labelledby"(){return z(y)},showBackdrop:!0,get open(){return r()},set open(e){r(e)},children:(e,r)=>{var a=Jfe();let u;var y=N(a),b=e=>{U(e,HS())};G(y,e=>{l()&&o()===`bottom`&&e(b)});var x=I(y,2),S=N(x),C=e=>{TS(e,{class:`close`,get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{z(d)?.close(`close`)}})};G(S,e=>{c()===`outside`&&e(C)}),D(x);var w=I(x,2),T=e=>{var r=H(),a=P(r),o=e=>{var n=H();Eo(P(n),()=>t.header),U(e,n)},s=e=>{var r=Kfe(),a=N(r),o=F(a,!0),s=I(a,2);wS(s,{flex:!0});var l=I(s,2);Eo(l,()=>t.headerExtra??Er);var u=I(l,2),f=e=>{TS(e,{class:`close`,get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{z(d)?.close(`close`)}})};G(u,e=>{c()===`inside`&&e(f)}),D(r),R(()=>{q(a,`id`,`${n}-title`),W(o,i())}),U(e,r)};G(a,e=>{t.header?e(o):e(s,-1)}),U(e,r)};G(w,e=>{(i()||c()===`inside`||t.header||t.headerExtra)&&e(T)});var ee=I(w,2);Eo(N(ee),()=>t.children??Er),D(ee);var E=I(ee,2),te=e=>{var n=qfe();Eo(N(n),()=>t.footer??Er),D(n),U(e,n)};G(E,e=>{t.footer&&e(te)});var ne=I(E,2),re=e=>{U(e,HS())};G(ne,e=>{l()&&o()===`top`&&e(re)}),D(a),bs(a,e=>M(p,e),()=>z(p)),R(()=>{is(a,1,es([`content`,t.class,s(),o(),z(f),{"swipe-dismiss":l(),swiping:!!z(m)}]),`svelte-3nf8k9`),u=os(a,``,u,{transform:z(m)?`translate${z(m).axis}(${z(m).sign*z(h)}px)`:void 0,"transition-duration":z(m)?`0s`:void 0})}),po(`pointerdown`,a,g),po(`pointermove`,a,_),po(`pointerup`,a,v),fo(`pointercancel`,a,v),U(e,a)},$$slots:{default:!0}})),e=>M(d,e,!0),()=>z(d)),k()}mo([`pointerdown`,`pointermove`,`pointerup`]);var Zfe=B(``);function US(e,t){O(t,!0);let n=J(t,`accept`,3,void 0),r=J(t,`multiple`,3,!1),i=J(t,`onSelect`,3,void 0),a=J(t,`onCancel`,3,void 0),o=j(void 0);var s={open:()=>{z(o)?.click()}},c=Zfe();return bs(c,e=>M(o,e),()=>z(o)),R(()=>{q(c,`accept`,n()),c.multiple=r()}),po(`change`,c,({target:e})=>{let t=e,n=[...t.files];t.value=``,i()?.({files:n,file:n[0]})}),fo(`cancel`,c,e=>{e.stopPropagation(),a()?.()}),U(e,c),k(s)}mo([`change`]);var Qfe=new Set([`$$slots`,`$$events`,`$$legacy`,`expanded`,`class`,`label`,`collapsible`,`children`,`chevronIcon`,`onChange`]),$fe=B(``),epe=B(`
    `),tpe=B(`
    `),npe={hash:`svelte-1wjtopa`,code:`[role=rowgroup].svelte-1wjtopa {display:table-row-group;}[role=row].svelte-1wjtopa {display:table-row;}[role=columnheader].svelte-1wjtopa {display:table-cell;padding:8px;color:var(--sui-secondary-foreground-color);background-color:var(--sui-secondary-background-color);font-size:var(--sui-font-size-default);text-align:start;}[role=columnheader].svelte-1wjtopa:has(> .expander) {padding:0;}[role=columnheader].svelte-1wjtopa .expander {justify-content:flex-start;margin:0;border-radius:0;padding:4px 8px 4px 4px;width:100%;height:auto;color:inherit;font-size:inherit;text-align:start;}.chevron.svelte-1wjtopa {flex:none;display:flex;align-items:center;justify-content:center;transition:transform 200ms;}.expander[aria-expanded='true'] > .chevron.svelte-1wjtopa:dir(ltr) {transform:rotate(90deg);}.expander[aria-expanded='true'] > .chevron.svelte-1wjtopa:dir(rtl) {transform:rotate(-90deg);}`};function WS(e,t){let n=yo();O(t,!0),K(e,npe);let r=J(t,`expanded`,15,!0),i=J(t,`label`,3,``),a=J(t,`collapsible`,3,!1),o=Ss(t,Qfe),s=A(()=>a()&&!!i()),c=()=>{r(!r()),t.onChange?.(new CustomEvent(`Change`,{detail:{expanded:r()}}))},l=e=>{let t=t=>{z(s)&&t.target===e&&c()};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}};var u=tpe();gs(u,e=>({...o,role:`rowgroup`,class:`sui grid-body row-group ${t.class??``}`,"aria-labelledby":i()?`${n}-label`:void 0,"aria-roledescription":e}),[()=>Y(`_sui.role_descriptions.grid_body`)],void 0,void 0,`svelte-1wjtopa`);var d=N(u),f=e=>{var a=epe();Ite(N(a),()=>`th`,!1,(e,a)=>{gs(e,()=>({role:`columnheader`,id:`${n}-label`,colspan:`9999`,class:``}),void 0,void 0,void 0,`svelte-1wjtopa`);var o=H(),l=P(o),u=e=>{eS(e,{class:`expander`,get label(){return i()},tabindex:`-1`,get"aria-expanded"(){return r()},onclick:c,startIcon:e=>{var n=$fe(),r=N(n),i=e=>{var n=H();Eo(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{{let t=A(()=>kc()?`chevron_left`:`chevron_right`);bx(e,{get name(){return z(t)}})}};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),D(n),U(e,n)},$$slots:{startIcon:!0}})},d=e=>{var t=V();R(()=>W(t,i())),U(e,t)};G(l,e=>{z(s)?e(u):e(d,-1)}),U(a,o)}),D(a),Qo(a,()=>l),U(e,a)};G(d,e=>{i()&&e(f)});var p=I(d,2),m=e=>{var n=H();Eo(P(n),()=>t.children??Er),U(e,n)};G(p,e=>{(!z(s)||r())&&e(m)}),D(u),U(e,u),k()}var rpe=new Set([`$$slots`,`$$events`,`$$legacy`,`role`,`kind`,`class`,`children`]),ipe=B(`
    `),ape={hash:`svelte-thpva3`,code:`.table-head.svelte-thpva3, .grid-head.svelte-thpva3 {display:table-header-group;}.table-foot.svelte-thpva3, .grid-foot.svelte-thpva3 {display:table-footer-group;}.table-row.svelte-thpva3, .grid-row.svelte-thpva3 {display:table-row;height:var(--sui-primary-row-height);}.table-col-header.svelte-thpva3, .grid-col-header.svelte-thpva3, .table-cell.svelte-thpva3, .grid-cell.svelte-thpva3 {display:table-cell;}.table-row-header.svelte-thpva3, .grid-row-header.svelte-thpva3 {display:table-cell;height:var(--sui-secondary-row-height);}`};function GS(e,t){K(e,ape);let n=Ss(t,rpe);var r=ipe();gs(r,()=>({...n,role:t.role,class:`sui ${t.kind??``} ${t.class??``}`}),void 0,void 0,void 0,`svelte-thpva3`),Eo(N(r),()=>t.children??Er),D(r),U(e,r)}var ope=new Set([`$$slots`,`$$events`,`$$legacy`]);function KS(e,t){let n=Ss(t,ope);GS(e,Cs(()=>n,{role:`gridcell`,kind:`grid-cell`}))}var spe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`sortOrder`,`children`,`onSort`]),cpe={hash:`svelte-p4j81a`,code:`:where(.sui.grid-col-header.sortable) {position:relative;}.sui.grid-col-header.sortable > .sui.button.sort-button {justify-content:flex-start;margin:0;border-radius:0;padding:0;width:100%;height:auto;color:inherit;font:inherit;text-align:start;}.sui.grid-col-header.sortable > .sui.button.sort-button::after {position:absolute;inset:0;content:"";}.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon {flex:none;font-size:16px;transition:opacity 200ms;}.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon.none {opacity:0;}.sui.grid-col-header.sortable > .sui.button.sort-button:is(:hover, :focus-visible) .sort-icon.none {opacity:0.4;} @media (hover: none) {.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon.none {opacity:0.4;} }`};function qS(e,t){O(t,!0),K(e,cpe);let n=J(t,`sortOrder`,3,void 0),r=Ss(t,spe),i=e=>{let r=r=>{r.stopPropagation(),e.focus(),t.onSort?.(new CustomEvent(`Sort`,{detail:{sortOrder:n()===`ascending`?`descending`:`ascending`}}))},i=e=>{let{key:t}=e;(t===`Enter`||t===` `)&&e.stopPropagation()};return e.addEventListener(`click`,r),e.addEventListener(`keydown`,i),()=>{e.removeEventListener(`click`,r),e.removeEventListener(`keydown`,i)}};var a=H(),o=P(a),s=e=>{GS(e,Cs(()=>r,{role:`columnheader`,kind:`grid-col-header`,get class(){return t.class},children:(e,n)=>{var r=H();Eo(P(r),()=>t.children??Er),U(e,r)},$$slots:{default:!0}}))},c=e=>{{let a=A(()=>t.class?`sortable ${t.class}`:`sortable`),o=A(()=>n()===`none`?void 0:n());GS(e,Cs(()=>r,{role:`columnheader`,kind:`grid-col-header`,get class(){return z(a)},get"aria-sort"(){return z(o)},children:(e,r)=>{{let r=e=>{{let t=A(()=>n()===`descending`?`arrow_downward`:`arrow_upward`);bx(e,{get class(){return`sort-icon ${n()??``}`},get name(){return z(t)}})}};eS(e,{class:`sort-button`,[ko()]:i,endIcon:r,children:(e,n)=>{var r=H();Eo(P(r),()=>t.children??Er),U(e,r)},$$slots:{endIcon:!0,default:!0}})}},$$slots:{default:!0}}))}};G(o,e=>{n()===void 0?e(s):e(c,-1)}),U(e,a),k()}var lpe=new Set([`$$slots`,`$$events`,`$$legacy`]);function upe(e,t){O(t,!0);let n=Ss(t,lpe);ai(`sui:grid-unselectable-rows`,!0);{let t=A(()=>Y(`_sui.role_descriptions.grid_head`));GS(e,Cs(()=>n,{role:`rowgroup`,kind:`grid-head`,get"aria-roledescription"(){return z(t)}}))}k()}var dpe=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`]);function JS(e,t){O(t,!0);let n=J(t,`selected`,3,!1),r=Ss(t,dpe),i=ii(`sui:grid-unselectable-rows`)===!0,a=A(()=>{if(!i)return{...r,"aria-selected":n()};let{"aria-selected":e,...t}=r;return{...t,"data-selectable":`false`}}),o=e=>{let t=t=>{let n=e.querySelector(`.sort-button`);t.target===e&&n&&(t.stopPropagation(),n.focus())};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}};var s=H(),c=P(s),l=e=>{GS(e,Cs(()=>z(a),{role:`row`,kind:`grid-row`,tabindex:`0`,[ko()]:o}))},u=e=>{GS(e,Cs(()=>z(a),{role:`row`,kind:`grid-row`,tabindex:`0`}))};G(c,e=>{i?e(l):e(u,-1)}),U(e,s),k()}var fpe=new Set([`$$slots`,`$$events`,`$$legacy`,`element`,`class`,`multiple`,`clickToSelect`,`ariaLabel`,`children`,`onChange`]),ppe=B(`
    `),mpe={hash:`svelte-hrfl0r`,code:`.grid.svelte-hrfl0r {display:table;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.grid.data.svelte-hrfl0r {border-collapse:collapse;}.grid.data.svelte-hrfl0r :is(.grid-col-header, .grid-row-header, .grid-cell) {border:1px solid var(--sui-secondary-border-color);padding:8px 8px;}`};function hpe(e,t){O(t,!0),K(e,mpe);let n=J(t,`element`,15),r=J(t,`multiple`,3,!1),i=J(t,`clickToSelect`,3,!0),a=J(t,`ariaLabel`,3,void 0),o=Ss(t,fpe);ai(`sui:grid-unselectable-rows`,!1);var s=ppe(),c=e=>{t.onChange?.(e)};gs(s,()=>({...o,role:`grid`,class:`sui grid ${t.class??``}`,"aria-multiselectable":r(),"aria-label":a(),onChange:c}),void 0,void 0,void 0,`svelte-hrfl0r`),Eo(N(s),()=>t.children??Er),D(s),bs(s,e=>n(e),()=>n()),Qo(s,()=>_S({clickToSelect:i()})),U(e,s),k()}var gpe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`multiple`,`searchTerms`,`ariaLabel`,`children`,`onFilter`]),_pe=B(`
    `),vpe={hash:`svelte-syg9gt`,code:`[role=listbox].svelte-syg9gt {display:flex;flex-direction:column;margin:var(--sui-focus-ring-width);border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);min-width:var(--sui-listbox-min-width, calc(var(--sui-option-height) * 5));color:var(--sui-listbox-foreground-color);background-color:var(--sui-listbox-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}[role=listbox].svelte-syg9gt [role=separator] {margin:4px 0;background-color:var(--sui-control-border-color);}[role=listbox][aria-invalid=true].svelte-syg9gt {border-color:var(--sui-error-border-color);}[role=listbox].tabs.svelte-syg9gt {padding:0;border-block-start-width:0;border-block-end-width:0;border-inline-end-width:1px;border-inline-start-width:0;border-color:var(--sui-control-border-color);}[role=listbox].tabs.svelte-syg9gt .option button {justify-content:flex-start;border-width:0;border-inline-end-width:2px;border-color:transparent;padding:0 12px;border-start-end-radius:0;border-end-end-radius:0;height:var(--sui-tab-medium-height);}[role=listbox].tabs.svelte-syg9gt .option button[aria-selected=true] {border-color:var(--sui-primary-accent-color-light);}[role=listbox].tabs.svelte-syg9gt .option button .icon {display:none;}[role=listbox].tabs[aria-readonly=true].svelte-syg9gt .option button[aria-selected='true'] {border-color:var(--sui-readonly-accent-color);}[role=listbox].in-combobox.svelte-syg9gt:focus-visible, [role=listbox].svelte-syg9gt:focus-visible:has(.focused) {outline-color:transparent;}[role=listbox].filtered.svelte-syg9gt [role=separator] {display:none;}.inner.svelte-syg9gt {display:contents;}`};function YS(e,t){O(t,!0),K(e,vpe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`readonly`,3,!1),a=J(t,`required`,3,!1),o=J(t,`invalid`,3,!1),s=J(t,`multiple`,3,!1),c=J(t,`searchTerms`,3,``),l=J(t,`ariaLabel`,3,void 0),u=Ss(t,gpe),d=j(!1);var f=_pe(),p=e=>{let{detail:{matched:n,total:r}}=e;M(d,n!==r),t.onFilter?.(e)};gs(f,()=>({...u,role:`listbox`,class:`sui listbox ${t.class??``}`,tabindex:r()?-1:0,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-multiselectable":s(),"aria-label":l(),onFilter:p,[fs]:{filtered:z(d)}}),void 0,void 0,void 0,`svelte-syg9gt`);var m=N(f);Eo(N(m),()=>t.children??Er),D(m),D(f),Qo(f,()=>_S(()=>({searchTerms:c()}))),R(()=>m.inert=r()),U(e,f),k()}var ype=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`label`,`children`]),bpe=B(`
    `),xpe={hash:`svelte-lqtkkl`,code:`.option-group.svelte-lqtkkl:not(:first-child) {margin:12px 0 0;}.label.svelte-lqtkkl {margin:8px;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.inner.svelte-lqtkkl {display:contents;}`};function XS(e,t){let n=yo();O(t,!0),K(e,xpe);let r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`label`,3,``),o=Ss(t,ype);var s=bpe();gs(s,e=>({...o,role:`group`,id:n,class:`sui option-group ${t.class??``}`,hidden:r(),"aria-hidden":r(),"aria-disabled":i(),"aria-labelledby":`${n}-label`,"aria-roledescription":e}),[()=>Y(`_sui.role_descriptions.option_group`)],void 0,void 0,`svelte-lqtkkl`);var c=N(s);Lx(N(c),{children:(e,t)=>{qr();var n=V();R(()=>W(n,a())),U(e,n)},$$slots:{default:!0}}),D(c);var l=I(c,2);Eo(N(l),()=>t.children??Er),D(l),D(s),R(()=>{q(c,`id`,`${n}-label`),l.inert=i()}),U(e,s),k()}var Spe=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`hidden`,`class`,`disabled`,`label`,`value`,`searchValue`,`wrap`,`children`,`checkIcon`,`startIcon`,`onChange`,`onToggle`]),Cpe=B(` `,1),wpe=B(`
    `),Tpe={hash:`svelte-10nr3xf`,code:`.option.svelte-10nr3xf {display:contents;}.option.svelte-10nr3xf:focus-visible {outline-width:0 !important;}.option.wrap.svelte-10nr3xf button {white-space:normal;}.option.svelte-10nr3xf button {flex:none;display:flex;gap:4px;margin:0 !important;border-radius:var(--sui-option-border-radius);padding:var(--sui-option-padding);width:100%;height:auto;min-height:var(--sui-option-height);}.option.svelte-10nr3xf button:active {background-color:var(--sui-active-background-color);}.option.svelte-10nr3xf button[aria-selected=true] .icon.check {color:var(--sui-primary-accent-color-text);}.option.svelte-10nr3xf button * {flex:none;}.option.svelte-10nr3xf button .label {flex:auto;}.option.svelte-10nr3xf :is(.focused, button:hover) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.option.svelte-10nr3xf .icon.check {margin:-2px;}[role='listbox']:focus-visible .option.svelte-10nr3xf .focused {outline-color:var(--sui-focus-ring-color);outline-offset:calc(var(--sui-focus-ring-width) * -1);}[role='listbox'][aria-readonly='true'] .option.svelte-10nr3xf button {cursor:default;}[role='listbox'][aria-readonly='true'] .option.svelte-10nr3xf button:not(.focused):is(:hover, :active) {color:var(--sui-control-foreground-color);background-color:transparent;}[role='listbox'][aria-readonly='true'] .option.svelte-10nr3xf button[aria-selected=true] .icon.check {color:var(--sui-readonly-accent-color);}`};function ZS(e,t){let n=yo();O(t,!0),K(e,Tpe);let r=J(t,`selected`,15,!1),i=J(t,`hidden`,15,!1),a=J(t,`disabled`,3,!1),o=J(t,`value`,3,void 0),s=J(t,`searchValue`,3,void 0),c=J(t,`wrap`,3,!1),l=Ss(t,Spe),u=A(()=>o()===void 0?t.label:o()),d=A(()=>s()===void 0?t.label:s()),f=Lde();f&&Oo(f.register({get value(){return z(u)},get label(){return t.label},get name(){return t.name},get type(){return t.valueType??Ix(z(u))},get selected(){return r()},set selected(e){r(e)},get disabled(){return a()}}));let p=A(()=>!f||f.expanded);var m=H(),h=P(m),g=e=>{var o=wpe();let s;var f=N(o);{let e=e=>{var n=H();Eo(P(n),()=>t.startIcon??Er),U(e,n)},o=A(()=>t.id??n);eS(f,Cs(()=>l,{role:`option`,get id(){return z(o)},tabindex:`-1`,get"aria-selected"(){return r()},get label(){return t.label},get value(){return z(u)},get hidden(){return i()},get disabled(){return a()},get"data-search-value"(){return z(d)},onChange:e=>{r(e.detail.selected),t.onChange?.(e)},onToggle:e=>{i(e.detail.hidden),i()&&r(!1),t.onToggle?.(e)},startIcon:e,children:(e,n)=>{var i=Cpe(),a=P(i),o=e=>{var n=H(),r=P(n),i=e=>{var n=H();Eo(P(n),()=>t.checkIcon),U(e,n)},a=e=>{bx(e,{class:`check`,name:`check`})};G(r,e=>{t.checkIcon?e(i):e(a,-1)}),U(e,n)};G(a,e=>{r()&&e(o)}),Eo(I(a,2),()=>t.children??Er),U(e,i)},$$slots:{startIcon:!0,default:!0}}))}D(o),R(()=>{s=is(o,1,`sui option ${t.class??``}`,`svelte-10nr3xf`,s,{wrap:c()}),q(o,`hidden`,i())}),U(e,o)};G(h,e=>{z(p)&&e(g)}),U(e,m),k()}var Epe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`ariaLabel`,`children`,`onChange`]),Dpe=B(`
    `),Ope={hash:`svelte-160pq2p`,code:`.menu.svelte-160pq2p {display:flex;flex-direction:column;margin:0;border-width:var(--sui-menu-border-width, 1px);border-style:var(--sui-menu-border-style, solid);border-color:var(--sui-menu-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-menu-border-radius, 4px);padding:var(--sui-menu-padding, 4px);}.menu.svelte-160pq2p [role=separator] {margin:var(--sui-menu-divider-margin, 4px);width:auto;background-color:var(--sui-menu-divider-color, var(--sui-control-border-color));}`};function QS(e,t){O(t,!0),K(e,Ope);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`ariaLabel`,3,void 0),a=Ss(t,Epe);var o=Dpe(),s=e=>{t.onChange?.(e)};gs(o,()=>({...a,role:`menu`,class:`sui menu ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-label":i(),onChange:s}),void 0,void 0,void 0,`svelte-160pq2p`),Eo(N(o),()=>t.children??Er),D(o),Qo(o,_S),U(e,o),k()}var kpe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`role`,`hidden`,`disabled`,`label`,`labelDir`,`popupPosition`,`children`,`startIcon`,`endIcon`,`chevronIcon`,`items`,`onmouseenter`,`onmouseleave`,`onclick`,`onChange`,`onSelect`]),Ape=B(``),jpe=B(`
    `,1),Mpe=B(`
    `),Npe={hash:`svelte-1r0q02h`,code:`.menuitem.svelte-1r0q02h {position:relative;}.menuitem.svelte-1r0q02h button {display:flex;gap:var(--sui-menuitem-gap, 4px);align-items:var(--sui-menuitem-align-items, center);border-radius:var(--sui-menuitem-border-radius, var(--sui-option-border-radius, 4px));margin:0 !important;padding:var(--sui-menuitem-padding, 0 16px);width:100%;min-width:var(--sui-menuitem-min-width, 160px);height:var(--sui-menuitem-height, var(--sui-option-height));color:var(--sui-menuitem-foreground-color, var(--sui-control-foreground-color, inherit));background-color:var(--sui-menuitem-background-color, transparent);font-size:var(--sui-menuitem-font-size, var(--sui-option-font-size));font-weight:var(--sui-menuitem-font-weight, var(--sui-option-font-weight, var(--sui-font-weight-normal, normal)));}.menuitem.svelte-1r0q02h button[aria-checked=true] .icon {color:var(--sui-primary-accent-color-text);}.menuitem.svelte-1r0q02h button:hover {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.menuitem.svelte-1r0q02h button:active {background-color:var(--sui-active-background-color);}.content.svelte-1r0q02h {flex:auto;}.icon-outer.svelte-1r0q02h {flex:none;width:24px;height:24px;}`};function $S(e,t){O(t,!0),K(e,Npe);let n=J(t,`role`,3,`menuitem`),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`label`,3,``),o=J(t,`labelDir`,3,void 0),s=J(t,`popupPosition`,3,`right-top`),c=Ss(t,kpe),l=j(!1),u=j(!1),d,f=j(void 0),p=j(void 0),m=A(()=>n()===`menuitem`&&!!t.items),h=e=>{window.clearTimeout(d),d=window.setTimeout(e,200)};Do(()=>(M(p,z(f)?.closest(`dialog`)??void 0,!0),()=>{window.clearTimeout(d)}));var g=Mpe(),_=N(g);{let e=e=>{var n=H();Eo(P(n),()=>t.startIcon??Er),U(e,n)},s=e=>{var n=jpe(),r=P(n);let i;var s=N(r),c=e=>{var t=V();R(()=>W(t,a())),U(e,t)},l=e=>{var n=H();Eo(P(n),()=>t.children??Er),U(e,n)};G(s,e=>{a()?e(c):e(l,-1)}),D(r);var u=I(r,2),d=e=>{var n=Ape(),r=N(n),i=e=>{var n=H();Eo(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{{let t=A(()=>kc()?`chevron_left`:`chevron_right`);bx(e,{get name(){return z(t)}})}};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),D(n),U(e,n)};G(u,e=>{z(m)&&e(d)}),R(()=>{i=is(r,1,`content svelte-1r0q02h`,null,i,{label:!!a()}),q(r,`dir`,a()?o():void 0),r.dir=r.dir}),U(e,n)},p=e=>{var n=H();Eo(P(n),()=>t.endIcon??Er),U(e,n)},g=A(()=>z(m)?`menu`:void 0),v=A(()=>z(m)?z(l):void 0);eS(_,Cs(()=>c,{get role(){return n()},get hidden(){return r()},get disabled(){return i()},get"aria-haspopup"(){return z(g)},get"aria-expanded"(){return z(v)},onmouseenter:e=>{z(m)&&h(()=>{M(l,!0)}),t.onmouseenter?.(e)},onmouseleave:e=>{z(m)&&h(()=>{z(u)||M(l,!1)}),t.onmouseleave?.(e)},onclick:e=>{z(m)&&(e.preventDefault(),e.stopPropagation(),window.clearTimeout(d),M(l,e.detail?!0:!z(l),!0)),t.onclick?.(e)},get onChange(){return t.onChange},get onSelect(){return t.onSelect},get element(){return z(f)},set element(e){M(f,e,!0)},startIcon:e,children:s,endIcon:p,$$slots:{startIcon:!0,default:!0,endIcon:!0}}))}var v=I(_,2),y=e=>{Qx(e,{get anchor(){return z(f)},get parentDialogElement(){return z(p)},get position(){return s()},get open(){return z(l)},set open(e){M(l,e,!0)},get hovered(){return z(u)},set hovered(e){M(u,e,!0)},children:(e,n)=>{QS(e,{children:(e,n)=>{var r=H();Eo(P(r),()=>t.items??Er),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(v,e=>{z(m)&&z(f)&&z(p)&&e(y)}),D(g),R(()=>{is(g,1,`sui menuitem ${t.class??``}`,`svelte-1r0q02h`),q(g,`hidden`,r())}),U(e,g),k()}var Ppe=new Set([`$$slots`,`$$events`,`$$legacy`,`role`,`checked`,`class`,`hidden`,`disabled`,`label`,`children`,`startIcon`,`onChange`]);function Fpe(e,t){O(t,!0);let n=J(t,`checked`,15),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`label`,3,``),o=Ss(t,Ppe),s=A(()=>t.role===`menuitemradio`?`menu-item-radio`:`menu-item-checkbox`);$S(e,Cs(()=>o,{get role(){return t.role},get class(){return`sui ${z(s)??``} ${t.class??``}`},get label(){return a()},get hidden(){return r()},get disabled(){return i()},get"aria-checked"(){return n()},onChange:e=>{n(e.detail.checked),t.onChange?.(e)},startIcon:e=>{var n=H();Eo(P(n),()=>t.startIcon??Er),U(e,n)},children:e=>{var n=H();Eo(P(n),()=>t.children??Er),U(e,n)},endIcon:e=>{var t=H(),r=P(t),i=e=>{bx(e,{name:`check`})};G(r,e=>{n()&&e(i)}),U(e,t)},$$slots:{startIcon:!0,default:!0,endIcon:!0}})),k()}var Ipe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`]);function eC(e,t){O(t,!0);let n=J(t,`checked`,15),r=Ss(t,Ipe);Fpe(e,Cs(()=>r,{role:`menuitemcheckbox`,get checked(){return n()},set checked(e){n(e)}})),k()}var Lpe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`]);function tC(e,t){O(t,!0);let n=J(t,`checked`,15),r=Ss(t,Lpe);Fpe(e,Cs(()=>r,{role:`menuitemradio`,get checked(){return n()},set checked(e){n(e)}})),k()}var Rpe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`now`,`min`,`max`,`text`,`ariaLabel`]),zpe=B(`
    `),Bpe={hash:`svelte-qb1hkd`,code:`.progressbar.svelte-qb1hkd {overflow:hidden;border-width:var(--sui-progressbar-border-width, 1px);border-style:var(--sui-progressbar-border-style, solid);border-color:var(--sui-progressbar-border-color, var(--sui-control-border-color));border-radius:var(--sui-progressbar-border-radius, 16px);width:var(--sui-progressbar-width, 240px);height:var(--sui-progressbar-height, 10px);background-color:var(--sui-progressbar-background-color, var(--sui-secondary-background-color));}.progressbar.svelte-qb1hkd div:where(.svelte-qb1hkd) {height:100%;background-color:var(--sui-progressbar-foreground-color, var(--sui-primary-accent-color-light));transition:width 250ms;}`};function Vpe(e,t){K(e,Bpe);let n=J(t,`now`,3,0),r=J(t,`min`,3,0),i=J(t,`max`,3,100),a=J(t,`ariaLabel`,3,void 0),o=Ss(t,Rpe),s=A(()=>i()>r()?Math.min(Math.max((n()-r())/(i()-r())*100,0),100):0);var c=zpe();gs(c,()=>({...o,role:`progressbar`,class:`sui progressbar ${t.class??``}`,"aria-valuenow":n(),"aria-valuemin":r(),"aria-valuemax":i(),"aria-valuetext":t.text,"aria-label":a()}),void 0,void 0,void 0,`svelte-qb1hkd`);var l=N(c);let u;D(c),R(()=>u=os(l,``,u,{width:`${z(s)}%`})),U(e,c)}var Hpe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`orientation`,`ariaLabel`,`children`,`onChange`]),Upe=B(`
    `),Wpe={hash:`svelte-o5i0vz`,code:`.radio-group.svelte-o5i0vz {display:inline-flex;}.radio-group.svelte-o5i0vz:focus-visible {outline-width:0 !important;}.radio-group.horizontal.svelte-o5i0vz {gap:8px;align-items:center;flex-wrap:wrap;}.radio-group.vertical.svelte-o5i0vz {gap:4px;flex-direction:column;} @media (pointer: coarse) {.radio-group.vertical.svelte-o5i0vz {gap:8px;} }.radio-group[aria-invalid=true].svelte-o5i0vz button {border-color:var(--sui-error-border-color);}.radio-group[aria-invalid=true].svelte-o5i0vz button[aria-checked=true] {border-color:var(--sui-error-border-color);}.radio-group[aria-invalid=true].svelte-o5i0vz button[aria-checked=true]::before {background-color:var(--sui-error-border-color);}.inner.svelte-o5i0vz {display:contents;}`};function Gpe(e,t){O(t,!0),K(e,Wpe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`readonly`,3,!1),a=J(t,`required`,3,!1),o=J(t,`invalid`,3,!1),s=J(t,`orientation`,3,`horizontal`),c=J(t,`ariaLabel`,3,void 0),l=Ss(t,Hpe);var u=Upe(),d=e=>{t.onChange?.(e)};gs(u,()=>({...l,role:`radiogroup`,class:[`sui`,`radio-group`,t.class,s()],tabindex:`-1`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-orientation":s(),"aria-label":c(),onChange:d}),void 0,void 0,void 0,`svelte-o5i0vz`);var f=N(u);Eo(N(f),()=>t.children??Er),D(f),D(u),Qo(u,_S),R(()=>f.inert=r()),U(e,u),k()}var Kpe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`class`,`hidden`,`disabled`,`name`,`value`,`valueType`,`label`,`ariaLabel`,`group`,`children`,`onChange`,`onSelect`]),qpe=B(``),Jpe=B(` `),Ype={hash:`svelte-10l2bnt`,code:`.radio.svelte-10l2bnt {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);min-width:24px;min-height:24px;color:var(--sui-control-foreground-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);cursor:pointer;-webkit-user-select:none;user-select:none;}.radio.svelte-10l2bnt:hover button {background-color:var(--sui-hover-background-color);}.radio.svelte-10l2bnt:hover button[aria-checked=true] {border-color:var(--sui-primary-accent-color-light);color:var(--sui-primary-accent-color-text);}.radio.svelte-10l2bnt:hover button[aria-checked=true]::before {background-color:var(--sui-primary-accent-color-light);}.radio.svelte-10l2bnt:active button {background-color:var(--sui-active-background-color);}.radio.svelte-10l2bnt:active button[aria-checked=true] {border-color:var(--sui-primary-accent-color-dark);color:var(--sui-primary-accent-color-dark);}.radio.svelte-10l2bnt button {flex:none;justify-content:center;overflow:hidden;margin:0 !important;border-width:1.5px;border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-height);padding:0;width:var(--sui-checkbox-height);height:var(--sui-checkbox-height);background-color:var(--sui-checkbox-background-color);transition:all 200ms;}.radio.svelte-10l2bnt button::before {content:"";border-radius:var(--sui-checkbox-height);width:calc(var(--sui-checkbox-height) - 7px);height:calc(var(--sui-checkbox-height) - 7px);background-color:var(--sui-primary-accent-color);opacity:0;transition:all 200ms;will-change:opacity;}.radio.svelte-10l2bnt button[aria-checked=true] {border-color:var(--sui-primary-accent-color);}.radio.svelte-10l2bnt button[aria-checked=true]::before {opacity:1;}.radio.svelte-10l2bnt label:where(.svelte-10l2bnt) {cursor:inherit;}[role='radiogroup'][aria-readonly='true'] .radio.svelte-10l2bnt {cursor:default;}[role='radiogroup'][aria-readonly='true'] .radio.svelte-10l2bnt button, [role='radiogroup'][aria-readonly='true'] .radio.svelte-10l2bnt:is(:where(.svelte-10l2bnt):hover, :where(.svelte-10l2bnt):active) button {background-color:var(--sui-checkbox-background-color);}[role='radiogroup'][aria-readonly='true'] .radio.svelte-10l2bnt button[aria-checked='true'], [role='radiogroup'][aria-readonly='true'] .radio.svelte-10l2bnt:is(:where(.svelte-10l2bnt):hover, :where(.svelte-10l2bnt):active) button[aria-checked='true'] {border-color:var(--sui-readonly-accent-color);}[role='radiogroup'][aria-readonly='true'] .radio.svelte-10l2bnt button[aria-checked='true']::before, [role='radiogroup'][aria-readonly='true'] .radio.svelte-10l2bnt:is(:where(.svelte-10l2bnt):hover, :where(.svelte-10l2bnt):active) button[aria-checked='true']::before {background-color:var(--sui-readonly-accent-color);}`};function nC(e,t){let n=yo();O(t,!0),K(e,Ype);let r=J(t,`checked`,7,!1),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`name`,3,void 0),s=J(t,`value`,3,void 0),c=J(t,`valueType`,3,void 0),l=J(t,`label`,3,void 0),u=J(t,`ariaLabel`,3,void 0),d=J(t,`group`,15),f=Ss(t,Kpe),p=j(void 0),m=A(()=>SS({id:n,ariaLabel:u()??f[`aria-label`],hasVisibleLabel:!!(t.children||l())})),h=()=>!!z(p)?.closest(`[role="radiogroup"]`)?.matches(`[aria-readonly="true"]`);L(()=>{typeof d()==`string`&&(d()===s()?r()||r(!0):r()&&r(!1))});var g=Jpe();let _;var v=N(g);eS(v,Cs(()=>f,{role:`radio`,get id(){return n},get hidden(){return i()},get disabled(){return a()},get name(){return o()},get value(){return s()},get valueType(){return c()},get"aria-checked"(){return r()}},()=>z(m),{onclick:e=>{e.preventDefault(),a()||r()||h()||(r(!0),typeof d()==`string`&&d(s()))},onChange:e=>{r(e.detail.checked),r()&&typeof d()==`string`&&d(s()),t.onChange?.(e)},get onSelect(){return t.onSelect},get element(){return z(p)},set element(e){M(p,e,!0)}}));var y=I(v,2),b=e=>{var r=qpe(),i=N(r),a=e=>{var n=H();Eo(P(n),()=>t.children??Er),U(e,n)},o=e=>{var t=V();R(()=>W(t,l())),U(e,t)};G(i,e=>{t.children?e(a):e(o,-1)}),D(r),R(()=>q(r,`id`,`${n}-label`)),U(e,r)};G(y,e=>{(t.children||l())&&e(b)}),D(g),R(()=>{_=is(g,1,`sui radio ${t.class??``}`,`svelte-10l2bnt`,_,{disabled:a()}),q(g,`hidden`,i())}),po(`click`,g,e=>{e.target.matches(`button`)||z(p)?.click()}),U(e,g),k()}mo([`click`]);var rC=(e,t,n)=>{if(typeof e==`number`)return e;if(!e||typeof e!=`string`)return t;let r=e.trim(),i=r.match(/^(-?\d+(?:\.\d+)?)%$/);if(i)return Number(i[1]);let{containerSize:a}=n;if(!a)return t;let o=r.match(/^(-?\d+(?:\.\d+)?)px$/i);if(o)return Number(o[1])/a*100;let s=r.match(/^(-?\d+(?:\.\d+)?)(dvw|vw|dvh|vh)$/i);if(s){let e=Number(s[1]),t=s[2].toLowerCase().endsWith(`w`)?n.viewportWidth:n.viewportHeight;return e/100*t/a*100}return t},iC=(e,t)=>{if(!e)return{minSize:0,maxSize:100};let n=Math.max(0,rC(e.minSize,0,t)),r=Math.min(100,rC(e.maxSize,100,t));return{minSize:n,maxSize:Math.max(n,r)}},Xpe=(e,t,n,r)=>{let i=r,a=n;for(;a.length&&Math.abs(i)>1e-9;){let n=i/a.length,r=a.map(r=>{let{minSize:i,maxSize:a}=t[r],o=Math.min(a,Math.max(i,e[r]+n)),s=o-e[r];return e[r]=o,s});i-=r.reduce((e,t)=>e+t,0),a=a.filter(r=>n>0?e[r]t[r].minSize)}return i},Zpe=(e,t)=>{let n=e.filter(e=>!Number.isNaN(e)),r=n.reduce((e,t)=>e+t,0),i=e.length-n.length,a=Math.max(0,100-r),o=i>0?a/i:0,s=e.map(e=>Number.isNaN(e)?o:e);if(!t)return s;let c=s.reduce((e,t)=>e+t,0),l=s.map((e,n)=>t[n]??{minSize:0,maxSize:100}),u=s.map((e,t)=>Math.min(l[t].maxSize,Math.max(l[t].minSize,e))),d=s.map((e,t)=>t);return Xpe(u,l,d,Xpe(u,l,d.filter(t=>Number.isNaN(e[t])),c-u.reduce((e,t)=>e+t,0))),u},Qpe=(e,{sizeBefore:t,sizeAfter:n,constraintsBefore:r,constraintsAfter:i})=>{let a=Math.max(0,Math.min(r.maxSize-t,n-i.minSize)),o=Math.max(0,Math.min(t-r.minSize,i.maxSize-n));return e>0?Math.min(e,a):-Math.min(-e,o)},$pe=(e,{neighbors:t,amount:n,exclude:r,getConstraints:i})=>{let a=n;return[...t,...e.map((e,t)=>t)].forEach(t=>{if(Math.abs(a)<.001||t===r||e[t]===void 0)return;let{minSize:n,maxSize:o}=i(t),s=Math.min(Math.max(e[t]+a,n),o);a-=s-e[t],e[t]=s}),a},eme=({key:e,shiftKey:t,isHorizontal:n,rtl:r})=>{if(e===`Enter`)return{type:`toggle`};if(e===`Home`)return{type:`resize`,delta:-100};if(e===`End`)return{type:`resize`,delta:100};let i=t?10:1,{prevKey:a,nextKey:o}=cS(n?`horizontal`:`vertical`,r);if(e===a)return{type:`resize`,delta:-i};if(e===o)return{type:`resize`,delta:i}},tme=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`showHandleBar`,`class`,`ariaLabel`,`children`,`onResizeStart`,`onResizeEnd`]),nme=B(`
    `),rme=B(`
    `),ime={hash:`svelte-d1909v`,code:`.resizable-handle.svelte-d1909v {position:relative;flex:0 0 auto;display:flex;align-items:center;justify-content:center;touch-action:none;outline-offset:0;background-color:transparent;transition:background-color 200ms;}.resizable-handle.svelte-d1909v:focus-visible, .resizable-handle.svelte-d1909v:hover, .resizable-handle.dragging.svelte-d1909v {outline:none;z-index:1;background-color:var(--sui-primary-accent-color-translucent-light);}.resizable-handle.svelte-d1909v:focus-visible .handle-bar:where(.svelte-d1909v), .resizable-handle.svelte-d1909v:hover .handle-bar:where(.svelte-d1909v), .resizable-handle.dragging.svelte-d1909v .handle-bar:where(.svelte-d1909v) {background-color:var(--sui-primary-accent-color);}.resizable-handle.disabled.svelte-d1909v {pointer-events:none;opacity:0.4;}.resizable-handle.svelte-d1909v::before {content:"";position:absolute;inset:0;z-index:1;}.resizable-handle.horizontal.svelte-d1909v {width:var(--sui-resizable-handle-size, 4px);height:100%;cursor:col-resize;}.resizable-handle.horizontal.svelte-d1909v::before {inset-inline:calc((var(--sui-resizable-handle-size, 4px) - 24px) / 2);}.resizable-handle.horizontal.svelte-d1909v .handle-bar:where(.svelte-d1909v) {width:2px;height:40%;min-height:20px;}.resizable-handle.vertical.svelte-d1909v {width:100%;height:var(--sui-resizable-handle-size, 4px);cursor:row-resize;}.resizable-handle.vertical.svelte-d1909v::before {inset-block:calc((var(--sui-resizable-handle-size, 4px) - 24px) / 2);}.resizable-handle.vertical.svelte-d1909v .handle-bar:where(.svelte-d1909v) {height:2px;width:40%;min-width:20px;}.resizable-handle.svelte-d1909v .handle-bar:where(.svelte-d1909v) {border-radius:1px;background-color:hsl(var(--sui-border-color-1-hsl));transition:background-color 200ms;}`};function ame(e,t){O(t,!0),K(e,ime);let n=J(t,`disabled`,3,!1),r=J(t,`showHandleBar`,3,!1),i=J(t,`ariaLabel`,3,void 0),a=Ss(t,tme),o=ii(`paneGroup`);if(!o)throw Error(` must be used inside a `);let s=j(void 0),c=o.registerHandle(()=>z(s)),l=A(()=>c.index);Oo(()=>{c.unregister()});let u=A(()=>o.direction===`horizontal`),d=A(()=>o.sizes),f=A(()=>z(d)[z(l)]??0),p=A(()=>o.getPaneConstraints(z(l))),m=A(()=>o.getPaneConstraints(z(l)+1)),h=A(()=>z(f)+(z(d)[z(l)+1]??0)),g=A(()=>Math.max(z(p).minSize,z(h)-z(m).maxSize)),_=A(()=>Math.min(z(p).maxSize,z(h)-z(m).minSize)),v=j(!1),y=j(0),b=0,x=j(0),S=j(!1),C=0,w=e=>{let{screenX:t,screenY:r,pointerId:i}=e;if(n()||!z(v)||i!==z(x))return;e.preventDefault(),e.stopPropagation();let a=(z(u)?t:r)-z(y);if(!C)return;let s=a/C*100;z(u)&&kc()&&(s=-s),o.resize(z(l),b+s-(z(d)[z(l)]??0))},T=e=>{let{pointerId:n}=e;z(v)&&n===z(x)&&(z(s)?.releasePointerCapture(n),M(v,!1),M(y,0),M(x,0),t.onResizeEnd?.(),document.removeEventListener(`pointermove`,w),document.removeEventListener(`pointerup`,T),document.removeEventListener(`pointercancel`,T))},ee=e=>{if(n())return;e.preventDefault(),e.stopPropagation();let{screenX:r,screenY:i,pointerId:a}=e;M(v,!0),M(y,z(u)?r:i,!0),b=z(d)[z(l)]??0,M(x,a,!0),C=o.measurePaneSpace(),z(s)?.setPointerCapture(a),t.onResizeStart?.(),document.addEventListener(`pointermove`,w),document.addEventListener(`pointerup`,T),document.addEventListener(`pointercancel`,T)},E=e=>{if(n())return;let{key:r,shiftKey:i}=e,a=eme({key:r,shiftKey:i,isHorizontal:z(u),rtl:kc()});a&&(e.preventDefault(),e.stopPropagation(),a.type===`toggle`?o.toggleCollapse(z(l)):(r!==`Home`&&r!==`End`&&!z(S)&&(M(S,!0),t.onResizeStart?.()),o.resize(z(l),a.delta)))},te=()=>{z(S)&&(M(S,!1),t.onResizeEnd?.())};L(()=>()=>{document.removeEventListener(`pointermove`,w),document.removeEventListener(`pointerup`,T),document.removeEventListener(`pointercancel`,T)});var ne=rme();gs(ne,e=>({...a,role:`separator`,tabindex:n()?-1:0,"aria-orientation":z(u)?`vertical`:`horizontal`,"aria-valuenow":e,"aria-valuemin":z(g),"aria-valuemax":z(_),"aria-controls":o.paneDefs[z(l)]?.id,"aria-disabled":n()||void 0,"aria-label":i(),class:`sui resizable-handle ${t.class??``}`,onpointerdown:ee,onkeydown:E,onblur:te,[fs]:{horizontal:z(u),vertical:!z(u),disabled:n(),dragging:z(v)}}),[()=>Math.round(z(f))],void 0,void 0,`svelte-d1909v`);var re=N(ne),ie=e=>{var n=H();Eo(P(n),()=>t.children),U(e,n)},ae=e=>{U(e,nme())};G(re,e=>{t.children?e(ie):r()&&e(ae,1)}),D(ne),bs(ne,e=>M(s,e),()=>z(s)),U(e,ne),k()}var ome=new Set([`$$slots`,`$$events`,`$$legacy`,`direction`,`class`,`children`,`onResize`]),sme=B(`
    `),cme={hash:`svelte-1uairpd`,code:`.resizable-pane-group.svelte-1uairpd {display:flex;overflow:hidden;}.resizable-pane-group.horizontal.svelte-1uairpd {flex-direction:row;width:100%;height:100%;}.resizable-pane-group.vertical.svelte-1uairpd {flex-direction:column;width:100%;height:100%;}`};function lme(e,t){O(t,!0),K(e,cme);let n=J(t,`direction`,3,`horizontal`),r=Ss(t,ome),i=j([]),a=j([]),o=j(void 0),s=ea([]),c=ea([]),l=()=>{if(!z(o))return 0;let e=n()===`horizontal`,t=e?z(o).clientWidth:z(o).clientHeight,r=[...z(o).querySelectorAll(`:scope > .resizable-handle`)].reduce((t,n)=>t+(e?n.offsetWidth:n.offsetHeight),0);return Math.max(t-r,0)},u=()=>({containerSize:l(),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}),d=e=>iC(z(i)[e],u()),f=``,p=()=>{if(!z(i).length)return;let e=u(),t=z(i).map(t=>t.defaultSize===void 0?NaN:rC(t.defaultSize,NaN,e)),n=z(i).map(t=>iC(t,e));s.splice(0,s.length,...Zpe(t,n)),f=s.map(e=>Number(e.toFixed(1))).join()},m=()=>{let e=s.map(e=>Number(e.toFixed(1))),n=e.join();n!==f&&(f=n,t.onResize?.({sizes:e}))},h=(e,t)=>{let n=e,r=e+1;if(n<0||r>=s.length)return;let i=s[n],a=s[r],o=Qpe(t,{sizeBefore:i,sizeAfter:a,constraintsBefore:d(n),constraintsAfter:d(r)});s[n]=i+o,s[r]=a-o,m()},g=e=>{let{minSize:t}=d(e);if(c[e]!==void 0&&Math.abs(s[e]-t)<.1){let t=c[e]-s[e];c[e]=void 0,h(e,t)}else c[e]=s[e],h(e,-(s[e]-t))},_=(e,t,n)=>$pe(s,{neighbors:e,amount:t,exclude:n,getConstraints:d}),v=()=>{if(!z(o)||!s.length)return;let e=[...z(o).querySelectorAll(`:scope > .resizable-pane`)].map(({id:e})=>e),t=t=>{let n=e.indexOf(t.id);return n===-1?1/0:n},n=z(i).toSorted((e,n)=>t(e)-t(n)),r=n.map(e=>s[z(i).indexOf(e)]);n.some((e,t)=>e!==z(i)[t])&&(M(i,n),s.splice(0,s.length,...r),c.length=0),s.forEach((e,t)=>{if(!Number.isNaN(e))return;let n=u(),r=z(i)[t],{minSize:a,maxSize:o}=iC(r,n),c=r.defaultSize===void 0?NaN:rC(r.defaultSize,NaN,n),l=Math.min(Math.max(Number.isNaN(c)?100/s.length:c,a),o);s[t]=0,s[t]=l+_([t-1,t+1],-l,t)});let l=[...z(o).querySelectorAll(`:scope > .resizable-handle`)],d=e=>{let t=l.indexOf(e());return t===-1?1/0:t},f=z(a).toSorted((e,t)=>d(e)-d(t));f.some((e,t)=>e!==z(a)[t])&&(M(a,f),c.length=0),s.some(e=>Number.isNaN(e))||m()};ai(`paneGroup`,{get direction(){return n()},sizes:s,registerPane:e=>(M(i,[...z(i),e]),s.length&&s.push(NaN),{get index(){return z(i).indexOf(e)},unregister:()=>{let t=z(i).indexOf(e);if(t!==-1&&(M(i,z(i).toSpliced(t,1)),s.length)){let[e]=s.splice(t,1);c.length=0,s.length&&!Number.isNaN(e)&&_([t-1,t],e)}}}),registerHandle:e=>(M(a,[...z(a),e]),{get index(){return z(a).indexOf(e)},unregister:()=>{M(a,z(a).filter(t=>t!==e)),c.length=0}}),resize:h,toggleCollapse:g,getPaneConstraints:d,measurePaneSpace:l,get paneDefs(){return z(i)}}),L(()=>{z(i).length&&!s.length&&p()}),L(()=>{if(!z(o))return;let e=new MutationObserver(()=>v());return e.observe(z(o),{childList:!0}),()=>{e.disconnect()}});var y=sme();gs(y,()=>({...r,role:`none`,class:[`sui`,`resizable-pane-group`,n(),t.class],"data-direction":n()}),void 0,void 0,void 0,`svelte-1uairpd`),Eo(N(y),()=>t.children??Er),D(y),bs(y,e=>M(o,e),()=>z(o)),U(e,y),k()}var ume=new Set([`$$slots`,`$$events`,`$$legacy`,`defaultSize`,`minSize`,`maxSize`,`class`,`children`,`onResize`]),dme=B(`
    `);function aC(e,t){let n=yo();O(t,!0);let r=J(t,`defaultSize`,3,void 0),i=J(t,`minSize`,3,0),a=J(t,`maxSize`,3,100),o=Ss(t,ume),s=ii(`paneGroup`);if(!s)throw Error(` must be used inside a `);let c=s.registerPane({id:n,get defaultSize(){return r()},get minSize(){return i()},get maxSize(){return a()}}),l=A(()=>s.direction),u=A(()=>s.sizes[c.index]),d=A(()=>z(u)!==void 0&&!Number.isNaN(z(u))?`${z(u)}%`:typeof r()==`number`?`${r()}%`:r()??`0%`);Oo(()=>{c.unregister()}),L(()=>{z(u)!==void 0&&!Number.isNaN(z(u))&&ao(()=>t.onResize?.({size:Number(z(u).toFixed(1))}))});var f=dme();gs(f,()=>({...o,id:n,role:`none`,class:`sui resizable-pane ${t.class??``}`,[ps]:{"flex-basis":z(d),"flex-grow":`0`,"flex-shrink":`1`,"overflow-x":z(l)===`horizontal`?`auto`:void 0,"overflow-y":z(l)===`vertical`?`auto`:void 0}})),Eo(N(f),()=>t.children??Er),D(f),U(e,f),k()}var fme=B(`
    `),pme=B(` `,1),mme={hash:`svelte-1qbkxne`,code:`.spinner.svelte-1qbkxne {height:1px;}`};function oC(e,t){O(t,!0),K(e,mme);let n=J(t,`itemChunkSize`,3,25),r=j(ea(n())),i=j(void 0),a=A(()=>t.items.length>z(r)),o=null,s=!1,c=e=>{if(s)return o;let t=null;o=null;for(let n=e.parentElement;n;n=n.parentElement)if(/^(auto|scroll)$/.test(getComputedStyle(n).overflowY)&&(t??=n,n.scrollHeight-n.clientHeight>1)){o=n;break}return s=o===t,o};L(()=>{if(z(r),!z(i))return;let e=new IntersectionObserver(e=>{e.at(-1)?.isIntersecting&&z(a)&&M(r,z(r)+n())},{root:c(z(i)),rootMargin:`0px 0px 500px 0px`});return e.observe(z(i)),()=>{e.disconnect()}});var l=pme(),u=P(l);Ro(u,19,()=>t.items.slice(0,z(r)),(e,n)=>e[t.itemKey]??n,(e,n,r)=>{var i=H();Eo(P(i),()=>t.renderItem,()=>z(n),()=>z(r)),U(e,i)});var d=I(u,2),f=e=>{var t=fme();bs(t,e=>M(i,e),()=>z(i)),U(e,t)};G(d,e=>{z(a)&&e(f)}),U(e,l),k()}function hme(e){let t=e-1;return t*t*t+1}function sC(e,{from:t,to:n},r={}){var{delay:i=0,duration:a=e=>Math.sqrt(e)*120,easing:o=hme}=r,s=getComputedStyle(e),c=s.transform===`none`?``:s.transform,[l,u]=s.transformOrigin.split(` `).map(parseFloat);l/=e.clientWidth,u/=e.clientHeight;var d=gme(e),f=e.clientWidth/n.width/d,p=e.clientHeight/n.height/d,m=t.left+t.width*l,h=t.top+t.height*u,g=n.left+n.width*l,_=n.top+n.height*u,v=(m-g)*f,y=(h-_)*p,b=t.width/n.width,x=t.height/n.height;return{delay:i,duration:typeof a==`function`?a(Math.sqrt(v*v+y*y)):a,easing:o,css:(e,t)=>`transform: ${c} translate(${t*v}px, ${t*y}px) scale(${e+t*b}, ${e+t*x});`}}function gme(e){if(`currentCSSZoom`in e)return e.currentCSSZoom;for(var t=e,n=1;t!==null;)n*=+getComputedStyle(t).zoom,t=t.parentElement;return n}var _me=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`flex`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`searchIcon`,`closeIcon`,`onClear`]),vme=B(`
    `),yme={hash:`svelte-1nh3z4x`,code:`.search-bar.svelte-1nh3z4x {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.search-bar.flex.svelte-1nh3z4x:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.search-bar.svelte-1nh3z4x > span:where(.svelte-1nh3z4x) {position:absolute;inset-block:0;inset-inline-start:0;inset-inline-end:auto;z-index:2;display:flex;align-items:center;justify-content:center;width:var(--sui-button-medium-height);height:var(--sui-button-medium-height);}.search-bar.svelte-1nh3z4x .icon {font-size:calc(var(--sui-textbox-height) * 0.6);opacity:0.5;}.search-bar.svelte-1nh3z4x > button {position:absolute;inset-block:0;inset-inline-start:auto;inset-inline-end:0;z-index:2;margin:0 !important;height:var(--sui-button-medium-height);}.search-bar.svelte-1nh3z4x .label {--sui-textbox-singleline-padding: 0 36px;}.search-bar.svelte-1nh3z4x .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.search-bar.svelte-1nh3z4x input {z-index:1;padding:0 var(--sui-button-medium-height) !important;width:100%;}.search-bar.svelte-1nh3z4x:dir(rtl) {--sui-textbox-text-align: right;}`};function cC(e,t){let n=yo();O(t,!0),K(e,yme);let r=J(t,`value`,15),i=J(t,`flex`,3,!1),a=J(t,`hidden`,3,!1),o=J(t,`disabled`,3,!1),s=J(t,`readonly`,3,!1),c=J(t,`required`,3,!1),l=J(t,`invalid`,3,!1),u=Ss(t,_me),d=j(void 0);var f={focus:()=>{z(d)?.focus()}},p=vme();let m;var h=N(p),g=N(h),_=e=>{var n=H();Eo(P(n),()=>t.searchIcon),U(e,n)},v=e=>{bx(e,{name:`search`})};G(g,e=>{t.searchIcon?e(_):e(v,-1)}),D(h);var y=I(h,2);RS(y,Cs({dir:`auto`},()=>u,{role:`searchbox`,get id(){return n},get flex(){return i()},get hidden(){return a()},get disabled(){return o()},get readonly(){return s()},get required(){return c()},get invalid(){return l()},inputmode:`search`,get element(){return z(d)},set element(e){M(d,e,!0)},get value(){return r()},set value(e){r(e)}}));var b=I(y,2),x=e=>{{let i=e=>{var n=H(),r=P(n),i=e=>{var n=H();Eo(P(n),()=>t.closeIcon),U(e,n)},a=e=>{bx(e,{name:`close`})};G(r,e=>{t.closeIcon?e(i):e(a,-1)}),U(e,n)},a=A(()=>o()||s()),c=A(()=>Y(`_sui.clear`));eS(e,{iconic:!0,get disabled(){return z(a)},get"aria-label"(){return z(c)},get"aria-controls"(){return n},onclick:()=>{r(``),z(d)?.focus(),t.onClear?.()},startIcon:i,$$slots:{startIcon:!0}})}};return G(b,e=>{r()&&e(x)}),D(p),R(()=>{q(p,`role`,a()?void 0:`none`),m=is(p,1,`sui search-bar ${t.class??``}`,`svelte-1nh3z4x`,m,{flex:i(),disabled:o(),readonly:s()}),q(p,`hidden`,a()),q(p,`aria-hidden`,a())}),U(e,p),k(f)}var bme=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`editable`,`position`,`filterThreshold`,`ariaLabel`,`children`,`chevronIcon`,`onChange`]),xme=B(`
    `),Sme=B(`
    `),Cme=B(`
    `),wme=B(`
    `,1),Tme={hash:`svelte-1vz2e50`,code:`:is(.option-host.svelte-1vz2e50, .listbox-slot.svelte-1vz2e50) {display:contents;}.combobox.svelte-1vz2e50 {margin:var(--sui-focus-ring-width);display:flex;align-items:center;position:relative;min-width:var(--sui-combobox-min-width, calc(var(--sui-option-height) * 5));}.combobox.svelte-1vz2e50 div[role=combobox]:where(.svelte-1vz2e50) {display:flex;align-items:center;border-width:1px;border-color:var(--sui-control-border-color);border-radius:var(--sui-textbox-border-radius);padding-block:0;padding-inline-start:calc(var(--sui-textbox-height) / 4);padding-inline-end:var(--sui-textbox-height);width:100%;height:var(--sui-textbox-height);color:var(--sui-control-foreground-color);background-color:var(--sui-disabled-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);-webkit-user-select:none;user-select:none;cursor:pointer;transition:all 200ms;}.combobox.svelte-1vz2e50 div[role=combobox]:where(.svelte-1vz2e50):not(.selected) {font-style:italic;}.combobox.svelte-1vz2e50 div[role=combobox]:where(.svelte-1vz2e50):is(:where(.svelte-1vz2e50):hover, :where(.svelte-1vz2e50):focus) {background-color:var(--sui-hover-background-color);}.combobox.svelte-1vz2e50 div[role=combobox][aria-readonly=true]:where(.svelte-1vz2e50) {cursor:default;}.combobox.svelte-1vz2e50 div[role=combobox][aria-readonly=true]:where(.svelte-1vz2e50):is(:where(.svelte-1vz2e50):hover, :where(.svelte-1vz2e50):focus):not(:focus-visible) {background-color:var(--sui-disabled-background-color);}.combobox.svelte-1vz2e50 div[role=combobox][aria-invalid=true]:where(.svelte-1vz2e50) {border-color:var(--sui-error-border-color);}.combobox.svelte-1vz2e50 div[role=combobox]:where(.svelte-1vz2e50) .label:where(.svelte-1vz2e50) {width:100%;}.combobox.svelte-1vz2e50 .icon {font-size:var(--sui-font-size-xx-large);opacity:0.5;}.combobox.svelte-1vz2e50 > button {position:absolute;inset-block-start:0;inset-inline-end:0;z-index:1;margin:0 !important;border-start-start-radius:0;border-end-start-radius:0;background-color:transparent !important;}.combobox.svelte-1vz2e50 > button[tabindex="-1"] {pointer-events:none;}.combobox.svelte-1vz2e50 .text-input {margin:0 !important;width:100% !important;}.combobox.svelte-1vz2e50 input {padding-block:0;padding-inline:8px 32px;width:0;}.combobox-inner.svelte-1vz2e50 {flex:auto;display:flex;flex-direction:column;overflow:hidden;}.combobox-inner.svelte-1vz2e50 .sui.search-bar {flex:none;margin-bottom:calc(8px - var(--sui-focus-ring-width));}.combobox-inner.svelte-1vz2e50 .sui.listbox {flex:auto;overflow-y:auto;}.combobox-inner.svelte-1vz2e50 .no-options:where(.svelte-1vz2e50) {flex:none;display:flex;align-items:center;padding:var(--sui-option-padding);height:var(--sui-option-height);color:var(--sui-tertiary-foreground-color);}`};function Eme(e,t){let n=yo();O(t,!0),K(e,Tme);let r=J(t,`value`,15),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`readonly`,3,!1),s=J(t,`required`,3,!1),c=J(t,`invalid`,3,!1),l=J(t,`editable`,3,!0),u=J(t,`position`,3,`bottom-left`),d=J(t,`filterThreshold`,3,5),f=J(t,`ariaLabel`,3,void 0),p=Ss(t,bme),m=j(!1),h=j(void 0),g=j(void 0),_=j(void 0),v=j(void 0),y=j(void 0),b=j(void 0),x=j(``),S=j(!1),C=j(``),w=j(0),T=A(()=>!z(C)||z(w)>0),ee=A(()=>z(h)??z(g)),E=Ide(),te=()=>{let e=E.find(r());M(x,e?.label??``,!0),E.selectOnly(r())},ne=({type:e,name:n,label:r,value:i})=>{t.onChange?.(new CustomEvent(`Change`,{detail:{target:void 0,type:e,name:n,label:r,value:i}}))},re=e=>{let n=aS(e);r(n.value),te(),t.onChange?.(new CustomEvent(`Change`,{detail:n}))},ie=e=>{let{target:n}=e;r(n.value),te(),t.oninput?.(e),t.onChange?.(new CustomEvent(`Change`,{detail:{target:n,type:`string`,name:void 0,label:n.value,value:r()}}))},ae=new lS,oe=e=>{let{key:t,ctrlKey:n,metaKey:i,altKey:s}=e;if(a()||o()||z(m)||t.length!==1||t===` `||n||i||s)return;e.preventDefault();let c=E.entries.filter(e=>!e.disabled),l=uS(c.map(e=>sS(e.label??``)),ae.push(t),c.findIndex(e=>e.value===r()));if(l===-1)return;let u=c[l];u.value!==r()&&(r(u.value),te(),ne(u))},se=()=>z(y)?.querySelector(`[role="listbox"]`),ce=()=>{let e=se(),t=e?.querySelector(`[role="option"][aria-selected="true"]`);e&&t&&(t.classList.add(`focused`),e.setAttribute(`aria-activedescendant`,t.id),t.scrollIntoView(!0))};L(()=>{E.expanded=z(m)}),L(()=>{if(!z(m))return;let e=globalThis.setTimeout(ce,150);return()=>{globalThis.clearTimeout(e),se()?.removeAttribute(`aria-activedescendant`)}}),L(()=>{if(!z(y))return;let e=z(m)?z(b):z(v);e&&z(y).parentElement!==e&&e.append(z(y))}),Do(()=>{let e=E.selectedEntry;e&&(r(e.value),M(x,e.label,!0),ne(e))}),L(()=>{r(),te()});var le=wme(),ue=P(le);let de;var fe=N(ue),pe=e=>{var t=xme();gs(t,()=>({...p,role:`combobox`,id:n,tabindex:a()?-1:0,"aria-expanded":z(m),"aria-hidden":i(),"aria-disabled":a(),"aria-readonly":o(),"aria-required":s(),"aria-invalid":c(),"aria-haspopup":`listbox`,"aria-label":f(),onkeydown:oe,[fs]:{selected:r()!==void 0}}),void 0,void 0,void 0,`svelte-1vz2e50`);var l=N(t);Lx(N(l),{children:(e,t)=>{qr();var n=V();R(e=>W(n,e),[()=>r()===void 0?Y(`_sui.combobox.select_an_option`):z(x)]),U(e,n)},$$slots:{default:!0}}),D(l),D(t),bs(t,e=>M(h,e),()=>z(h)),U(e,t)},me=e=>{{let t=A(()=>r()===void 0?``:String(r()));RS(e,Cs(()=>p,{dir:`auto`,role:`combobox`,get id(){return n},get value(){return z(t)},get hidden(){return i()},get disabled(){return a()},get readonly(){return o()},get required(){return s()},get invalid(){return c()},get"aria-expanded"(){return z(m)},"aria-haspopup":`listbox`,get ariaLabel(){return f()},oninput:ie,get element(){return z(g)},set element(e){M(g,e,!0)}}))}};G(fe,e=>{l()?e(me,-1):e(pe)});var he=I(fe,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Eo(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{bx(e,{name:`expand_more`})};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>!l()||o()||a()?-1:0),s=A(()=>z(m)?Y(`_sui.collapse`):Y(`_sui.expand`)),c=A(()=>z(m)?`${n}-popup`:void 0);eS(he,{variant:`ghost`,iconic:!0,get hidden(){return i()},get disabled(){return a()},get tabindex(){return z(r)},get"aria-label"(){return z(s)},get"aria-controls"(){return z(c)},get"aria-expanded"(){return z(m)},onclick:e=>{e.preventDefault(),e.stopPropagation(),!a()&&!o()&&M(m,!z(m))},startIcon:e,$$slots:{startIcon:!0}})}D(ue);var ge=I(ue,2),_e=N(ge);YS(N(_e),{get id(){return`${n}-listbox`},class:`in-combobox`,get searchTerms(){return z(C)},onclick:e=>{e.target.matches(`[role="option"]`)&&re(e.target)},onFilter:e=>{M(w,e.detail.matched,!0)},children:(e,n)=>{var r=H();Eo(P(r),()=>t.children??Er),U(e,r)},$$slots:{default:!0}}),D(_e),bs(_e,e=>M(y,e),()=>z(y)),D(ge),bs(ge,e=>M(v,e),()=>z(v)),Qx(I(ge,2),{get id(){return`${n}-popup`},class:`combobox`,get anchor(){return z(ee)},get position(){return u()},touchOptimized:!0,onOpen:()=>{M(S,d()!==-1&&E.count>d(),!0),M(C,``)},get content(){return z(_)},set content(e){M(_,e,!0)},get open(){return z(m)},set open(e){M(m,e,!0)},children:(e,t)=>{var r=Cme(),i=N(r),a=e=>{{let t=A(()=>Y(`_sui.combobox.filter_options`));cC(e,{flex:!0,get"aria-label"(){return z(t)},get"aria-controls"(){return`${n}-listbox`},onkeydown:e=>{[`ArrowUp`,`ArrowDown`,`Enter`].includes(e.key)&&(e.preventDefault(),z(_)?.querySelector(`.sui.listbox`)?.dispatchEvent(new KeyboardEvent(`keydown`,e)))},get value(){return z(C)},set value(e){M(C,e,!0)}})}};G(i,e=>{z(S)&&e(a)});var o=I(i,2);bs(o,e=>M(b,e),()=>z(b));var s=I(o,2),c=e=>{var t=Sme(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`_sui.combobox.no_matching_options`)]),U(e,t)};G(s,e=>{z(T)||e(c)}),D(r),U(e,r)},$$slots:{default:!0}}),R(()=>{de=is(ue,1,`sui combobox ${t.class??``}`,`svelte-1vz2e50`,de,{editable:l()}),q(ue,`hidden`,i())}),U(e,le),k()}var Dme=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`class`]);function lC(e,t){O(t,!0);let n=J(t,`value`,15),r=Ss(t,Dme);Eme(e,Cs(()=>r,{get class(){return`sui select ${t.class??``}`},editable:!1,get value(){return n()},set value(e){n(e)}})),k()}var Ome=(e,t,n)=>{if(t===n)return e;let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r},kme=({key:e,index:t,length:n,rtl:r})=>e===(r?`ArrowRight`:`ArrowLeft`)&&t>0?t-1:e===(r?`ArrowLeft`:`ArrowRight`)&&t0?0:e===`End`&&tt{if(t!==e&&t!==e+1)return t>e?t-1:t},Mme=new Set([`$$slots`,`$$events`,`$$legacy`,`values`,`options`,`max`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`onAddValue`,`onRemoveValue`,`onReorder`]),Nme=B(``),Pme=B(` `),Fme=B(`
    `),Ime={hash:`svelte-26j0it`,code:`.select-tags.svelte-26j0it {display:flex;flex-wrap:wrap;align-items:center;}.select-tags.disabled.svelte-26j0it {pointer-events:none;}.select-tags.disabled.svelte-26j0it > :where(.svelte-26j0it) {opacity:0.5;}.select-tags.svelte-26j0it span[role=grid]:where(.svelte-26j0it) {display:contents;}.select-tags.svelte-26j0it span[draggable]:where(.svelte-26j0it) {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);padding:0;padding-inline-start:8px;border-radius:var(--sui-control-medium-border-radius);background-color:var(--sui-secondary-background-color);cursor:grab;outline:none;}.select-tags.svelte-26j0it span[draggable]:where(.svelte-26j0it):focus-within {outline:var(--sui-focus-ring-width) solid var(--sui-focus-ring-color);}.select-tags.svelte-26j0it span[draggable].drag-source:where(.svelte-26j0it) {opacity:0.4;cursor:grabbing;}.select-tags.svelte-26j0it span[draggable].drop-before:where(.svelte-26j0it)::before, .select-tags.svelte-26j0it span[draggable].drop-after:where(.svelte-26j0it)::after {content:"";position:absolute;top:0;bottom:0;margin-inline-start:-1px;border-radius:1px;width:4px;background-color:var(--sui-primary-accent-color);pointer-events:none;}.select-tags.svelte-26j0it span[draggable].drop-before:where(.svelte-26j0it)::before {inset-inline-start:calc(-1 * var(--sui-focus-ring-width) - 1px);}.select-tags.svelte-26j0it span[draggable].drop-after:where(.svelte-26j0it)::after {inset-inline-end:calc(-1 * var(--sui-focus-ring-width) - 1px);}.select-tags.svelte-26j0it span[draggable]:where(.svelte-26j0it) .label:where(.svelte-26j0it) {outline:none;}.select-tags.svelte-26j0it span[draggable]:where(.svelte-26j0it) span[role=gridcell]:where(.svelte-26j0it):not(.label) {display:contents;}.select-tags.svelte-26j0it span[draggable]:where(.svelte-26j0it) button {outline-offset:-2px;}.select-tags.svelte-26j0it span[draggable]:where(.svelte-26j0it) .icon {font-size:var(--sui-font-size-large);}`};function Lme(e,t){O(t,!0),K(e,Ime);let n=J(t,`values`,31,()=>ea([])),r=J(t,`max`,3,void 0),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`readonly`,3,!1),s=J(t,`required`,3,!1),c=J(t,`invalid`,3,!1),l=Ss(t,Mme),u=A(()=>new Map(t.options.map(e=>[e.value,e]))),d=A(()=>new Set(n())),f=A(()=>t.options.some(({value:e})=>!z(d).has(e))),p=j(void 0),m=j(void 0),h=j(void 0),g=j(void 0),_=(e,r)=>{if(e===r)return;let i=Ome(n(),e,r);n(i),t.onReorder?.(new CustomEvent(`Reorder`,{detail:{values:i}}))},v=async(e,t)=>{_(e,t),await no(),(z(p)?.querySelectorAll(`.label[tabindex]`)?.[t])?.focus()};var y=Fme();let b;var x=N(y);Ro(x,30,n,e=>e,(e,r,i)=>{let s=A(()=>z(u).get(r)),c=A(()=>z(s)?.label||z(s)?.value||r);var l=Pme();let d;var f=N(l),p=F(f,!0),m=I(f,2),_=e=>{var i=Nme(),s=N(i);{let e=e=>{bx(e,{name:`close`})},i=A(()=>a()||o()),l=A(()=>Y(`_sui.select_tags.remove_x`,{values:{name:z(c)}}));eS(s,{iconic:!0,size:`small`,get disabled(){return z(i)},get"aria-label"(){return z(l)},onclick:()=>{n(n().filter(e=>e!==r)),t.onRemoveValue?.(new CustomEvent(`RemoveValue`,{detail:{value:r}}))},startIcon:e,$$slots:{startIcon:!0}})}D(i),U(e,i)};G(m,e=>{z(s)&&e(_)}),D(l),R(()=>{q(l,`draggable`,!a()&&!o()),d=is(l,1,`svelte-26j0it`,null,d,{"drag-source":z(h)===z(i),"drop-before":z(g)===z(i)&&z(h)!==z(i)&&z(h)!==z(i)-1,"drop-after":z(g)===n().length&&z(i)===n().length-1&&z(h)!==n().length-1}),q(f,`tabindex`,a()||o()?void 0:0),W(p,z(c))}),fo(`dragstart`,l,e=>{M(h,z(i),!0),e.dataTransfer&&(e.dataTransfer.setData(`text/plain`,z(c)),e.dataTransfer.effectAllowed=`move`)}),fo(`dragover`,l,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),M(g,Ame({index:z(i),clientX:e.clientX,rect:e.currentTarget.getBoundingClientRect(),rtl:kc()}),!0)}),fo(`drop`,l,async e=>{e.preventDefault();let t=z(h),n=z(g);if(M(h,void 0),M(g,void 0),t===void 0||n===void 0)return;let r=jme(t,n);r!==void 0&&await v(t,r)}),fo(`dragend`,l,()=>{M(h,void 0),M(g,void 0)}),po(`keydown`,f,async e=>{let t=kme({key:e.key,index:z(i),length:n().length,rtl:kc()});t!==-1&&(e.preventDefault(),await v(z(i),t))}),Yo(l,()=>sC,()=>({duration:200})),U(e,l)}),D(x);var S=I(x,2),C=e=>{{let r=A(()=>a()||o());lC(e,Cs(()=>l,{get disabled(){return z(r)},get readonly(){return o()},get required(){return s()},get invalid(){return c()},onChange:()=>{z(m)!==void 0&&(n([...n(),z(m)]),t.onAddValue?.(new CustomEvent(`AddValue`,{detail:{value:z(m)}})),M(m,void 0))},get value(){return z(m)},set value(e){M(m,e,!0)},children:(e,n)=>{var r=H();Ro(P(r),17,()=>t.options,({label:e,value:t,searchValue:n})=>t,(e,t)=>{let n=()=>z(t).label,r=()=>z(t).value,i=()=>z(t).searchValue;var a=H(),o=P(a),s=e=>{ZS(e,{get label(){return n()},get value(){return r()},get searchValue(){return i()}})},c=A(()=>!z(d).has(r()));G(o,e=>{z(c)&&e(s)}),U(e,a)}),U(e,r)},$$slots:{default:!0}}))}};G(S,e=>{(typeof r()!=`number`||n().lengthM(p,e),()=>z(p)),R(e=>{b=is(y,1,`sui select-tags ${t.class??``}`,`svelte-26j0it`,b,{disabled:a()||o()}),q(y,`hidden`,i()),q(x,`aria-label`,e)},[()=>Y(`_sui.select_tags.selected_options`)]),U(e,y),k()}mo([`keydown`]);var Rme=e=>{let[t,n=`0`]=String(e).split(`e`);return Math.min(Math.max((t.split(`.`)[1]??``).length-Number(n),0),100)},zme=({min:e,max:t,step:n,barWidth:r})=>{let i=(t-e)/n,a=Math.floor(i+1e-9)+1,o=r/i,s=Array.from({length:a}),c=Math.max(Rme(e),Rme(n));return{valueList:s.map((t,r)=>Number((r*n+e).toFixed(c))),positionList:s.map((e,t)=>t*o)}},Bme=(e,t,n)=>Math.min(t,Math.max(0,n?t-e:e)),Vme=(e,t)=>{let n=e.findLastIndex(e=>e<=t),r=e.findIndex(e=>t<=e);return n===-1?r:r===-1||Math.abs(e[n]-t){let{prevKey:n,nextKey:r}=cS(`horizontal`,t);return e===`ArrowUp`||e===r?1:e===`ArrowDown`||e===n?-1:0},Ume=({key:e,rtl:t,currentIndex:n,length:r})=>{let i=r-1,a=Math.max(1,Math.round(r/10)),o;if(e===`Home`)o=0;else if(e===`End`)o=i;else if(e===`PageUp`)o=n+a;else if(e===`PageDown`)o=n-a;else{let r=Hme(e,t);if(!r)return-1;o=n+r}return o=Math.min(i,Math.max(0,o)),o===n?-1:o},Wme=({valueIndex:e,targetPosition:t,sliderPositions:n})=>e===0&&n[1]<=t||e===1&&n[0]>=t,Gme=({valueList:e,value:t,decreasing:n})=>{let r=e.indexOf(t);if(r!==-1)return r;if(n){let n=e.findIndex(e=>e>t);return n===-1?e.length:n}return e.findLastIndex(e=>e{let[n,r]=e,i=Math.abs(n-t),a=Math.abs(r-t);return i===a?+(t>r):+(a`),Yme=B(` `),Xme=B(`
    `),Zme={hash:`svelte-sz3hkp`,code:`.slider.svelte-sz3hkp {position:relative;display:inline-block;margin:var(--sui-focus-ring-width);padding:4px 6px;touch-action:none;}.slider.svelte-sz3hkp:hover .base-bar:where(.svelte-sz3hkp) {background-color:var(--sui-hover-background-color);}.slider.svelte-sz3hkp:active .base-bar:where(.svelte-sz3hkp) {background-color:var(--sui-active-background-color);}.slider.readonly.svelte-sz3hkp .base-bar:where(.svelte-sz3hkp), .slider.readonly.svelte-sz3hkp:is(:where(.svelte-sz3hkp):hover, :where(.svelte-sz3hkp):active) .base-bar:where(.svelte-sz3hkp) {background-color:var(--sui-slider-background-color, var(--sui-secondary-background-color));}.slider.readonly.svelte-sz3hkp .base:where(.svelte-sz3hkp), .slider.readonly.svelte-sz3hkp [role=slider]:where(.svelte-sz3hkp) {cursor:default;}.slider.readonly.svelte-sz3hkp:not(.invalid) .slider-bar:where(.svelte-sz3hkp) {background-color:var(--sui-readonly-accent-color);}.slider.readonly.svelte-sz3hkp:not(.invalid) [role=slider]:where(.svelte-sz3hkp) {border-color:var(--sui-readonly-accent-color);}.base.svelte-sz3hkp {position:relative;width:var(--sui-slider-base-width, 240px);height:calc(var(--sui-checkbox-height) / 2);cursor:pointer;}.base-bar.svelte-sz3hkp {border-width:1px;border-style:solid;border-color:var(--sui-control-border-color);border-radius:var(--sui-checkbox-height);background-color:var(--sui-slider-background-color, var(--sui-secondary-background-color));transition:all 200ms;width:100%;height:100%;}.slider-bar.svelte-sz3hkp {position:absolute;top:0;height:calc(var(--sui-checkbox-height) / 2);border-radius:var(--sui-checkbox-height);background-color:var(--sui-primary-accent-color-light);}.invalid.svelte-sz3hkp .slider-bar:where(.svelte-sz3hkp) {background-color:var(--sui-error-border-color);}[role=slider].svelte-sz3hkp {position:absolute;top:0;border:3px solid var(--sui-primary-accent-color-light);border-radius:var(--sui-checkbox-height);width:calc(var(--sui-checkbox-height) - 2px);height:calc(var(--sui-checkbox-height) - 2px);background-color:var(--sui-primary-accent-color-inverted);cursor:pointer;}[role=slider].svelte-sz3hkp::before {content:"";position:absolute;inset:-4px;border-radius:inherit;}[role=slider].svelte-sz3hkp:dir(ltr) {transform:translate(calc((var(--sui-checkbox-height) / 2 - 1px) * -1), calc((var(--sui-checkbox-height) / 4 - 1px) * -1));}[role=slider].svelte-sz3hkp:dir(rtl) {transform:translate(calc(var(--sui-checkbox-height) / 2 - 1px), calc((var(--sui-checkbox-height) / 4 - 1px) * -1));}.invalid.svelte-sz3hkp [role=slider]:where(.svelte-sz3hkp) {border-color:var(--sui-error-border-color);}.label.svelte-sz3hkp {position:absolute;top:calc(var(--sui-checkbox-height) / 2 + 8px);font-size:var(--sui-font-size-x-small);}.label.svelte-sz3hkp:dir(ltr) {transform:translateX(-50%);}.label.svelte-sz3hkp:dir(rtl) {transform:translateX(50%);}`};function Qme(e,t){O(t,!0),K(e,Zme);let n=J(t,`value`,15,0),r=J(t,`min`,3,0),i=J(t,`max`,3,100),a=J(t,`sliderLabel`,3,``),o=J(t,`ariaLabelledby`,3,void 0),s=J(t,`values`,15,void 0),c=J(t,`sliderLabels`,3,void 0),l=J(t,`step`,3,1),u=J(t,`optionLabels`,19,()=>[]),d=J(t,`hidden`,3,!1),f=J(t,`disabled`,3,!1),p=J(t,`readonly`,3,!1),m=J(t,`invalid`,3,!1),h=Ss(t,qme),g=A(()=>Array.isArray(s())),_=j(void 0),v=j(0),y=j(ea([])),b=j(ea([])),x=e=>{if(u().length!==z(b).length||e===void 0)return;let t=z(b).indexOf(e);return t===-1?void 0:String(u()[t])},S=j(0),C=j(0),w=ea([0,0]),T=j(!1),ee=j(0),E=j(0),te=(e,r)=>{let i=s();(z(g)?i[e]:n())!==r&&(z(g)?(i[e]=r,s([...i]),t.onChange?.({values:s()})):(n(r),t.onChange?.({value:n()})))},ne=e=>{let t=Vme(z(y),Bme(e,z(v),kc()));z(g)&&Wme({valueIndex:z(E),targetPosition:z(y)[t],sliderPositions:w})||te(z(E),z(b)[t])},re=(e,t=0)=>{let{key:r,ctrlKey:i,metaKey:a,shiftKey:o,altKey:c}=e,l=o||c||i||a;if(f()||p()||l)return;let u=z(g)?s()[t]:n(),d=kc(),m=Ume({key:r,rtl:d,currentIndex:Gme({valueList:z(b),value:u,decreasing:r===`PageDown`||Hme(r,d)===-1}),length:z(b).length});m===-1?[`Home`,`End`,`PageUp`,`PageDown`].includes(r)&&e.preventDefault():(e.preventDefault(),e.stopPropagation(),z(g)&&Wme({valueIndex:t,targetPosition:z(y)[m],sliderPositions:w})||te(t,z(b)[m]))},ie=e=>{let{screenX:t,pointerId:n}=e;if(f()||p()||!z(T)||n!==z(ee))return;e.preventDefault(),e.stopPropagation();let r=t-z(C),i=z(S)+r;ne(i)},ae=e=>{let{pointerId:t,target:n}=e;if(f()||p()||!z(T)||t!==z(ee))return;e.stopPropagation();let r=n;if(r.matches(`.base-bar, .slider-bar`)){let t=z(_).getBoundingClientRect(),n=e.clientX-t.left;ne(n)}r.releasePointerCapture(t),M(T,!1),M(S,0),M(C,0),M(ee,0),M(E,0),document.removeEventListener(`pointermove`,ie),document.removeEventListener(`pointerup`,ae),document.removeEventListener(`pointercancel`,ae)},oe=(e,t)=>{if(f()||p())return;e.preventDefault(),e.stopPropagation(),M(T,!0);let{clientX:n,screenX:r,pointerId:i,target:a}=e,o=a,s=z(_).getBoundingClientRect();M(S,n-s.left),M(C,r,!0),M(ee,i,!0),M(E,t??(z(g)?Kme(w,Bme(z(S),z(v),kc())):0),!0),o.setPointerCapture(i),document.addEventListener(`pointermove`,ie),document.addEventListener(`pointerup`,ae),document.addEventListener(`pointercancel`,ae)},se=e=>z(y)[Vme(z(b),e)]??0,ce=()=>{if(z(g)){let[e,t]=s();w[0]=se(e),w[1]=se(t)}else w[0]=se(n())},le=()=>{z(_)&&(M(v,z(_).clientWidth,!0),(e=>{M(b,e.valueList,!0),M(y,e.positionList,!0)})(zme({min:r(),max:i(),step:l(),barWidth:z(v)})),ce())};Do(()=>{let e=new ResizeObserver(()=>le()),t=globalThis.matchMedia(`(pointer: coarse)`);return e.observe(z(_)),t.addEventListener(`change`,le),le(),()=>{e.disconnect(),t.removeEventListener(`change`,le),document.removeEventListener(`pointermove`,ie),document.removeEventListener(`pointerup`,ae),document.removeEventListener(`pointercancel`,ae)}}),L(()=>{n(),s(),ce()}),L(()=>{r(),i(),l(),ao(le)});var ue=Xme();fo(`click`,ia.body,()=>{M(T,!1)}),gs(ue,()=>({...h,role:`none`,class:`sui slider ${t.class??``}`,hidden:d(),[fs]:{disabled:f(),readonly:p(),invalid:m()}}),void 0,void 0,void 0,`svelte-sz3hkp`);var de=N(ue),fe=I(N(de),2);let pe;var me=I(fe,2);let he;var ge=I(me,2),_e=e=>{var t=Jme();let n;R(e=>{q(t,`tabindex`,f()?-1:0),q(t,`aria-label`,c()?.[1]||void 0),q(t,`aria-hidden`,d()),q(t,`aria-disabled`,f()),q(t,`aria-readonly`,p()),q(t,`aria-invalid`,m()),q(t,`aria-valuemin`,r()),q(t,`aria-valuemax`,i()),q(t,`aria-valuenow`,s()?.[1]),q(t,`aria-valuetext`,e),n=os(t,``,n,{"inset-inline-start":`${w[1]}px`})},[()=>x(s()?.[1])]),po(`pointerdown`,t,e=>oe(e,1)),po(`keydown`,t,e=>re(e,1)),U(e,t)};G(ge,e=>{z(g)&&e(_e)});var ve=I(ge,2),ye=e=>{var t=H();Ro(P(t),19,u,(e,t)=>`${t}-${e}`,(e,t,n)=>{var r=Yme();let i;var a=F(r,!0);R(()=>{i=os(r,``,i,{"inset-inline-start":`${z(v)/(u().length-1)*z(n)}px`}),W(a,z(t))}),U(e,r)}),U(e,t)};G(ve,e=>{u().length&&e(ye)}),D(de),bs(de,e=>M(_,e),()=>z(_)),D(ue),R(e=>{pe=os(fe,``,pe,{"inset-inline-start":`${z(g)?w[0]:0}px`,width:`${z(g)?w[1]-w[0]:w[0]}px`}),q(me,`tabindex`,f()?-1:0),q(me,`aria-label`,(z(g)?c()?.[0]:a())||void 0),q(me,`aria-labelledby`,z(g)?void 0:o()),q(me,`aria-hidden`,d()),q(me,`aria-disabled`,f()),q(me,`aria-readonly`,p()),q(me,`aria-invalid`,m()),q(me,`aria-valuemin`,r()),q(me,`aria-valuemax`,i()),q(me,`aria-valuenow`,z(g)?s()?.[0]:n()),q(me,`aria-valuetext`,e),he=os(me,``,he,{"inset-inline-start":`${w[0]}px`})},[()=>x(z(g)?s()?.[0]:n())]),po(`pointerdown`,de,e=>oe(e)),po(`pointerdown`,me,e=>oe(e,0)),po(`keydown`,me,e=>re(e,0)),U(e,ue),k()}mo([`pointerdown`,`keydown`]);var $me=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`label`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`,`onChange`]),ehe=B(``),the={hash:`svelte-1xlgdcj`,code:`button.svelte-1xlgdcj {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);border-width:0;border-style:solid;border-color:transparent;padding:0;color:var(--sui-control-foreground-color);background-color:transparent;box-shadow:none;font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);font-weight:var(--sui-font-weight-normal, normal);text-align:start;cursor:pointer;-webkit-user-select:none;user-select:none;}button[aria-invalid=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-error-border-color) !important;}button:hover[aria-checked=false].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-hover-background-color);}button:hover[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-primary-accent-color-light);}button:active[aria-checked=false].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-active-background-color);}button:active[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-primary-accent-color-dark);}button.svelte-1xlgdcj:focus-visible {outline:0;}button.svelte-1xlgdcj:focus-visible span:where(.svelte-1xlgdcj) {outline-color:var(--sui-focus-ring-color);}button[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-primary-accent-color);border-color:transparent;}button[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj)::before {--translateX: var(--sui-checkbox-height) * 2 - var(--sui-checkbox-height);border-color:var(--sui-primary-accent-color);background-color:var(--sui-primary-accent-color-inverted);}button[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj):dir(ltr)::before {transform:translateX(calc(var(--translateX)));}button[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj):dir(rtl)::before {transform:translateX(calc((var(--translateX)) * -1));}button[aria-readonly=true].svelte-1xlgdcj {cursor:default;}button[aria-readonly=true][aria-checked=false].svelte-1xlgdcj span:where(.svelte-1xlgdcj), button[aria-readonly=true]:is(:where(.svelte-1xlgdcj):hover, :where(.svelte-1xlgdcj):active)[aria-checked=false].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-control-background-color);}button[aria-readonly=true][aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj), button[aria-readonly=true]:is(:where(.svelte-1xlgdcj):hover, :where(.svelte-1xlgdcj):active)[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj) {background-color:var(--sui-readonly-accent-color);}button[aria-readonly=true][aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj)::before, button[aria-readonly=true]:is(:where(.svelte-1xlgdcj):hover, :where(.svelte-1xlgdcj):active)[aria-checked=true].svelte-1xlgdcj span:where(.svelte-1xlgdcj)::before {border-color:var(--sui-readonly-accent-color);background-color:var(--sui-readonly-accent-color-inverted);}span.svelte-1xlgdcj {position:relative;width:calc(var(--sui-checkbox-height) * 2);height:var(--sui-checkbox-height);padding:0 2px;display:inline-flex;align-items:center;border-width:1.5px;border-style:solid;border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-height);background-color:var(--sui-control-background-color);transition:all 200ms;}span.svelte-1xlgdcj::before {display:inline-block;width:calc(var(--sui-checkbox-height) - 6px);height:calc(var(--sui-checkbox-height) - 6px);border-radius:var(--sui-checkbox-height);background-color:var(--sui-checkbox-border-color);transition:all 200ms;content:"";}`};function uC(e,t){O(t,!0),K(e,the);let n=J(t,`checked`,15,!1),r=J(t,`label`,3,void 0),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`readonly`,3,!1),s=J(t,`required`,3,!1),c=J(t,`invalid`,3,!1),l=J(t,`ariaLabel`,3,void 0),u=Ss(t,$me);var d=ehe(),f=()=>{!a()&&!o()&&(n(!n()),t.onChange?.(new CustomEvent(`Change`,{detail:{checked:n()}})))};gs(d,()=>({...u,role:`switch`,class:`sui switch ${t.class??``}`,type:`button`,hidden:i(),disabled:a()||void 0,"aria-checked":n(),"aria-hidden":i(),"aria-disabled":a(),"aria-readonly":o(),"aria-required":s(),"aria-invalid":c(),"aria-label":l(),onclick:f}),void 0,void 0,void 0,`svelte-1xlgdcj`);var p=I(N(d),2),m=e=>{var t=V();R(()=>W(t,r())),U(e,t)},h=e=>{var n=H();Eo(P(n),()=>t.children??Er),U(e,n)};G(p,e=>{r()?e(m):e(h,-1)}),D(d),U(e,d),k()}var nhe=new Set([`$$slots`,`$$events`,`$$legacy`]);function rhe(e,t){let n=Ss(t,nhe);GS(e,Cs(()=>n,{role:`cell`,kind:`table-cell`}))}var ihe=new Set([`$$slots`,`$$events`,`$$legacy`]);function ahe(e,t){let n=Ss(t,ihe);GS(e,Cs(()=>n,{role:`row`,kind:`table-row`}))}var ohe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`ariaLabel`,`children`]),she=B(`
    `),che={hash:`svelte-1ububp1`,code:`.table.svelte-1ububp1 {display:table;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.table.data.svelte-1ububp1 {border-collapse:collapse;}.table.data.svelte-1ububp1 :is(.table-col-header, .table-row-header, .table-cell) {border:1px solid var(--sui-secondary-border-color);padding:8px 8px;}`};function lhe(e,t){K(e,che);let n=J(t,`ariaLabel`,3,void 0),r=Ss(t,ohe);var i=she();gs(i,()=>({...r,role:`table`,class:`sui table ${t.class??``}`,"aria-label":n()}),void 0,void 0,void 0,`svelte-1ububp1`),Eo(N(i),()=>t.children??Er),D(i),U(e,i)}var uhe=({offsetTop:e,offsetLeft:t,offsetWidth:n,offsetHeight:r})=>Object.entries({top:e,left:t,width:n,height:r}).map(([e,t])=>`${e}: ${t}px`).join(`; `),dhe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`name`,`ariaLabel`,`children`,`onChange`]),fhe=B(`
    `),phe={hash:`svelte-1ya9ibl`,code:`.tab-list.svelte-1ya9ibl {flex:none;position:relative;display:flex;align-items:center;margin:var(--sui-tab-list-margin, var(--sui-focus-ring-width));border-color:var(--sui-tab-list-border-color, var(--sui-control-border-color));border-radius:var(--sui-tab-list-border-radius, 0);background-color:var(--sui-tab-list-background-color, transparent);}.tab-list[aria-orientation=horizontal].svelte-1ya9ibl {gap:var(--sui-horizontal-tab-list-gap, var(--sui-tab-list-gap, 8px));margin-block:var(--sui-horizontal-tab-list-margin-block, 0 32px);margin-inline:var(--sui-horizontal-tab-list-margin-inline, 0);border-block-width:var(--sui-horizontal-tab-list-border-block-width, 0 1px);border-inline-width:var(--sui-horizontal-tab-list-border-inline-width, 0 0);padding:var(--sui-horizontal-tab-list-padding, var(--sui-tab-list-padding, 0 16px));}.tab-list[aria-orientation=horizontal].svelte-1ya9ibl button {width:var(--sui-horizontal-tab-width, var(--sui-tab-width, auto));height:var(--sui-horizontal-tab-height, var(--sui-tab-height, 100%));justify-content:var(--sui-horizontal-tab-justify-content, center);}.tab-list[aria-orientation=horizontal].svelte-1ya9ibl .indicator:where(.svelte-1ya9ibl) {border-block-width:var(--sui-horizontal-tab-list-indicator-border-block-width, 0 2px);border-inline-width:var(--sui-horizontal-tab-list-indicator-border-inline-width, 0 0);}.tab-list[aria-orientation=vertical].svelte-1ya9ibl {gap:var(--sui-vertical-tab-list-gap, var(--sui-tab-list-gap, 8px));flex-direction:column;margin-block:var(--sui-vertical-tab-list-margin-block, 0);margin-inline:var(--sui-vertical-tab-list-margin-inline, 0 32px);border-block-width:var(--sui-vertical-tab-list-border-block-width, 0 0);border-inline-width:var(--sui-vertical-tab-list-border-inline-width, 0 1px);padding:var(--sui-vertical-tab-list-padding, var(--sui-tab-list-padding, 8px 0));width:var(--sui-vertical-tab-list-width, auto);}.tab-list[aria-orientation=vertical].svelte-1ya9ibl button {justify-content:var(--sui-vertical-tab-justify-content, flex-start);padding-inline-end:32px;width:var(--sui-vertical-tab-width, var(--sui-tab-width, 100%));height:var(--sui-vertical-tab-height, var(--sui-tab-height, auto));}.tab-list[aria-orientation=vertical].svelte-1ya9ibl .indicator:where(.svelte-1ya9ibl) {border-block-width:var(--sui-vertical-tab-list-indicator-border-block-width, 0 0);border-inline-width:var(--sui-vertical-tab-list-indicator-border-inline-width, 0 2px);}.tab-list.svelte-1ya9ibl button {position:relative;z-index:1;border-color:transparent;margin:0 !important;border-radius:var(--sui-tab-border-radius, 0);font-family:var(--sui-tab-font-family, var(--sui-control-font-family, inherit));font-size:var(--sui-tab-font-size, var(--sui-control-font-size, inherit));font-weight:var(--sui-tab-font-weight, var(--sui-control-font-weight, var(--sui-font-weight-normal, normal)));}.inner.svelte-1ya9ibl {display:contents;}.indicator.svelte-1ya9ibl {position:absolute;z-index:0;inset:auto;border-radius:var(--sui-tab-list-indicator-border-radius, 0);border-color:var(--sui-tab-list-indicator-border-color, var(--sui-primary-accent-color-light));background-color:var(--sui-tab-list-indicator-background-color, transparent);box-shadow:var(--sui-tab-list-indicator-box-shadow, none);pointer-events:none;transition:var(--sui-tab-list-indicator-transition, all 200ms);}`};function mhe(e,t){O(t,!0),K(e,phe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`orientation`,3,`horizontal`),a=J(t,`name`,3,void 0),o=J(t,`ariaLabel`,3,void 0),s=Ss(t,dhe),c=j(void 0),l=j(void 0),u=()=>{globalThis.requestAnimationFrame(()=>{let e=z(c)?.querySelector(`[role="tab"][aria-selected="true"]`);M(l,e?uhe(e):void 0,!0)})};Do(()=>{let e=new ResizeObserver(()=>{u()}),t=new MutationObserver(()=>{u()});return e.observe(z(c)),t.observe(z(c),{subtree:!0,attributes:!0,attributeFilter:[`aria-selected`]}),()=>{e.disconnect(),t.disconnect()}});var d=fhe(),f=()=>{u()},p=e=>{u(),t.onChange?.(e)};gs(d,()=>({...s,role:`tablist`,class:`sui tab-list ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-orientation":i(),"aria-label":o(),"data-name":a()||void 0,onInitialized:f,onChange:p}),void 0,void 0,void 0,`svelte-1ya9ibl`);var m=N(d);Eo(N(m),()=>t.children??Er),D(m);var h=I(m,2);D(d),bs(d,e=>M(c,e),()=>z(c)),Qo(d,_S),R(()=>{m.inert=r(),os(h,z(l))}),U(e,d),k()}var hhe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`children`]),ghe=B(`
    `),_he={hash:`svelte-1fgmqs3`,code:`.tab-panel.svelte-1fgmqs3 {flex:auto;transition:all 200ms;}.tab-panel[aria-hidden=true].svelte-1fgmqs3, .tab-panel.svelte-1fgmqs3:not([aria-hidden]) {display:none;}`};function vhe(e,t){K(e,_he);let n=Ss(t,hhe);var r=ghe();gs(r,()=>({...n,role:`tabpanel`,class:`sui tab-panel ${t.class??``}`}),void 0,void 0,void 0,`svelte-1fgmqs3`),Eo(N(r),()=>t.children??Er),D(r),U(e,r)}var yhe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`selected`,`children`,`startIcon`,`endIcon`]);function bhe(e,t){let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`selected`,3,!1),a=Ss(t,yhe);eS(e,Cs(()=>a,{role:`tab`,get class(){return`sui tab ${t.class??``}`},get hidden(){return n()},get disabled(){return r()},get"aria-selected"(){return i()},startIcon:e=>{var n=H();Eo(P(n),()=>t.startIcon??Er),U(e,n)},children:e=>{var n=H();Eo(P(n),()=>t.children??Er),U(e,n)},endIcon:e=>{var n=H();Eo(P(n),()=>t.endIcon??Er),U(e,n)},$$slots:{startIcon:!0,default:!0,endIcon:!0}}))}var dC=[],xhe=()=>(dC.splice(0,dC.length,...dC.filter(e=>e.isConnected&&e.matches(`:modal`))),dC.at(-1)??document.querySelector(`.sui.app-shell`)??document.body),fC=e=>{e.showPopover&&(e.matches(`:popover-open`)&&e.hidePopover(),e.querySelector(`.toast`)&&e.showPopover())},pC=e=>{let t=xhe();if(e.parentElement===t)return!1;let{moveBefore:n}=t;return typeof n==`function`&&e.isConnected?n.call(t,e,null):t.appendChild(e),!0},She=(e,t)=>{let n=[...e.children].find(e=>e.dataset.position===t);return n||(n=document.createElement(`div`),n.setAttribute(`role`,`none`),n.className=`toast-lane ${t}`,n.dataset.position=t,e.appendChild(n)),n},mC,hC=0,Che=e=>{let{target:t,newState:n}=e;mC&&t instanceof HTMLDialogElement&&n===`open`&&t.matches(`:modal`)&&!dC.includes(t)&&(dC.push(t),pC(mC),fC(mC))},gC=e=>{let{target:t}=e;if(!mC||!(t instanceof HTMLDialogElement)||e.type===`beforetoggle`&&e.newState!==`closed`)return;let n=dC.indexOf(t);n>-1&&dC.splice(n,1),t.contains(mC)&&pC(mC)&&!mC.matches(`:popover-open`)&&fC(mC)},whe=()=>(hC+=1,mC||(mC=document.createElement(`div`),mC.setAttribute(`role`,`none`),mC.className=`sui toast-base enabled`,mC.popover=`manual`,dC.push(...document.querySelectorAll(`dialog:modal`)),document.addEventListener(`toggle`,Che,!0),document.addEventListener(`beforetoggle`,gC,!0),document.addEventListener(`close`,gC,!0)),pC(mC),mC),The=()=>{--hC,hC>0||!mC||(document.removeEventListener(`toggle`,Che,!0),document.removeEventListener(`beforetoggle`,gC,!0),document.removeEventListener(`close`,gC,!0),mC.remove(),mC=void 0,dC.length=0)},Ehe=new Set([`$$slots`,`$$events`,`$$legacy`,`show`,`id`,`duration`,`position`,`children`]),Dhe=B(`
    `),Ohe={hash:`svelte-o6w6r5`,code:`.sui.toast-base {position:fixed;inset:16px;z-index:99999;overflow:visible;margin:0;border:0;padding:0;width:auto;height:auto;background-color:transparent;font-family:var(--sui-font-family-default);font-size:var(--sui-font-size-default);font-weight:var(--sui-font-weight-normal, normal);text-align:center;pointer-events:none;-webkit-user-select:none;user-select:none;}body:has(.sui.bottom-navigation:not([inert]:not([hidden]))) .toast-base {bottom:calc(var(--sui-bottom-navigation-height) + 16px);}.sui.toast-base > .toast-lane {position:absolute;display:flex;flex-direction:column;margin-block:-4px;max-width:100%;}.sui.toast-base > .toast-lane.top-left, .sui.toast-base > .toast-lane.top-center, .sui.toast-base > .toast-lane.top-right {inset-block-start:0;}.sui.toast-base > .toast-lane.bottom-left, .sui.toast-base > .toast-lane.bottom-center, .sui.toast-base > .toast-lane.bottom-right {inset-block-end:0;}.sui.toast-base > .toast-lane.top-left, .sui.toast-base > .toast-lane.bottom-left {inset-inline-start:0;align-items:flex-start;}.sui.toast-base > .toast-lane.top-center, .sui.toast-base > .toast-lane.bottom-center {inset-inline:0;align-items:center;}.sui.toast-base > .toast-lane.top-right, .sui.toast-base > .toast-lane.bottom-right {inset-inline-end:0;align-items:flex-end;}.toast.svelte-o6w6r5 {margin-block:4px;width:max-content;max-width:80dvw;height:auto;overflow:clip;opacity:1;transition-duration:250ms;will-change:opacity;} @starting-style {.toast.svelte-o6w6r5 {opacity:0;} }.toast.svelte-o6w6r5 {pointer-events:auto;}.toast[aria-hidden=true].svelte-o6w6r5 {display:block;opacity:0;pointer-events:none;} @supports (interpolate-size: allow-keywords) {.toast.svelte-o6w6r5 {interpolate-size:allow-keywords;} @starting-style {.toast.svelte-o6w6r5 {margin-block:0;height:0;} }.toast[aria-hidden=true].svelte-o6w6r5 {margin-block:0;height:0;} }.toast.svelte-o6w6r5:has(.alert) {filter:drop-shadow(0 8px 8px var(--sui-popup-shadow-color));}`};function _C(e,t){O(t,!0),K(e,Ohe);let n=J(t,`show`,15,!1),r=J(t,`id`,3,void 0),i=J(t,`duration`,3,5e3),a=J(t,`position`,7,`auto`),o=Ss(t,Ehe),s=j(void 0),c=j(void 0),l=j(!1),u=j(!1),d=A(()=>z(l)||z(u)),f=j(!1);Do(()=>(M(s,whe(),!0),()=>{z(c)?.remove(),The()})),Do(()=>{if(a()!==`auto`)return;let e=globalThis.matchMedia(`(width < 1024px)`),t=()=>{a(e.matches?`bottom-center`:`bottom-right`)};return t(),e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}}),L(()=>{if(!z(s)||!z(c))return;if(!z(f)){z(c).remove(),M(l,!1),M(u,!1),!z(s).querySelector(`.toast`)&&z(s).matches(`:popover-open`)&&z(s).hidePopover();return}pC(z(s));let e=She(z(s),a());a().startsWith(`top-`)?e.prepend(z(c)):e.append(z(c)),fC(z(s))}),L(()=>{if(n()){M(f,!0);return}let e=globalThis.setTimeout(()=>{M(f,!1)},250);return()=>{globalThis.clearTimeout(e)}}),L(()=>{if(r(),n(),i(),z(d),!n()||!i()||z(d))return;let e=globalThis.setTimeout(()=>{n(!1)},i());return()=>{globalThis.clearTimeout(e)}});var p=Dhe(),m=()=>{M(l,!0)},h=()=>{M(l,!1)},g=()=>{M(u,!0)},_=e=>{M(u,!!e.relatedTarget&&!!z(c)?.contains(e.relatedTarget),!0)};gs(p,()=>({...o,class:[`sui`,`toast`,a()],"aria-hidden":!n(),onpointerenter:m,onpointerleave:h,onfocusin:g,onfocusout:_}),void 0,void 0,void 0,`svelte-o6w6r5`);var v=N(p),y=e=>{var n=H();Eo(P(n),()=>t.children??Er),U(e,n)};G(v,e=>{z(f)&&e(y)}),D(p),bs(p,e=>M(c,e),()=>z(c)),U(e,p),k()}var vC="```",khe=(e,t)=>t?`${vC}${e}\n${t}\n${vC}`:`${vC}${e}\n${vC}`,Ahe=e=>{let{lang:t=`plain`,code:n=``}=e.match(/^```(?[^\s`]+)?\n(?:(?.*)\n)?```/s)?.groups??{};return{lang:t,code:n}};function yC(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function bC(e,...t){throw yC(e,...t)}function xC(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function jhe(){return typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0}var SC=jhe();function Mhe(){return SC&&`documentMode`in document?document.documentMode:null}var Nhe=Mhe();function Phe(e){return SC&&e.test(navigator.platform)}function CC(e){return SC&&e.test(navigator.userAgent)}var wC=Phe(/Mac|iPod|iPhone|iPad/),TC=CC(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function Fhe(){return!(!SC||!(`InputEvent`in window)||Nhe)&&`getTargetRanges`in new window.InputEvent(`input`)}var EC=Fhe();function Ihe(){return SC&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}var DC=Ihe(),Lhe=CC(/Android/),OC=CC(/Version\/[\d.]+.*Safari/)&&!Lhe,kC=CC(/^(?=.*Chrome).*/i),AC=SC&&Lhe&&kC,jC=CC(/AppleWebKit\/[\d.]+/)&&wC&&!kC;function Rhe(){return 2047}var zhe=Rhe(),MC=OC||DC||jC?`\xA0`:`​`,NC=` `,PC=TC?`\xA0`:MC,Bhe=`֑-߿יִ-﷽ﹰ-ﻼ`,Vhe=`A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿`;function Hhe(e,t){return RegExp(`^[^`+e+`]*[`+t+`]`)}var Uhe=Hhe(Vhe,Bhe),Whe=Hhe(Bhe,Vhe),FC={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Ghe={directionless:1,unmergeable:2},IC={center:2,end:6,justify:4,left:1,right:3,start:5};function Khe(e){let t={};for(let n of Object.keys(e))t[e[n]]=n;return t}var qhe=Khe(IC),LC={normal:0,segmented:2,token:1},Jhe=Khe(LC),Yhe=Symbol.for(`@lexical/ctrlOrOtherKey`),RC=`$config`;function Xhe(e){return()=>{}}function zC(e){return{type:e}}var BC=zC(`SELECTION_CHANGE_COMMAND`),Zhe=zC(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),VC=zC(`CLICK_COMMAND`),Qhe=zC(`BEFORE_INPUT_COMMAND`),$he=zC(`INPUT_COMMAND`),ege=zC(`COMPOSITION_START_COMMAND`),tge=zC(`COMPOSITION_END_COMMAND`),HC=zC(`DELETE_CHARACTER_COMMAND`),UC=zC(`INSERT_LINE_BREAK_COMMAND`),WC=zC(`INSERT_PARAGRAPH_COMMAND`),GC=zC(`CONTROLLED_TEXT_INSERTION_COMMAND`),KC=zC(`PASTE_COMMAND`),qC=zC(`REMOVE_TEXT_COMMAND`),JC=zC(`DELETE_WORD_COMMAND`),YC=zC(`DELETE_LINE_COMMAND`),XC=zC(`FORMAT_TEXT_COMMAND`),nge=zC(`SET_TEXT_FORMAT_COMMAND`),ZC=zC(`UNDO_COMMAND`),QC=zC(`REDO_COMMAND`),$C=zC(`KEYDOWN_COMMAND`),ew=zC(`KEY_ARROW_RIGHT_COMMAND`),tw=zC(`MOVE_TO_END`),nw=zC(`KEY_ARROW_LEFT_COMMAND`),rw=zC(`MOVE_TO_START`),iw=zC(`KEY_ARROW_UP_COMMAND`),aw=zC(`KEY_ARROW_DOWN_COMMAND`),ow=zC(`KEY_ENTER_COMMAND`),rge=zC(`KEY_SPACE_COMMAND`),sw=zC(`KEY_BACKSPACE_COMMAND`),cw=zC(`KEY_ESCAPE_COMMAND`),lw=zC(`KEY_DELETE_COMMAND`),uw=zC(`KEY_TAB_COMMAND`),dw=zC(`INSERT_TAB_COMMAND`),fw=zC(`INDENT_CONTENT_COMMAND`),pw=zC(`OUTDENT_CONTENT_COMMAND`),ige=zC(`DROP_COMMAND`),mw=zC(`FORMAT_ELEMENT_COMMAND`),age=zC(`DRAGSTART_COMMAND`),oge=zC(`DRAGOVER_COMMAND`),sge=zC(`DRAGEND_COMMAND`),hw=zC(`COPY_COMMAND`),gw=zC(`CUT_COMMAND`),_w=zC(`SELECT_ALL_COMMAND`),cge=zC(`CLEAR_EDITOR_COMMAND`),lge=zC(`CLEAR_HISTORY_COMMAND`),vw=zC(`CAN_REDO_COMMAND`),yw=zC(`CAN_UNDO_COMMAND`),uge=zC(`FOCUS_COMMAND`),dge=zC(`BLUR_COMMAND`),fge=zC(`KEY_MODIFIER_COMMAND`);function pge(e,t){return{...t,[Yhe]:e}}var bw=pge(`metaKey`,{ctrlKey:!wC,metaKey:wC}),mge=pge(`altKey`,{altKey:wC,ctrlKey:!wC}),hge=[[`altKey`,1],[`ctrlKey`,2],[`metaKey`,4],[`shiftKey`,8]];function xw(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}var gge=class{byKey=new Map;byCode=new Map;add(e){let{key:t,modifiers:n={}}=e;t.length>0||bC(399);let r=t.toLowerCase();for(let i of function(e){let t=[0];for(let[n,r]of hge){let i=e[n]||!1;i===`any`?t=t.concat(t.map(e=>e|r)):i&&(t=t.map(e=>e|r))}return t}(n))xw(this.byKey,`${i}:${r}`,e),t.length===1&&(/[0-9]/.test(t)?xw(this.byCode,`${i}:Digit${t}`,e):/[a-z]/.test(r)&&xw(this.byCode,`${i}:Key${r.toUpperCase()}`,e));return this}matches(e){let t=e.key;if(!t)return[];let n=function(e){let t=0;for(let[n,r]of hge)e[n]&&(t|=r);return t}(e),r=this.byKey.get(`${n}:${t.toLowerCase()}`),i=r?r.slice():[];if(this.byCode.size>0&&!(t.length===1&&t.charCodeAt(0)<=127)){let t=this.byCode.get(`${n}:${e.code}`);t&&i.push(...t)}return i}match(e){return this.matches(e)[0]}};function _ge(e){let t=new gge;for(let n of e)t.add(n);return t}function vge(e){let t=new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));let a=()=>{let e=t.get(n);e&&e.holders.delete(a)&&e.holders.size===0&&(t.delete(n),e.dispose())};return i.holders.add(a),a}}}function yge(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"+source"`}var bge=yge(),Sw=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},Cw=null;function xge(e,t=1e3){return e instanceof ww?e.clone():e.sizethis._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)n===Cw?e.delete(t):e.set(t,n);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return n!==Cw&&n!==void 0||(this._size++,n===Cw&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,Cw),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(e){if(t)for(let n of t){let t=n[0],r=e.get(t);r!==Cw&&(r!==void 0&&(n[1]=r),yield n)}for(let n of e)n[1]===Cw||t&&t.has(n[0])||(yield n)}else t&&(yield*t)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.entries())e(n,t,this)}get[Symbol.toStringTag](){return`GenMap`}[Symbol.iterator](){return this.entries()}},Tw=!1;function Sge(e,t,...n){let r=Tw,i;try{Tw=e,i=t()}finally{Tw=r}var a;return(a=i)===null||typeof a!=`object`&&typeof a!=`function`||typeof a.then!=`function`||bC(421),i}function Cge(){return Tw}function wge(e){let t=e.exportJSON(Tw),n=e.constructor;return t.type!==n.getType()&&bC(130,n.name),Z(e)&&!Array.isArray(t.children)&&bC(59,n.name),t}function Ew(){return _O()._blockCursorElement}function Dw(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-slot`)}var Tge=jC||DC||OC;function Ege(){let e=rO().createElement(`img`);e.setAttribute(`data-lexical-decorator-boundary`,`true`),e.alt=``;for(let[t,n]of[[`position`,`absolute`],[`width`,`0px`],[`height`,`0px`],[`border`,`0px`],[`margin`,`0px`],[`padding`,`0px`]])e.style.setProperty(t,n,`important`);return e}function Ow(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-decorator-boundary`)}var Dge=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&bC(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&bC(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&bC(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?`before`:`after`;let r=Oge(e,this.element);if(r===null)return`after`;let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return`after`;if(t===e)return n<=i?`before`:`after`;let a=Oge(e,t);if(a===null)return`after`;let o=Array.prototype.indexOf.call(e.childNodes,a);return o>=0&&o<=i?`before`:`after`}getInsertionAnchor(){return this.before}};function Oge(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var kge=class e extends Dge{withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor(`trailing`)}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;Dw(t);)e=t,t=t.nextSibling;Ow(t)&&(e=t,t=t.nextSibling);let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===Ew()?n:e}getDecoratorBoundaryAnchor(e){let t;if(e===`leading`){let e=super.getFirstChildAnchor();for(t=e?e.nextSibling:this.element.firstChild;Dw(t);)t=t.nextSibling}else t=this.before?this.before.previousSibling:this.element.lastChild,t!==null&&t===Ew()&&(t=t.previousSibling);return Ow(t)?t:null}setDecoratorBoundaryAnchor(e,t){let n=this.getDecoratorBoundaryAnchor(e);if(t!==(n!==null)){if(n!==null)this.element.removeChild(n);else if(e===`leading`){let e=this.getFirstChildAnchor();this.element.insertBefore(Ege(),e?e.nextSibling:this.element.firstChild)}else this.element.insertBefore(Ege(),this.before)}}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){let t=this.element,n=this.after===null?t.firstChild:this.after.nextSibling,r=e===`empty`&&Dw(n)?null:e;if(t.__lexicalLastChildKind!==r){if(t.__lexicalLastChildKind=r,r===null)this.removeManagedLineBreak();else{let e=r===`decorator`&&Tge;this.insertManagedLineBreak(e)}}}removeManagedLineBreak(){let e=this.element,t=this.getManagedLineBreak();if(t){t.remove();for(let t of e.querySelectorAll(`:scope > [data-lexical-managed-linebreak]`))t.remove();e.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.element,n=this.getManagedLineBreak();if(n){let r=e?n.nextSibling:n;if(r&&r===t.querySelector(`:scope > br[data-lexical-managed-linebreak]`))return;this.removeManagedLineBreak()}let r=this.before||this.getDecoratorBoundaryAnchor(`trailing`),i=rO().createElement(`br`);if(i.setAttribute(`data-lexical-managed-linebreak`,`true`),t.insertBefore(i,r),e){let e=rO().createElement(`img`);e.setAttribute(`data-lexical-managed-linebreak`,`true`),e.style.setProperty(`display`,`inline`,`important`),e.style.setProperty(`border`,`0px`,`important`),e.style.setProperty(`margin`,`0px`,`important`),e.alt=``,t.insertBefore(e,i),t.__lexicalLineBreak=e}else t.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;r!==null&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=Ew(),i=this.element.childNodes,a=Math.min(r,i.length),o=0;for(let e=t;en){o+=1;break}}return[e.getParentOrThrow(),o]}};function Age(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&bC(225),n.reverse()}var kw=!1,jge=0;function Mge(){jge=performance.now()}function Nge(e){return dO(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)}function Pge(e,t,n){let r=QD(VD(n)),i=r&&oO(r,n._rootElement),a=null,o=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;s!==null&&xD(t,s,a,o,!1)}function Fge(e,t,n){if(Q(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return YE(t)&&n.isAttached()}function Ige(e,t,n){for(let r=e;r&&!OO(r);r=ND(r)){let e=sD(r,t);if(e!==void 0){let t=iD(e,n);if(t)return KT(t)||!dO(r)?void 0:[r,t]}}}function Lge(e,t,n,r){kw=!0;let i=e._inputState.unprocessedBeforeInputData===null&&performance.now()-jge>100;try{Kk(e,()=>{let a=$()||function(e){return e.read(`latest`,()=>{let e=$();return e===null?null:e.clone()})}(e),o=new Map,s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n of t){let t=n.type,d=n.target,f=Ige(d,e,s);if(!f)continue;let[p,m]=f;if(t===`characterData`)r?uE(m)&&m.isAttached()&&m.markDirty():i&&uE(m)&&YE(d)&&Fge(a,d,m)&&Pge(d,m,e);else{l=!0;for(let t of n.addedNodes){let n=sD(t,e);if(t!==c&&t.parentNode===d&&(n?e.getElementByKey(n)!==t:!(e._slotsUsed&&dO(t)&&t.hasAttribute(`data-lexical-slot`)||OO(t)))){if(TC){let e=(dO(t)?t.innerText:null)||t.nodeValue;e&&(u+=e)}d.removeChild(t)}}for(let e of n.removedNodes){let t=c===e;if(t||Ow(e)||Nge(e)){let t=n.nextSibling,r=n.previousSibling;d.insertBefore(e,t&&t.parentNode!==d?r?r.parentNode===d?r.nextSibling:null:d.firstChild:t)}t||o.set(p,m)}}}for(let[t,n]of o)n.reconcileObservedMutation(t,e);let d=n.takeRecords();for(let t of d)for(let n of t.addedNodes)n.nodeName!==`BR`||sD(n,e)||Nge(n)||n.remove();n.takeRecords(),a!==null&&(l&&pD(a),TC&&AD(e)&&a.insertRawText(u))})}finally{kw=!1}}function Aw(e,t,n){let r=e._observer;if(r!==null){let i=r.takeRecords();(!n||i.length>0)&&Lge(e,i,r,t)}}function Rge(e){(function(e){VD(e).addEventListener(`textInput`,Mge,!0)})(e),e._observer=new MutationObserver((t,n)=>{Lge(e,t,n)})}function jw(e,t,n){let{isEqual:r}=e;return t===n||r!==void 0&&r(t,n)}function Mw(e,t){return jw(e,t,e.defaultValue)}function Nw(e){return typeof e==`object`&&!!e}function Pw(e,t){let n=zw(e,t).getter;return Nw(n)&&n.getterTable!==void 0||bC(405,t),Rw(n.getterTable)}function Fw(e,t){let n=zw(e,t).setter;return Nw(n)&&n.setterTable!==void 0||bC(406,t),Rw(n.setterTable)}function Iw(e,t,n){let{meta:r}=zw(e,t);for(let e=0;;)if(r.kind===`aliased`){if(e===n)return Rw(r.aliases);e++,r=r.inner.meta}else r.kind===`nullable`||r.kind===`optional`?r=r.inner.meta:r.kind===`array`?r=r.item.meta:bC(407,t,String(n))}function Lw(e,t){let n=zw(e,t),{setter:r}=n;Nw(r)&&r.setterTable!==void 0||bC(408,t);let i=String(n.defaultValue);return Hw(r.setterTable,i)||bC(409,t,i),r.setterTable[i]}function Rw(e){return Object.assign(Object.create(null),e)}function zw(e,t){let n=e.get(t);return n===void 0&&bC(410,t),n}function Bw(e,t,n,r,i){i!==void 0&&zge.add(i);let a=n===void 0,o=a?e(void 0):n;return a&&Hge(o),Object.assign(e,{accepts:i,defaultValue:o,isEqual:r,meta:t})}var zge=new WeakSet,Bge=new WeakSet;function Vge(e){return typeof e==`object`&&e&&Bge.add(e),e}function Hge(e){if(typeof e==`object`&&e&&!Object.isFrozen(e)&&!Bge.has(e)){Object.freeze(e);for(let t of Object.values(e))Hge(t)}}function Uge(e){let{isEqual:t}=e;return t===void 0?void 0:(e,n)=>e==null||n==null?e===n:t(e,n)}function Wge(e,t){return n=>t(n)||Vw(e,n)}function Vw(e,t){let{accepts:n}=e;return n===void 0?function(e,t){let{accepts:n}=e;if(n!==void 0)return Vw(e,t)?{parsed:e(t)}:void 0;let r=e(t);return Mw(e,r)&&t!==e.defaultValue?void 0:{parsed:r}}(e,t)!==void 0:n.call(e,t)}function Hw(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Uw(e=``){return Bw(t=>typeof t==`string`?t:e,{kind:`string`},void 0,void 0,e=>typeof e==`string`)}var Gge=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Ww(e=0,t={}){let{integer:n,clamp:r}=t,i=n&&t.min!==void 0?Math.ceil(t.min):t.min,a=n&&t.max!==void 0?Math.floor(t.max):t.max,o=e=>typeof e==`string`&&Gge.test(e)?Number(e):e,s=e=>typeof e==`number`&&Number.isFinite(e)&&(!n||Number.isInteger(e)),c=e=>s(e)&&(i===void 0||e>=i)&&(a===void 0||e<=a);return Bw(t=>{let n=o(t);return r&&s(n)?i!==void 0&&na?a:n:c(n)?n:e},{clamp:r,integer:n,kind:`number`,max:a,min:i},void 0,void 0,e=>r?s(o(e)):c(o(e)))}function Gw(e=!1){return Bw(t=>typeof t==`boolean`?t:e,{kind:`boolean`},void 0,void 0,e=>typeof e==`boolean`)}function Kw(e,...t){let n=Vge(t.length===0?e[0]:t[0]),r=new Set(e);return Bw(e=>e!==void 0&&r.has(e)?e:n,{kind:`enum`,values:e},n,void 0,e=>r.has(e)&&(e!==void 0||n===void 0))}function qw(e,t={}){let{defaultAsNull:n}=t;return Bw(t=>{if(t==null)return null;let r=e(t);return n&&Mw(e,r)?null:r},{defaultAsNull:n,inner:e,kind:`nullable`},void 0,Uge(e),Wge(e,e=>e==null))}function Jw(e,t={}){let{omitDefault:n}=t;return Bw(t=>{if(t===void 0)return;let r=e(t);return n&&Mw(e,r)?void 0:r},{inner:e,kind:`optional`,omitDefault:n},void 0,Uge(e),Wge(e,e=>e===void 0))}function Yw(){return e=>function(e){return{meta:{fields:e,kind:`node`}}}(e)}function Xw(e,t){let n=e=>typeof e==`string`&&Hw(t,e);return Bw(r=>n(r)?t[r]:e(r),{aliases:t,inner:e,kind:`aliased`},e.defaultValue,e.isEqual,t=>n(t)||Vw(e,t))}function Kge(e){return Bw(t=>{if(!Array.isArray(t))return[];let n=Array(t.length);for(let r=0;r{if(!Array.isArray(t)||!Array.isArray(n)||t.length!==n.length)return!1;for(let r=0;rArray.isArray(e))}function Zw(e,t){return qge(0,e,{getter:{field:t.field,getterTable:t.getterTable,method:t.getter,when:t.when},setter:{field:t.field,method:t.setter,setterTable:t.setterTable}},!0===t.derived)}function Qw(e,t){return qge(0,e,{getter:t.getter,setter:t.setter},!0===t.derived)}function qge(e,t,n,r=!1){return Object.assign(e=>t(e),{accepts:t.accepts,defaultValue:t.defaultValue,...r?{derived:!0}:{},getter:n.getter,isEqual:t.isEqual,meta:t.meta,setter:n.setter})}var Jge=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;derived;schema;constructor(e,t){this.key=e,this.derived=!0===t.derived;let n=`meta`in(r=t.parse)&&typeof r.meta==`object`&&r.meta!==null&&`kind`in r.meta&&typeof r.meta.kind==`string`&&`defaultValue`in r?t.parse:void 0;var r;this.schema=n,this.parse=t.parse.bind(t),this.unparse=(t.unparse||n_e).bind(t),this.isEqual=t.isEqual?t.isEqual.bind(t):n!==void 0&&n.isEqual!==void 0?(e,t)=>jw(n,e,t):Object.is,this.defaultValue=n===void 0?this.parse(void 0):n.defaultValue,this.resetOnCopyNode=t.resetOnCopyNode||!1}};function $w(e,t){return new Jge(e,t)}function eT(e,t,n=`latest`){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function tT(e,t,n){let r;if(Dk(),typeof n==`function`){let i=e.getLatest(),a=eT(i,t);if(r=Yge(t,n(a)),t.isEqual(a,r))return i}else r=Yge(t,n);let i=e.getWritable();return $ge(i).updateFromKnown(t,r),i}function Yge(e,t){let{schema:n}=e;return n!==void 0&&n.meta.kind===`set`?e.parse(t):t}function Xge(e){let t=new Map,n=new Set;for(let{ownNodeConfig:r}of JO(typeof e==`function`?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;`stateConfig`in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}var Zge=new Set([`__proto__`,`constructor`,`prototype`]),Qge=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.knownState.set(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return t_e(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){if(Zge.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;i&&n in i?(delete i[n],this.unknownState=t_e(i)):r.has(e)||this.size++,r.set(e,t)}updateFromUnknown(e,t){if(Zge.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function $ge(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Qge(t,function(e){return e.__state?e.__state.sharedNodeState:zE(_O(),e.getType()).sharedNodeState}(t));return t.__state=n,n}function e_e(e,t){let n=e.getWritable(),r=t.$;return(n.__state||r)&&$ge(e).updateFromJSON(r),n}function t_e(e){if(e)for(let t in e)return e}function n_e(e){return e}function r_e(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function i_e(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function a_e(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function nT(e){return!YT(e)&&e.getTextContent!==WT.prototype.getTextContent}var rT=Symbol.for(`@lexical/CachedTextSize`);function o_e(e,t){return vT.read(()=>{let n=0,r=e;for(let e=0;e0)n+=i.getTextContentSize();else{let e=i[rT];e===void 0&&bC(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:aT})}function s_e(e){Z(e)||AT(e).size>0||e[rT]===void 0&&(e[rT]=uE(e)?e.__text.length:e.getTextContentSize())}var c_e=4,iT,aT,oT,sT=``,cT=null,lT=null,uT=null;function dT(){return{firstTextKey:uT,format:cT,style:lT}}function fT(e){e.firstTextKey!==null&&(cT=e.format,lT=e.style,uT=e.firstTextKey)}function pT(e){if(uT!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&bC(348),t===null)return;let n=yT.get(t);uE(n)&&(cT=n.getFormat(),lT=n.getStyle(),uT=t)}var mT,hT,gT,_T,vT,yT,bT,xT,ST,CT,wT=!1,TT=!1;function ET(e,t){let n=_T.get(e),r=yT.has(e);if(t!==null){let n=LT(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(aT._keyToDOMMap.delete(e),Z(n)){let e=ZO(n,_T);DT(e,0,e.length-1,null)}if(n!==void 0){for(let e of AT(n).values()){let t=jT(e);ET(e,null),t!==null&&t.remove()}DD(ST,oT,mT,n,`destroyed`)}}}function DT(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&ET(t,r)}}function OT(e,t){e.setProperty(`text-align`,t)}var l_e=`40px`;function u_e(e,t){let n=iT.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * var(--lexical-indent-base-value, ${l_e}))`),TD(e,`class`),TD(e,`style`)}function d_e(e,t){let n=e.style;t===0?OT(n,``):t===1?OT(n,`left`):t===2?OT(n,`center`):t===3?OT(n,`right`):t===4?OT(n,`justify`):t===5?OT(n,`start`):t===6&&OT(n,`end`),TD(e,`style`)}function kT(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(YT(e))return null;let n=e.getParent();return n===null||GD(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function f_e(e){let t=rO().createElement(`div`);return t.setAttribute(`data-lexical-slot`,e),t.style.display=`none`,t}function p_e(e,t,n){t||e.contentEditable===`false`?jve(n,aT):n.removeAttribute(`contenteditable`)}function m_e(e,t,n){let r=sT,i=dT();sT=``;let a=``,o=KT(e);for(let[r,i]of n){let n=f_e(r);p_e(t,o,n),t.appendChild(n),sT=``;let s=dT();MT(i,yO(e,n,aT)),fT(s),h_e(e,r,t,n),a+=sT}return fT(i),sT=r,a}function AT(e){return jj(e)&&e.__slots!==null?e.__slots:Aj}function h_e(e,t,n,r){let i=CT.$getSlotTargetElement(e,t,n,aT);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display=``)}function jT(e){let t=bT.get(e);return t===void 0?null:t.parentElement}function g_e(e,t,n){let r=AT(e),i=AT(t);for(let[e,t]of r)if(!i.has(e)){let e=jT(t);ET(t,null),e!==null&&e.remove()}let a=sT,o=dT(),s=``,c=null,l=KT(t);for(let[e,a]of i){let i=r.get(e),o=i===void 0?null:jT(i);sT=``;let u=dT();if(o===null){o=f_e(e);let r=null;for(let e of n.children)if(!e.hasAttribute(`data-lexical-slot`)){r=e;break}n.insertBefore(o,r),MT(a,yO(t,o,aT))}else i===a?FT(a,o):(i!==void 0&&ET(i,o),MT(a,yO(t,o,aT)));if(fT(u),p_e(n,l,o),h_e(t,e,n,o),s+=sT,o.parentElement===n){let e=c===null?n.firstChild:c.nextSibling;e!==o&&n.insertBefore(o,e),c=o}}return fT(o),sT=a,s}function MT(e,t){let n=yT.get(e);if(n===void 0&&bC(60),t!==null){let r=_T.get(e);if(r!==void 0){let i=bT.get(e);if(i!==void 0){let a=Mj(r)?r.__slotHost:null,o=Mj(n)?n.__slotHost:null,s=r.__parent!==n.__parent||a!==o,c=o!==null&&i.parentElement!==t.element;if(s||c)return t.insertChild(i),FT(e,t.element)}}}let r=CT.$createDOM(n,aT);if(function(e,t,n){let r=n._keyToDOMMap;oD(t,n,e),r.set(e,t)}(e,r,aT),uE(n)?r.setAttribute(`data-lexical-text`,`true`):KT(n)&&(r.setAttribute(`data-lexical-decorator`,`true`),DO(r,{captureSelection:!0})),Z(n)){let e=sT,t=n.__indent,i=n.__size;kT(r,n),t!==0&&u_e(r,t);let a=AT(n),o=a.size>0?m_e(n,r,a):``;if(i===0)r.__lexicalTextContent=o,r.__lexicalFirstTextKey=null,sT+=o,a.size>0&&(r.__lexicalSlotTextLength=o.length);else{let t=i-1;if(NT(ZO(n,yT),n,0,t,yO(n,r,aT)),o!==``){let t=r.__lexicalTextContent||``;r.__lexicalTextContent=o+t,sT=e+o+t}a.size>0&&(r.__lexicalSlotTextLength=o.length)}if(nT(n)){let t=n.getTextContent();r.__lexicalTextContent=t,sT=e+t}let s=n.__format;s!==0&&d_e(r,s),n.isInline()||(v_e(0,n,r),PT(n,r))}else{let t=n.getTextContent();if(KT(n)){let t=n.decorate(aT,iT);t!==null&&b_e(e,t),r.contentEditable=`false`;let i=AT(n);i.size>0&&m_e(n,r,i)}sT+=t}return t!==null&&t.insertChild(r),CT.$decorateDOM(n,null,r,aT),s_e(n),DD(ST,oT,mT,n,`created`),r}function NT(e,t,n,r,i){let a=sT,o=dT();sT=``,cT=null,lT=null,uT=null;let s=n;for(;s<=r;++s){let t=dT();MT(e[s],i);let n=yT.get(e[s]);n!==null&&uE(n)?cT===null&&(cT=n.getFormat(),lT=n.getStyle(),uT=n.__key):Z(n)&&s0||AT(n).size>0)?g_e(n,r,a):``;if(i){let e=sT;if(function(e,t,n){var r;cT=null,lT=null,uT=null,function(e,t,n){let r=sT,i=e.__size,a=t.__size;sT=``;let o=n.element,s=aT._keyToDOMMap.get(t.__key);s===void 0&&bC(351,t.__key);let c=a-i;if(!wT&&Math.abs(c)<=1&&i>=c_e&&e.__first===t.__first&&(c!==0||!aT._cloneNotNeeded.has(e.__key))){let i=s.__lexicalTextContent,l=xT.get(e.__key);if(!wT&&!nT(t)&&typeof i==`string`&&l!==void 0){let a=function(e,t){let n=t.size;if(n===0||n>=e.__size)return null;let r=e.__last,i=null,a=0;for(;r!==null&&a0?i.slice(f):i,m=p.slice(0,p.length-e)+d;s.__lexicalTextContent=m,sT=r+m,y_e(t,s,l);return}if(function(e,t,n,r,i,a,o,s){if(s!==1&&s!==-1||o!==(s===1?2:1))return!1;let c=o-s,l=e.__last;for(let e=0;e0?i.slice(S):i;return r.__lexicalTextContent=C.slice(0,C.length-b)+x,!0}(e,0,n,s,i,a,u,c)){let e=s.__lexicalTextContent;typeof e!=`string`&&bC(353),sT=r+e,y_e(t,s,l);return}}}if(c===0){let t=e.__first,n=0;for(;t!==null;){let e=yT.get(t);if(e===void 0)break;let r=wT||gT.has(t)||hT.has(t),i=dT();if(r)FT(t,o);else{let n,r;if(Z(e)){r=bT.get(t);let i=r&&r.__lexicalTextContent;typeof i!=`string`&&bC(354,e.getType()),n=i}else n=e.getTextContent();sT+=n,r!==void 0&&pT(r)}uE(e)?cT===null&&(cT=e.getFormat(),lT=e.getStyle(),uT=e.__key):Z(e)&&no,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:aT.getElementByKey(t);NT(n,e,f,s,a.withBefore(r??a.before))}else m&&!p&&DT(t,d,o,a.element)})(t,r,s,i,a,n)}s.__lexicalTextContent=sT,s.__lexicalFirstTextKey=uT,sT=r+sT}(e,t,yO(t,n,aT)),GD(t)||(r=t,cT==null||cT===r.__textFormat||TT||r.setTextFormat(cT),function(e){lT==null||lT===e.__textStyle||TT||e.setTextStyle(lT)}(t))}(n,r,a),r.isInline()||(YT(r)||v_e(0,r,a),PT(r,a)),s!==``){let t=a.__lexicalTextContent||``;a.__lexicalTextContent=s+t,sT=e+s+t,a.__lexicalSlotTextLength=s.length}else(AT(r).size>0||AT(n).size>0)&&(a.__lexicalSlotTextLength=0);if(nT(r)){let t=r.getTextContent();a.__lexicalTextContent=t,sT=e+t}}else{let e=a.__lexicalTextContent;typeof e!=`string`&&bC(356,n.getType()),sT+=e,pT(a)}if((wT||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(kT(a,r),YT(r)&&!wT))for(let e of r.getChildren())Z(e)&&kT(MD(aT,e.getKey()),e)}else{let t=r.getTextContent();if(KT(r)){let t=r.decorate(aT,iT);t!==null&&b_e(e,t),i&&(AT(r).size>0||AT(n).size>0)&&g_e(n,r,a)}sT+=t}if(!TT&&YT(r)){let e=r.getLatest();if(e.__cachedText!==sT){let t=e.getWritable();t.__cachedText=sT,r=t}}return CT.$decorateDOM(r,n,a,aT),s_e(r),a}function b_e(e,t){let n=aT._pendingDecorators,r=aT._decorators;if(n===null){if(r[e]===t)return;n=lD(aT)}n[e]=t}function IT(e){let t=e.nextSibling;return t!==null&&t===aT._blockCursorElement&&(t=t.nextSibling),t}function x_e(e,t){let n=new Set;for(let r=t;r{for(let n of t){let t=yT.get(n);if(t===void 0)continue;let r=t.__parent;if(r===null)continue;let i=e.get(r);i===void 0&&(i=new Set,e.set(r,i)),i.add(n)}};return t(hT.keys()),t(gT),e}();let o=new Map;return ST=o,FT(`root`,null),aT=void 0,oT=void 0,hT=void 0,gT=void 0,_T=void 0,vT=void 0,yT=void 0,iT=void 0,bT=void 0,xT=void 0,ST=void 0,CT=dk,o}function LT(e){let t=bT.get(e);return t===void 0&&bC(75,e),t}function RT(e,t,n){Dk();let r=e.__key,i=e.getParent();if(i===null)return void(Nj(e)!==null&&bC(367,r,String(Nj(e))));let a=function(e){let t=$();if(!Q(t)||!Z(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return zD(i,e)&&n.set(e.__key,0,`element`),zD(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(Q(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(uj(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(uj(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else FA(a)&&t&&e.isSelected()&&e.selectPrevious();Ej(e.getWritable(),t&&!o&&Q(a)?a:null),n||GD(i)||i.canBeEmpty()||!i.isEmpty()||RT(i,t),t&&a&&YT(i)&&i.isEmpty()&&i.selectEnd()}function C_e(e){return e}var w_e=Symbol.for(`ephemeral`);function zT(e){return e[w_e]||!1}var T_e={configurable:!0,enumerable:!1,value:void 0,writable:!0},BT=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=WO(this);return e===void 0&&bC(64,this.name),e}static clone(e){bC(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||QO(this.constructor);return Object.assign(t,{extends:n}),typeof e==`string`&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",T_e),Object.defineProperty(this,rT,T_e),$E(this,e)}getType(){return this.__type}isInline(){bC(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=iD(e);if(t===null)break;e=t.__parent===null?Nj(t):t.__parent}return!1}isSelected(e){let t=e||$();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(uE(this))return n;if(Q(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(KT(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:iD(e)}getParentOrThrow(){let e=this.getParent();return e===null&&bC(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(GD(t)||Nj(e)!==null)return Z(e)||e===this&&KT(e)||bC(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&bC(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:iD(e)}getPreviousSiblings(){return kj(this.getPreviousSibling(),`previous`).reverse()}getNextSibling(){let e=this.getLatest().__next;return e===null?null:iD(e)}getNextSiblings(){return kj(this.getNextSibling(),`next`)}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=yM(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?gM(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&bC(279),!1)))}isParentOf(e){return zD(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],r=this,i=!0,a=0;for(;r!==null&&((i||a===0)&&n.push(r),!r.is(e));){!i&&a>0&&a--;let e=i&&Z(r)?t?r.getFirstChild():r.getLastChild():null;e!==null&&a++;let n=e||(t?r.getNextSibling():r.getPreviousSibling());i=n!==null,r=n||r.getParent()}return t?n:n.reverse()}isDirty(){let e=Ak()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(zT(this))return this;let e=iD(this.__key);return e===null&&bC(442,this.__key,this.__type),e}getWritable(){if(zT(this))return this;Dk();let e=kk(),t=Ak(),n=this.__key,r=t._cloneNotNeeded,i=r.get(n),a=e._selection;if(a!==null&&a.setCachedNodes(null),i!==void 0)return eD(i),i;let o=e._nodeMap,s=o.get(n);s===void 0&&bC(442,n,this.__type);let c=CO(s);return r.set(n,c),o.set(n,c),eD(c),c}getTextContent(){return Uj(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){bC(70)}updateDOM(e,t,n){bC(71)}getDOMSlot(e){return new Dge(e)}exportDOM(e){return{element:vO(e).$createDOM(this,e)}}exportJSON(e=!1){let t=function(e,t){let n=NO(MO(e.constructor)),{generated:r,isCompactDefault:i}=n,a=r===null?void 0:t?r.exportCompactJSON:r.exportJSON;return a===void 0?function(e,t,n){let r=n?{type:e.__type}:{};return Z(e)&&(r.children=[]),function(e,t,n,r){for(let i=0;i=n&&a<=r&&Number.isInteger(a)?a:t}var N_e=e=>{let t=Pw(e,`format`),n=Fw(e,`format`),r=Lw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=M_e(t.indent,0,0,1/0),e.__textFormat=HT(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}};function P_e(e,t){e.__detail=t.__detail,e.__format=t.__format,e.__mode=t.__mode,e.__style=t.__style,e.__text=t.__text}var F_e=e=>{let t=Pw(e,`mode`),n=Iw(e,`detail`,0),r=Iw(e,`format`,0),i=Fw(e,`mode`),a=Lw(e,`mode`);return{exportJSON:function(e){return{detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__detail;r!==void 0&&r!==0&&(n.detail=r);let i=e.__format;i!==void 0&&i!==0&&(n.format=i);let a=t[e.__mode];a!==void 0&&a!==`normal`&&(n.mode=a);let o=e.__style;o!==void 0&&o!==``&&(n.style=o);let s=e.__text;return s!==void 0&&s!==``&&(n.text=s),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:HT(o,0);let s=t.format;e.__format=typeof s==`string`&&s in r?r[s]:HT(s,0);let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;return e.__text=typeof u==`string`?u:``,e},afterCloneFrom:P_e}},I_e=e=>{let t=Pw(e,`format`),n=Fw(e,`format`),r=Lw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=M_e(t.indent,0,0,1/0),e.__textFormat=HT(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},L_e=()=>({exportJSON:function(e){return{type:e.__type,version:1}},exportCompactJSON:function(e){return{type:e.__type}}}),R_e=e=>{let t=Pw(e,`mode`),n=Iw(e,`format`,0);return{exportJSON:function(e){return{detail:e.__detail,mode:t[e.__mode],text:e.__text,format:e.__format,style:e.__style,type:e.__type,version:1}},exportCompactJSON:function(e){let t={type:e.__type},n=e.__format;n!==void 0&&n!==0&&(t.format=n);let r=e.__style;return r!==void 0&&r!==``&&(t.style=r),t},updateFromJSON:function(e,t){let r=t.format;e.__format=typeof r==`string`&&r in n?n[r]:HT(r,0);let i=t.style;return e.__style=typeof i==`string`?i:``,e}}},z_e=new WeakMap;function B_e(e,t){for(let n=e;n!==null&&n!==t;n=Object.getPrototypeOf(n)){let t=n.prototype;if(t!==void 0&&Object.prototype.hasOwnProperty.call(t,`isInline`)&&typeof t.isInline==`function`&&!zve(t.isInline))try{let t=e.prototype.isInline.call(Object.create(e.prototype));return typeof t==`boolean`?t:null}catch{return null}}}function V_e(e){for(let{ownNodeConfig:t}of JO(e))if(t&&t.children!==void 0)return t.children}function H_e(e){let t=z_e.get(e);if(t===void 0){let n={},r={},i=!1;for(let{klass:t,ownNodeConfig:a}of JO(e))a&&(r.inline===void 0&&a.inline!==void 0&&(n.inline=a.inline,r.inline=t),r.children===void 0&&a.children!==void 0&&(n.children=a.children,r.children=t),i||a.mergeAdjacent===void 0||(i=!0,!1!==a.mergeAdjacent&&(n.mergeAdjacent=a.mergeAdjacent,r.mergeAdjacent=t)));let a=function(e){let t=new Set,n=BO(e);for(let e of Object.keys(n))!0===n[e].derived&&t.add(e);for(let{ownNodeConfig:n}of JO(e)){let e=n&&n.stateConfigs;if(e)for(let n of e){let e=n instanceof Jge?n:n.stateConfig;e.derived&&t.add(e.key)}}return t}(e);r.inline!==void 0&&r.inline!==e&&B_e(e,r.inline)!==void 0&&B_e(e,r.inline)!==n.inline&&(delete n.inline,delete r.inline),r.mergeAdjacent===void 0||r.mergeAdjacent===e||function(e,t,n){let r=BO(e);for(let e of t.by)if(typeof e==`string`){if(!(e in r))return{entry:e,reason:`unknown`};if(n.has(e))return{entry:e,reason:`derived`}}else if(e.derived)return{entry:String(e.key),reason:`derived-state`};return null}(e,n.mergeAdjacent,a)===null&&function(e,t){if(!Array.isArray(t)||t.includes(`inline`))return null;for(let n of t){if(n===`inline`)continue;let t=V_e(n);if(!(t===`inline`||Array.isArray(t)&&t.includes(`inline`)&&t.every(t=>t===`inline`||t===e||e.prototype instanceof t)))return n}return null}(e,n.children)===null||(delete n.mergeAdjacent,delete r.mergeAdjacent),t=Object.freeze({...n,declaredBy:Object.freeze(r),derived:a,derivedNames:a}),z_e.set(e,t)}return t}function U_e(e){let{derivedNames:t,...n}=H_e(e);return Object.freeze({...n,derived:new Set(t)})}var W_e;function UT(e){return W_e!==void 0&&W_e.has(e)}function G_e(){return{...qhe,0:``}}function K_e(){return{...IC,"":0}}var q_e=G_e(),J_e=K_e(),Y_e=Yw()({direction:Zw(Kw([null,`ltr`,`rtl`]),{field:`__dir`}),format:Zw(Kw([``,`left`,`start`,`center`,`right`,`end`,`justify`]),{field:`__format`,getter:`getFormatType`,getterTable:q_e,setter:`setFormat`,setterTable:J_e}),indent:Zw(Ww(0,{integer:!0,min:0}),{field:`__indent`}),textFormat:Qw(Ww(),{getter:{field:`__textFormat`,method:`getSerializedTextFormat`,when:`shouldSerializeTextStyles`},setter:{field:`__textFormat`}}),textStyle:Qw(Uw(),{getter:{field:`__textStyle`,method:`getSerializedTextStyle`,when:`shouldSerializeTextStyles`},setter:{field:`__textStyle`}})});function X_e(e){if(GD(e)&&!UT(Ak())){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var WT=class extends BT{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for(`ElementNode`),{$transform:X_e,extends:BT,generated:N_e,json:Y_e})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``,this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&bC(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__style=e.__style,function(e,t){e.__dir=t.__dir,e.__format=t.__format,e.__indent=t.__indent,e.__textFormat=t.__textFormat,e.__textStyle=t.__textStyle}(this,e)}getFormat(){return this.getLatest().__format}getFormatType(){return qhe[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){return kj(this.getFirstChild(),`next`)}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&Rj(this).length===0}isDirty(){let e=Ak()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let t of Rj(this)){let n=zj(this,t);if(Z(n))for(let t of n.getAllTextNodes())e.push(t)}let t=this.getFirstChild();for(;t!==null;){if(uE(t)&&e.push(t),Z(t))for(let n of t.getAllTextNodes())e.push(n);t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Z(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Z(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=e>=this.getChildrenSize(),n=t?this.getLastChild():this.getChildAtIndex(e);return Z(n)&&(t?n.getLastDescendant():n.getFirstDescendant())||n}getFirstChild(){let e=this.getLatest().__first;return e===null?null:iD(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&bC(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:iD(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&bC(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=Uj(this),t=this.getChildren(),n=t.length;for(let r=0;re.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){let t=this.getWritable();return t.__format=e!==``&&IC[e]||0,t}setStyle(e){let t=this.getWritable();return t.__style=e||``,t}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){let t=this.getWritable();return t.__indent=e,t}splice(e,t,n){zT(this)&&bC(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||bC(226,String(e),String(t),String(r));for(let e of n);let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}t>0&&(s=function(e,t,n,r){let i=[],a=t;for(let e=0;e(Cj(e),e.__prev=null,e.__next=null,e.__parent=null,e.__key))}(i,l===null?this.getFirstChild():l.getNextSibling(),t,l));let d=n.length>0&&l!==null?l.getWritable():null;for(let e of n){d!==null&&e.is(d)&&(l=d.getPreviousSibling(),d=l&&l.getWritable()),c!==null&&e.is(c)&&(c=c.getNextSibling());let t=e.getWritable();t.__parent===a&&u--,Tj(t);let n=e.__key;wj(i,t,d,c&&c.getWritable()),e.__key===a&&bC(76),o.push(n),d=t}if(i.__size=u,s.length){let e=$();if(Q(e)){let t=new Set(s),n=new Set(o);for(let r of[e.anchor,e.focus])Z_e(r,t,n)&&uj(r,r.getNode(),this,l,c);u!==0||this.canBeEmpty()||GD(this)||this.remove()}}return i}getDOMSlot(e){return new kge(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(dO(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`,t.setAttribute(`data-lexical-indent`,String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}shouldSerializeTextStyles(){if(GD(this))return!1;for(let e=this.getFirstChild();e!==null;e=e.getNextSibling())if(uE(e))return!1;return!0}getSerializedTextFormat(){let e=this.getTextFormat();return e!==0&&this.shouldSerializeTextStyles()?e:void 0}getSerializedTextStyle(){let e=this.getTextStyle();return e!==``&&this.shouldSerializeTextStyles()?e:void 0}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){t.read(`latest`,()=>{let n=yO(this,e,t),r=n.element;n.after&&n.after.parentNode!==r&&(n=n.withAfter(null)),n.before&&n.before.parentNode!==r&&(n=n.withBefore(null));let i=n.getManagedLineBreak();i&&n.insertManagedLineBreak(i.nodeName===`IMG`);let a=n.getFirstChild();for(let e of this.getChildrenKeys()){let i=t.getElementByKey(e);if(!i)continue;let o,s=a;for(;s&&!(o=sD(s,t))&&OO(s);)s=s.nextSibling;s!==i&&r.insertBefore(i,o?s:a||n.getInsertionAnchor()),a=i.nextSibling}PT(this,e,n)})}};function Z(e){return e instanceof WT}function Z_e(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var GT=class extends BT{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&bC(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function KT(e){return e instanceof GT}function qT(e){let t=e.getLatest().__cachedText;return t===null||!Ek()&&Ak()._dirtyType!==0?null:t}var JT=class extends WT{__cachedText;$config(){return this.config(`root`,{extends:WT})}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){bC(51)}getTextContent(){let e=qT(this);return e===null?super.getTextContent():e}getTextContentSize(){let e=qT(this);return e===null?super.getTextContentSize():e.length}remove(){bC(52)}replace(e){bC(53)}insertBefore(e){bC(54)}insertAfter(e){bC(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)Z(e)||KT(e)||bC(282);return super.splice(e,t,n)}static importJSON(e){return dD().updateFromJSON(e)}collapseAtStart(){return!0}};function YT(e){return e instanceof JT}function XT(e){let t={};if(!e)return t;let n=``,r=``,i=null,a=!1,o=!1,s=!1,c=0,l=e.length,u=-1;for(let d=0;d=0&&r.slice(i).toLowerCase()===`!important`?e.setProperty(t,r.slice(0,i).trim(),`important`):e.setProperty(t,n,``)}function ZT(e,t,n=``){if(t===n)return;let r=XT(n),i=XT(t);for(let t in i)delete r[t],Q_e(e,t,i[t]);for(let t in r)e.removeProperty(t)}var $_e=Yw()({detail:Zw(Xw(Ww(),Ghe),{field:`__detail`}),format:Zw(Xw(Ww(),FC),{field:`__format`}),mode:Zw(Kw([`normal`,`token`,`segmented`]),{field:`__mode`,getterTable:Jhe,setterTable:LC}),style:Zw(Uw(),{field:`__style`}),text:Zw(Uw(),{field:`__text`,getter:`getTextContent`,setter:`setTextContent`})});function QT(e,t){return 16&t?`code`:128&t?`mark`:32&t?`sub`:64&t?`sup`:null}function $T(e,t){return 1&t?`strong`:2&t?`em`:`span`}function eE(e,t,n,r,i){let a=r.classList,o=ED(i,`base`);o!==void 0&&a.add(...o),o=ED(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in FC){let r=FC[e];if(o=ED(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}TD(r,`class`)}function tE(e,t,n){let r=n.isComposing(),i=e+(r?MC:``),a=_O(),o=vO(a).$getDOMSlot(n,t,a),s=o.getFirstChild();if(s===null||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(rO().createTextNode(i));let c=s,l=c.nodeValue;if(l!==i){if(r||TC||kC){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i({conversion:rve,priority:0}),b:()=>({conversion:tve,priority:0}),code:()=>({conversion:cE,priority:0}),em:()=>({conversion:cE,priority:0}),i:()=>({conversion:cE,priority:0}),mark:()=>({conversion:cE,priority:0}),s:()=>({conversion:cE,priority:0}),span:()=>({conversion:eve,priority:0}),strong:()=>({conversion:cE,priority:0}),sub:()=>({conversion:cE,priority:0}),sup:()=>({conversion:cE,priority:0}),u:()=>({conversion:cE,priority:0})},json:$_e})}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return Jhe[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===nD()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=FC[e];return(this.getFormat()&t)!==0}isSimpleText(){let e=this.getLatest();return e.__type===`text`&&e.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return QE(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=QT(0,n),i=$T(0,n),a=r===null?i:r,o=rO().createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=rO().createElement(i),o.appendChild(s)),nE(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&ZT(o.style,c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=QT(0,i),s=QT(0,a),c=$T(0,i),l=$T(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??bC(48);let i=rO().createElement(l);return nE(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??bC(49)),tE(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&eE(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(ZT(t.style,p,f),TD(t,`style`)),!1}exportDOM(e){let{element:t}=super.exportDOM(e);return dO(t)||bC(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=rE(t,`b`)),this.hasFormat(`italic`)&&(t=rE(t,`i`)),this.hasFormat(`strikethrough`)&&(t=rE(t,`s`)),this.hasFormat(`underline`)&&(t=rE(t,`u`)),{element:t}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?FC[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?Ghe[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=QE(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=LC[e];if(this.getLatest().__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.getLatest().__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){Dk();let n=e,r=t,i=$(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!Q(i))return tj(o,n,o,r,`text`,`text`);{let e=nD();e!==i.anchor.key&&e!==i.focus.key||tD(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=$();if(r&&Q(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Dk();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=nD(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;tt&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=$();if(Q(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=lE(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=a_e(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e=S&&(g.set(e.getKey(),b-S,`text`),b=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&eD(t),n!==null&&eD(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),Q(v)&&lj(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||bC(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;nD()===r&&tD(n);let o=$();if(Q(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&dj(i,t,n,e,a),s!==null&&s.key===r&&dj(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function eve(e){return{forChild:dE(e.style),node:null}}function tve(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:dE(t.style,n?void 0:`bold`),node:null}}var oE=new WeakMap;function nve(e){if(!dO(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function rve(e){let t=e;e.parentElement===null&&bC(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=oE.get(n))===void 0&&!nve(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=sE(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:lE(n)}}function sE(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,dO(n)){let e=n.style.display;if(e===``&&!mO(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(YE(n))return n;if(n.nodeName===`BR`)return null}}var ive={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function cE(e){let t=ive[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:dE(e.style,t),node:null}}function lE(e=``){return qD(new aE(e))}function uE(e){return e instanceof aE}function dE(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign,l=e.textTransform;return e=>((uE(e)||iE(e))&&(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),l!==`lowercase`&&l!==`uppercase`&&l!==`capitalize`||e.hasFormat(l)||e.toggleFormat(l),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}function fE(e,t){let{type:n,key:r,offset:i}=e,a=YD(e.key);return n===`text`?(uE(a)||bC(266,a.getType(),r),tM(a,t,i)):(Z(a)||bC(267,a.getType(),r),CE(a,e.offset,t))}function pE(e,t){let{origin:n,direction:r}=t,i=r===`next`;Zj(t)?e.set(n.getKey(),t.offset,`text`):Qj(t)?uE(n)?e.set(n.getKey(),nM(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):($j(t)&&Z(n)||bC(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function mE(e){let t=$(),n=Q(t)?t:nj();return hE(n,e),pD(n),n}function hE(e,t){pE(e.anchor,t.anchor),pE(e.focus,t.focus)}function gE(e){let{anchor:t,focus:n}=e,r=fE(t,`next`),i=fE(n,`next`),a=pM(r,i)<=0?`next`:`previous`;return dM(cM(r,a),cM(i,a))}function _E(e){let{direction:t,origin:n}=e,r=eM(n,qj(t)).getNodeAtCaret();return r?eM(r,t):iM(n.getParentOrThrow(),t)}function vE(e,t=`root`){let n=[e];for(let r=$j(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(_E(r));return n}function ave(e){return!!e&&e.origin.isAttached()}function ove(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=SE(e,r),o=a.anchor.origin;for(;o!==null&&!GD(o);)o=o.getParent();let s=Z(o)?o.getFirstChild():null,c=vE(a.anchor,n),l=vE(a.focus.getFlipped(),n),u=new Set,d=[];for(let e of a.iterNodeCarets(n))if($j(e))u.add(e.origin.getKey());else if(Qj(e)){let{origin:t}=e;Z(t)&&!u.has(t.getKey())||d.push(t)}let f=new Set;for(let e of d){let t=e.getParent();t===null||u.has(t.getKey())||f.add(t),hve(e)}for(let e of f)!e.canBeEmpty()&&!GD(e)&&e.isEmpty()&&e.isAttached()&&e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=_E(eM(t,r)),o=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||o===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(o===`segmented`){let e=t.origin,n=lE(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=tM(n,r,t.offset)}n.is(c[0].origin)&&(c[0]=t),n.is(l[0].origin)&&(l[0]=t.getFlipped())}}let p=yE(c),m=yE(l),h=function(e,t,n){let r=e&&e.getParentAtCaret(),i=t&&t.getParentAtCaret(),a=r&&i&&yM(r,i);if(!a||a.type!==`branch`)return null;let o=(e,t)=>{let r;for(let i=e;i&&!i.is(a.commonAncestor);i=i.getParent()){if(GD(i))return;t&&!n.has(i.__key)||!gO(i)||(r=i)}return r},s=o(r,!1),c=s&&o(i,!0);return s&&c&&Rj(c).length===0?[s,c]:null}(p,m,u);if(h){let[e,t]=h;iM(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(m){let e=function(e){if($j(e)){let t=e.origin;if(gO(t))return t}else{let t=e.getParentAtCaret();if(t&&gO(t))return t}return null}(m),t=e&&e.getParent(),n=e&&e.getParents().findLast(WD);if(e&&t&&!YT(t)&&e.isEmpty()&&u.has(e.getKey())&&Rj(e).length===0&&(!n||u.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!YT(n)&&n.isEmpty();){let e=n.getParent();if(e&&YT(e)&&e.getChildrenSize()<=1&&n.canBeEmpty())break;let t=n;n=e,t.remove(!0)}}}fD(o,s)!==null||o===null||o.isAttached()||fD(dD(),null);let g=yE([p,m,...c,...l]);if(g)return uM(cM(g,e.direction));bC(269,JSON.stringify(c.map(e=>e.origin.__key)))}function yE(e){let t=e.find(ave);return t&&bE(t)}function bE(e){let t=function(e){let t=e;for(;$j(t);){let e=oM(t);if(!$j(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(uE(t.origin))return Zj(t)?t:tM(t.origin,n,n);let r=t.getAdjacentCaret();return Qj(r)&&uE(r.origin)?tM(r.origin,n,qj(n)):t}function xE(e){return Zj(e)&&e.offset!==nM(e.origin,e.direction)}function SE(e,t){return e.direction===t?e:dM(cM(e.focus,t),cM(e.anchor,t))}function CE(e,t,n){let r=e.getChildrenSize(),i=(t>0?Math.min(Math.ceil(t),r):0)-+(n===`next`),a=i<0||i>=r?null:e.getChildAtIndex(i);return a===null?iM(e,n):eM(a,n)}function wE(e,t=`root`){let n=0,r=e,i=oM(r);for(;i===null;){if(n--,i=r.getParentCaret(t),!i)return null;r=i,i=oM(r)}return i&&[i,n]}function sve(e){let{origin:t,offset:n,direction:r}=e;if(n===nM(t,r))return e.getSiblingCaret();if(n===nM(t,qj(r)))return _E(e.getSiblingCaret());let[i]=t.splitText(n);return uE(i)||bC(281),cM(eM(i,`next`),r)}function TE(e,t){for(let n of e)if(n!==null&&n.caret.origin.is(t))return n}function EE(e,t=null){let{origin:n}=e.caret,[r,i]=e.getSliceIndices();if(r===i)return null;if(r===0&&i===n.getTextContentSize())return n;let a=n.getParent(),o=t&&a&&cj(t,a)?n.getIndexWithinParent():-1,s=t?[t.anchor,t.focus].map(e=>[e,e.key===n.__key&&e.type===`text`?e.offset-r:a!==null&&e.key===a.__key&&e.offset===o?0:null]):[],c=n.splitText(r,i),l=c[r===0?0:1];a&&t&&t!==$()&&lj(t,a,o,c.length-1);for(let[e,t]of s)t!==null&&e.set(l.__key,t,`text`);return l}function cve(e,t){return!0}function DE(e,{$copyElementNode:t=KD,$splitTextPointCaretNext:n=sve,rootMode:r=`shadowRoot`,$shouldSplit:i=cve,removeEmptyDestination:a=!1}={}){if(Zj(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if($j(e)){let e=_E(o);if(a&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,`first`))return e}let r=kj((s=e).getNodeAtCaret(),s.direction);(r.length>0||!a&&n.canBeEmpty()&&i(n,`last`))&&o.insert(t(n).splice(0,0,r))}var s;return o}function OE(e,t,n){let r=cM(t,`next`);Zj(r)&&(r.offset===0?r=eM(r.origin,`previous`).getFlipped():r.offset===r.origin.getTextContentSize()&&(r=eM(r.origin,`next`))),r.origin.is(e)&&(Qj(r)||bC(342,e.getKey(),e.getType()),r=_E(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=DE(e,n))r=e;return Zj(r)&&bC(283),r.insert(e.isInline()?jE().append(e):e),cM(eM(e.getLatest(),`next`),t.direction)}function kE(e,t){let n=SE(Q(t)?gE(t):t,`next`),r=Fj(n.anchor.origin),i=Fj(e.getLatest());if(r===null?i!==null:!r.is(i))return!1;let a=bE(iM(e,`next`)),o=cM(bE(iM(e,`previous`)),`next`);return pM(n.anchor,a)<=0&&pM(n.focus,o)>=0}var AE=class extends WT{$config(){return this.config(`paragraph`,{children:`inline`,extends:WT,generated:I_e,importDOM:{p:()=>({conversion:lve,priority:0})}})}createDOM(e){let t=rO().createElement(`p`),n=ED(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(dO(t)){this.isEmpty()&&t.append(rO().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}exportJSON(e=!1){let t=super.exportJSON(e);if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(uE),r=n?n.getFormat():this.getTextFormat(),i=n?n.getStyle():this.getTextStyle();e&&r===0||(t.textFormat=r),e&&i===``||(t.textStyle=i)}return t}extractWithChild(e,t,n){if(!Q(t)||this.getFormatType()===``&&this.getIndent()===0&&this.getStyle()===``)return!1;if(kE(this,t)){let e=this.getTextContent();return e!==``&&t.getTextContent()===e}return!1}insertNewAfter(e,t){let n=jE();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.getChildren().every(e=>uE(e)&&!/\S/.test(e.getTextContent()))){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function lve(e){let t=jE();if(EO(t,e),wO(e,t),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in IC&&t.setFormat(n)}return TO(t,e),{node:t}}function jE(){return qD(new AE)}function ME(e){return e instanceof AE}var uve=Yw()({detail:Qw(Ww(2),{getter:{field:`__detail`},setter:null}),mode:Qw(Kw([`normal`]),{getter:{field:`__mode`,getterTable:{0:`normal`}},setter:null}),text:Qw(Uw(` `),{getter:{field:`__text`,method:`getTextContent`},setter:null})}),NE=class extends aE{$config(){return this.config(`tab`,{extends:aE,generated:R_e,json:uve})}constructor(e=void 0){super(` `,e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=ED(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}setTextContent(e){return super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||bC(286),this}setDetail(e){return e!==2&&bC(127),this}setMode(e){return e!==`normal`&&bC(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function PE(){return qD(new NE)}function FE(e){return e instanceof NE}var IE=null;function LE(e){IE=e}var RE=Symbol(`INTERNAL_SKIP_AFTER_CLONE_FROM`),dve=1;function zE(e,t){let n=BE(e,t);return n===void 0&&bC(30,t),n}function BE(e,t){return e._nodes.get(t)}var fve=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function VE(e,t){let n=t===void 0?(()=>{let t=e.getRootNode();return XE(t)||$D(t)?cO(t):null})():t;if(!dO(n)||n.hasAttribute(`data-lexical-slot`))return!1;let r=cD(n),i=n.nodeName;return E_e(r)&&(i===`INPUT`||i===`TEXTAREA`||n.contentEditable===`true`&&KE(n)==null)}function HE(e){let t=e===null?null:lO(e);return fO(t)&&VE(t)}function UE(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return GE(t)===e&&e.read(`latest`,()=>!VE(t))}function WE(e){return e instanceof mk}function GE(e){let t=e;for(;t!=null;){let e=KE(t);if(WE(e))return e;t=ND(t)}return null}function KE(e){return e?e.__lexicalEditor:null}function pve(e){return Uhe.test(e)?`rtl`:Whe.test(e)?`ltr`:null}function qE(e){return FE(e)||e.isToken()}function JE(e){return qE(e)||e.isSegmented()}function YE(e){return fO(e)&&e.nodeType===3}function XE(e){return fO(e)&&e.nodeType===9}function ZE(e){let t=e;for(;t!=null;){if(YE(t))return t;t=t.firstChild}return null}function QE(e,t,n){let r=FC[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~FC.superscript:t===`superscript`?i&=~FC.subscript:t===`lowercase`?(i&=~FC.uppercase,i&=~FC.capitalize):t===`uppercase`?(i&=~FC.lowercase,i&=~FC.capitalize):t===`capitalize`&&(i&=~FC.lowercase,i&=~FC.uppercase),i}function mve(e){return uE(e)||ok(e)||KT(e)}function $E(e,t){let n=function(){let e=IE;return IE=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);Dk(),Ok();let r=Ak(),i=kk(),a=``+dve++;i._nodeMap.set(a,e),Z(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.set(a,e),r._dirtyType===0&&(r._dirtyType=1),e.__key=a}function hve(e){Tj(e.getParent()===null?e:e.getWritable())}function eD(e){Ok(),zT(e)&&bC(323,e.__key,e.__type);let t=e.__parent===null?Mj(e)?e.__slotHost:null:e.__parent,n=kk(),r=Ak(),i=n._nodeMap,a=r._dirtyElements;t!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent===null?Mj(e)?e.__slotHost:null:e.__parent}}(t,i,a);let o=e.__key;r._dirtyType===0&&(r._dirtyType=1),Z(e)?a.set(o,!0):r._dirtyLeaves.add(o)}function tD(e){Dk();let t=Ak(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=iD(n);e!==null&&e.getWritable()}if(e!==null){let t=iD(e);t!==null&&t.getWritable()}}}function nD(){return Ek()?null:Ak()._compositionKey}function rD(e){return!DC&&(OC||jC)&&e.__text===``&&e.__key===Ak()._compositionKey}function iD(e,t){let n=(t||kk())._nodeMap.get(e);return n===void 0?null:n}function aD(e,t){let n=sD(e,Ak());return n===void 0?null:iD(n,t)}function oD(e,t,n){e[`__lexicalKey_${t._key}`]=n}function sD(e,t){return e[`__lexicalKey_${t._key}`]}function cD(e,t){let n=e;for(;n!=null;){let e=aD(n,t);if(e!==null)return e;n=ND(n)}return null}function lD(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function uD(e){return e.read(()=>dD().getTextContent())}function gve(e,t){let n=SO(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=iD(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:`history-merge`}:void 0)}function dD(){return kk()._nodeMap.get(`root`)}function fD(e,t){if(!(GD(e)&&e.isAttached()&&(YT(e)?e.getChildrenSize()===0:e.isEmpty())&&(YT(e)||t!==null&&gO(t))))return null;let n=jE();return e.append(n),n}function pD(e){Dk();let t=kk();e!==null&&(e.dirty=!0,e.setCachedNodes(null),Q(e)&&Ak()._slotsUsed&&ZA(e)),t._selection=e}function mD(e){Dk(),Aw(Ak(),e)}function hD(e){let t=function(e,t){let n=e;for(;n!=null;){let e=sD(n,t);if(e!==void 0)return e;n=ND(n)}return null}(e,Ak());return t===null?null:iD(t)}function gD(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function _D(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}var _ve=0;function vD(){return SC?Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5):`s${(++_ve).toString(36)}`}function yD(e){return YE(e)?e.nodeValue:null}function bD(e,t,n){let r=QD(VD(t));if(r===null)return;let i=oO(r,t._rootElement),a=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(a!==null){let t=yD(a),r=cD(a);if(t!==null&&uE(r)){if((t===MC||t===PC)&&n){let e=n.length;t=n,o=e,s=e}t!==null&&xD(r,t,o,s,e)}}}function xD(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing(),s=!DC&&(OC||jC);if(a.isToken()&&o)return;let c=t;if((o||i)&&(!t.endsWith(MC)||s&&t===a.getTextContent()||(c=t.slice(0,-MC.length)),i&&!s)){let e=PC,t;for(;(t=c.indexOf(e))!==-1;)c=c.slice(0,t)+c.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let l=a.getTextContent();if(i||c!==l){let t=$();if(c===``){if(o&&!i&&s)return void SD(a,``,t);if(tD(null),OC||DC||jC)a.remove();else{let e=Ak();SD(a,``,t),setTimeout(()=>{e.update(()=>{a.isAttached()&&a.getTextContent()===``&&a.remove()})},20)}return}let l=a.getParent(),u=sj(),d=a.getTextContentSize(),f=nD(),p=a.getKey();if(a.isToken()&&!o||f!==null&&p===f&&!o||Q(u)&&(l!==null&&!l.canInsertTextBefore()&&u.anchor.offset===0||u.anchor.key===e.__key&&u.anchor.offset===0&&!a.canInsertTextBefore()&&!o||u.focus.key===e.__key&&u.focus.offset===d&&!a.canInsertTextAfter()&&!o))return void a.markDirty();if(!Q(t)||n===null||r===null)return void SD(a,c,t);if(t.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=lE(a.getTextContent());a.replace(e),a=e}SD(a,c,t)}}}function SD(e,t,n){if(e.setTextContent(t),Q(n)){let t=e.getKey(),r=!1;for(let i of[`anchor`,`focus`]){let a=n[i];a.type===`text`&&a.key===t&&(a.offset=nM(e,a.offset,`clamp`),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function CD(e){let t=e;for(;t!==null;){let e=t.getParent();if(e===null)return null;if(YT(e))return t;t=e}return null}function wD(e,t){let{anchor:n,focus:r}=e,i=n.key,a=n.offset,o=n.type,s=r.key,c=r.offset,l=r.type;if(VT(e),!YT(t))return e;let u=CD(n.getNode());return Z(u)&&u.isShadowRoot()&&u.is(CD(r.getNode()))&&(n.set(i,a,o),r.set(s,c,l)),e}function vve(e){let t=dD();if(Q(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(YT(r))return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),wD(e,r),e;let i=r.getTopLevelElementOrThrow(),a=i.getParent();return a===null?(Z(i)&&(t.set(i.getKey(),0,`element`),n.set(i.getKey(),i.getChildrenSize(),`element`),wD(e,i)),e):(t.set(a.getKey(),0,`element`),n.set(a.getKey(),a.getChildrenSize(),`element`),wD(e,a),e)}{let e=t.select(0,t.getChildrenSize());return pD(wD(e,t)),e}}function TD(e,t){e.getAttribute(t)===``&&e.removeAttribute(t)}function ED(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=xM(i);return n[t]=e,e}return i}function DD(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&bC(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function OD(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function kD(e,t){let n=e.offset;if(e.type===`element`)return OD(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?OD(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function AD(e){let t=VD(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function jD(e,t,...n){return Hk(e,t,n[0],e)}function MD(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&bC(75,t),n}function ND(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return $D(n)?n.host:null}function PD(e){return XE(e)?e:dO(e)?e.ownerDocument:null}function FD(e,t){let n=parseFloat(e);return isFinite(n)?e.endsWith(`%`)?n*t/100:n:0}function yve(e,t,n,r){let i=t.clientWidth,a=t.scrollWidth-i;if(a<=0)return 0;let o=e.getComputedStyle(t);if(o.overflowX!==`auto`&&o.overflowX!==`scroll`)return 0;let s=t.getBoundingClientRect(),c=t.offsetWidth,l=c>0&&Math.abs(s.width-c)>1?s.width/c:1,u=o.direction===`rtl`,d=s.left+t.clientLeft*l,f=d+FD(o.scrollPaddingLeft,i)*l,p=d+(i-FD(o.scrollPaddingRight,i))*l,m=n,h=Math.max(r,n+1);h-m>p-f&&(u?m=h-1:h=m+1);let g=0;if(mp&&(g=h-p),g===0)return 0;let _=t.scrollLeft,v=_+g/l,y=g>0?Math.ceil(v):Math.floor(v),b=u?Math.min(0,Math.max(-a,y)):Math.max(0,Math.min(a,y)),x=_*l;return Math.abs(b)=f&&h+x<=p&&(b=0),b===_?0:(t.scrollLeft=b,(t.scrollLeft-_)*l)}function ID(e){return Ak()._updateTags.has(e)}function LD(e){Dk(),Ak()._updateTags.add(e)}function RD(e){Dk(),Ak()._deferred.push(e)}function zD(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function BD(e){let t=PD(e);return t?t.defaultView:null}function VD(e){let t=e._window;return t===null&&bC(78),t}function HD(e){return Z(e)&&e.isInline()||KT(e)&&e.isInline()}function UD(e){let t=e.getLatest();for(;t!==null;){if(Nj(t)!==null&&Z(t))return t;let e=t.getParentOrThrow();if(GD(e))return e;t=e}return t}function WD(e){return Z(e)&&e.isShadowRoot()}function GD(e){return YT(e)||WD(e)}function KD(e,t=!1){let n=e.constructor.clone(e,RE);return $E(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function qD(e){let t=Ak(),n=e.getType(),r=BE(t,n);r===void 0&&bC(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||bC(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||bC(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&bC(203,e.constructor.name,n,r.name,r.getType()),t}return e}function JD(e,t){!YT(e.getParent())||Z(t)||KT(t)||bC(99)}function YD(e){let t=iD(e);return t===null&&bC(63,e),t}function XD(e){if(!e||e.isInline())return!1;if(KT(e))return!0;if(Z(e)){if(e.isShadowRoot()){let t=e.getParent();return!(Z(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function ZD(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function QD(e){return SC?(e||window).getSelection():null}function bve(e){let t=BD(e);return t?t.getSelection():null}function $D(e){return pO(e)&&`host`in e}var xve=[];function eO(e){let t=e.getRootNode();if(t===e||!$D(t))return xve;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!$D(e))break;n.push(e),r=e.host}return n}function*tO(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll(`[data-lexical-editor="true"]`);let e=(XE(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function nO(e){return e===null?document:e.ownerDocument}function rO(){let e=Nk();return nO(e===null?null:e._rootElement)}function iO(e,t){if(t===null||typeof e.getComposedRanges!=`function`)return null;let n=eO(t);if(n.length===0)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(t!==void 0)return t}catch{}try{let t=r.apply(e,n)[0];if(t!==void 0)return t}catch{}return null}function aO(e,t){let n=iO(e,t);if(n!==null){let e=Sve(n);if(e!==null)return e}return e.rangeCount>0?e.getRangeAt(0):null}function oO(e,t){let n=iO(e,t);return n===null?e:Cve(n,wve(e))}function Sve(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}function Cve(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e;return t===`backward`?{anchorNode:i,anchorOffset:a,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:a}}function wve(e){return e.direction}function sO(e){let t=e.getRootNode();return XE(t)||$D(t)?t.activeElement:null}function cO(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let e=t.shadowRoot.activeElement;if(e===null)break;t=e}return t}function lO(e){let t=e.target;if(t!==null&&dO(t)&&t.shadowRoot!==null&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0)return t[0]}return t}function uO(e){return dO(e)&&e.tagName===`A`}function Tve(e){return dO(e)&&e.tagName===`TR`}function dO(e){return fO(e)&&e.nodeType===1}function fO(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function pO(e){return fO(e)&&e.nodeType===11}var Eve=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function mO(e){return!(!dO(e)||!e.style.display.startsWith(`inline`))||Eve.test(e.nodeName)}var Dve=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function hO(e){return(!dO(e)||!e.style.display.startsWith(`inline`))&&Dve.test(e.nodeName)}function gO(e){if(KT(e)&&!e.isInline())return!0;if(!Z(e)||GD(e))return!1;let t=e.getFirstChild(),n=t===null||ok(t)||uE(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function _O(){return Ak()}function vO(e=_O()){return e._config.dom||dk}function yO(e,t,n=_O()){let r=vO(n).$getDOMSlot(e,t,n);return Z(e)&&(Ove(r)||bC(344,e.getKey(),e.getType())),r}function Ove(e){return e instanceof kge}function bO(e,t,n=_O()){return ZE(yO(e,t,n).element)}var xO=new WeakMap,kve=new Map;function SO(e){if(!e._readOnly&&e.isEmpty())return kve;e._readOnly||bC(192);let t=xO.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),xO.set(e,t)),t}function CO(e){let t=e.constructor.clone(e,RE);return t.afterCloneFrom(e),t}function Ave(e){return(t=CO(e))[w_e]=!0,t;var t}function wO(e,t){let n=e.getAttribute(`data-lexical-indent`);if(n!==null){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function TO(e,t){let n=t.getAttribute(`dir`);return n===`ltr`||n===`rtl`?e.setDirection(n):e}function EO(e,t){let n=t.style.textAlign;return n&&n in IC?e.setFormat(n):e}function DO(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function OO(e){return!0===e.__lexicalUnmanaged}function jve(e,t=_O()){let n=t.isEditable();e.contentEditable=n?`true`:`false`,n?e.__lexicalEditor=t:delete e.__lexicalEditor}function kO(e,t){let n=e;for(;n!=null;){if(!0===n.__lexicalCapturedSelection)return!0;if(dO(n)&&n.hasAttribute(`data-lexical-slot`)||sD(n,t)!==void 0)return!1;n=ND(n)}return!1}function AO(e,t){return Hw(e,t)&&e[t]!==BT[t]}var jO=new WeakMap;function MO(e){let t=jO.get(e);return t===void 0?function(e){let t=e.prototype!=null&&RC in e.prototype?e.prototype[RC]():void 0,n=function(e){if(!(e===BT||e.prototype instanceof BT)){let t=``,n=``;try{t=e.getType()}catch{}try{mk.version&&(n=JSON.parse(mk.version))}catch{}bC(290,e.name,t,n)}return e===GT||e===WT||e===BT}(e),r=!n&&AO(e,`getType`)?e.getType:void 0,i=r&&!(PO in r)?r.call(e):void 0,a,o=i;if(t){if(i)a=t[i];else{for(let[e,n]of Object.entries(t))o=e,a=n;if(!a)for(let e of Object.getOwnPropertySymbols(t)){let n=t[e];if(n){a=n;break}}}}let s={compiled:void 0,composed:void 0,config:{declaresOwnConfig:Hw(e.prototype,RC),klass:e,ownNodeConfig:a,ownNodeType:o},ownFieldsValidated:!1};jO.set(e,s);try{let t=function(e){let t=e.prototype,n=new Map,{fieldsBaseFirst:r}=zO(e);for(let[i,a]of r){let r=Ive(e,i,a);if(r===null)continue;if(Nw(r)){let t=r.field;if(t===`__proto__`&&bC(430,e.name,i),r.setterTable!==void 0){let{setterTable:t}=r,{meta:n}=a;for(let r of n.kind===`enum`?n.values:[a.defaultValue])Hw(t,String(r))||bC(431,e.name,i,JSON.stringify(r))}n.set(i,{field:t,key:i,kind:`ownField`,schema:a,setterTable:r.setterTable});continue}let o=t[r];typeof o!=`function`&&bC(432,e.name,i,r),n.set(i,{key:i,kind:`field`,schema:a,setter:o})}return n.size===0?Mve:[...n.values()]}(e),r=function(e){let t=e.prototype,n=new Map;for(let[r,i]of zO(e).fieldsDerivedFirst){let a=Fve(e,r,i);if(a===null)continue;if(Nw(a)){let o=a.field;o===`__proto__`&&bC(426,e.name,r);let s=a.when,c;if(s!==void 0){let n=t[s];typeof n!=`function`&&bC(427,e.name,r,s),c=n}n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,field:o,getterTable:a.getterTable,isEqual:i.isEqual,key:r,kind:`ownField`,schema:i,when:c});continue}let o=t[a];typeof o!=`function`&&bC(428,e.name,r,a),n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,getter:o,isEqual:i.isEqual,key:r,kind:`method`,schema:i})}return n.size===0?Pve:[...n.values()]}(e),i=zO(e),c=function(e,t,n){let r,i=e;for(let{klass:t,ownNodeConfig:n}of JO(e))n&&n.generated!==void 0&&(r===void 0?(r=n.generated,i=t):n.generated===r&&(i=t));return r===void 0?null:i===e||function(e,t){if(e.getters.length!==t.getters.length||e.setters.length!==t.setters.length)return!1;for(let n=0;n{LE(t);let r=new e;return n!==RE&&r.afterCloneFrom(t),r}),AO(e,`importJSON`)||(e.importJSON=r&&r.$importJSON||function(e){return t=>{let n=YO(e);return n.updateFromJSON===BT.prototype.updateFromJSON?function(e,t){return UO(e.__state||t.$!==void 0?e_e(e,t):e,t)}(n,t):n.updateFromJSON(t)}}(e)),!AO(e,`importDOM`)&&r){let{importDOM:t}=r;t&&(e.importDOM=()=>t)}let t=e.prototype;Hw(t,`getTextContent`)&&!Hw(t,`getTextContentSize`)&&(e.prototype.getTextContentSize=BT.prototype.getTextContentSize)}}(e,n,o,a),function(e){for(let{klass:t,ownNodeConfig:n}of JO(e)){let e=t.prototype;if(Hw(e,`afterCloneFrom`))continue;let r=Hve(t);if(r.length===0)continue;let i=Object.getPrototypeOf(e),a=n&&n.generated!==void 0?NO(MO(t)).generated:null,o=a!==null&&a.afterCloneFrom||((e,t)=>{let n=e,i=t;for(let e=0;e=0;e--){for(let[r,s]of t[e]){let t=i.get(r);t===void 0||a.has(r)||a.set(r,t),t===void 0||s!==t||o.has(r)||o.set(r,n[e])}for(let t of r[e])s.has(t.key)||s.set(t.key,t)}return i.size===0&&s.size===0?Nve:{declaredBy:o,fields:a,fieldsBaseFirst:[...a],fieldsDerivedFirst:[...i],flatStates:[...s.values()]}}(e)),t.composed}function BO(e){let{fieldsDerivedFirst:t,flatStates:n}=zO(e),r={};for(let e of n)e.schema&&(r[e.key]=e.schema);for(let[e,n]of t)r[e]=n;return r}var Pve=[];function Fve(e,t,n){let r=n.getter;if(r===null)return null;let i=r===void 0?RO(t):r;return Nw(i)?FO(e,t,i,RO(t)):i}function Ive(e,t,n){let r=n.setter;if(r===null)return null;let i=r===void 0?LO(t):r;return Nw(i)?FO(e,t,i,LO(t)):i}function VO(e){return e}function HO(e,t){let{defaultValue:n,isEqual:r}=e;return t===void 0||t===n||r!==void 0&&r(t,n)}function Lve(e){let t;return(n,r)=>{t===void 0&&(t=new Map(e.map(e=>[e.key,e])));let i=t.get(n);return i!==void 0&&HO(i,r)}}function Rve(e){let{setterTable:t,schema:n}=e,{defaultValue:r}=n;return t===void 0?r:t[String(r)]}function UO(e,t){let{flatStates:n,generated:r,setters:i}=NO(MO(e.constructor)),a=function(e,t,n){let r=e;for(let e=0;ee)}}return r}(e,t,n);return r!==null&&r.updateFromJSON!==void 0?r.updateFromJSON(a,t):function(e,t,n){for(let r=0;r!n.has(e))}function*JO(e){for(let t=e;t&&(t===BT||E_e(t.prototype));){let e=WO(t),n=e.declaresOwnConfig;yield n?e:{...e,ownNodeConfig:void 0},t=n&&e.ownNodeConfig&&e.ownNodeConfig.extends||QO(t)}}function YO(e){let t=_O();Dk();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),r=new n.klass;return n.replace===null?r:qD(r)}var XO=(e,t)=>{let n=e;for(;n!=null&&!YT(n);){if(t(n))return n;n=n.getParent()}return null};function ZO(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t===null?iD(r):t.get(r);e??bC(174),n.push(r),r=e.__next}return n}function QO(e){let t=Object.getPrototypeOf(e);if(typeof t==`function`&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}function $O(e){return new nk(xge(e._nodeMap),null,e._slotsUsed)}function ek(){return new nk(new Map([[`root`,new JT]]),null,!1)}function tk(e){let t=e.constructor,n=wge(e);if(Z(e)){let t=n.children,r=e.getChildren();for(let e=0;e0){let i={};for(let n of r){let r=zj(e,n);r===null&&bC(366,t.name,n),i[n]=tk(r)}n.$slots=i}return n}function Uve(e){return e instanceof nk}var nk=class e{_nodeMap;_movedNodes;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._movedNodes=null,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size<=1&&this._selection===null}read(e,t){return Rk(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n._parsed=this._parsed,n}toJSON(e){return Sge(typeof e==`boolean`&&e,()=>Rk(null,this,()=>({root:tk(dD())})))}},rk=class extends WT{$config(){return this.config(`artificial`,{extends:WT})}createDOM(e){return rO().createElement(`div`)}},ik=class extends BT{$config(){return this.config(`linebreak`,{extends:BT,generated:L_e,importDOM:{br:e=>sk(e)||ck(e)?null:{conversion:Wve,priority:0}}})}getTextContent(){return` `}createDOM(){return rO().createElement(`br`)}updateDOM(){return!1}isInline(){return!0}};function Wve(e){return{node:ak()}}function ak(){return qD(new ik)}function ok(e){return e instanceof ik}function sk(e){let t=e.parentElement;if(t!==null&&hO(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&lk(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&lk(n))return!0}}return!1}function ck(e){let t=e.parentElement;if(t!==null&&hO(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&lk(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&lk(r))return!0}return!1}function lk(e){return YE(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function Gve(e){console.warn(e)}function uk(e,t,n,r,i){let a=e._keyToDOMMap;a.clear(),e._editorState=ek(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),t!==null&&sA(e,t),e._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let o=e._observer;o!==null&&(o.disconnect(),e._observer=null),t!==null&&(t.textContent=``,function(e,t){delete e[`__lexicalKey_${t._key}`]}(t,e)),n!==null&&(n.textContent=``,a.set(`root`,n),oD(n,e,`root`))}function Kve(e){let t=new Set,n=new Set;for(let{klass:r,ownNodeConfig:i}of JO(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}var dk={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=BE(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>Z(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>Z(e)&&e.excludeFromCopy(`html`),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function fk(e){let t=e||{},n=Nk(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=ek(),s=t.namespace||(i===null?vD():i._config.namespace),c=t.editorState,l=[JT,aE,ik,NE,AE,rk,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let e=0;e`;try{r=JSON.parse(bge)}catch{}bC(365,String(e-l.length+(t.nodes?t.nodes.length:0)),typeof n==`function`?`${n.name}${typeof n.getType==`function`?` (type ${String(n.getType())})`:``}`:String(n),String(r))}WO(n);let a=n.getType(),o=Kve(n);m.set(a,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:Xge(l[e]),transforms:o})}}let h=new mk(o,i,m,{disableEvents:a,dom:{...dk,...e&&e.dom},namespace:s,theme:r},u||console.error,d||Gve,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(m,f?f.import:void 0),p,e);return c!==void 0&&(h._pendingEditorState=c,h._dirtyType=2),function(e){e.registerCommand(Qhe,rye,0),e.registerCommand($he,aye,0),e.registerCommand(ege,sye,0),e.registerCommand(tge,cye,0),e.registerCommand($C,fye,0)}(h),h}function qve(e,t){let n=e.get(t);e.delete(t),n&&n()}function pk(e,t,n){return e.set(t,n),qve.bind(null,e,t)}var mk=class{static version=bge;_headless;_recordNodeMoves;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_keyDownShortcuts;_inputState;_lastNotifiedSelection;_createEditorArgs;constructor(e,t,n,r,i,a,o,s,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new ww,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Map,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=vD(),this._onError=i,this._onWarn=a,this._htmlConversions=o,this._editable=s,this._headless=t!==null&&t._headless,this._recordNodeMoves=!1,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},composedSegmentedKey:null,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,lastPointerType:``,mouseDrag:null,postDeleteSelectionToRestore:null,savedInputMode:void 0,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null},this._lastNotifiedSelection=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return pk(this._listeners.update,e)}registerEditableListener(e){return pk(this._listeners.editable,e)}registerDecoratorListener(e){return pk(this._listeners.decorator,e)}registerTextContentListener(e){return pk(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return qk(pk(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&bC(35);let r=this._commands;r.has(e)||r.set(e,[new Sw,new Sw,new Sw,new Sw,new Sw]);let i=r.get(e);i===void 0&&bC(36,String(e));let a=function(e){return 7&e}(n),o=i[a];return a===n?o.addBack(t):o.addFront(t),()=>{o.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&bC(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=SO(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return gve(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return jD(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=ED(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,uk(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||function(e){let t=Zk.get(e);if(t===void 0)return void EA();let n=Qk.get(t);if(n===void 0)return void EA();Zk.delete(e);let r=KE(e);WE(r)?(function(e){if(e._parentEditor!==null){let t=_D(e),n=t[t.length-1]._key;wA.get(n)===e&&wA.delete(n)}else wA.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&bC(198);let i=SA(e);for(let e=0;e{mye(i)||(pye(i),n===`blur`&&(sA(t,e),t._inputState.isShiftKeyDown=!1,t._inputState.isInsertLineBreak=!1),(t.isEditable()||n===`click`||n===`copy`)&&(typeof r==`function`?r(i,t):jD(t,r,i)))}));let o,s=()=>{t._inputState.mouseDrag=null},c=n=>{let i=t._inputState,a=i.mouseDrag;if(o&&o.defaultPrevented&&!n.buttons&&(i.isSelectionChangeFromMouseDown=!1),!a||n.pointerType!==`mouse`)return;let c=n.type===`pointerup`;if(n.type===`pointercancel`||!c&&n.buttons!==1)return s();i.mouseDrag=c?null:n,Kk(t,()=>{let o=QD(VD(t));if(a.type!==`mousedown`){let r=c&&o&&Q($())&&aj(sj(),o,t,new Event(`selectionchange`));return r&&pD(r),lA(t,n,c&&o?oO(o,e).focusNode:null)}let l=ij(o,t);if(a.defaultPrevented||!a.shiftKey&&l&&!l.isCollapsed())s();else if(o&&i.isSelectionChangeFromMouseDown){CA(t,o,new Event(`selectionchange`),r),lA(t,a,oO(o,e).focusNode);let n=$();Q(n)&&n.isCollapsed()&&!n.is(sj())&&iA(t,n)}})};i.push(Yk(n,{pointercancel:c,pointermove:c,pointerup:c},!0),Jk(VD(t),`blur`,s),t.registerEditableListener(s),Yk(e,{contextmenu:s,dragstart:s,keydown:e=>e.getModifierState&&e.getModifierState(e.key)||s(),mousedown:e=>{let n=t._inputState;n.mouseDrag=e.button!==0||e.detail!==1||e.defaultPrevented||n.lastPointerType!==`mouse`||!t.isEditable()||t.isComposing()||kO(lO(e),t)?null:e}}),Jk(e,`pointerdown`,e=>{o=e,t._inputState.lastPointerType=e.pointerType},!0)),DC&&i.push(function(e,t){let n=null,r={capture:!0,passive:!0};return qk(Jk(e,`touchstart`,e=>{let t=e.touches.length===1?e.touches[0]:null;n=t?{x:t.clientX,y:t.clientY}:null},r),Jk(e,`touchend`,e=>{let r=e.changedTouches[0];n!==null&&r&&e.touches.length===0&&Math.abs(r.clientX-n.x)<=aA&&Math.abs(r.clientY-n.y)<=aA&&t(e),n=null},r))}(e,n=>function(e,t,n){t._inputState.savedInputMode!==void 0&&(oA(e,t,n)||(cO(n.ownerDocument)===n&&n.blur(),sA(t,n)))}(n,t,e)))}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(`history-merge`),zk(this);Bk(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){let n=e.isEmpty(),r=e;r._readOnly&&(r=$O(e),r._selection=e._selection?e._selection.clone():null),Aw(this);let i=this._pendingEditorState,a=t===void 0?null:t.tag;i===null||i.isEmpty()||(a!=null&&this._updateTags.add(a),zk(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,Kk(this,()=>{if(a&&this._updateTags.add(a),n&&(xC(38),dD().append(jE())),e._parsed)for(let[e,t]of r._nodeMap.entries())Z(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=ek(),i=gk,a=vk,o=_k,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Map,t._dirtyType=0,gk=r,vk=!1,_k=t,LE(null);try{let i=t._nodes;Lk(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,gk=i,vk=a,_k=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?[`force-commit`,e[0]]:e;return t===`force-commit`&&(Ck.has(this)||zk(this)),(t===`pending`?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):Gk(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),Kk(this,()=>{let r=$(),i=dD();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||pD(r.clone()),LD(`focus`),RD(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=QD(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Bk(`editable`,this,!0,e),this._slotsUsed&&this.update(()=>jk()))}toJSON(){return{editorState:this._editorState.toJSON(Cge())}}};function hk(e,t,n,r,i,a){if(Z(e)){let o=e.__first;for(;o!==null;){let e=r.get(o);if(e===void 0)break;let s=Z(e);e.__parent!==t||s&&a.has(o)||((s||jj(e)&&e.__slots!==null)&&hk(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o)),o=e.__next}}for(let o of jj(e)&&e.__slots!==null?e.__slots.values():[]){let e=r.get(o);e!==void 0&&Mj(e)&&e.__slotHost===t&&((Z(e)||jj(e)&&e.__slots!==null)&&hk(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o))}}var gk=null,_k=null,vk=!1,yk=!1,bk=!1,xk=new Set,Sk=new Set,Ck=new Set,wk=0,Tk={characterData:!0,childList:!0,subtree:!0};function Ek(){return vk||gk!==null&&gk._readOnly}function Dk(){vk&&bC(13)}function Ok(){wk>99&&bC(14)}function kk(){return gk===null&&bC(195,Mk()),gk}function Jve(e){kk()!==null&&_k===null&&(_k=e),_k!==e&&xC(378)}function Ak(){return _k===null&&bC(337,Mk()),_k}function jk(){Ak()._dirtyType=2}function Mk(){let e=0,t=new Set,n=mk.version;if(typeof window<`u`)for(let r of tO(document)){let i=KE(r);if(WE(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function Nk(){return _k}function Pk(e,t,n){let r=t.__type,i=zE(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;ee.dispatchCommand(BC),void 0,!0)}return!1}finally{Sk.delete(e)}}(e);(function(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return void(!e._updating&&e._deferred.length>0&&Uk(e,e._deferred));let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=gk,u=vk,d=_k,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){_k=e,gk=n,vk=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=S_e(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),yk)throw t;uk(e,null,r,n),Rge(e),e._dirtyType=2,yk=!0,zk(e,a),yk=!1;return}finally{p.observe(r,Tk),e._updating=f,gk=l,vk=u,_k=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set;let y=e._deferred;f||(e._deferred=[]),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=lD(e)),delete r[a])}(e,n);let b=i?null:QD(VD(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){_k=e,gk=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&ZD(t,e,r),xye(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(Q(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(sO(t))){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())XD(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);t!==null&&XD(t)&&(s=!0,c=e.getElementByKey(t.__key))}if(s){let n=yO(a,e.getElementByKey(a.__key),e).element;r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=rO().createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=xM(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&ZD(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,Tk),_k=d,gk=l}}let x=Ck.has(e);Ck.add(e);try{m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e{xk.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(yC(437,e._config.namespace));let n=t.shift();if(n){let[t,r]=n;Gk(e,t,r)}}(e)})(e,t),n&&e._onWarn(yC(436))}finally{bk=n}}function Bk(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r),a=typeof i==`function`?i:void 0;n.has(e)?n.set(e,a):a&&a()}}finally{t._updating=i}}function Vk(e,t){let n=e._lastNotifiedSelection;return t===null?n!==null:!t.is(n)}function Hk(e,t,n,r){let i=_D(e),a;if(!bk)for(let e=0;e{i=Hk(e,t,n,r)}),i}let i=kk()._selection;e._lastNotifiedSelection=i===null?null:i.clone()}for(let e=4;e>=0;e--)for(let o=0;o0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t.size>0){let e=!1;if(Kk(s,()=>{for(let i of t)if(i(n,r))return void(e=!0)}),e)return e}}}return a&&a.update(()=>{Hk(a,t,n,r)}),!1}function Uk(e,t){if(e._deferred===t&&(e._deferred=[]),t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);uE(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&k_e(r),r!==void 0&&Fk(r,a)&&Pk(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){wk++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&Fk(c,a)&&Pk(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,wk++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),Wk(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(Z(t)&&hk(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(jj(t)&&t.__slots!==null&&hk(t,e,i,a,o,n),i.has(e)||n.delete(e),o.push(e))}let s=Ak(),c=s._cloneNotNeeded;for(let e of o)a.delete(e),c.delete(e);let l=s._compositionKey;l===null||a.has(l)||(s._compositionKey=null)}(c,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);let i=l._selection;if(Q(i)){e._slotsUsed&&ZA(i);let t=l._nodeMap,n=i.anchor.key,r=i.focus.key;t.get(n)!==void 0&&t.get(r)!==void 0||bC(19)}else FA(i)&&i._nodes.size===0&&(l._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=c;let n=c._selection;e._lastNotifiedSelection=n===null?null:n.clone(),e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),zk(e);return}finally{gk=d,vk=f,_k=p,e._updating=m,wk=0}r||(e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(l,e)?l._flushSync?(l._flushSync=!1,zk(e)):u&&fve(()=>{zk(e)}):(l._flushSync=!1,u&&(i.clear(),e._deferred=[],e._pendingEditorState=null,e._lastNotifiedSelection=h)))}function Kk(e,t,n){_k===e&&n===void 0?Ek()?Gk(e,t,n):t():Gk(e,t,n)}function qk(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function Jk(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}function Yk(e,t,n){return qk(...Object.entries(t).map(([t,r])=>Jk(e,t,r,n)))}var Xk=30,Zk=new WeakMap,Qk=new WeakMap,Zve=vge(e=>(e.addEventListener(`selectionchange`,TA),()=>e.removeEventListener(`selectionchange`,TA)));function $k(e,t,n,r,i,a){let o=e.anchor,s=e.focus,c=o.getNode(),l=Ak(),u;if(a!==void 0)u=a;else{let e=QD(VD(l));u=e===null?null:oO(e,l._rootElement)}let d=u===null?null:u.anchorNode,f=o.key,p=l.getElementByKey(f),m=n.length;return f!==s.key||!uE(c)||(!i&&(!EC||l._inputState.lastBeforeInputInsertTextTimeStamp1||(i||!EC)&&p!==null&&!c.isComposing()&&d!==bO(c,p,l)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=qE(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(uE(t)||Z(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,c)}function eA(e,t){return YE(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function tA(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=oO(e,t._rootElement),s=t._inputState;if(s.isSelectionChangeFromDOMUpdate){s.isSelectionChangeFromDOMUpdate=!1;let e=s.selectionChangeFromDOMUpdatePoints;if(s.selectionChangeFromDOMUpdatePoints=null,eA(r,i)&&eA(a,o)&&!s.postDeleteSelectionToRestore&&(e===null||e.anchorNode===r&&e.anchorOffset===i&&e.focusNode===a&&e.focusOffset===o))return}Kk(t,()=>{if(!n)return void pD(null);if(!UE(t,r,a))return;let c=s.mouseDrag;!c||c.type===`mousedown`&&c.defaultPrevented||lA(t,c,a);let l=cA.has(c),u=$();if(s.postDeleteSelectionToRestore&&Q(u)&&u.isCollapsed()){let e=u.anchor,t=s.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(u=s.postDeleteSelectionToRestore.clone(),pD(u))}if(s.postDeleteSelectionToRestore=null,Q(u)){let n=u.anchor;if(u.isCollapsed())e.type===`Range`&&r===a&&(u.dirty=!0),iA(t,u);else{let e=n.key,t=u.focus,r=t.key,a=u.getNodes(),s=a.length,c=u.isBackward(),[d,f]=l?[n.offset,t.offset]:[i,o],p=c?f:d,m=c?d:f,h=c?r:e,g=c?e:r,_=zhe,v=!1;for(let e=0;e{let n=$(),r=QD(VD(t)),i=sj();if(r){if(Q(n)){let e=n.anchor,t=e.getNode();e.type===`element`&&e.offset===0&&n.isCollapsed()&&!YT(t)&&dD().getChildrenSize()===1&&t.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType===`touch`||e.pointerType===`pen`||DC&&t._inputState.lastPointerType!==`mouse`){let n=oO(r,t._rootElement).anchorNode;(dO(n)||YE(n))&&pD(aj(i,r,t,e))}}if(TC&&r!==null&&r.rangeCount===0){let n=t._rootElement;if(n!==null&&e.target===n){let a=e.clientY,o=n.childNodes.length;for(let e=0;e{kO(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}var cA=new WeakSet;function lA(e,t,n=null){let r=$(),i=r&&r.clone();(function(e,t,n){let r=sj(),i=t.type===`mousedown`,a=i&&!t.shiftKey,o=n&&cD(n);KT(o)&&(i?a&&o.isInline()&&o.selectPrevious():Q(r)&&pD(r.clone()));let s=$(),c=s||(a?nj():Q(r)?r.clone():null),l=e.getRootElement(),u=l&&l.getRootNode();if(!Q(c)||a&&!c.isCollapsed()||!XE(u)&&!$D(u))return;let{anchor:d,focus:f}=c;if(!i&&Q(r)){let{key:e,offset:t,type:n}=r.anchor;d.set(e,t,n,!0)}let{clientX:p,clientY:m}=t,h=u.elementFromPoint&&u.elementFromPoint(p,m),g=h&&cD(h),_=(e,t)=>Z(e)?t===`next`?e.getLastDescendant():e.getFirstDescendant():e,v=[null],y=Z(g)&&!g.isInline()&&(YT(g)?XO(f.getNode(),ej):g);for(let e of y?iM(y,`next`):[])v.push(eM(e.origin,`previous`),e);let b=VD(e),x=b.document.createRange(),S=null;for(let t of v){let n=t?_(t.origin,t.direction):g;if(!KT(n)||!n.isInline()||n===S)continue;let r=e.getElementByKey(n.getKey());if(!r)continue;x.selectNodeContents(r);let i=x.getBoundingClientRect(),o=r.getBoundingClientRect(),{bottom:l,left:u,right:h,top:v}=i.height>o.height?i:o;if(t&&(ml)){S=n;continue}let y=b.getComputedStyle(ND(r)||r).direction===`rtl`,C=2*p>u+h!==y,w=C?`next`:`previous`,T=t&&t.getNodeAtCaret(),ee=T&&e.getElementByKey(T.getKey()),E=ee?ee.getClientRects():[],te=E[C?0:E.length-1];if(!t||t.direction===w&&b.getComputedStyle(r).cssFloat===`none`&&(!T||ok(T)||te&&(C===y?2*te.right>u+h:2*te.leftfA(e),0))}function mA(e,t){let n=lO(e);if(dO(n)&&kO(n,t))return!0;let r=t.getRootElement();if(r===null)return!1;let i=cO(r.ownerDocument);return i!==null&&r.contains(i)&&(kO(i,t)||VE(r,i))}function nye(e,t){let n=e.inputType;n===`deleteCompositionText`||TC&&AD(t)||n!==`insertCompositionText`&&Kk(t,()=>{mA(e,t)||jD(t,Qhe,e)},{event:e})}function rye(e){let t=e.inputType,n=uA(e),r=Ak(),i=r._inputState,a=$();if(t===`insertText`&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(fA(i),e.preventDefault(),Q(a)&&!a.isCollapsed()){let e=a.isBackward()?a.anchor:a.focus;a.anchor.set(e.key,e.offset,e.type),a.focus.set(e.key,e.offset,e.type)}return!0}if(t===`deleteContentBackward`){if(a===null){let e=sj();if(!Q(e))return!0;pD(e.clone())}if(Q(a)){let t=a.anchor.key===a.focus.key;if(function(e,t){return e.lastKeyCode===`MediaLast`&&t{Kk(r,()=>{tD(null)})},Xk),Q(a)){let e=a.anchor.getNode();e.markDirty(),uE(e)||bC(142),rA(a,e)}}else{if(tD(null),DC&&n!==null&&!n.collapsed&&(a.applyDOMRange(n),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let o=a.anchor.getNode(),s=o.getTextContent(),c=o.canInsertTextAfter(),l=a.anchor.offset===0&&a.focus.offset===s.length,u=AC&&t&&!l&&c;if(u&&a.isCollapsed()&&(u=!KT(kD(a.anchor,!0))),!u){jD(r,HC,!0);let e=$();AC&&Q(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!Q(a))return t!==`historyUndo`&&t!==`historyRedo`||(e.preventDefault(),jD(r,t===`historyUndo`?ZC:QC)),!0;let o=e.data;i.unprocessedBeforeInputData!==null&&bD(!1,r,i.unprocessedBeforeInputData);let s=!1;if((!a.dirty||i.unprocessedBeforeInputData!==null)&&a.isCollapsed()&&!YT(a.anchor.getNode())&&n!==null){let{key:e,offset:i,type:o}=a.anchor,c=r._slotsUsed&&JA(a.anchor);a.applyDOMRange(n);let l=t.endsWith(`Forward`);if(!1!==c&&(l||t.endsWith(`Backward`))){let n=DA(e,i,o),{anchor:r,focus:u}=a,d=!XA(JA(r),c)||!XA(JA(u),c),f=!d&&c!==null&&(l?r.isBefore(n)||u.isBefore(n):n.isBefore(r)||n.isBefore(u));(d||f)&&(r.set(e,i,o),u.set(e,i,o),s=f&&t===`deleteContentForward`)}}i.unprocessedBeforeInputData=null;let c=a.anchor,l=a.focus,u=c.getNode(),d=l.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===` `)e.preventDefault(),jD(r,UC,!1);else if(o===NC)e.preventDefault(),jD(r,WC);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),a.insertRawText(t)}else o!=null&&$k(a,n,o,e.timeStamp,!0)?(e.preventDefault(),jD(r,GC,o),dA(o)):i.unprocessedBeforeInputData=o;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:jD(r,GC,e),dA((e.dataTransfer?e.dataTransfer.getData(`text/plain`):null)??e.data);break;case`insertFromComposition`:{i.compositionPhase=`idle`;let t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let n=r._compositionKey;tD(null),t||jD(r,GC,e),hA(n);break}case`insertLineBreak`:tD(null),i.isInsertLineBreak=!1,jD(r,UC,!1);break;case`insertParagraph`:tD(null),i.isInsertLineBreak?(i.isInsertLineBreak=!1,jD(r,UC,!1)):jD(r,WC);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:jD(r,KC,e);break;case`deleteByComposition`:(function(e,t){return e!==t||Z(e)||Z(t)||!qE(e)||!qE(t)})(u,d)&&jD(r,qC,e);break;case`deleteByDrag`:LD(`skip-selection-focus`),jD(r,qC,e);break;case`deleteByCut`:jD(r,qC,e);break;case`deleteContent`:jD(r,HC,!1);break;case`deleteWordBackward`:jD(r,JC,!0);break;case`deleteWordForward`:jD(r,JC,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:jD(r,YC,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:jD(r,s?HC:YC,!1);break;case`formatStrikeThrough`:jD(r,XC,`strikethrough`);break;case`formatBold`:jD(r,XC,`bold`);break;case`formatItalic`:jD(r,XC,`italic`);break;case`formatUnderline`:jD(r,XC,`underline`);break;case`historyUndo`:jD(r,ZC);break;case`historyRedo`:jD(r,QC)}return!0}function iye(e,t){e.stopPropagation();let n=t._inputState;fA(n),Kk(t,()=>{mA(e,t)||t.dispatchCommand($he,e)},{event:e}),n.unprocessedBeforeInputData=null}function aye(e){let t=Ak(),n=t._inputState,r=$(),i=e.data,a=uA(e),o=!1,s=!1;if(i!=null&&Q(r)){let c=QD(VD(t)),l=c===null?null:oO(c,t._rootElement),u=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&!t.isComposing();u&&(n.hadOrphanedCompositionEvents=!0);let d=r.anchor.getNode(),f=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&t.isComposing()&&uE(d)&&JE(d);if(!u&&!f&&$k(r,a,i,e.timeStamp,!1,l)){if(o=!0,n.compositionPhase===`ending-firefox`){let e=gA(t,i);if(n.compositionPhase=`idle`,e)return LD(`composition-end`),mD(),!0}let a=r.anchor.getNode();if(c===null||l===null)return!0;let u=r.isBackward(),d=u?r.anchor.offset:r.focus.offset,f=u?r.focus.offset:r.anchor.offset;EC&&!r.isCollapsed()&&uE(a)&&l.anchorNode!==null&&a.getTextContent().slice(0,d)+i+a.getTextContent().slice(d+f)===yD(l.anchorNode)||(jD(t,GC,i),s=e.inputType===`insertText`);let p=i.length;TC&&p>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(r.anchor.offset-=p,r._cachedNodes=null,r._cachedIsBackward=null),AC&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,tD(null))}}return o||(bD(!1,t,i===null?void 0:i),n.compositionPhase===`ending-firefox`&&(gA(t,i||void 0),LD(`composition-end`),n.compositionPhase=`idle`)),mD(s),!0}function oye(e,t){jD(t,ege,e)}function sye(e){let t=Ak(),n=t._inputState,r=$();if(Q(r)&&!t.isComposing()){n.compositionPhase=`composing`,n.hadOrphanedCompositionEvents=!1;let i=r.anchor,a=r.anchor.getNode();if(tD(i.key),LD(`composition-start`),e.timeStamp({key:e,modifiers:t,onMatch:(e,t)=>{jD(t,n,e)}}),t=(e,t,n,r)=>({key:e,modifiers:t,onMatch:(e,t)=>{e.preventDefault(),jD(t,n,r)}}),n=(e,t)=>({key:`Enter`,modifiers:e,onMatch:(e,n)=>{let r=n._inputState;r.isInsertLineBreak=t&&(!DC||r.isShiftKeyDown),jD(n,ow,e),e.defaultPrevented&&(r.isInsertLineBreak=!1)}}),r=(e,t)=>({key:e,modifiers:bw,onMatch:(e,n)=>{let r=n._editorState._selection;r===null||Q(r)||HE(e)||(e.preventDefault(),jD(n,t,e))}});return[e(`ArrowRight`,bA,ew),e(`ArrowLeft`,bA,nw),e(`ArrowUp`,xA,iw),e(`ArrowDown`,xA,aw),n({..._A,shiftKey:!0},!0),n({..._A,shiftKey:!1},!1),e(` `,_A,rge),{key:`Backspace`,modifiers:bA,onMatch:(e,t)=>{jD(t,sw,e)&&pA(t._inputState)}},e(`Escape`,_A,cw),e(`Delete`,{},lw),t(`Backspace`,mge,JC,!0),t(`Delete`,mge,JC,!1),t(`b`,bw,XC,`bold`),t(`u`,bw,XC,`underline`),t(`i`,bw,XC,`italic`),e(`Tab`,bA,uw),t(`z`,bw,ZC,void 0),t(`z`,{...bw,shiftKey:!0},QC,void 0),...wC?[{key:`o`,modifiers:vA,onMatch:(e,t)=>{e.preventDefault(),jD(t,UC,!0)}},e(`ArrowLeft`,{metaKey:!0,...bA},rw),e(`ArrowRight`,{metaKey:!0,...bA},tw),t(`h`,vA,HC,!0),t(`d`,vA,HC,!1),t(`Backspace`,yA,YC,!0),t(`Delete`,yA,YC,!1),t(`k`,vA,YC,!1)]:[e(`Home`,bA,rw),e(`End`,bA,tw),t(`y`,vA,QC,void 0)],{key:`a`,modifiers:bw,onMatch:(e,t)=>{e.preventDefault(),jD(t,_w,e)&&pA(t._inputState)}},r(`c`,hw),r(`x`,gw)]}()),t._keyDownShortcuts=n);let r=n.match(e);return r&&r.onMatch(e,t),function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(fge,e),!0}function SA(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}function CA(e,t,n,r){if(r!==void 0)for(let e of r.editors)e._inputState.isSelectionChangeFromMouseDown=!1;let i=oO(t,e._rootElement).anchorNode;(dO(i)||YE(i))&&pD(aj(sj(),t,e,n))}var wA=new Map;function TA(e){let t=e.target;if(dO(t)&&(t.nodeName===`INPUT`||t.nodeName===`TEXTAREA`))return;let n=bve(t);if(n===null)return;let r=PD(t),i=null,a=r===null?void 0:Qk.get(r);if(r!==null){if(a!==void 0){let e=a.editors,t=a.hasShadowEditor;if(t===void 0){t=!1;for(let n of e)if(n._rootElement!==null&&$D(n._rootElement.getRootNode())){t=!0;break}a.hasShadowEditor=t}if(t){let t=null;for(let r of e){let e=r._rootElement;if(e===null)continue;let a=oO(n,e).anchorNode;if(a!==null&&GE(a)===r){if($D(e.getRootNode())){i=r;break}t===null&&(t=r)}}i===null&&t!==null&&(i=t)}else{let e=n.anchorNode;e===null||dO(e)&&e.shadowRoot!==null||(i=GE(e))}}if(i===null){let e=cO(r);i=e===null?null:GE(e)}}if(i===null)return;i._inputState.isSelectionChangeFromMouseDown&&Kk(i,()=>CA(i,n,e,a));let o=_D(i),s=o[o.length-1],c=s._key,l=wA.get(c),u=l||s;u!==i&&tA(n,u,!1),tA(n,i,!0),i===s?l&&wA.delete(c):wA.set(c,i)}function pye(e){e._lexicalHandled=!0}function mye(e){return!0===e._lexicalHandled}var EA=Xhe(),hye=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offsete&&(r=e)}else if(!Z(t)){let e=t.getNextSibling();if(uE(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function gye(e,t){if(Z(t)){let n=t.getLastDescendant();Z(n)||uE(n)?OA(e,n):OA(e,t)}else OA(e,t)}function kA(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=lE();if(o.setFormat(n),o.setStyle(r),ME(a))a.splice(0,0,[o]);else if(a!==null){let e=GD(i)?jE().append(o):o;a.insertBefore(e)}else if(GD(i)){let e=i.getLastChild();Z(e)&&!e.isInline()&&e.isEmpty()?e.append(o):i.append(jE().append(o))}else i.append(o);e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}function AA(e,t,n){let r=e.format,i=e.style;if(!e.isCollapsed()){let a=(e.focus.isBefore(e.anchor)?e.focus:e.anchor).getNode();if(uE(a)&&(r=a.getFormat(),i=a.getStyle()),e.removeText(),e.format=r,e.style=i,t===``&&!n)return;if(nD()===null)return e.anchor.type===`element`&&kA(e.anchor,e.focus,r,i),void jA(e,t,r,i)}e.anchor.type===`element`&&kA(e.anchor,e.focus,r,i);let a=e.anchor.getNode();uE(a)||bC(398);let o=e.anchor.offset,s=a.getParentOrThrow(),c=a.getTextContentSize();if(JE(a)||o===0&&(!a.canInsertTextBefore()||!s.canInsertTextBefore()&&!a.__prev)||o===c&&(!a.canInsertTextAfter()||!s.canInsertTextAfter()&&!a.__next)){if(a.isSegmented()&&o!==0&&o!==c){if(nD()!==null)a.setMode(`normal`).setFormat(r).setStyle(i),Ak()._inputState.composedSegmentedKey=a.getKey();else{let t=lE(a.getTextContent());t.setFormat(r),t.setStyle(i);let n=$()===e;a.replace(t),e.setTextNodeRange(t,o,t,o),n&&$()!==e&&pD(e)}(t!==``||n)&&AA(e,t,n);return}if(t===``&&!n)return;if(o===0||o===c){let c=o===0,l=c?`previous`:`next`,u=eM(a,l).getNodeAtCaret(),d;uE(u)&&(c?u.canInsertTextAfter():u.canInsertTextBefore())&&!JE(u)?d=u:(d=lE().setFormat(r).setStyle(i),eM((c?s.canInsertTextBefore():s.canInsertTextAfter())?a:s,l).insert(d));let f=c?void 0:0;d.select(f,f),AA(e,t,n);return}let l=lE(t);l.setFormat(r),l.setStyle(i),a.replace(l),l.select();return}if(t===``&&!n)return;let l=s.isInline()&&o===0&&!a.__prev,u=s.isInline()&&o===c&&!a.__next,d=a.getFormat()!==r||a.getStyle()!==i;if(l||u||d){if(a.getTextContent()!==``||l||u)return void jA(e,t,r,i);a.setFormat(r),a.setStyle(i)}a.spliceText(o,0,t,!0),a.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}function jA(e,t,n,r){let i=e.anchor.getNode();uE(i)||bC(398);let a=e.anchor.offset,o=lE(t).setFormat(n).setStyle(r),s=i.getParentOrThrow(),c=a===0,l=c||a===i.getTextContentSize();if(l&&s.isInline()&&!(c?i.__prev:i.__next))eM(s,c?`previous`:`next`).insert(o);else{let e=l?i:i.splitText(a)[0];c?e.insertBefore(o,!1):e.insertAfter(o,!1)}i.getTextContent()===``&&i.isAttached()&&i.remove(),o.selectEnd(),o.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}var MA=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!FA(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter(e=>Nj(e)===null),n=t.length;if(n===0)return;let r=t[n-1],i;if(uE(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;eNj(e)===null);if(($()||sj())===this&&e[0]){let t=eM(e[0],`next`);mE(dM(t,t))}for(let t of e)t.remove();NA()}};function NA(){let e=dD();if(e.getChildrenSize()===0&&Ij($())===null){let t=jE();e.append(t),t.select()}}function Q(e){return e instanceof PA}var PA=class e{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Q(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=0;for(let n of e)if($j(n)){let{origin:e}=n;t.length===0?i.add(e):(a++,t.push(e))}else{let{origin:e}=n;Z(e)&&a!==0?a--:t.push(e)}if(r&&t.push(r.caret.origin),Qj(e.focus)&&Z(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=iM(e.focus.origin,`previous`);$j(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=oM(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!Z(e)||a>0||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=bE(e.anchor),r=bE(e.anchor.getFlipped()),i=e=>Zj(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(SE(gE(this),`next`));return Ek()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`),this}getTextContent(){if(this.isCollapsed())return``;let e=this.getNodes(),t=gE(this).getTextSlices(),n=``,r=!0;for(let i=0;i(Z(e)||KT(e))&&!e.isInline())){Z(i)||bC(211,r.constructor.name,r.getType());let[t,n]=vj(this,!0);(Z(t)?t:i).splice(n,0,e),a.selectEnd();return}if(i===null){let t=bj(e),n=t.getLastDescendant(),r=fE(this.anchor,`next`);for(let e of t.getChildren())r=OE(e,r);n!==null&&n.selectEnd();return}if(Z(i)&&(Nj(i)!==null||!i.isParentRequired()&&!GD(i.getParentOrThrow()))){let[,t]=vj(this),n=_j(e);i.splice(t,0,n);let r=n[n.length-1];r===void 0?i.select(t,t):r.selectEnd();return}let o=bj(e),s=o.getLastDescendant(),c=o.getChildren(),l=function(e){let t=function(e){let t=e.getNode();if(e.offset>0)return e.type===`element`&&Z(t)?t.getChildAtIndex(e.offset-1):null;for(let e=t;e!==null&&!gO(e)&&!GD(e);e=e.getParent()){let t=e.getPreviousSibling();if(t!==null)return t}return null}(e);return ok(t)&&ok(t.getPreviousSibling())}(n),u=Z(i)&&i.isEmpty()?null:this.insertParagraph();u&&!i.isAttached()&&(r=this.anchor.getNode(),i=XO(r,gO));let d=c[c.length-1],f=c[0];var p=f;l||!Z(p)||!gO(p)||p.isEmpty()||!Z(i)||i.isEmpty()&&!i.canMergeWhenEmpty()||(Z(i)||bC(211,r.constructor.name,r.getType()),i.append(...f.getChildren()),f=c[1]),f&&(i===null&&bC(212,r.constructor.name,r.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||bC(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(i,f));let m=XO(s,gO),h=s.selectEnd();u&&(Z(m)&&(u.canMergeWhenEmpty()||gO(d))?(m.append(...u.getChildren()),u.remove()):u.isEmpty()&&u.remove()),Z(i)&&i.isEmpty()&&i.remove();let g=Z(i)?i.getLastChild():null;ok(g)&&m!==i&&g.remove();let _=bE(fE(h.anchor,`next`));pE(h.anchor,_),pE(h.focus,_)}insertParagraph(){this.isCollapsed()||this.removeText();let e=this.anchor.getNode();if(this.anchor.type===`element`&&GD(e)){let t=jE();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let[,t]=vj(this),n=XO(this.anchor.getNode(),gO);if(n!==null&&Nj(n)!==null)return null;Z(n)||bC(213);let r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let t=ak();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=this.getNodes();if(this.isCollapsed())return[...e];let t=this.isBackward(),n=gE(this).getTextSlices(),r=[];for(let t of e){let e=TE(n,t),i=e?EE(e,this):t;i!==null&&r.push(i)}if(e.length===1&&r.length===1&&uE(r[0])){let e=r[0],[n,i]=t?[this.focus,this.anchor]:[this.anchor,this.focus];n.set(e.getKey(),0,`text`),i.set(e.getKey(),e.getTextContentSize(),`text`)}return r}modify(e,t,n){if(xj(this,e,t,n))return;let r=e===`move`,i=Ak(),a=QD(VD(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();s===null||o===null||!Z(c)||c.isInline()||c.canBeEmpty()||ZD(o,i,s);let l=MD(i,this.focus.key),u=l;if(this.focus.type===`text`&&(u=uE(c)?bO(c,l,i):null),this.dirty){let e=MD(i,this.anchor.key),t=e;if(this.anchor.type===`text`){let n=this.anchor.getNode();t=uE(n)?bO(n,e,i):null}t&&u&&fj(a,t,this.anchor.offset,u,this.focus.offset)}if(n===`character`&&uE(c)&&c.isUnmergeable()&&(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let e=eM(c,t?`previous`:`next`).getNodeAtCaret();if(uE(e)){if(!r){let n=e.getTextContentSize();t?this.focus.set(e.__key,n-1,`text`):this.focus.set(e.__key,1,`text`),this.dirty=!0;return}{let n=i.getElementByKey(e.getKey()),r=n?bO(e,n,i):null;if(r){let e=t?r.length:0;fj(a,r,e,r,e)}}}}if(VA(a,e,t?`backward`:`forward`,n,s),a.rangeCount>0){let e=iO(a,i._rootElement),n=e||a.getRangeAt(0),o=this.anchor.getNode(),s=YT(o)?o:UD(o);this.applyDOMRange(n),this.dirty=!0,r||(HA(this,t,s),(e?a.direction!==`backward`:a.anchorNode===n.startContainer&&a.anchorOffset===n.startOffset)||BA(this))}n===`lineboundary`&&xj(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&Z(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(Z(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e)){let e=Z(n)?n.getNextSibling():null;if(!(Z(n)&&n.isEmpty()&&Z(e)&&e.isShadowRoot()))return}let r=fE(t,e?`previous`:`next`),i=lM(r);if(i.getTextSlices().every(e=>e===null||e.distance===0)){if(t.type===`element`){let e=r.getNodeAtCaret();if(Z(e)&&XD(e)){let t=e.getParent();e.remove();let n=fD(t,e);n!==null&&n.selectStart();return}}let e={type:`initial`};for(let t of i.iterNodeCarets(`shadowRoot`))if($j(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(Z(i.anchor.origin)&&i.anchor.origin.isEmpty()){let e=bE(t);hE(this,dM(e,e)),i.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(Qj(t)){if(Z(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(i.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(KT(t.origin)){if(!t.origin.isIsolated()){if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&Z(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let e=rj();e.add(t.origin.getKey()),pD(e)}else{let e=t.origin,n=e.getParent();e.remove();let r=fD(n,e);r!==null&&r.selectStart()}}return}if(ok(t.origin))return void t.origin.remove();break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return Rj(n).length>0?void 0:t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(hE(this,dM(!t.origin.isEmpty()&&n.isEmpty()?_E(eM(n,t.direction)):i.anchor,t)),this.removeText())}for(let e=t.getNode();e!==null;){if(Nj(e)!==null)return;if(Z(e)&&e.isShadowRoot())break;e=e.getParent()}}let a=this.focus;if(UA(this,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&function(e,t){for(let n=t;n;n=n.getParent()){if(Z(n)){if(n.collapseAtStart(e))return!0;if(GD(n))break}if(n.getPreviousSibling())break}return!1}(this,t.getNode()))return}else{let r=a.type===`text`?a.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=a.offset,i=r.getTextContentSize();if(r.is(n)||e&&t!==i||!e&&t!==0)return void GA(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void GA(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,o=r.offset,s=e{for(let[t,r]of n)e=QE(e,t,r?FC[t]:0);return e})}function RA(e,t,n=null){let r=n===null&&Q(e)?QE(e.format,t,null):n;LA(e,e=>QE(e,t,r))}function zA(e){let t=dD();!t.isEmpty()&&kE(t,e)&&(e.anchor.set(t.getKey(),0,`element`),e.focus.set(t.getKey(),t.getChildrenSize(),`element`))}function BA(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}function VA(e,t,n,r,i){let a=r===`character`?oO(e,i):null,o=a&&a.focusNode,s=a?a.focusOffset:0;if(e.modify(t,n,r),a===null||!function(e,t,n){return e!==null&&e.nodeType===3&&(n===`backward`?t>0:n===`forward`&&tzD(e,n));if(i.length===0||i.length===r.length)return!1;let a=t?i[0]:i[i.length-1],o=Z(a)?a:a.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function UA(e,t,n){if(xj(e,`extend`,t,n))return!1;let r=Ak(),i=QD(VD(r));if(!i||typeof i.modify!=`function`)return!1;let a=r._blockCursorElement,o=r._rootElement,s=e.anchor,c=e.focus.getNode();o===null||a===null||!Z(c)||c.isInline()||c.canBeEmpty()||ZD(a,r,o);let l=e=>{let t=e.getNode(),n=r.getElementByKey(e.key);return n!==null&&e.type===`text`&&uE(t)?bO(t,n,r):n},u=s.getNode(),d=l(s);if(d===null)return!1;let f=s.offset,p=e.isCollapsed(),m=e.focus,h=p?d:l(m);if(h===null)return!1;let g=m.offset;if(fj(i,h,g,h,g),VA(i,`move`,t?`backward`:`forward`,n,o),i.rangeCount===0)return!1;let _=iO(i,o)||i.getRangeAt(0),v=_.startContainer,y=_.startOffset;if(n===`lineboundary`&&YE(v)&&GE(v)===r){let e=hD(v);if(KT(e)&&e.isInline()&&!e.isIsolated()){let n=r.getElementByKey(e.getKey());n!==null&&n.contains(v)&&(v=n,y=t?0:n.childNodes.length)}}if(p&&n===`character`&&s.type===`text`&&uE(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let n=eM(u,t?`previous`:`next`).getNodeAtCaret();if(uE(n)){let r=t?n.getTextContentSize()-1:1;return e.focus.set(n.__key,r,`text`),e.dirty=!0,!1}}if(p&&n===`character`&&s.type===`text`){let n=t?0:u.getTextContentSize(),r=v===d?y:f===n?-1:n;if(r>=0)return r!==f&&(e.focus.set(s.key,r,`text`),e.dirty=!0),!1}let b=r._slotsUsed&&cD(v),x=b?Fj(u):null,S=b?Fj(b):null;if(b&&!XA(S,x)&&WA(e.focus,u,x,S,`deletion`,()=>!t))return!0;let[C,w,T,ee]=t?[v,y,d,f]:[d,f,v,y],E=YT(u)?u:UD(u);return e.applyDOMRange({collapsed:!1,endContainer:T,endOffset:ee,startContainer:C,startOffset:w}),e.dirty=!0,!HA(e,t,E)&&t&&BA(e),!1}function WA(e,t,n,r,i,a){let o=r&&function(e,t){for(let n=Pj(e);n!==null;){let e=Fj(n);if(XA(e,t))return e!==null||n.isAttached()?n:null;n=e&&Pj(e)}return null}(r,n);if(o===null&&n===null)return!1;let s=a(),c=o&&o.getParent(),l,u;if(o===null||c===null||t!==null&&(o.is(t)||o.isParentOf(t))){let t=o||n;if(!Z(t))return t!==null&&function(e,t,n){Z(t)?e.set(t.getKey(),n?t.getChildrenSize():0,`element`):e.set(t.getKey(),n?t.getTextContentSize():0,`text`)}(e,t,s),!0;l=t,u=s?t.getChildrenSize():0}else l=c,u=o.getIndexWithinParent()+ +(s===(i===`selection`));return i===`deletion`?function(e,t,n,r){for(;;){let i=t.getChildAtIndex(r?n:n-1);if(uE(i))return void e.set(i.getKey(),r?0:i.getTextContentSize(),`text`);if(!Z(i)||GD(i))break;t=i,n=r?0:i.getChildrenSize()}e.set(t.getKey(),n,`element`)}(e,l,u,!s):e.set(l.getKey(),u,`element`),!0}function vye(){try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1}var yye=vye();function GA(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;en||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function KA(e,t,n,r){let i,a=t,o=!1;if(dO(e)){let s=!1,c=e.childNodes,l=c.length,u=r._blockCursorElement;a===l&&l>0&&(s=!0,a=l-1),sD(e,r)!==void 0||kO(e,r)||(o=!0);let d=c[a],f=!1;if(d===u)d=c[a+1],f=!0;else if(u!==null){let n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&a--}if(i=hD(d),uE(i))a=nM(i,s?`next`:`previous`);else{let c=hD(e);if(c===null)return null;if(Z(c)){let o=r.getElementByKey(c.getKey());o===null&&bC(214);let l=yO(c,o,r);[c,a]=l.resolveChildIndex(c,o,e,t),Z(c)||bC(215),s&&a>=c.getChildrenSize()&&(a=Math.max(0,c.getChildrenSize()-1));let u=c.getChildAtIndex(a);if(Z(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=s?u.getLastDescendant():u.getFirstDescendant();e===null?c=u:(u=e,c=Z(u)?u:u.getParentOrThrow()),a=0}uE(u)?(i=u,c=null,a=nM(u,s?`next`:`previous`)):u!==c&&s&&!f&&(Z(c)||bC(216),a=Math.min(c.getChildrenSize(),a+1))}else{let n=Pj(c),i=n===null?c:n,o=i.getIndexWithinParent(),s=r.getElementByKey(c.getKey()),l=`after`;if(s!==null&&hD(e)===c){let n=yO(c,s,r);n.element===s?t===0&&KT(c)&&(l=`before`):l=n.resolveLeafPosition(s,e,t)}a=l===`before`?o:o+1,c=i.getParentOrThrow()}if(Z(c))return[DA(c.__key,a,`element`),o]}}else i=hD(e);return uE(i)?[DA(i.__key,nM(i,a,`clamp`),`text`),o]:null}function qA(e,t,n){let r=e.getNode();if(rD(r))return;let i=e.offset===0;if(!i&&e.offset!==r.getTextContent().length)return;let a=i?`previous`:`next`,o=eM(r,a).getNodeAtCaret();if(i===t||!Z(o)||!o.isInline()||i&&n){if(i&&!t)uE(o)&&!r.isUnmergeable()&&e.set(o.__key,o.getTextContent().length,`text`);else if(o===null&&(n||!i&&t)){let t=r.getParent();if(Z(t)&&t.isInline()&&(i||!t.canInsertTextAfter()&&t.getTextContentSize()>1)){let n=eM(t,a).getNodeAtCaret();uE(n)&&e.set(n.__key,i?n.getTextContent().length:0,`text`)}}}else e.set(o.__key,i?o.getChildrenSize():0,`element`)}function JA(e){let t=iD(e.key);return t===null?null:Fj(t)}function YA(e,t,n){let r=JA(e),i=JA(t);return!XA(r,i)&&WA(t,iD(e.key),r,i,`selection`,n)}function XA(e,t){return e===null?t===null:e.is(t)}function ZA(e){let t=YA(e.anchor,e.focus,()=>function(e,t){let n=function(e,t){let n=new Map;for(let t=null,r=e;r!==null;t=r,r=mM(r))n.set(r.getKey(),t);for(let e=null,r=t;r!==null;e=r,r=mM(r)){let t=n.get(r.getKey());if(t===void 0)continue;let i=r.getLatest();return t===null?e===null?{commonAncestor:i,type:`same`}:{b:e,commonAncestor:i,type:`ancestor`}:e===null?{a:t,commonAncestor:i,type:`descendant`}:{a:t,b:e,commonAncestor:i,type:`branch`}}return null}(e.origin,t.origin);if(n===null)return null;switch(n.type){case`same`:return hM(e,t);case`ancestor`:return e.type===`child`&&Nj(n.b)===null?-1:1;case`descendant`:return t.type===`child`&&Nj(n.a)===null?1:-1;case`branch`:{let e=Nj(n.a)&&n.a.getKey(),t=Nj(n.b)&&n.b.getKey();if(e&&t){for(let r of Lj(n.commonAncestor).values())if(r===e||r===t)return r===e?-1:1}return e?-1:t?1:n.a.isBefore(n.b)?-1:1}}}(fE(e.anchor,`next`),fE(e.focus,`next`))!==1);return t&&(e.dirty=!0),t}function QA(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;let r=0;for(let e=n&&n.previousSibling;e;e=e.previousSibling)r++;return r}function $A(e,t,n,r,i,a){if(e===null||n===null||!UE(i,e,n))return null;let o=KA(e,t,Q(a)?a.anchor:null,i);if(o===null)return null;let s=KA(n,r,Q(a)?a.focus:null,i);if(s===null)return null;let[c,l]=o,[u,d]=s;if(c.type===`element`&&u.type===`element`){let t=hD(e),r=hD(n);if(KT(t)&&KT(r))return null}let f=i._slotsUsed&&YA(c,u,()=>function(e,t,n,r){if(e===n)return r>=t;let i=e.compareDocumentPosition(n);return i&Node.DOCUMENT_POSITION_CONTAINED_BY?QA(e,n)>=t:i&Node.DOCUMENT_POSITION_CONTAINS?r>QA(n,e):(i&Node.DOCUMENT_POSITION_FOLLOWING)!==0}(e,t,n,r));return function(e,t){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);qA(e,n,r),qA(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}(c,u),[c,u,l||d||f]}function ej(e){return Z(e)&&!e.isInline()}function tj(e,t,n,r,i,a){let o=kk(),s=new PA(DA(e,t,i),DA(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function nj(){return new PA(DA(`root`,0,`element`),DA(`root`,0,`element`),0,``)}function rj(){return new MA(new Set)}function ij(e,t){return aj(null,e,t,null)}var bye=new Set([` `,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`Backspace`,`Delete`,`End`,`Enter`,`Home`,`Tab`]);function aj(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=o===`keydown`&&a,l=c&&lO(c),u=c&&(c.ctrlKey||c.metaKey||bye.has(c.key))&&fO(l)&&GE(l)===n,d=!kw&&(s||u||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),f,p,m,h;if(Q(e)&&!d)return e.clone();{if(t===null)return null;let r=oO(t,n._rootElement);if(f=r.anchorNode,p=r.focusNode,m=r.anchorOffset,h=r.focusOffset,(s||u||o===void 0)&&Q(e)&&!UE(n,f,p))return e.clone()}let g=$A(f,m,p,h,n,e);if(g===null)return null;let[_,v,y]=g,b=Q(e)?e:null,x=new PA(_,v,b?b.format:0,b?b.style:``);return b&&oj(x,b.anchor.key),x.dirty=y,x}function oj(e,t){let n=e.anchor;if(n.key===t)return;let r=n.getNode(),i=0,a=``;uE(r)?(i=r.getFormat(),a=r.getStyle()):Z(r)&&(i=r.getTextFormat(),a=r.getTextStyle()),e.format===i&&e.style===a||(e.format=i,e.style=a,e.dirty=!0)}function $(){return kk()._selection}function sj(){return Ak()._editorState._selection}function cj(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function lj(e,t,n,r=1){if(cj(e,t))for(let i of[e.anchor,e.focus]){i.key===t.__key&&(n<=i.offset&&r>0||n=t,r=e.getChildAtIndex(n?t-1:i.offset);uE(r)&&i.set(r.__key,n?r.getTextContentSize():0,`text`)}}}function uj(e,t,n,r,i){let a=r||i;if(uE(a)||Z(a)){let t=uE(a);e.set(a.__key,r===null?0:t?a.getTextContentSize():a.getChildrenSize(),t?`text`:`element`)}else{let r=t.getIndexWithinParent();e.set(n.__key,r===-1?n.getChildrenSize():r,`element`)}}function dj(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function fj(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function pj(e,t,n){let r=MD(e,t.getKey());if(Z(t)){let i=yO(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function xye(e,t,n,r,i,a){let o=a.getRootNode(),s=XE(o)||$D(o)?cO(o):null;if(i.has(`collaboration`)&&s!==a||s!==null&&VE(s,s))return;let c=oO(r,a),l;if(!Q(t))return void(e!==null&&UE(n,c.anchorNode,c.focusNode)&&r.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[m,h]=pj(n,f,u.offset),[g,_]=pj(n,p,d.offset),v=t.format,y=t.style,b=t.isCollapsed(),x=m,S=g,C=!1;if(u.type===`text`?(x=uE(f)?bO(f,m,n):null,C=f.getFormat()!==v||f.getStyle()!==y):Q(e)&&e.anchor.type===`text`&&(C=!0),d.type===`text`&&(S=uE(p)?bO(p,g,n):null),x===null||S===null)return;let w=b&&uE(p)&&rD(p)&&YE(S)&&S.nodeValue===MC?MC.length:_;if(b&&(e===null||C||Q(e)&&(e.format!==v||e.style!==y))&&function(e,t,n,r,i,a){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:a}}(n,v,y,u.offset,u.key,performance.now()),(r.type!==`Range`||!b)&&c.anchorOffset===h&&c.focusOffset===w&&c.anchorNode===x&&c.focusNode===S){if(s===null||!a.contains(s)){let e=s===null?null:GE(s);e!==null&&e!==n||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0})}if(u.type!==`element`)return}if(fj(r,x,h,S,w),TC&&t.isCollapsed()&&a!==null&&!i.has(`skip-selection-focus`)){let e=sO(a);if(e===null||!a.contains(e)){let e=cO(a.ownerDocument),t=e===null?null:GE(e);t!==null&&t!==n||a.focus({preventScroll:!0})}}if(!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===sO(a)){let e=Q(t)&&t.anchor.type===`element`?function(e,t,n){let r=t.childNodes[n];if(!dO(r))return r||null;let i=sD(r,e),a=i===void 0?null:iD(i);return a===null||Z(a)?r:yO(a,r,e).element}(n,x,h):(l===void 0&&(l=aO(r,a)),l);if(e!==null){let t;if(YE(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=dO(e)?e.getBoundingClientRect():function(e){let t=e.getBoundingClientRect(),{startContainer:n,startOffset:r}=e;if(!e.collapsed||t.width!==0||t.height!==0||!YE(n)||n.length===0)return t;let i=e.cloneRange();return r>0?i.setStart(n,r-1):i.setEnd(n,1),i.getBoundingClientRect()}(e);(function(e,t,n,r=null){let i=PD(n),a=BD(i);if(i===null||a===null)return;let o=n.getBoundingClientRect();if(t.bottom0){let{left:e,right:i}=t,o=dO(r)?r:ND(r);for(;o!==null&&n.contains(o);){let t=yve(a,o,e,i);e-=t,i-=t,o=o===n?null:ND(o)}}let{top:s,bottom:c}=t,l=0,u=0,d=n;for(;d!==null;){let t=d===i.body;if(t){let t=a.visualViewport;if(t){let e=t.offsetTop;l=e,u=e+t.height}else l=0,u=VD(e).innerHeight;let n=a.getComputedStyle(i.documentElement),r=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);isFinite(r)&&(l+=r),isFinite(o)&&(u-=o)}else{let e=d===n?o:d.getBoundingClientRect();l=e.top,u=e.bottom}let r=0;if(su&&(r=c-u),r!==0){if(t)a.scrollBy(0,r);else{let e=d.scrollTop;d.scrollTop+=r;let t=d.scrollTop-e;s-=t,c-=t}}if(t)break;d=ND(d)}})(n,t,a,x)}}(function(e,t,n,r,i){let a=e._inputState;a.isSelectionChangeFromDOMUpdate=!0,a.selectionChangeFromDOMUpdatePoints=t!==void 0&&n!==void 0&&r!==void 0&&i!==void 0?{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:i}:null})(n,x,h,S,w)}function mj(e){let t=$()||sj();t===null&&(t=dD().selectEnd()),t.insertNodes(e)}function hj(e,t){for(let n of e.split(/(\r?\n|\t)/))n===` `||n===`\r `?t.linebreak():n===` `?t.tab():n!==``&&t.text(n)}function gj(e){let t=[];return hj(e,{linebreak:()=>t.push(ak()),tab:()=>t.push(PE()),text:e=>t.push(lE(e))}),t}function Sye(){let e=$();return e===null?``:e.getTextContent()}function _j(e){let t=[];for(let n of e)ok(n)||(!Z(n)&&!KT(n)||n.isInline()?t.push(n):Z(n)&&t.push(..._j(n.getChildren())));return t}function vj(e,t=!1){let n=e;e.isCollapsed()||n.removeText();let r=$();Q(r)&&(n=r),Q(n)||bC(161);let i=n.anchor,a=i.getNode(),o=i.offset;for(;!gO(a)&&Nj(a)===null;){let e=a;if([a,o]=Cye(a,o,t),e.is(a))break}return[a,o]}function Cye(e,t,n=!1){let r=e.getParent();if(!r){let e=jE();return dD().append(e),e.select(),[dD(),0]}if(uE(e)){let n=e.splitText(t);if(n.length===0)return[r,e.getIndexWithinParent()];let i=t===0?0:1;return[r,n[0].getIndexWithinParent()+i]}if(!Z(e)||t===0)return[r,e.getIndexWithinParent()];let i=e.getChildAtIndex(t);if(i){let r=new PA(DA(e.__key,t,`element`),DA(e.__key,t,`element`),0,``),a=e.insertNewAfter(r);if(a)a.append(i,...i.getNextSiblings());else if(n)return[e,t]}return[r,e.getIndexWithinParent()+1]}function yj(e){return ok(e)||HD(e)||uE(e)||e.isParentRequired()}function bj(e){let t=jE(),n=null;for(let r=0;re.type===`element`&&e.key===n.__key&&e.offset===r+1):null;return t&&n&&r!==-1&&t.isBackward(),Tj(e),t&&n&&r!==-1&&lj(t,n,r,-1),t&&(t._cachedIsBackward=null),i}function Dj(e,t,n,r){Dk();let i=t===`next`;JD(e,n);let a=e.getWritable(),o=n.getWritable();e.getParentOrThrow();let s=$(),c=r&&Q(s)?s:null,l=Ej(o,c),u=e.getParentOrThrow().getWritable(),d=c&&(i&&l!==null&&l.length>0||cj(c,u))?e.getIndexWithinParent()+ +!!i:-1,f=i?e.getNextSibling():e.getPreviousSibling(),p=f&&f.getWritable();if(wj(u,o,i?a:p,i?p:a),u.__size++,c&&d!==-1&&(lj(c,u,d),i&&l!==null))for(let e of l)e.set(u.__key,d+1,`element`);return n}function Oj(e,t,n){Dk();let{origin:r,direction:i}=e,a=i===`next`,o=Pj(r);if(o!==null)return a?o.selectNext(t,n):o.selectPrevious(t,n);let s=e.getNodeAtCaret(),c=r.getParentOrThrow();if(s===null)return a?c.select():c.select(0,0);if(Z(s))return a?s.select(0,0):s.select();if(uE(s))return s.select(t,n);let l=s.getIndexWithinParent()+ +!a;return c.select(l,l)}function kj(e,t){let n=[];for(let r=e;r!==null;r=t===`next`?r.getNextSibling():r.getPreviousSibling())n.push(r);return n}var Aj=new Map;function jj(e){return Z(e)||KT(e)}function Mj(e){return Z(e)||KT(e)}function Nj(e){let t=e.getLatest();return Mj(t)?t.__slotHost:null}function Pj(e){let t=Nj(e);if(t===null)return null;let n=iD(t);return Z(n)||KT(n)||bC(370),n}function wye(e){let t=Pj(e);if(t===null)return null;let n=e.getLatest().__key;for(let[e,r]of Lj(t))if(r===n)return e;return null}function Fj(e){let t=e.getLatest();for(;t!==null;){if(Nj(t)!==null)return t;t=t.getParent()}return null}function Ij(e){if(e===null)return null;let t=Q(e)?e.anchor.getNode():e.getNodes()[0]??null;return t===null?null:Fj(t)}function Lj(e){let t=e.getLatest();return jj(t)&&t.__slots!==null?t.__slots:Aj}function Rj(e){return Array.from(Lj(e).keys())}function zj(e,t){let n=Lj(e).get(t);return n===void 0?null:iD(n)}var Tye=[`__proto__`,`constructor`,`prototype`],Bj=Symbol(`slotMapOwner`);function Vj(e){let t=e.__slots;return t!==null&&t[Bj]===e||(t=new Map(t),t[Bj]=e,e.__slots=t),t}var Hj=new WeakMap,Eye=[];function Dye(e){for(let{ownNodeConfig:t}of JO(e)){let e=t&&t.slots;if(e)return e}return Eye}function Uj(e){let t=``;for(let n of Lj(e).values()){let e=iD(n);e!==null&&(t+=e.getTextContent())}return t}function Wj(e,t,n){let r=n.get(e),i=n.get(t);return r===void 0?i===void 0?et):1:i===void 0?-1:r-i}function Oye(e,t,n){t!==`__proto__`&&t!==`constructor`&&t!==`prototype`||bC(373,t);let r=e.getLatest();if(r.__slots!==null&&r.__slots.get(t)===n.getLatest().__key)return r;(!Z(n)&&!KT(n)||n.isInline())&&bC(374,n.__key);let i=e.getWritable(),a=Vj(i),o=a.get(t);o!==void 0&&kye(o);let s=n.getWritable(),c=Pj(s);if(c!==null){let e=wye(s);e!==null&&Vj(c.getWritable()).delete(e),s.__slotHost=null}return Tj(s),s.__slotHost=i.__key,a.set(t,s.__key),function(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(e){let t=Hj.get(e);if(t===void 0){let n=Dye(e),r=new Map;for(let t of n)Tye.includes(t)&&bC(371,e.name,t),r.has(t)&&bC(372,e.name,t),r.set(t,r.size);t=r,Hj.set(e,t)}return t}(e.constructor),r=null,i=!0;for(let e of t.keys()){if(r!==null&&Wj(r,e,n)>0){i=!1;break}r=e}if(i)return;let a=Array.from(t).sort(([e],[t])=>Wj(e,t,n));t.clear();for(let[e,n]of a)t.set(e,n)}(i),Ak()._slotsUsed=!0,kk()._slotsUsed=!0,i}function kye(e){let t=iD(e);if(t===null)return;let n=t.getWritable();Mj(n)||bC(377,e),n.__slotHost=null,n.remove()}var Aye={next:`previous`,previous:`next`},Gj=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return fM({hasNext:Qj,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return eM(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return eM(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&bC(263,Array.from(o).join(` `))}else i.insert(e);i=eM(e,this.direction)}for(let e of o.values())e.remove();return this}},Kj=class e extends Gj{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:iM(e,this.direction)}getParentCaret(e=`root`){return eM(Jj(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=qj(this.direction);return eM(this.getNodeAtCaret(),e)||iM(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},jye={root:YT,shadowRoot:GD};function qj(e){return Aye[e]}function Jj(e,t=`root`){return e===null||jye[t](e)?null:Nj(e)===null?e:null}var Yj=class e extends Gj{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:eM(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return Z(this.origin)?iM(this.origin,this.direction):null}getParentCaret(e=`root`){return eM(Jj(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=qj(this.direction);return eM(this.getNodeAtCaret(),e)||iM(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof Xj)&&this.direction===t.direction&&this.origin.is(t.origin)}},Xj=class e extends Gj{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:tM(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return eM(Jj(this.getParentAtCaret(),e),this.direction)}getFlipped(){return tM(this.origin,qj(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof Yj||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return eM(this.origin,this.direction)}};function Zj(e){return e instanceof Xj}function Qj(e){return e instanceof Yj}function $j(e){return e instanceof Kj}var Mye={next:class extends Xj{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Xj{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Nye={next:class extends Yj{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Yj{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Pye={next:class extends Kj{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends Kj{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function eM(e,t){return e?new Nye[t](e):null}function tM(e,t,n){return e?new Mye[t](e,nM(e,n)):null}function nM(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&xC(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function rM(e,t){return new Iye(e,t)}function iM(e,t){return Z(e)?new Pye[t](e):null}function aM(e){return e&&e.getChildCaret()||e}function oM(e){return e&&aM(e.getAdjacentCaret())}var Fye=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=this.anchor.getLatest(),t=this.focus.getLatest();return Zj(e)&&Zj(t)&&e.isSameNodeCaret(t)?[rM(e,t.offset-e.offset),null]:[Zj(e)?sM(e,`anchor`):null,Zj(t)?sM(t,`focus`):null]}iterNodeCarets(e=`root`){let t=Zj(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=Zj(n),i=t=>t.isSameNodeCaret(n)?null:oM(t)||t.getParentCaret(e);return fM({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},Iye=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n0&&e.classList.add(...n)}function CM(e,...t){let n=xM(...t);n.length>0&&e.classList.remove(...n)}function wM(e,t,n){let r=e.getElementByKey(t.getKey());if(r===null||uE(t))return[ZE(r),n];let i=r.parentNode;return i&&r.nodeName===`BR`?[i,Array.from(i.childNodes).indexOf(r)]:e.read(`latest`,()=>pj(e,t,n))}function zye(e,t,n,r,i){let a=nO(e.getRootElement()).createRange(),[o,s]=wM(e,t,n),[c,l]=wM(e,r,i),u=l;if(o===null||c===null)return null;let d=o.firstChild;o===c&&d!=null&&d.nodeName===`BR`&&s===0&&u===0&&(u=1);try{a.setStart(o,s),a.setEnd(c,u)}catch{return null}return!a.collapsed||s===u&&t.is(r)||(a.setStart(c,u),a.setEnd(o,s)),a}function TM(e){let t=_O().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function EM(e){let t=YT(e)?e:e.getParent();return t&&TM(t)}function DM(e){let t=EM(e);return t!==null&&t.direction===`rtl`}function OM(e,t,n=`self`){let r=e.getStartEndPoints();if(r!==null&&t.isSelected(e)&&!JE(t)){let[i,a]=e.isBackward()?[r[1],r[0]]:r,o=!Q(e)||i.type!==`element`&&a.type!==`element`?void 0:TE(gE(e).getTextSlices(),t),[s,c]=o?o.getSliceIndices():[t.__key===i.key?i.offset:0,t.__key===a.key?a.offset:void 0],l=t.__text.slice(s,c);l!==t.__text&&(n===`clone`&&(t=Ave(t)),t.__text=l)}return t}function Bye(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function kM(e,t,n){let r=fE(e,n);if(xE(r))return!1;for(;r;r=r.getParentCaret()){let e=r.getParentAtCaret();if(!e||r.getNodeAtCaret())return!1;if(t.is(e))return!0}return!1}function Vye(e,t,n=Bye){if(!e)return;let r=e.getStartEndPoints(),i=!1,a=null,o=new Map;if(r){let[t,n]=r,s=XO(t.getNode(),gO);a=XO(n.getNode(),gO);let c=e.isBackward()?`previous`:`next`;i=Z(a)&&!a.is(s)&&function(e,t,n){let r=e.getNode();return(!Z(r)||!r.isEmpty())&&kM(e,t,n)}(n,a,qj(c)),Z(s)&&o.set(s.getKey(),s),Z(a)&&!i&&o.set(a.getKey(),a)}for(let t of e.getNodes())if(Z(t)&&gO(t)){if(i&&t.is(a))continue;o.set(t.getKey(),t)}else if(!r){let e=XO(t,gO);Z(e)&&o.set(e.getKey(),e)}for(let e of o.values()){if(Pj(e)!==null)continue;let r=t();n(e,r),e.replace(r,!0)}}function AM(e){let t=jM(e);return t!==null&&t.writingMode===`vertical-rl`}function jM(e){let t=e.anchor.getNode();return Z(t)?TM(t):EM(t)}function MM(e,t){let n=AM(e)?!t:t;NM(e)&&(n=!n);let r=fE(e.focus,n?`previous`:`next`);if(xE(r))return!1;if(Zj(r)&&!FE(r.origin)&&r.origin.isUnmergeable()){let e=r.getNodeAtCaret();if(uE(e)&&!FE(e))return!0}for(let e of lM(r)){if($j(e))return!e.origin.isInline();if(!Z(e.origin)){if(KT(e.origin))return!0;break}}return!1}function Hye(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function NM(e){let t=jM(e);return t!==null&&t.direction===`rtl`}function PM(e,t,n){let r=NM(e),i;i=AM(e)||r?!n:n,Hye(e,t,i,`character`)}function Uye(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Wye(e,t){return Array.from(Gye(e,t))}function Gye(e,t){return Kye(`next`,e,t)}function FM(e,t){let n=wE(eM(e,t));return n&&n[0]}function Kye(e,t,n){let r=dD(),i=t||r,a=Z(i)?iM(i,e):eM(i,e),o=qye(i),s=n?oM(aM(eM(n,e)))||FM(n,e):FM(i,e),c=o;return fM({hasNext:e=>e!==null,initial:a,map:e=>({depth:c,node:e.origin}),step:e=>{if(e.isSameNodeCaret(s))return null;$j(e)&&c++;let t=wE(e);return!t||t[0].isSameNodeCaret(s)?null:(c+=t[1],t[0])}})}function qye(e){let t=-1;for(let n=e;n!==null;n=n.getParent()??Pj(n))t++;return t}function IM(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function Jye(e){let t=XO(e,e=>Z(e)&&!e.isInline());return Z(t)||Uye(4,e.__key),t}function LM(e){let t=$()||sj(),n;if(Q(t))n=fE(t.focus,`next`);else{if(t!=null){let e=t.getNodes(),r=e[e.length-1];r&&(n=eM(r,`next`))}n||=iM(dD(),`previous`).getFlipped().insert(jE())}let r=OE(e,n,xE(i=n)||wE(Zj(i)?i.getSiblingCaret():i,`shadowRoot`)!==null?{$shouldSplit:(e,t)=>t!==`last`}:void 0);var i;let a=oM(r);return mE(uM($j(a)?bE(a):r)),e.getLatest()}function RM(e,t){if(e==null)return!1;let n=Object.getPrototypeOf(e);return n!=null&&n.constructor!=null&&n.constructor.name===t.name}function zM(e){let t=null;if(RM(e,DragEvent)?t=e.dataTransfer:RM(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function BM(e){let t=$();if(!Q(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;tZ(e)&&!e.isInline());if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}function Yye(e,t){iM(e,`next`).insert(t)}function VM(e,t){return HM(e,t,null)}function HM(e,t,n){let r=!1;for(let i of WM(e))t(i)?n!==null&&n(i):(r=!0,Z(i)&&HM(i,t,n||(e=>i.insertAfter(e))),i.remove());return r}function UM(e,t){let n=[],r=Array.from(e).reverse();for(let e=r.pop();e!==void 0;e=r.pop())if(t(e))n.push(e);else if(Z(e))for(let t of WM(e))r.push(t);return n}function WM(e){return Xye(iM(e,`previous`))}function Xye(e){return fM({hasNext:Qj,initial:e.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function Zye(e){_E(eM(e,`next`)).splice(1,e.getChildren())}function GM(e,t){let n=$();if(Q(n)&&n.isCollapsed()){let r=XO(n.anchor.getNode(),e);if(r){let e=r.getParent();if(e!==null&&e.getFirstChild()===r&&qM(n.anchor,r))return r.insertBefore(jE()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function KM(e,t){let n=$();if(Q(n)&&n.isCollapsed()){let r=XO(n.anchor.getNode(),e);if(r){let e=r.getParent();if(e!==null&&e.getLastChild()===r&&JM(n.anchor,r))return r.insertAfter(jE()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function qM(e,t){return kM(e,t,`previous`)}function JM(e,t){return kM(e,t,`next`)}function Qye(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}var YM={tag:`history-merge`};function $ye(){let e=dD();e.isEmpty()&&e.append(jE())}var ebe={config:{setOptions:YM,updateOptions:YM},init:({$initialEditorState:e=$ye})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(Uve(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[JT,aE,ik,NE,AE]};function XM(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function tbe(){let e;try{e=`0.53.0+prod.esm`}catch{}return e??`"+source"`}var nbe=tbe(),rbe=new Set([`__proto__`,`constructor`,`prototype`]);function ZM(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)!rbe.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=ZM(n[e],r[e]));return e}return t}function QM(e){return e.id===0}function $M(e){return e.id===2}var ibe=new Set,abe=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):bM;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;$M(t)||XM(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:3,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:4,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==4&&XM(307,String(t.id),`5`),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:5,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==5&&XM(308,String(n.id),`5`);let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:6})}(n),()=>{let e=this.state;e.id!==7&&XM(309,String(n.id),`7`),this.state=function(e){return Object.assign(e,{id:5})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==6&&XM(310,String(t.id),`6`),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:7})}(t),n}getSignal(){return this._signal===void 0&&XM(311),this._signal}getInitResult(){this.extension.init===void 0&&XM(312,this.extension.name);let e=this.state;return function(e){return e.id>=4}(e)||XM(313,String(e.id),`4`),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=3}(e)||XM(314,String(e.id),`3`),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&XM(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&XM(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=7}(e)||XM(316,String(e.id),`7`),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||ibe}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=5})(e)||XM(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},eN=Symbol.for(`@lexical/extension/LexicalBuilder`);function obe(...e){return iN.fromExtensions(e).buildEditor()}function tN(){}function sbe(e){throw e}function nN(e){return Array.isArray(e)?e:[e]}var rN=nbe,iN=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=rN,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[nN(ebe)];for(let e of t)n.push(nN(e));return new e(n)}static maybeFromEditor(t){let n=t[eN];return n&&(n.PACKAGE_VERSION!==rN&&XM(292,n.PACKAGE_VERSION,rN),n instanceof e||XM(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&XM(294),n}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(fk({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[eN]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=tN;function t(){try{e()}finally{e=tN}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=qk(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&XM(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);if(r){let e=r.get(t);e?e.push(...n):r.set(t,n)}else this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&XM(296);let[t]=nN(e);typeof t.name!=`string`&&XM(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&XM(298,t.name),!n){n=new abe(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&XM(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&XM(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=nN(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if($M(i))return;let a=n.extension.name;var o;QM(i)||XM(300,a,r||`[unknown]`),QM(o=i)||XM(304,String(o.id),`0`),i=Object.assign(o,{id:1}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=function(e){return function(e){return e.id===1}(e)||XM(305,String(e.id),`1`),Object.assign(e,{id:2})}(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())QM(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&XM(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return qk(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.onWarn!==void 0&&(e.onWarn=o.onWarn),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of Qye(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&XM(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&ZM(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=Array.from(t));let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=sbe,e}};function aN(e,t){let n=iN.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}var cbe=Symbol.for(`preact-signals`);function oN(){if(dN>1)dN--;else{var e,t=!1;for((function(){var e=mN;for(mN=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();uN!==void 0;){var n=uN;for(uN=void 0,fN++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&yN(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(fN=0,dN--,t)throw e}}function lbe(e){if(dN>0)return e();pN=++ube,dN++;try{return e()}finally{oN()}}var sN,cN=void 0;function lN(e){var t=cN,n=sN;cN=void 0,sN=void 0;try{return e()}finally{cN=t,sN=n}}var uN=void 0,dN=0,fN=0,ube=0,pN=0,mN=void 0,hN=0;function gN(e){if(cN!==void 0){var t=e.n;if(t===void 0||t.t!==cN)return t={i:0,S:e,p:cN.s,n:void 0,t:cN,e:void 0,x:void 0,r:t},cN.s!==void 0&&(cN.s.n=t),cN.s=t,e.n=t,32&cN.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=cN.s,t.n=void 0,cN.s.n=t,cN.s=t),t}}function _N(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}_N.prototype.brand=cbe,_N.prototype.h=function(){return!0},_N.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?lN(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},_N.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&lN(function(){var e;(e=t.Z)==null||e.call(t)}))}},_N.prototype.subscribe=function(e){var t=this;return EN(function(){var n=t.value;lN(function(){return e(n)})},{name:`sub`})},_N.prototype.valueOf=function(){return this.value},_N.prototype.toString=function(){return this.value+``},_N.prototype.toJSON=function(){return this.value},_N.prototype.peek=function(){var e=this;return lN(function(){return e.value})},Object.defineProperty(_N.prototype,"value",{get:function(){var e=gN(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(fN>100)throw Error(`Cycle detected`);(function(e){dN!==0&&fN===0&&e.l!==pN&&(e.l=pN,mN={S:e,v:e.v,i:e.i,o:mN})})(this),this.v=e,this.i++,hN++,dN++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{oN()}}}});function vN(e,t){return new _N(e,t)}function yN(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function bN(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function xN(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function SN(e,t){_N.call(this,void 0,t),this.x=e,this.s=void 0,this.g=hN-1,this.f=4}SN.prototype=new _N,SN.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===hN))return!0;if(this.g=hN,this.f|=1,this.i>0&&!yN(this))return this.f&=-2,!0;var e=cN;try{bN(this),cN=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return cN=e,xN(this),this.f&=-2,!0},SN.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}_N.prototype.S.call(this,e)},SN.prototype.U=function(e){if(this.t!==void 0&&(_N.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},SN.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(SN.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=gN(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function dbe(e,t){return new SN(e,t)}function CN(e){var t=e.j;if(e.j=void 0,typeof t==`function`){dN++;var n=cN;cN=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,wN(e),t}finally{cN=n,oN()}}}function wN(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,CN(e)}function fbe(e){if(cN!==this)throw Error(`Out-of-order effect`);xN(this),cN=e,this.f&=-2;try{8&this.f&&wN(this)}finally{oN()}}function TN(e,t){this.x=e,this.j=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,sN&&sN.push(this)}TN.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.j=t)}finally{e()}},TN.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,CN(this),bN(this),dN++;var e=cN;return cN=this,fbe.bind(this,e)},TN.prototype.N=function(){2&this.f||(this.f|=2,this.u=uN,uN=this)},TN.prototype.d=function(){this.f|=8,1&this.f||wN(this)},TN.prototype.dispose=function(){this.d()};function EN(e,t){var n=new TN(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}function DN(e,t){let n;return vN(e(),{unwatched(){n&&=(n(),void 0)},watched(){this.value=e(),n=t(this)}})}var ON={build:e=>DN(()=>e.getEditorState(),t=>e.registerUpdateListener(e=>{t.value=e.editorState})),name:`@lexical/extension/EditorState`},pbe=new Set,kN={build(e,t,n){let r=n.getDependency(ON).output,i=vN({watchedNodeKeys:new Map}),a=DN(()=>{},()=>EN(()=>{let e=a.peek(),{watchedNodeKeys:t}=i.value,n,o=!1;r.value.read(()=>{if($())for(let[r,i]of t.entries()){if(i.size===0){t.delete(r);continue}let a=iD(r),s=a&&a.isSelected()||!1;o||=s!==(!!e&&e.has(r)),s&&(n||=new Set,n.add(r))}}),!o&&n&&e&&n.size===e.size||(a.value=n)}));return{watchNodeKey:function(e){let t=dbe(()=>(a.value||pbe).has(e)),{watchedNodeKeys:n}=i.peek(),r=n.get(e),o=r!==void 0;return r||=new Set,r.add(t),o||(n.set(e,r),i.value={watchedNodeKeys:n}),t}}},dependencies:[ON],name:`@lexical/extension/NodeSelection`},mbe=zC(`INSERT_HORIZONTAL_RULE_COMMAND`),AN=class extends GT{$config(){return this.config(`horizontalrule`,{extends:GT,importDOM:{hr:()=>({conversion:hbe,priority:0})}})}exportDOM(){return{element:rO().createElement(`hr`)}}createDOM(e){let t=rO().createElement(`hr`);return SM(t,e.theme.hr),t}getTextContent(){return` `}isInline(){return!1}updateDOM(){return!1}};function hbe(){return{node:jN()}}function jN(){return YO(AN)}function MN(e){return e instanceof AN}var gbe={dependencies:[ON,kN],name:`@lexical/extension/HorizontalRule`,nodes:()=>[AN],register(e,t,n){let{watchNodeKey:r}=n.getDependency(kN).output,i=vN({nodeSelections:new Map}),a=e._config.theme.hrSelected??`selected`;return qk(e.registerCommand(mbe,e=>{let t=$();return Q(t)?(t.focus.getNode()!==null&&LM(jN()),!0):!1},0),e.registerCommand(VC,e=>{if(fO(e.target)){let t=aD(e.target);if(MN(t))return function(e,t=!1){let n=$(),r=e.isSelected(),i=e.getKey(),a;t&&FA(n)?a=n:(a=rj(),pD(a)),r?a.delete(i):a.add(i)}(t,e.shiftKey),!0}return!1},1),e.registerMutationListener(AN,(t,n)=>{lbe(()=>{let n=!1,{nodeSelections:a}=i.peek();for(let[i,o]of t.entries())if(o===`destroyed`)a.delete(i),n=!0;else{let t=a.get(i),o=e.getElementByKey(i);t?t.domNode.value=o:(n=!0,a.set(i,{domNode:vN(o),selectedSignal:r(i)}))}n&&(i.value={nodeSelections:a})})}),EN(()=>{let e=[];for(let{domNode:t,selectedSignal:n}of i.value.nodeSelections.values())e.push(EN(()=>{let e=t.value;e&&(n.value?SM(e,a):CM(e,a))}));return qk(...e)}))}};function _be(e){return aN(_O(),e)}function NN(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var vbe=(e,t,n)=>{PN(e),n()};function PN(e){if(!XE(e))return;let t=e;if(t.querySelector(`style`)===null)return;let n=new Map;function r(e){let t=n.get(e);if(t===void 0){t=new Set;for(let n=0;n{}){return(n,r=_O())=>i=>{let a=LN(r),o=a&&a[e],s=zN(n,o||t(r));return s&&s!==o?VN(e,s,i,r):i()}}function UN(e,t,n,r){return Object.assign($w(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}var WN=`@lexical/html/DOM`,GN=Symbol.for(`@lexical/html/DOMExportContext`),KN=`@lexical/html/DOMImport`,qN=Symbol.for(`@lexical/html/DOMImportContext`);function xbe(e,t,n){return UN(GN,e,t,n)}var Sbe=xbe(`isExport`,Boolean);function Cbe(e){let t=aN(e,WN);return t?t.output.defaults:void 0}function wbe(e){let t=aN(e,WN);return t?t.output.runtime:void 0}function Tbe(e=_O()){let t=wbe(e);return t?t.getSessionConfig():vO(e)}var Ebe=HN(GN,Cbe),JN=Symbol.for(`@lexical/html/SelectorImpl`);function YN(e,t){let n={kind:`element`,predicate:(r=t,r.length===0?dO:r.length===1?r[0]:(e,t)=>{for(let n of r)if(!n(e,t))return!1;return!0}),tags:e};var r;let i=n=>YN(e,[...t,n]);return{[JN]:n,attr:(e,t,n)=>i(QN(e,t,n)),classAll:(...e)=>i(ZN(e)),classAny:(...e)=>i(function(e){let t=XN(e);return t.length===0?()=>!1:e=>{if(!dO(e))return!1;let n=e.classList;for(let e of t)if(n.contains(e))return!0;return!1}}(e)),styleAny:(e,t,n)=>i(function(e,t,n){if(typeof t==`string`)return n=>dO(n)&&n.style.getPropertyValue(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!dO(t))return!1;let a=t.style.getPropertyValue(e);if(!a)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}NN(362,JSON.stringify(e))}(e,t,n))}}function XN(e){let t=[];for(let n of e)n&&t.push(n);return t}function ZN(e){let t=XN(e);return t.length===0?()=>!0:e=>{if(!dO(e))return!1;let n=e.classList;for(let e of t)if(!n.contains(e))return!1;return!0}}function QN(e,t,n){if(!0===t)return t=>dO(t)&&t.hasAttribute(e);if(typeof t==`string`)return n=>dO(n)&&n.getAttribute(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!dO(t))return!1;let a=t.getAttribute(e);if(a==null)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}NN(361,JSON.stringify(e))}function $N(e){return{[JN]:e}}var Dbe=$N({kind:`text`,predicate:YE,tags:new Set}),Obe=$N({kind:`comment`,predicate:e=>e.nodeType===8,tags:new Set});function eP(){return YN(new Set,[])}function tP(){return Obe}function nP(...e){e.length>0||NN(363);let t=new Set;for(let n of e)t.add(n.toUpperCase());return YN(t,[])}function rP(){return Dbe}var iP={any:eP,comment:tP,tag:nP,text:rP},aP=/[A-Za-z0-9_-]/,kbe=class{constructor(e,t){this.source=e,this.pos=t}peek(e=0){return this.source[this.pos+e]||``}consume(){return this.source[this.pos++]||``}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let e=this.pos;for(;!this.eof()&&aP.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e===`"`||e===`'`,`expected quote`);let t=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()===`\\`?this.pos+=2:this.pos++;this.assert(!this.eof(),`unterminated string`);let n=this.source.slice(t,this.pos);return this.pos++,n.replace(/\\(.)/g,`$1`)}assert(e,t){e||NN(364,String(this.pos+1),t,this.source)}};function Abe(e){let t=new Set,n=[],r=[],i=!1;if(e.skipWhitespace(),e.peek()===`*`)e.consume(),i=!0;else if(aP.test(e.peek())){let n=e.readIdent();n&&t.add(n.toUpperCase())}for(;!e.eof();){let t=e.peek();if(t===`.`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected class name after "."`),r.push(t)}else if(t===`#`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected id after "#"`),n.push(QN(`id`,t))}else{if(t!==`[`)break;{e.consume(),e.skipWhitespace();let t=e.readIdent();e.assert(t!==``,`expected attribute name after "["`),e.skipWhitespace();let r=!0;if(e.peek()===`=`){e.consume(),e.skipWhitespace();let t=e.peek();t===`"`||t===`'`?r=e.readQuoted():(r=e.readIdent(),e.assert(r!==``,`expected attribute value`)),e.skipWhitespace()}e.assert(e.peek()===`]`,`expected "]"`),e.consume(),n.push(QN(t,r))}}}return r.length>0&&n.push(ZN(r)),e.assert(i||t.size>0||n.length>0,`expected a selector`),{predicates:n,tags:t}}function jbe(e){let t=new kbe(e,0),n=[];for(;n.push(Abe(t)),t.skipWhitespace(),!t.eof();)t.assert(t.peek()===`,`,`expected "," (selector lists are the only supported combinator)`),t.consume(),t.skipWhitespace();if(n.length===1)return YN(n[0].tags,n[0].predicates);let r=new Set;if(n.every(e=>e.tags.size>0))for(let e of n)for(let t of e.tags)r.add(t);return YN(r,[(e,t)=>{for(let r of n){let n=e.nodeName;if(r.tags.size>0&&!r.tags.has(n))continue;let i=!0;for(let n of r.predicates)if(!n(e,t)){i=!1;break}if(i)return!0}return!1}])}function oP(e,t,n){return UN(qN,e,t,n)}var sP=oP(`textFormat`,()=>0),cP=oP(`textStyle`,()=>({}));function Mbe(e){if(!dO(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function Nbe(e){if(YE(e))return!0;if(!dO(e))return!1;let t=e.style.display;return t?t.startsWith(`inline`):!hO(e)&&mO(e)}var Pbe=oP(`whitespaceConfig`,()=>({isInline:Nbe,preservesWhitespace:Mbe})),lP=oP(`importOverlays`,()=>[]),Fbe=class{constructor(e){this.record=e}get(e){return IN(this.record,e)}set(e,t){this.record[e.key]=t}update(e,t){this.record[e.key]=t(IN(this.record,e))}has(e){return Object.prototype.hasOwnProperty.call(this.record,e.key)}};function uP(e){let t=aN(e,KN);return t?t.output.defaults:void 0}function Ibe(e,t=_O()){return IN(function(e){return RN(qN,e)||uP(e)}(t),e)}var dP=HN(qN,uP);function fP(e){return ej(e)||KT(e)&&!e.isInline()}function pP(e,t){if(!dO(t))return e;let n=t.style.textAlign;if(!gP(n))return e;for(let t of e)ej(t)&&t.getFormatType()===``&&t.setFormat(n);return e}function mP(e,t,n){e.length===1&&ok(e[0])&&(e=[]);let r=jE();if(dO(n)){let e=n.style.textAlign;gP(e)&&r.setFormat(e)}return[r.splice(0,0,e)]}var Lbe={$accepts:fP,$packageRun:mP,name:`BlockSchema`},Rbe={$accepts:fP,$packageRun:mP,name:`RootSchema`},hP=iP,zbe=new Set([`center`,`end`,`justify`,`left`,`right`,`start`]);function gP(e){return zbe.has(e)}var Bbe={B:{fontWeight:`bold`},EM:{fontStyle:`italic`},I:{fontStyle:`italic`},S:{textDecoration:`line-through`},STRONG:{fontWeight:`bold`},SUB:{verticalAlign:`sub`},SUP:{verticalAlign:`super`},U:{textDecoration:`underline`}},Vbe={CODE:16,MARK:128},Hbe=new Set([`font-weight`,`font-style`,`text-decoration`,`text-transform`,`vertical-align`]),Ube={$import:(e,t)=>{let n=e.get(sP),r=Bbe[t.nodeName],i=function(e){return{fontStyle:e.style.fontStyle,fontWeight:e.style.fontWeight,textDecoration:e.style.textDecoration,textTransform:e.style.textTransform,verticalAlign:e.style.verticalAlign}}(t);var a,o;let s=n&~(c=function(e){let t=0,n=0,{fontWeight:r,fontStyle:i,textDecoration:a,textTransform:o,verticalAlign:s}=e;if(r===`700`||r===`bold`?t|=1:r!==`normal`&&r!==`400`||(n|=1),i===`italic`?t|=2:i===`normal`&&(n|=2),a){let e=a.split(` `);e.includes(`underline`)&&(t|=8),e.includes(`line-through`)&&(t|=4),e.includes(`none`)&&(n|=12)}return o===`lowercase`?(t|=FC.lowercase,n|=FC.uppercase|FC.capitalize):o===`uppercase`?(t|=FC.uppercase,n|=FC.lowercase|FC.capitalize):o===`capitalize`?(t|=FC.capitalize,n|=FC.lowercase|FC.uppercase):o===`none`&&(n|=FC.lowercase|FC.uppercase|FC.capitalize),s===`sub`?(t|=32,n|=64):s===`super`?(t|=64,n|=32):s===`baseline`&&(n|=96),{clear:n,set:t}}(r?(a=r,{fontStyle:(o=i).fontStyle||a.fontStyle,fontWeight:o.fontWeight||a.fontWeight,textDecoration:o.textDecoration||a.textDecoration,textTransform:o.textTransform||a.textTransform,verticalAlign:o.verticalAlign||a.verticalAlign}):i)).clear|c.set;var c;let l=Vbe[t.nodeName];return l&&(s|=l),s===n?e.$importChildren(t):e.$importChildren(t,{context:[BN(sP,s)]})},match:hP.tag(`b`,`strong`,`em`,`i`,`code`,`mark`,`s`,`sub`,`sup`,`u`,`span`),name:`@lexical/html/inline-format`};function _P(e,t,n){let r=e;for(;;){let e=null;for(;(e=t?r.nextSibling:r.previousSibling)===null;){let e=r.parentNode;if(e===null)return null;r=e}if(r=e,!n.isInline(r))return null;let i=r;for(;(i=t?r.firstChild:r.lastChild)!==null;)r=i;if(YE(r))return r;if(r.nodeName===`BR`)return null}}function vP(e,t){return t!==0&&uE(e)?e.setFormat(t):e}function yP(e,t){if(uE(e)){let n=function(e){let t=``;for(let n in e)Hbe.has(n)||(t+=`${n}: ${e[n]}; `);return t.trimEnd()}(t);n!==``&&e.setStyle(n)}return e}var Wbe={$import:(e,t)=>{let n=e.get(sP),r=e.get(cP),i=e.get(Pbe);if(function(e,t){let n=e.parentNode;for(;n!==null;){if(t.preservesWhitespace(n))return!0;n=n.parentNode}return!1}(t,i)){let e=gj(t.textContent||``);for(let t of e)vP(t,n),yP(t,r);return e}let a=function(e,t){let n=(e.textContent||``).replace(/\r/g,``).replace(/[ \t\n]+/g,` `);if(n.length===0)return``;if(n[0]===` `){let r=e,i=!0;for(;r!==null&&(r=_P(r,!1,t))!==null;){let e=r.textContent||``;if(e.length>0){/[ \t\n]$/.test(e)&&(n=n.slice(1)),i=!1;break}}i&&(n=n.slice(1))}if(n.length>0&&n[n.length-1]===` `){let r=e,i=!0;for(;r!==null&&(r=_P(r,!0,t))!==null;)if((r.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){i=!1;break}i&&(n=n.slice(0,-1))}return n}(t,i);if(a===``)return[];let o=lE(a);return vP(o,n),yP(o,r),[o]},match:hP.text(),name:`@lexical/html/#text`},Gbe={$import:()=>[],match:hP.tag(`script`,`style`),name:`@lexical/html/script-style-ignore`},Kbe={$import:(e,t)=>sk(t)||ck(t)?[]:[ak()],match:hP.tag(`br`),name:`@lexical/html/br`},qbe=[Gbe,{$import:(e,t)=>{let n=jE();if(EO(n,t),wO(t,n),n.getFormatType()===``){let e=t.getAttribute(`align`);e&&gP(e)&&n.setFormat(e)}return TO(n,t),[n.splice(0,0,e.$importChildren(t))]},match:hP.tag(`p`),name:`@lexical/html/p`},{$import:(e,t,n)=>_O().hasNode(AN)?[jN()]:n(),match:hP.tag(`hr`),name:`@lexical/html/hr`},{$import:(e,t,n)=>hO(t)?pP(e.$importChildren(t,{schema:Lbe}),t):n(),match:hP.any(),name:`@lexical/html/transparent-block`},Wbe,Kbe,Ube];function Jbe(e,t){let n=[],r=0,i=0;for(;r{let c=function(e){let t=e[JN];return t===void 0&&NN(360),t}(e.match),l=e.name||function(e,t){return e.kind===`text`?`#text@${t}`:e.kind===`comment`?`#comment@${t}`:e.tags.size===0?`*@${t}`:`${Array.from(e.tags).join(`,`).toLowerCase()}@${t}`}(c,s);if(e.name&&o.add(e.name),t.push({$import:e.$import,name:l,predicate:c.predicate}),c.kind===`text`)i.push(s);else if(c.kind===`comment`)a.push(s);else if(c.tags.size===0)r.push(s);else for(let e of c.tags){let t=n.get(e);t||(t=[],n.set(e,t)),t.push(s)}});let s=new Map;if(r.length===0)for(let[e,t]of n)s.set(e,t);else for(let[e,t]of n)s.set(e,Jbe(t,r));return{byTag:s,commentIndices:a,rules:t,textIndices:i,wildcardIndices:r}}function xP(e,t){return YE(t)?e.textIndices:t.nodeType===8?e.commentIndices:dO(t)?e.byTag.get(t.nodeName)||e.wildcardIndices:Ybe}var Ybe=Object.freeze([]);function SP(e){let t=[];for(let n of e)if(Xbe(n))for(let e of n.rules)t.push(e);else t.push(n);return t}function Xbe(e){return typeof e==`object`&&!!e&&`__type`in e&&e.__type===`CompiledOverlayRules`}function CP(e){let t=SP(e);return{__type:`CompiledOverlayRules`,dispatch:bP(t),rules:t}}var Zbe=Object.freeze({});function Qbe(e,t){return{$importChildren:(t,n)=>function(e,t,n){let r=n&&n.rules?n.rules.dispatch:void 0;r&&e.overlays.push(r);try{let r=()=>wP(e,t,n);return n&&n.context?dP(n.context,e.editor)(r):r()}finally{r&&e.overlays.pop()}}(e,t,n),$importOne:(t,n)=>TP(e,t,n),captures:t,get:t=>Ibe(t,e.editor),session:e.session}}function wP(e,t,n){let r=n&&n.$onChild,i=[];for(let n of Array.from(t.childNodes)){let t=TP(e,n,void 0);for(let e of t){let t=r?r(e):e;t!=null&&i.push(t)}}let a=n&&n.$after?n.$after(i):i,o=n&&n.schema;return o?function(e,t,n,r){let i=[],a=null,o=()=>{if(a===null)return;let t=a;if(a=null,e.$packageRun){let a=e.$packageRun(t,n,r);if(a.length>0){for(let e of a)i.push(e);return}}if(e.onReject===`hoist`)for(let e of t)i.push(e)};for(let r of t)e.$accepts(r,n)?(o(),i.push(r)):(a===null&&(a=[]),a.push(r));return o(),e.$finalize?e.$finalize(i,n):i}(o,a,null,t):a}function TP(e,t,n){let r=()=>function(e,t){let n=function(e,t){let n=[];for(let r=e.overlays.length-1;r>=0;r--){let i=e.overlays[r],a=xP(i,t);a.length>0&&n.push({dispatch:i,indices:a})}let r=xP(e.dispatch,t);return r.length>0&&n.push({dispatch:e.dispatch,indices:r}),n}(e,t);if(n.length===0)return EP(e,t);let r=0,i=0,a=()=>{for(;r{let o=RN(qN,e)||r,s=a&&a.context?zN(a.context,o):o,c=s!==void 0&&s!==o?s:Object.create(o||null),l=new Fbe(c),u={session:l};return function(e,t,n){let r=e.length-1,i=()=>{for(;r>=0;)return void(0,e[r--])(t,n,i)};i()}(a&&a.preprocess?[...i,...a.preprocess]:i,t,u),VN(qN,c,()=>function(e,t,n,r){return wP({dispatch:e,editor:t,overlays:r.get(lP).map(e=>e.dispatch),session:r},XE(n)?n.body:n,{schema:Rbe})}(n,e,t,l),e)},defaults:r}},config:{contextDefaults:[],preprocess:[vbe],rules:[{$import:(e,t)=>e.$importChildren(t),match:iP.any(),name:`@lexical/html/default-hoist`}]},mergeConfig:(e,t)=>bM(e,{...t,...t.contextDefaults&&{contextDefaults:[...e.contextDefaults,...t.contextDefaults]},...t.preprocess&&{preprocess:[...e.preprocess,...t.preprocess]},...t.rules&&{rules:[...t.rules,...e.rules]}}),name:KN},OP={dependencies:[[DP,{rules:qbe}]],name:`@lexical/html/CoreImport`},kP={any:eP,comment:tP,css:jbe,tag:nP,text:rP},AP=new Set([`STYLE`,`SCRIPT`]);function jP(e,t){PN(t);let n=XE(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(let t of n)if(!AP.has(t.nodeName)){let n=PP(t,e,i,!1);if(n!==null)for(let e of n)r.push(e)}return function(e){for(let t of e)t.getParent()&&t.getNextSibling()instanceof rk&&t.insertAfter(ak());for(let t of e){let e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function $be(e,t=null,n=_O()){return Ebe([BN(Sbe,!0)],n)(()=>{let r=dD(),i=Tbe(n),a=Ij(t),o=e.append.bind(e);for(let e of(Z(a)?a:r).getChildren())NP(n,e,o,t,i);return e})}function MP(e,t=null){return(typeof document>`u`||typeof window>`u`&&global.window===void 0)&&NN(338),Jve(e),$be(rO().createElement(`div`),t,e).innerHTML}function NP(e,t,n,r=null,i=vO(e)){let a=i.$shouldInclude(t,r,e),o=i.$shouldExclude(t,r,e),s=t;r!==null&&uE(t)&&(s=OM(r,t,`clone`));let{element:c,after:l,append:u,$getChildNodes:d}=i.$exportDOM(s,e);if(!c)return!1;let f=rO().createDocumentFragment(),p=d?d():Z(s)?s.getChildren():[],m=a&&FA(r)&&Z(t)?null:r,h=f.append.bind(f),g=null;for(let n of p){let o=NP(e,n,h,m,i);o&&(g=n),!a&&o&&i.$extractWithChild(t,n,r,`html`,e)&&(a=!0)}if(a&&!o){if((dO(c)||pO(c))&&(u?u(f):c.append(f),function(e,t){let n=e.lastChild;if(ok(t)&&dO(e)&&hO(e)&&n!==null&&n.nodeName===`BR`){let t=rO().createElement(`br`);t.setAttribute(`data-lexical-managed-linebreak`,`true`),e.append(t)}}(c,g)),pO(c)){if(l){let e=l.call(s,c);e&&c.replaceChildren(e)}n(c)}else if(n(c),l){let e=l.call(s,c);e&&c.replaceWith(e)}}else n(f);return a}function PP(e,t,n,r,i=new Map,a){let o=[];if(AP.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!GD(s))&&(s!=null&&ej(s)||r);for(let e=0;e{let e=new rk;return n.push(e),e}:jE)),s==null){if(f.length>0)for(let e of f)o.push(e);else hO(e)&&function(e){return e.nextSibling!=null&&e.previousSibling!=null&&mO(e.nextSibling)&&mO(e.previousSibling)}(e)&&o.push(ak())}else Z(s)&&s.append(...f);return o}function exe(e,t={}){let n={};for(let r in e){let i=t[r];n[r]=vN(i===void 0?e[r]:i)}return n}function txe(e){return()=>{}}function FP(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function IP(e,t){let n=e;for(let r=eM(e,t);r&&(rF(r.origin)||FE(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}function LP(e){return IP(e,`previous`)}function RP(e){return IP(e,`next`)}function nxe(e){let t=LP(e),n=RP(e),r=t;for(;r!==null;){if(rF(r)){let e=pve(r.getTextContent());if(e!==null)return e}if(r===n)break;r=r.getNextSibling()}let i=t.getParent();if(Z(i)){let e=i.getDirection();if(e===`ltr`||e===`rtl`)return e}return null}function rxe(e,t){let n=null,r=null,i=e,a=t,o=e.getTextContent();for(;;){if(a===0){let e=i.getPreviousSibling();if(e===null){i=null;break}if(rF(e)||FE(e)||ok(e)||FP(167),i=e,ok(i)){n={node:i,offset:1};break}a=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else a--;let e=o[a];rF(i)&&e!==` `&&(r={node:i,offset:a})}if(r!==null)return r;let s=null;if(tt.push(ak()),tab:()=>t.push(PE()),text:e=>t.push(nF(e))}),t}function BP(e,t,n){if(!Number.isInteger(t)||t<=0)return!1;let r=e.getTextContent(),i=/^ +/.exec(r);if(!i)return!1;let a=Math.min(t,i[0].length),o=e.getKey(),s=n.anchor.key===o&&n.anchor.type===`text`?n.anchor.offset:null,c=n.focus.key===o&&n.focus.type===`text`?n.focus.offset:null;return e.spliceText(0,a,``),s!==null&&n.anchor.set(o,Math.max(0,s-a),`text`),c!==null&&n.focus.set(o,Math.max(0,c-a),`text`),!0}var axe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function VP(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!axe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}var oxe=e=>{let t=Pw(e,`format`),n=Fw(e,`format`),r=Lw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],language:e.__language,theme:e.__theme,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__language;o!==void 0&&(a.language=o);let s=e.__theme;s!==void 0&&(a.theme=s);let c=e.__dir;c!=null&&(a.direction=c);let l=t[e.__format];l!==void 0&&l!==``&&(a.format=l);let u=e.__indent;return u!==void 0&&u!==0&&(a.indent=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=function(e){let t=VP(e,0);return t>=0&&t<=1/0&&Number.isInteger(t)?t:0}(t.indent),e.__textFormat=VP(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.language;e.setLanguage(s==null||typeof s==`string`?s:``);let c=t.theme;return e.setTheme(c===void 0?void 0:typeof c==`string`?c:``),e}}};function sxe(e,t){e.__highlightType=t.__highlightType}var cxe=e=>{let t=Pw(e,`mode`),n=Iw(e,`detail`,0),r=Iw(e,`format`,0),i=Fw(e,`mode`),a=Lw(e,`mode`);return{exportJSON:function(e){return{highlightType:e.__highlightType,detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__highlightType;r!==void 0&&(n.highlightType=r);let i=e.__detail;i!==void 0&&i!==0&&(n.detail=i);let a=e.__format;a!==void 0&&a!==0&&(n.format=a);let o=t[e.__mode];o!==void 0&&o!==`normal`&&(n.mode=o);let s=e.__style;s!==void 0&&s!==``&&(n.style=s);let c=e.__text;return c!==void 0&&c!==``&&(n.text=c),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:VP(o,0);let s=t.format;e.setFormat(typeof s==`string`&&s in r?r[s]:VP(s,0));let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;e.__text=typeof u==`string`?u:``;let d=t.highlightType;return e.setHighlightType(d==null||typeof d==`string`?d:``),e},afterCloneFrom:sxe}},lxe=Yw()({language:Qw(Jw(qw(Uw())),{getter:{field:`__language`}}),theme:Qw(Jw(Uw()),{getter:{field:`__theme`}})});function HP(e,t){for(let n of e.childNodes)if(dO(n)&&n.tagName===t||HP(n,t))return!0;return!1}var UP=`data-language`,WP=`data-highlight-language`,GP=`data-theme`,uxe=txe(),KP=class extends WT{__language;__theme;__isSyntaxHighlightSupported;$config(){return this.config(`code`,{children:`inline`,extends:WT,generated:oxe,importDOM:{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||HP(e,`BR`))?{conversion:YP,priority:1}:null,div:()=>({conversion:dxe,priority:1}),pre:()=>({conversion:YP,priority:0}),table:e=>QP(e)?{conversion:fxe,priority:3}:null,td:e=>{let t=e,n=t.closest(`table`);return t.classList.contains(`js-file-line`)||n&&QP(n)?{conversion:XP,priority:3}:null},tr:e=>{let t=e.closest(`table`);return t&&QP(t)?{conversion:XP,priority:3}:null}},json:lxe})}constructor(e=void 0,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),function(e,t){e.__language=t.__language,e.__theme=t.__theme}(this,e),this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let t=rO().createElement(`code`);SM(t,e.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(UP,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(WP,n));let r=this.getTheme();r&&t.setAttribute(GP,r);let i=this.getStyle();return i&&ZT(t.style,i),t}updateDOM(e,t,n){let r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(UP,r):i&&t.removeAttribute(UP);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&r?r!==i&&t.setAttribute(WP,r):t.removeAttribute(WP):a&&r&&t.setAttribute(WP,r);let o=this.__theme,s=e.__theme;o?o!==s&&t.setAttribute(GP,o):s&&t.removeAttribute(GP);let c=this.__style,l=e.__style;return c!==l&&ZT(t.style,c,l),!1}exportDOM(e){let t=rO().createElement(`pre`);SM(t,e._config.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(UP,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(WP,n));let r=this.getTheme();r&&t.setAttribute(GP,r);let i=this.getStyle();return i&&ZT(t.style,i),{element:t}}insertNewAfter(e,t=!0){if(!aN(_O(),`@lexical/code`)){uxe();let t=$P(e);if(t)return t}let{anchor:n,focus:r}=e,i=(n.isBefore(r)?n:r).getNode();if(uE(i)){let e=LP(i),t=[];for(;;)if(FE(e))t.push(PE()),e=e.getNextSibling();else{if(!rF(e))break;{let n=0,r=e.getTextContent(),i=e.getTextContentSize();for(;ne.append(t)),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function qP(e,t){return YO(KP).setLanguage(e).setTheme(t)}function JP(e){return e instanceof KP}function YP(e){return{node:qP(e.getAttribute(UP),e.getAttribute(GP))}}function dxe(e){let t=e,n=ZP(t);return n||function(e){let t=e.parentElement;for(;t!==null;){if(ZP(t))return!0;t=t.parentElement}return!1}(t)?{node:n?qP():null}:{node:null}}function fxe(){return{node:qP()}}function XP(){return{node:null}}function ZP(e){return e.style.fontFamily.match(`monospace`)!==null}function QP(e){return e.classList.contains(`js-file-line-container`)}function $P(e){let{anchor:t}=e;if(e.isCollapsed()&&t.type===`element`){let e=t.getNode();if(JP(e)){let n=e.getChildrenSize();if(n>=2&&t.offset===n){let t=e.getLastChild();if(ok(t)&&ok(t.getPreviousSibling())){let t=jE();return e.splice(n-2,2,[]).insertAfter(t,!1),t.select(),t}}}}return null}var pxe=Yw()({highlightType:Qw(Jw(qw(Uw())),{getter:{field:`__highlightType`}})}),eF=class extends aE{__highlightType;constructor(e=``,t,n){super(e,n),this.__highlightType=t}$config(){return this.config(`code-highlight`,{extends:aE,generated:cxe,json:pxe})}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e);return SM(t,tF(e.theme,this.__highlightType)),t}updateDOM(e,t,n){let r=super.updateDOM(e,t,n),i=tF(n.theme,e.__highlightType),a=tF(n.theme,this.__highlightType);return i!==a&&(i&&CM(t,i),a&&SM(t,a)),r}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return qP()}};function tF(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function nF(e=``,t){return qD(new eF(e,t))}function rF(e){return e instanceof eF}var iF=`data-language`,aF=`data-theme`;function oF(e){let t=[],n=!1;for(let r=0;r0&&(a||n)&&t.push(` `),t.push(i.getTextContent()),n=a}return zP(t.join(``))}function sF(e){return e.style.fontFamily.match(`monospace`)!==null}function cF(e){let t=e.parentElement;for(;t!==null;){if(sF(t))return!0;t=t.parentElement}return!1}var mxe=CP([{$import:(e,t)=>e.$importChildren(t),match:kP.tag(`tr`,`td`),name:`@lexical/code/github-code-table/unwrap`}]),hxe={$import:(e,t)=>[qP(t.getAttribute(iF),t.getAttribute(aF)).splice(0,0,oF(e.$importChildren(t)))],match:kP.tag(`pre`),name:`@lexical/code/pre`},gxe={$import:(e,t,n)=>{let r=t.textContent||``;return/\r?\n/.test(r)||t.querySelector(`br`)!==null?[qP(t.getAttribute(iF),t.getAttribute(aF)).splice(0,0,oF(e.$importChildren(t)))]:n()},match:kP.tag(`code`),name:`@lexical/code/code-multiline`};function lF(e){if(!dO(e))return!1;let t=e.style.fontFamily,n=e.style.whiteSpace;return typeof t==`string`&&/monospace/i.test(t)&&typeof n==`string`&&n.startsWith(`pre`)}function uF(e){let t=!1,n=[],r=``,i=!1,a=()=>{i&&=(n.push(r),r=``,!1)};for(let o of Array.from(e.childNodes))if(dO(o))o.tagName===`DIV`?(a(),n.push(o.textContent||``),t=!0):o.tagName===`BR`?(a(),n.push(``),t=!0):(r+=o.textContent||``,i=!0);else if(YE(o)){let e=o.textContent||``;e.length>0&&(r+=e,i=!0)}return a(),t?n:null}function dF(e){for(let t of Array.from(e.children))if(dO(t)&&lF(t)){if(uF(t)!==null)return!0;let e=t.nextElementSibling;if(e&&lF(e))return!0}else if(dF(t))return!0;return!1}var _xe=CP([{$import:(e,t,n)=>{if(!lF(t)||cF(t))return n();let r=uF(t);return r===null||r.length===0?n():[qP().splice(0,0,zP(r.join(` `)))]},match:kP.tag(`div`),name:`@lexical/code/vscode-wrapper`},{$import:(e,t,n)=>{if(!lF(t)||cF(t))return n();let r=t.previousElementSibling;if(r&&lF(r))return[];let i=[],a=t;for(;a&&lF(a);)i.push(a.tagName===`BR`?``:a.textContent||``),a=a.nextElementSibling;return i.length<2?n():[qP().splice(0,0,zP(i.join(` `)))]},match:kP.tag(`div`,`br`),name:`@lexical/code/vscode-line-run`}]),vxe={$import:(e,t,n)=>sF(t)?[qP().splice(0,0,oF(e.$importChildren(t)))]:n(),match:kP.tag(`div`),name:`@lexical/code/div`},yxe={dependencies:[OP,[DP,{preprocess:[(e,t,n)=>{dF(XE(e)?e.body:e)&&t.session.update(lP,e=>[...e,_xe]),n()}],rules:[{$import:(e,t)=>[qP().splice(0,0,oF(e.$importChildren(t,{rules:mxe})))],match:kP.tag(`table`).classAll(`js-file-line-container`),name:`@lexical/code/github-code-table`},{$import:(e,t)=>e.$importChildren(t),match:kP.tag(`td`).classAll(`js-file-line`),name:`@lexical/code/github-code-cell-by-class`},gxe,hxe,vxe]}]],name:`@lexical/code`,nodes:()=>[KP,eF],register:e=>qk(e.registerCommand(ow,e=>{let t=$();return!(!Q(t)||!$P(t)||(e!==null&&e.preventDefault(),0))},1),e.registerNodeTransform(NE,e=>{e.getFormat()!==0&&JP(e.getParent())&&e.setFormat(0)}))};function fF(e){if(!Q(e))return!1;let t=e.anchor.getNode(),n=JP(t)?t:t.getParent(),r=e.focus.getNode(),i=JP(r)?r:r.getParent();return JP(n)&&n.is(i)}function pF(e){let t=e.getNodes(),n=[];if(t.length===1&&JP(t[0]))return n;let r=[];for(let e=0;e0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){let t=e.isBackward()?e.anchor:e.focus,i=DA(r[0].getKey(),0,`text`);t.is(i)||n.push(r)}return n}function mF(e,t){let n=$();if(!Q(n)||!fF(n))return!1;let r=pF(n),i=r.length;if(i===0&&n.isCollapsed())return e===fw?n.insertNodes([PE()]):function(e,t){let n=e.anchor.getNode();if(!rF(n)&&!FE(n))return;let r=LP(n);FE(r)?r.remove():t!==void 0&&rF(r)&&BP(r,t,e)}(n,t),!0;if(i===0&&e===fw&&n.getTextContent()===` `){let e=PE(),t=ak(),r=n.isBackward()?`previous`:`next`;return n.insertNodes([e,t]),mE(SE(dM(tM(e,`next`,0),bE(eM(t,`next`))),r)),!0}for(let a=0;a0){let r=i[0];if(a===0&&(r=LP(r)),e===fw){let e=PE();if(r.insertBefore(e),a===0){let t=n.isBackward()?`focus`:`anchor`,i=DA(r.getKey(),0,`text`);n[t].is(i)&&n[t].set(e.getKey(),0,`text`)}}else FE(r)?r.remove():t!==void 0&&rF(r)&&BP(r,t,n)}}return!0}function hF(e,t){let n=$();if(!Q(n))return!1;let{anchor:r,focus:i}=n,a=r.offset,o=i.offset,s=r.getNode(),c=i.getNode(),l=e===iw;if(!fF(n)||!rF(s)&&!FE(s)||!rF(c)&&!FE(c))return!1;if(!t.altKey){if(n.isCollapsed()){let e=s.getParentOrThrow();if(l&&a===0&&s.getPreviousSibling()===null){if(e.getPreviousSibling()===null)return e.selectPrevious(),t.preventDefault(),!1}else if(!l&&a===s.getTextContentSize()&&s.getNextSibling()===null&&e.getNextSibling()===null)return e.selectNext(),t.preventDefault(),!1}return!1}let u,d;if(s.isBefore(c)?(u=LP(s),d=RP(c)):(u=LP(c),d=RP(s)),u==null||d==null)return!1;let f=u.getNodesBetween(d);for(let e=0;ee.remove()),h?(f.forEach(e=>{g.insertAfter(e),g=e}),g.insertAfter(p)):e===iw?(f.forEach(e=>g.insertBefore(e)),g.insertBefore(p)):(g.insertAfter(p),g=p,f.forEach(e=>{g.insertAfter(e),g=e})),n.setTextNodeRange(s,a,c,o),!0}function gF(e,t){let n=$();if(!Q(n))return!1;let{anchor:r,focus:i}=n,a=r.getNode(),o=i.getNode(),s=e===rw;if(!fF(n)||!rF(a)&&!FE(a)||!rF(o)&&!FE(o))return!1;let c=o,l=nxe(c)===`rtl`?!s:s,u=r.key,d=r.offset,f=r.type;if(l){let e=rxe(c,i.offset);if(e!==null){let{node:t,offset:r}=e;ok(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else c.getParentOrThrow().selectStart()}else ixe(c).select();return t.shiftKey&&n.anchor.set(u,d,f),t.preventDefault(),t.stopPropagation(),!0}function bxe(e,t,n){return qk(...n?[e.registerCommand(aw,e=>!e.altKey&&KM(JP,e),1),e.registerCommand(ew,e=>KM(JP,e),1),e.registerCommand(iw,e=>!e.altKey&&GM(JP,e),1),e.registerCommand(nw,e=>GM(JP,e),1)]:[],e.registerCommand(uw,t=>{let n=function(e){let t=$();if(!Q(t)||!fF(t))return null;let n=e?pw:fw,r=e?pw:dw,i=t.anchor,a=t.focus;if(i.is(a))return r;let o=pF(t);if(o.length!==1)return n;let s=o[0],c,l;s.length===0&&FP(285),t.isBackward()?(c=a,l=i):(c=i,l=a);let u=LP(s[0]),d=RP(s[0]),f=DA(u.getKey(),0,`text`),p=DA(d.getKey(),d.getTextContentSize(),`text`);return c.isBefore(f)||p.isBefore(l)?n:f.isBefore(c)||l.isBefore(p)?r:n}(t.shiftKey);return n!==null&&(t.preventDefault(),e.dispatchCommand(n),!0)},1),e.registerCommand(dw,()=>!!fF($())&&(mj([PE()]),!0),1),e.registerCommand(fw,()=>mF(fw),1),e.registerCommand(pw,()=>mF(pw,t),1),e.registerCommand(iw,e=>{let t=$();if(!Q(t))return!1;let{anchor:n}=t,r=n.getNode();if(!fF(t))return!1;let i=r.getParent();return t.isCollapsed()&&n.offset===0&&r.getPreviousSibling()===null&&JP(i)&&i.getPreviousSibling()===null?(e.preventDefault(),!0):hF(iw,e)},1),e.registerCommand(aw,e=>{let t=$();if(!Q(t))return!1;let{anchor:n}=t,r=n.getNode();return!!fF(t)&&(t.isCollapsed()&&n.offset===r.getTextContentSize()&&r.getNextSibling()===null&&JP(r.getParentOrThrow())&&r.getParentOrThrow().getNextSibling()===null?(e.preventDefault(),!0):hF(aw,e))},1),e.registerCommand(rw,e=>gF(rw,e),1),e.registerCommand(tw,e=>gF(tw,e),1))}var xxe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function _F(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!xxe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function vF(e,t,n,r,i){let a=_F(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Sxe(e,t){e.__rel=t.__rel,e.__target=t.__target,e.__title=t.__title,e.__url=t.__url}var Cxe=e=>{let t=Pw(e,`format`),n=Fw(e,`format`),r=Lw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],rel:e.__rel,target:e.__target,title:e.__title,url:e.__url,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__rel;o!=null&&(a.rel=o);let s=e.__target;s!=null&&(a.target=s);let c=e.__title;c!=null&&(a.title=c);let l=e.__url;l!==void 0&&l!==``&&(a.url=l);let u=e.__dir;u!=null&&(a.direction=u);let d=t[e.__format];d!==void 0&&d!==``&&(a.format=d);let f=e.__indent;return f!==void 0&&f!==0&&(a.indent=f),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=vF(t.indent,0,0,1/0),e.__textFormat=_F(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.rel;e.__rel=typeof s==`string`&&s!==``?s:null;let c=t.target;e.__target=typeof c==`string`&&c!==``?c:null;let l=t.title;e.__title=typeof l==`string`&&l!==``?l:null;let u=t.url;return e.__url=typeof u==`string`?u:``,e},afterCloneFrom:Sxe}};function wxe(e,t){e.__isUnlinked=t.__isUnlinked}var Txe=e=>{let t=Pw(e,`format`),n=Fw(e,`format`),r=Lw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title,url:e.__url,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__isUnlinked;o!==void 0&&!1!==o&&(a.isUnlinked=o);let s=e.__rel;s!=null&&(a.rel=s);let c=e.__target;c!=null&&(a.target=c);let l=e.__title;l!=null&&(a.title=l);let u=e.__url;u!==void 0&&u!==``&&(a.url=u);let d=e.__dir;d!=null&&(a.direction=d);let f=t[e.__format];f!==void 0&&f!==``&&(a.format=f);let p=e.__indent;return p!==void 0&&p!==0&&(a.indent=p),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=vF(t.indent,0,0,1/0),e.__textFormat=_F(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.rel;e.__rel=typeof s==`string`&&s!==``?s:null;let c=t.target;e.__target=typeof c==`string`&&c!==``?c:null;let l=t.title;e.__title=typeof l==`string`&&l!==``?l:null;let u=t.url;e.__url=typeof u==`string`?u:``;let d=t.isUnlinked;return e.__isUnlinked=typeof d==`boolean`&&d,e},afterCloneFrom:wxe}},yF=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]),Exe=Yw()({rel:Zw(qw(Uw(),{defaultAsNull:!0}),{field:`__rel`}),target:Zw(qw(Uw(),{defaultAsNull:!0}),{field:`__target`}),title:Zw(qw(Uw(),{defaultAsNull:!0}),{field:`__title`}),url:Zw(Uw(),{field:`__url`,getter:`getURL`,setter:`setURL`})}),bF=class extends WT{__url;__target;__rel;__title;$config(){return this.config(`link`,{children:`inline`,extends:WT,generated:Cxe,importDOM:{a:()=>({conversion:Dxe,priority:1})},inline:!0,json:Exe,mergeAdjacent:{by:[`url`,`target`,`rel`,`title`]}})}constructor(e=``,t={},n){super(n);let{target:r=null,rel:i=null,title:a=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=a}createDOM(e){let t=rO().createElement(`a`);return this.updateLinkDOM(null,t,e),SM(t,e.theme.link),t}updateLinkDOM(e,t,n){if(uO(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let n of[`target`,`rel`,`title`]){let r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}sanitizeUrl(e){let t=e;e=EF(e);try{let t=new URL(EF(e));if(!yF.has(t.protocol))return`about:blank`}catch{let e=t.replace(/[\u0000-\u001F\u007F\s]/g,``).match(/^([a-z][a-z0-9+.-]*):/i);if(e!=null&&!yF.has(`${e[1].toLowerCase()}:`))return`about:blank`}return e}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=KD(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!Q(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return(this.is(r)||this.isParentOf(r))&&(this.is(i)||this.isParentOf(i))&&t.getTextContent().length>0}isEmailURI(){return this.getURL().startsWith(`mailto:`)}isWebSiteURI(){let e=this.getURL();return e.startsWith(`https://`)||e.startsWith(`http://`)}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.getURL()===e.getURL()&&this.getTarget()===e.getTarget()&&this.getRel()===e.getRel()&&this.getTitle()===e.getTitle()}};function Dxe(e){let t=null;if(uO(e)){let n=e.textContent;(n!==null&&n!==``||e.children.length>0)&&(t=xF(e.getAttribute(`href`)||``,{rel:e.getAttribute(`rel`),target:e.getAttribute(`target`),title:e.getAttribute(`title`)}))}return{node:t}}function xF(e=``,t){return qD(new bF(e,t))}function SF(e){return e instanceof bF}var Oxe=Yw()({isUnlinked:Zw(Gw(),{field:`__isUnlinked`})}),kxe=class extends bF{__isUnlinked;constructor(e=``,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}$config(){return this.config(`autolink`,{extends:bF,generated:Txe,json:Oxe,mergeAdjacent:!1})}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.getLatest().__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?rO().createElement(`span`):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}};function CF(e){return e instanceof kxe}var wF=zC(`TOGGLE_LINK_COMMAND`);function TF(e,t){if(e.type===`element`){let n=e.getNode();return Z(n)||function(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}(252),n.getChildren()[e.offset+t]||null}return null}function Axe(e,t={}){let n;if(e&&typeof e==`object`){let{url:r,...i}=e;n=r,t={...i,...t}}else n=e;let{target:r,title:i}=t,a=t.rel===void 0?`noreferrer`:t.rel,o=$();if(o===null||!Q(o)&&!FA(o))return;if(FA(o)){let e=o.getNodes();if(e.length===0)return;e.forEach(e=>{if(n===null){let t=XO(e,e=>!CF(e)&&SF(e));t&&(t.insertBefore(e),t.getChildren().length===0&&t.remove())}else{let t=XO(e,e=>!CF(e)&&SF(e));if(t)t.setURL(n),r!==void 0&&t.setTarget(r),a!==void 0&&t.setRel(a),i!==void 0&&t.setTitle(i);else{let t=xF(n,{rel:a,target:r,title:i});e.insertBefore(t),t.append(e)}}});return}if(o.isCollapsed()&&n===null)for(let e of o.getNodes()){let t=XO(e,e=>!CF(e)&&SF(e));t!==null&&(t.getParentOrThrow().splice(t.getIndexWithinParent(),0,t.getChildren()),t.remove());return}let s=o.extract();if(n===null){let e=new Set;s.forEach(t=>{let n=XO(t,e=>!CF(e)&&SF(e));if(n!==null){let t=n.getKey();if(e.has(t))return;(function(e,t){let n=new Set(t.filter(t=>e.isParentOf(t)).map(e=>e.getKey())),r=e.getChildren(),i=r=>n.has(r.getKey())||Z(r)&&t.some(t=>e.isParentOf(t)&&r.isParentOf(t)),a=r.filter(i);if(a.length===0&&r.length>0)return;if(a.length===r.length)return r.forEach(t=>e.insertBefore(t)),void e.remove();let o=r.findIndex(i),s=r.findLastIndex(i),c=o===0,l=s===r.length-1;if(c)a.forEach(t=>e.insertBefore(t));else if(l)for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);else{for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);let t=r.slice(s+1);if(t.length>0){let n=KD(e);a[a.length-1].insertAfter(n),t.forEach(e=>n.append(e))}}})(n,s),e.add(t)}});return}let c=new Set,l=e=>{c.has(e.getKey())||(c.add(e.getKey()),e.setURL(n),r!==void 0&&e.setTarget(r),a!==void 0&&e.setRel(a),i!==void 0&&e.setTitle(i))};if(s.length===1){let e=s[0],t=XO(e,SF);if(t!==null)return l(t)}(function(e){let t=$();if(!Q(t))return e();let n=VT(t),r=n.isBackward(),i=TF(n.anchor,r?-1:0),a=TF(n.focus,r?0:-1);if(e(),i||a){let e=$();if(Q(e)){let t=e.clone();if(i){let e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+ +!!r,`element`)}if(a){let e=a.getParent();e&&t.focus.set(e.getKey(),a.getIndexWithinParent()+ +!r,`element`)}pD(VT(t))}}})(()=>{let e=null;for(let t of s){if(!t.isAttached())continue;let o=XO(t,SF);if(o){l(o);continue}if(Z(t)){if(!t.isInline())continue;if(SF(t)){if(!(CF(t)||e!==null&&e.getParentOrThrow().isParentOf(t))){l(t),e=t;continue}for(let e of t.getChildren())t.insertBefore(e);t.remove();continue}}let s=t.getPreviousSibling();SF(s)&&s.is(e)?s.append(t):(e=xF(n,{rel:a,target:r,title:i}),t.insertAfter(e),e.append(t))}})}var jxe=/^\+?[0-9\s()-]{5,}$/;function EF(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes(`@`)?`mailto:${e}`:jxe.test(e)?`tel:${e}`:`https://${e}`}function DF(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function Mxe(e){let t=1,n=e.getParent();for(;n!=null;){if(JF(n)){let e=n.getParent();if(UF(e)){t++,n=e.getParent();continue}DF(40)}return t}return t}function Nxe(e){let t=e.getParent();UF(t)||DF(40);let n=t,r=t;for(;r!==null;)r=r.getParent(),UF(r)&&(n=r);return n}function OF(e){return JF(e)&&UF(e.getFirstChild())}function kF(e,t){return t.getValue()}function Pxe(e,t){return JF(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function AF(e,t){return UF(e)?KD(e).setListType(t):HF(t)}function Fxe(e){let t=$();if(t!==null){let n=t.getNodes();if(Q(t)){let[r]=t.getStartEndPoints(),i=r.getNode(),a=i.getParent();if(GD(i)){let e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=jE();i.append(e),n=e.select().getNodes()}}else if(Pxe(i,n)){if(GD(a)){let t=HF(e);i.replace(t);let n=qF();Z(i)&&(n.setFormat(i.getFormatType()),n.setIndent(i.getIndent())),t.append(n)}else if(JF(i)){let t=i.getParentOrThrow();if(Pj(t)===null){let n=AF(t,e);jF(n,t.getChildren()),t.replace(n)}}return}}let r=new Set;for(let t=0;t0&&e.append(...r),t.remove()}function FF(e,t,n=!1){if(e&&t&&OF(e)&&OF(t)&&(!n||e.getChildrenSize()===1&&t.getChildrenSize()===1)&&e.getFirstChild().getListType()===t.getFirstChild().getListType()){if(PF(e.getFirstChild(),t.getFirstChild(),n),!n)return void t.remove();WT.prototype.remove.call(t)}}function Ixe(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())JF(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),UF(r.getFirstChild())||n++)}function Lxe(e){let t=new Set;if(OF(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(OF(r)&&OF(i)){let n=i.getFirstChild();if(UF(n)){n.append(e);let i=r.getFirstChild();UF(i)&&n.getListType()===i.getListType()&&(jF(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(OF(r)){let t=r.getFirstChild();if(UF(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(OF(i)){let t=i.getFirstChild();UF(t)&&t.append(e)}else if(UF(n)){let t=KD(e),a=KD(n);t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function IF(e){if(OF(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(UF(n?n.getParent():void 0)&&JF(n)&&UF(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=KD(e),i=KD(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));let a=KD(e),o=KD(t);a.append(o),jF(o,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(a),n.replace(e)}}}function Rxe(e=!1){let t=$();if(!Q(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),r=null;if(JF(n)&&n.getChildrenSize()===0)r=n;else if(uE(n)){let e=n.getParent();JF(e)&&e.getChildren().every(e=>uE(e)&&e.getTextContent().trim()===``)&&(r=e)}if(r===null)return!1;let i=Nxe(r),a=r.getParent();UF(a)||DF(40);let o=a.getParent(),s;if(GD(o))s=jE(),i.insertAfter(s);else{if(!JF(o))return!1;s=KD(o),o.insertAfter(s)}s.setTextStyle(t.style).setTextFormat(t.format).select();let c=r.getNextSiblings();if(c.length>0){let t=e?kF(0,r):1,n=KD(a).setStart(t);if(JF(s)){let e=KD(s);e.append(n),s.insertAfter(e)}else s.insertAfter(n);n.append(...c)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!JF(e)&&!UF(e))break;t=e}t.remove()}(r),!0}var zxe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function LF(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!zxe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function Bxe(e,t){e.__listType=t.__listType,e.__start=t.__start,e.__tag=t.__tag}var Vxe=e=>{let t=Pw(e,`format`),n=Fw(e,`format`),r=Lw(e,`format`),i=Iw(e,`listType`,0);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],listType:e.__listType,start:e.__start,tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__listType;o!==void 0&&o!==`number`&&(a.listType=o);let s=e.__start;s!==void 0&&s!==1&&(a.start=s);let c=e.__dir;c!=null&&(a.direction=c);let l=t[e.__format];l!==void 0&&l!==``&&(a.format=l);let u=e.__indent;return u!==void 0&&u!==0&&(a.indent=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let a=t.direction;e.__dir=a===null||a===`ltr`||a===`rtl`?a:null;let o=t.format;e.__format=typeof o==`string`&&o in n?n[o]:r,e.__indent=function(e){let t=LF(e,0);return t>=0&&t<=1/0&&Number.isInteger(t)?t:0}(t.indent),e.__textFormat=LF(t.textFormat,0);let s=t.textStyle;e.__textStyle=typeof s==`string`?s:``;let c=t.listType;return e.setListType(typeof c==`string`&&c in i?i[c]:c===`number`||c===`bullet`||c===`check`?c:`number`),e.__start=LF(t.start,1),e},afterCloneFrom:Bxe}};function Hxe(e,t){e.__checked=t.__checked,e.__value=t.__value}var Uxe=e=>{let t=Pw(e,`format`),n=Fw(e,`format`),r=Lw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],checked:e.getChecked(),indent:e.getIndent(),value:e.__value,direction:e.__dir,format:t[e.__format],textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.getChecked();o!==void 0&&(a.checked=o);let s=e.getIndent();s!==void 0&&s!==0&&(a.indent=s);let c=e.__value;c!==void 0&&c!==1&&(a.value=c);let l=e.__dir;l!=null&&(a.direction=l);let u=t[e.__format];return u!==void 0&&u!==``&&(a.format=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.setIndent(function(e){let t=LF(e,NaN);return Number.isFinite(t)&&Number.isInteger(t)?t<0?0:t>128?128:t:0}(t.indent)),e.__textFormat=LF(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.checked;return e.__checked=s===void 0?void 0:typeof s==`boolean`&&s,e.__value=LF(t.value,1),e},afterCloneFrom:Hxe}},RF={ol:`number`,ul:`bullet`},Wxe=Yw()({listType:Qw(Xw(Kw([`number`,`bullet`,`check`]),RF),{getter:{field:`__listType`}}),start:Zw(Ww(1),{field:`__start`}),tag:Qw(Kw([`ul`,`ol`]),{getter:{field:`__tag`},setter:null})}),zF=class extends WT{__tag;__start;__listType;$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.constructor,n=e.getNextSibling();return n!==null&&n.constructor===t&&UT(_O())&&U_e(t).declaredBy.mergeAdjacent===t})(e)||function(e){let t=e.getNextSibling();UF(t)&&e.getListType()===t.getListType()&&NF(e,t)}(e),Ixe(e)},children:[WF],extends:WT,generated:Vxe,importDOM:C_e({ol:()=>({conversion:VF,priority:0}),ul:()=>({conversion:VF,priority:0})}),json:Wxe,mergeAdjacent:{by:[`listType`]}})}constructor(e=`number`,t=1,n){super(n);let r=RF[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=rO().createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,BF(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(BF(t,n.theme,this),e.__start!==this.__start&&t.setAttribute(`start`,String(this.__start)),!1)}exportDOM(e){let t=this.createDOM(e._config,e);if(dO(t)){this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`);let e=this.getDirection();e&&(t.dir=e)}return{element:t}}canBeEmpty(){return!1}INTERNAL_$afterStructureMerge(e,t){FF(e,t,!0)}INTERNAL_$afterStructureSplit(e,t){if(this.getListType()===`number`){let n=e.getStart();for(let e of t)JF(e)&&!UF(e.getFirstChild())&&n++;this.setStart(n)}}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e1?r.push(...e):i.push(...e)}}i.length>0&&CM(e,...i),r.length>0&&SM(e,...r)}function VF(e){let t;if(function(e){return dO(e)&&e.nodeName.toLowerCase()===`ol`}(e)){let n=e.start;t=HF(`number`,n)}else t=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`)||e.getAttribute(`data-is-checklist`)===`1`)return!0;for(let t of e.childNodes)if(dO(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?HF(`check`):HF(`bullet`);return TO(t,e),{after:e=>function(e,t){let n=t.createListItemNode.bind(t),r=[];for(let t=0;t1&&e.forEach(e=>{UF(e)&&r.push(n().append(e))})}else r.push(n().append(i))}return r}(e,t),node:t}}function HF(e=`number`,t=1){return qD(new zF(e,t))}function UF(e){return e instanceof zF}var Gxe=Yw()({checked:Qw(Jw(Gw()),{setter:{field:`__checked`}}),indent:Qw(Ww(0,{clamp:!0,integer:!0,max:128,min:0}),{derived:!0}),value:Zw(Ww(1),{derived:!0,field:`__value`})}),WF=class extends WT{__value;__checked;$config(){return this.config(`listitem`,{$transform:e=>{let t=e.getParent();if(UF(t))t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0);else if(t){let n=e.createParentElementNode();UF(n)||DF(340);let r=[e];for(let t of[`previous`,`next`]){r.reverse();for(let{origin:n}of eM(e,t)){if(!JF(n))break;r.push(n)}}let i=UT(_O()),a=i?function(e,t){let n=$();if(!Q(n))return null;let r=e.getKey(),i=t[0].getIndexWithinParent(),a=[n.anchor,n.focus].filter(e=>e.type===`element`&&e.key===r).map(e=>({offset:e.offset,point:e}));return a.length===0?null:e=>{for(let{point:e,offset:n}of a)if(n<=i)e.set(r,n,`element`);else if(n!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},children:[`inline`,zF],extends:WT,generated:Uxe,importDOM:C_e({li:()=>({conversion:Kxe,priority:0})}),json:Gxe})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){let t=rO().createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(e,t){let n=t.getParent();!UF(n)||n.getListType()!==`check`||UF(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))})(t,this),t.value=this.__value,function(e,t,n){let r=t.list;if(!r)return;let i=r.listitem,a=r.nested&&r.nested.listitem,o=n.getParent(),s=UF(o)&&o.getListType()===`check`,c=n.getChecked(),l=n.getChildren().some(e=>UF(e)),u=[];r.listitemChecked!==void 0&&u.push(r.listitemChecked),r.listitemUnchecked!==void 0&&u.push(r.listitemUnchecked),a!==void 0&&u.push(...xM(a)),u.length>0&&CM(e,...u);let d=[];if(i!==void 0&&d.push(...xM(i)),s){let e=c?r.listitemChecked:r.listitemUnchecked;e!==void 0&&d.push(e)}a!==void 0&&l&&d.push(...xM(a)),d.length>0&&SM(e,...d)}(t,n.theme,this);let r=e?e.__style:``,i=this.__style;r!==i&&ZT(t.style,i,r),function(e,t,n){let r=t.__textStyle,i=n?n.__textStyle:``;if(n!==null&&i===r)return;let a=XT(r);for(let t in a)e.style.setProperty(`--listitem-marker-${t}`,a[t]);if(i!==``)for(let t in XT(i))t in a||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),OF(this)?{after(e){if(dO(e)){let t=e.previousElementSibling;if(dO(t)&&t.nodeName===`LI`){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}append(...e){for(let t=0;ti.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&OF(t)&&OF(n)&&t.getFirstChild().getListType()===n.getFirstChild().getListType()&&(NF(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){let n=KD(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(OF(this))return!1;let t=this.getParentOrThrow();if(JF(t.getParentOrThrow()))return IF(this),!0;let n=jE().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){let e=KD(t);e.append(...r),t.insertAfter(e)}return t.insertAfter(n),this.remove(),t.getChildrenSize()===0&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return UF(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;JF(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&DF(117),(e=Math.floor(e))>=0||DF(199);let t=e,n=this.getIndent();for(;n!==t;)n0&&t.children[0].tagName===`INPUT`)return GF(t.children[0])}let t=e.getAttribute(`aria-checked`),n=qF(t===`true`||t!==`false`&&void 0);return EO(n,e),{after:KF.bind(null,n),node:TO(n,e)}}function GF(e){if(e.getAttribute(`type`)!==`checkbox`)return{node:null};let t=qF(e.hasAttribute(`checked`));return{after:KF.bind(null,t),node:t}}function KF(e,t){let n=t[0];return t.length===1&&ME(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function qF(e){return qD(new WF(void 0,e))}function JF(e){return e instanceof WF}var YF=zC(`INSERT_UNORDERED_LIST_COMMAND`),XF=zC(`INSERT_ORDERED_LIST_COMMAND`);function ZF(e,t,n=null){let r=nO(n),i=n?eO(n):[],a=n!==null&&i.length>0;if(a&&typeof r.caretPositionFromPoint==`function`){let a=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(a!==null&&function(e,t){for(let n=e;n!==null;){if(n===t)return!0;n=ND(n)}return!1}(a.offsetNode,n))return{node:a.offsetNode,offset:a.offset}}if(a){let i=n.getRootNode();if($D(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let n=function(e,t,n,r){let i=r.createRange(),a=e=>te.bottom?t-e.bottom:0,o=t=>et.right?e-t.right:0,s=r.createTreeWalker(n,NodeFilter.SHOW_TEXT),c=null,l=1/0,u=1/0;for(let e=s.nextNode();e;e=s.nextNode()){i.selectNodeContents(e);for(let t of i.getClientRects()){let n=a(t),r=o(t);(ne}).createHTML(e):e}var eI=(e,t)=>{if(!Q(t))return t.insertRawText(e),!0;t!==$()&&pD(t);let n=e=>{let t=$();Q(t)&&e(t)};return hj(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([PE()])),text:e=>n(t=>t.insertText(e))}),!0},tI={"application/x-lexical-editor":[(e,t,n)=>{try{let n=_O(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return cI(n,tSe(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{let n=_O();return cI(n,jP(n,new DOMParser().parseFromString(qxe(e),`text/html`)),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[eI],"text/uri-list":[eI]};function Jxe(e,t,n,r){if(!e)return!1;let i=(t,n,a)=>!!e[t]&&e[t](n,a,(e=n,r=a)=>i(t-1,e,r),r);return i(e.length-1,t,n)}function nI(e,t,n){let r=t.getData(`text/plain`);for(let i of function(e){return Object.keys(e.$importMimeType).filter(t=>e.$importMimeType[t]!==void 0).sort((t,n)=>{let r=e.priority[t],i=e.priority[n];return r===void 0&&i===void 0?tn):r===void 0?1:i===void 0?-1:r-i})}(e)){let a=t.getData(i);if(a&&(i!==`text/html`||a!==r)&&Jxe(e.$importMimeType[i],a,n,t))return!0}return!1}var Yxe={$importMimeType:tI,$insertDataTransfer:(e,t)=>nI({$importMimeType:tI,priority:$F},e,t),priority:$F},Xxe={build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>nI(t,e,n),priority:t.priority}),config:{$importMimeType:tI,priority:$F},mergeConfig(e,t){let n=bM(e,t);if(t.$importMimeType){let r={...e.$importMimeType};for(let[e,n]of Object.entries(t.$importMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$importMimeType=r}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:`@lexical/clipboard/Import`};function rI(e,t=$()){return t??QF(166),Q(t)&&t.isCollapsed()||t.getNodes().length===0?``:MP(e,t)}function iI(e,t=$()){return t??QF(166),Q(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(eSe(e,t))}function aI(e,t,n){(function(){let e=_be(Xxe.name);return e?e.output:Yxe})().$insertDataTransfer(e,t)}var oI=`application/x-lexical-drag`;function Zxe(e,t){let n={editorKey:t.getKey()};e.setData(oI,JSON.stringify(n))}function sI(e){let t=e;if(Zj(t)){if(t.offset===0)t=_E(t.getSiblingCaret());else{if(t.offset!==t.origin.getTextContentSize())return t;t=t.getSiblingCaret()}}for(;;){let e=t.getParentAtCaret();if(e===null||!e.isInline()||e.isShadowRoot())return t;if($j(t))t=_E(eM(e,`next`));else{if(t.getNodeAtCaret()!==null)return t;t=eM(e,`next`)}}}function Qxe(e,t,n){let r=e.dataTransfer;if(r===null)return!1;let i=function(e){let t=e.getData(oI);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return(r=n)!==null&&typeof r==`object`&&`editorKey`in r&&typeof r.editorKey==`string`?n:null;var r}(r);if(i===null)return!1;let a=function(e,t){let n=ZF(e.clientX,e.clientY,t.getRootElement());if(n===null)return null;let r=cD(n.node);if(r===null)return null;if(uE(r))return tM(r,`next`,n.offset);let i=r.getParent();if(Z(r)){let e=t.getElementByKey(r.getKey());if(e===null)return null;let a=yO(r,e,t);return n.node===a.element||i?CE(...a.resolveChildIndex(r,e,n.node,n.offset),`next`):null}return i&&CE(i,r.getIndexWithinParent()+1,`next`)}(e,t);if(a===null)return!1;let o=i.editorKey===t.getKey(),s=$();if(o){if(!Q(s)||s.isCollapsed())return!1;if(function(e,t){let{anchor:n,focus:r}=SE(gE(t),`next`),i=sI(e);return pM(sI(n),i)<=0&&pM(i,sI(r))<=0}(a,s))return e.preventDefault(),!0}let c=bE(a),l=Zj(c)?DE(c):c;if(l===null)return!1;let u=l.getFlipped();o&&Q(s)&&s.removeText();let d=l.origin.isAttached()?l:u;if(d.origin.isAttached()||QF(438),n(r,mE(uM(d)),t),!o){let e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(let n of tO(t)){let t=KE(n);if(WE(t)&&t.getKey()===e&&dO(n))return n}return null}(i.editorKey,n):null;r!==null&&r.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteByDrag`}))}return e.preventDefault(),!0}function $xe(e,t){return Qxe(e,t,aI)}function cI(e,t,n){e.dispatchCommand(Zhe,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(Q(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=fE(t,`previous`);if(r){if(Zj(r))n=r.origin;else{let e=dM(r,iM(dD(),`next`).getFlipped());for(let t of e){if(uE(t.origin)){n=t.origin;break}if(Z(t.origin)&&!t.origin.isInline())break}}}if(n&&uE(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function lI(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=Z(n)&&n.excludeFromCopy(`clone`),o=n;t!==null&&uE(o)&&(o=OM(t,o,`clone`));let s=wge(o),c=Z(o)?o.getChildren():[],l=s.children||[];uE(o)&&o.getTextContentSize()===0&&(i=!1);let u=i&&FA(t)&&Z(n)?null:t;for(let r=0;r0){let n={};for(let r of t){let t=zj(o,r);t===null&&QF(366,o.constructor.name,r);let i=[];lI(e,null,t,i),(i.length!==1||Z(t)&&t.excludeFromCopy(`clone`))&&QF(435,r,o.constructor.name,String(i.length)),n[r]=i[0]}s.$slots=n}}if(i&&!a)r.push(s);else for(let e=0;e{e.update(()=>{r(fI(e,t,n))})});let r=e.getRootElement(),i=e._window||window,a=i.document,o=QD(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.position=`fixed`,s.style.top=`-1000px`,s.append(a.createTextNode(`#`)),r.append(s);let c=a.createRange();return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise((t,r)=>{let o=e.registerCommand(hw,r=>(RM(r,ClipboardEvent)&&(o(),uI!==null&&(i.clearTimeout(uI),uI=null),t(fI(e,r,n))),!0),4);uI=i.setTimeout(()=>{o(),uI=null,t(!1)},50),a.execCommand(`copy`),s.remove()})}function fI(e,t,n){if(n===void 0){let t=QD(e._window),r=$();if(!r||r.isCollapsed()||!t)return!1;let i=oO(t,e.getRootElement()),a=i.anchorNode,o=i.focusNode;if(a!==null&&o!==null&&!UE(e,a,o))return!1;n=pI(r)}t.preventDefault();let r=t.clipboardData;return r!==null&&(mI(r,n),!0)}var nSe=[[`text/html`,rI],[`application/x-lexical-editor`,iI]];function pI(e=$()){return function(e,t){let n={"text/plain":``};for(let[r,i]of Object.entries(e))if(i){let e=iSe(i,t);e!==null&&(n[r]=e)}return n}(rSe(),e)}function mI(e,t){for(let[n]of nSe)t[n]===void 0&&e.setData(n,``);for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}function rSe(e=_O()){let t=aN(e,aSe.name);return t?t.output:hI}var hI={"application/x-lexical-editor":[(e,t)=>e?iI(_O(),e):t()],"text/html":[(e,t)=>e?rI(_O(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function iSe(e,t){let n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}var aSe={build:(e,t,n)=>t.$exportMimeType,config:{$exportMimeType:hI},mergeConfig(e,t){let n=bM(e,t);if(t.$exportMimeType){let r={...e.$exportMimeType};for(let[e,n]of Object.entries(t.$exportMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$exportMimeType=r}return n},name:`@lexical/clipboard/GetClipboardData`},oSe={bold:`bold`,italic:`italic`,strikeThrough:`strikethrough`,subscript:`subscript`,superscript:`superscript`,underline:`underline`},gI=Symbol.for(`@lexical/dragon/WindowState`);function sSe(e,t,n){let r=function(e){let t=e[gI];return t===void 0&&(t={dispose:()=>{},editors:new Map,installs:new Set},e[gI]=t),t}(e);if(r.installs.size===0){let t=uSe.bind(e);e.addEventListener(`message`,t,!0),r.dispose=()=>{e.removeEventListener(`message`,t,!0)}}if(r.installs.add(t),n){let e=r.editors.get(n)||new Set;e.add(t),r.editors.set(n,e)}return cSe.bind(null,e,r,t,n)}function cSe(e,t,n,r){if(r){let e=t.editors.get(r);e&&e.delete(n)&&e.size===0&&t.editors.delete(r)}t.installs.delete(n)&&t.installs.size===0&&(t.dispose(),delete e[gI])}function _I(e){return e&&e.ownerDocument.defaultView}function lSe(e){let t=DN(()=>_I(e.getRootElement()),t=>e.registerRootListener(e=>{t.value=_I(e)}));return EN(()=>{let n=t.value;if(n)return sSe(n,Symbol(`@lexical/dragon/editorInstall`),e)})}function uSe(e){if(e.origin!==this.location.origin)return;let t=function(e){let t=e[gI];if(t===void 0)return null;let n=KE(cO(e.document));return WE(n)&&t.editors.has(n)?n:null}(this);if(t===null)return;let n=e.data;if(typeof n==`string`){let r;try{r=JSON.parse(n)}catch{return}if(r&&r.protocol===`nuanria_messaging`&&r.type===`request`){let n=r.payload;if(n&&n.functionId===`makeChanges`){let r=n.args;if(Array.isArray(r)){let[n,i,a,o,s,c]=r;if(![n,i,o,s].every(Number.isFinite)||typeof a!=`string`&&a!==-1)return;t.update(()=>{let t=$();if(Q(t)){let r=t.anchor,l=r.getNode(),u=0,d=0;if(uE(l)&&n>=0&&i>=0&&(u=n,d=n+i,t.setTextNodeRange(l,u,l,d)),typeof a!=`string`||u===d&&a===``||(t.insertRawText(a),l=r.getNode()),uE(l)){let e=l.getTextContentSize();u=Math.min(Math.max(o,0),e),d=o<0||s<0?u:Math.min(o+s,e),t.setTextNodeRange(l,u,l,d)}if(typeof c==`string`&&s>0&&!t.isCollapsed()){let e=oSe[c];e!==void 0&&t.formatText(e)}e.stopImmediatePropagation()}})}}}}}var dSe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function vI(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!dSe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function yI(e,t,n,r,i){let a=vI(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function fSe(e,t){e.__tag=t.__tag}var pSe=e=>{let t=Pw(e,`format`),n=Fw(e,`format`),r=Lw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__tag;o!==void 0&&o!==`h1`&&(a.tag=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=yI(t.indent,0,0,1/0),e.__textFormat=vI(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.tag;return e.__tag=s===`h1`||s===`h2`||s===`h3`||s===`h4`||s===`h5`||s===`h6`?s:`h1`,e},afterCloneFrom:fSe}},mSe=e=>{let t=Pw(e,`format`),n=Fw(e,`format`),r=Lw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=yI(t.indent,0,0,1/0),e.__textFormat=vI(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},bI=zC(`DRAG_DROP_PASTE_FILE`),xI=$w(`shadowRoot`,{parse:Gw()}),SI=class extends WT{$config(){return this.config(`quote`,{children:`inline`,extends:WT,generated:mSe,importDOM:{blockquote:()=>({conversion:gSe,priority:0})},stateConfigs:[{flat:!0,stateConfig:xI}]})}isShadowRoot(){return eT(this,xI)}setIsShadowRoot(e){return tT(this,xI,e)}createDOM(e){let t=rO().createElement(`blockquote`);return SM(t,e.theme.quote),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(dO(t)){this.isEmpty()&&t.append(rO().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return CI().updateFromJSON(e)}insertNewAfter(e,t){let n=jE();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(let e of this.getChildren())this.insertBefore(e);return this.remove(),!0}let e=jE();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function CI(e){let t=qD(new SI);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function wI(e){return e instanceof SI}var hSe=Yw()({tag:Zw(Kw([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]),{field:`__tag`})}),TI=class extends WT{__tag;$config(){return this.config(`heading`,{children:`inline`,extends:WT,generated:pSe,importDOM:{h1:()=>({conversion:DI,priority:0}),h2:()=>({conversion:DI,priority:0}),h3:()=>({conversion:DI,priority:0}),h4:()=>({conversion:DI,priority:0}),h5:()=>({conversion:DI,priority:0}),h6:()=>({conversion:DI,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&EI(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>EI(e)?{conversion:()=>({node:OI(`h1`)}),priority:3}:null},json:hSe})}constructor(e=`h1`,t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let t=this.getWritable();return t.__tag=e,t}createDOM(e){let t=this.__tag,n=rO().createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];SM(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}exportDOM(e){let{element:t}=super.exportDOM(e);if(dO(t)){this.isEmpty()&&t.append(rO().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}insertNewAfter(e,t=!0){let n=!this.getLastDescendant()||e&&JM(e.anchor,this),r=e&&qM(e.anchor,this),i=n||!e?jE():OI(this.getTag()).setFormat(this.getFormatType()).setStyle(this.getStyle()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),r&&!this.isEmpty()){let e=jE();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=jE();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function EI(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function DI(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=OI(t),wO(e,n),EO(n,e),TO(n,e)),{node:n}}function gSe(e){let t=CI();return EO(t,e),wO(e,t),TO(t,e),{node:t}}function OI(e=`h1`){return qD(new TI(e))}function kI(e){return e instanceof TI}function AI(e){return KT(cD(e))&&!(dO(e)&&e.hasAttribute(`data-lexical-slot`))}function jI(e){let t=e.focus;return t.key===`root`&&t.offset===dD().getChildrenSize()}function MI(e){let t=e.focus;return t.key===`root`&&t.offset===0}function NI(e,t){if(!e.isCollapsed())return!1;let n=t===`next`;if(!(n?jI(e):MI(e)))return!1;let r=e.focus.offset;return XD(dD().getChildAtIndex(n?r-1:r))}function PI(e,t,n,r){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type===`text`){let t=e.anchor.getNode();if(uE(t)){a=t;let r=e.anchor.offset,o=r===t.getTextContentSize()&&t.getNextSibling()===null,s=r===0&&t.getPreviousSibling()===null;i=n===`end`&&o||n===`start`&&s||n===`both`&&(o||s)}}let o=!1;for(let[n,s]of Object.entries(r)){if(s==null||!s[t])continue;let r=n;if(s.onlyAtBoundary){if(!(i&&a&&uE(a)&&a.hasFormat(r)))continue;o=!0}e.hasFormat(r)&&e.toggleFormat(r)}o&&e.setStyle(``)}var _Se={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function FI(e,t){return function(e,t){if(!e.isCollapsed())return!1;let n=fE(e.focus,t),r=XO(n.origin,WD);if(!r)return!1;let i=e.focus.getNode();if(!r.is(i)&&!zD(i,r))return!1;let a=dM(n,eM(r,t));if(a.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;let o=dM(a.anchor.getSiblingCaret(),a.focus),s=o.anchor.origin;for(let e of o){if(!Qj(e)||!e.origin.is(s.getParent()))return!1;s=e.origin}let c=r;for(let e of lM(eM(r,t))){if(!e.origin.is(c.getParent())){if(XD(e.origin)){let e=eM(c,t);return mE(dM(e,e)),!0}break}if(!WD(e.origin))break;c=e.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||e.anchor.type!==`element`)return!1;let n=fE(e.anchor,t).getNodeAtCaret();return!(!WD(n)||n.isInline()||(mE(uM(bE(iM(n,t)))),0))}(e,t)}function II(e){return KT(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function LI(e){let t=rj();t.add(e),pD(t)}function RI(e,t){if(!e.isCollapsed())return!1;let n=e.focus,r=n.getNode(),i=t?`previous`:`next`,a=fE(n,i);if(n.type===`element`&&Z(r)&&GD(r)){let e=a.getNodeAtCaret();return!(e===null||!II(e)||(LI(e.__key),0))}let o=XO(Z(r)?r:r.getParentOrThrow(),e=>Z(e)&&!e.isInline()&&GD(e.getParent()));if(o===null)return!1;let s=eM(o,i).getNodeAtCaret();if(s===null||!II(s))return!1;if(o.getTextContentSize()===0)return LI(s.__key),!0;let c=_O().getRootElement();if(c===null)return!1;let l=QD(c.ownerDocument.defaultView);if(l===null||l.rangeCount===0)return!1;let u=l.anchorNode,d=l.anchorOffset,f=l.focusNode,p=l.focusOffset;l.modify(`move`,t?`backward`:`forward`,`line`);let m=l.anchorNode,h=l.anchorOffset;if(m===null)return zI(l,u,d,f,p),!1;let g=cD(m);return zI(l,u,d,f,p),g!==null&&(m===u&&h===d||!g.is(o)&&!zD(g,o))&&(LI(s.__key),!0)}function zI(e,t,n,r,i){t!==null&&r!==null&&e.setBaseAndExtent(t,n,r,i)}function BI(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),r=XO(Z(n)?n:n.getParentOrThrow(),e=>Z(e)&&!e.isInline());if(r===null)return!1;let i=_O(),a=i.getRootElement();if(a===null)return!1;let o=a.ownerDocument.defaultView;if(o===null)return!1;let s=!1;for(let e of r.getChildren())if(Z(e)&&e.isInline()){let t=i.getElementByKey(e.getKey());if(t!==null){let e=o.getComputedStyle(t).display;if(e===`inline-grid`||e===`inline-flex`){s=!0;break}}}if(!s)return!1;let c=eM(r,t?`previous`:`next`).getNodeAtCaret();if(c===null||!Z(c)){if(t){let e=r.getFirstDescendant();uE(e)?e.select(0,0):r.select(0,0)}else{let e=r.getLastDescendant();if(uE(e)){let t=e.getTextContentSize();e.select(t,t)}else{let e=r.getChildrenSize();r.select(e,e)}}return!0}let l=i.getElementByKey(c.getKey());if(l===null)return!1;let u=QD(o);if(u===null||u.rangeCount===0)return!1;let d=u.getRangeAt(0).cloneRange();d.collapse(!0);let f=d.getBoundingClientRect(),p=l.getBoundingClientRect(),m=p.top+p.height/2;if(f.height>0){let t=ZF(f.left,m,a);if(t!==null&&l.contains(t.node)){let n=a.ownerDocument.createRange();return n.setStart(t.node,t.offset),n.collapse(!0),e.applyDOMRange(n),e.dirty=!0,!0}}let h=t?c.getLastDescendant():c.getFirstDescendant();if(uE(h)){let e=t?h.getTextContentSize():0;h.select(e,e)}else{let e=c.getChildrenSize();c.select(t?e:0,t?e:0)}return!0}function VI(e,t){let n=eM(e,t),r=n.getAdjacentCaret();r!==null&&Z(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?mE(uM(n)):t===`next`?e.selectNext(0,0):e.selectPrevious()}function HI(e,t){let n=e.getNodes().map(e=>eM(e,`next`)).sort(pM),r=n[0],i=n[n.length-1];if(!r||!i)return!1;for(let e=0;eeM(e,`next`)).sort(pM),a=(t?i[0]:i[i.length-1]).origin,o=XO(a,e=>e!==a&&Z(e)&&!e.isInline())??dD(),s=t?0:o.getChildrenSize();return o.select(s,s),!0}function vSe(e,t){return e.length>0&&!t}function ySe(e,t=vN(_Se),n=vN(vSe)){return qk(e.registerCommand(VC,n=>{let r=$();if(FA(r)){let t=n.target;if(dO(t))for(let n of r.getNodes()){let r=e.getElementByKey(n.getKey());if(r!==null&&r.contains(t))return!1}return r.clear(),!0}return Q(r)&&PI(r,`click`,`both`,t.peek()),!1},0),e.registerCommand(HC,e=>{let t=$();return Q(t)?(t.deleteCharacter(e),!0):!!FA(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(JC,e=>{let t=$();return!!Q(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(YC,e=>{let t=$();return!!Q(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(GC,t=>{let n=$();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)aI(r,n,e);else if(Q(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},0),e.registerCommand(qC,()=>{let e=$();return!!Q(e)&&(e.removeText(),!0)},0),e.registerCommand(XC,e=>{let t=$();return!(!Q(t)&&!FA(t)||(RA(t,e),0))},0),e.registerCommand(nge,e=>{let t=$();return!(!Q(t)&&!FA(t)||(_ye(t,e),0))},0),e.registerCommand(mw,e=>{let t=$();if(!Q(t)&&!FA(t))return!1;let n=t.getNodes();for(let t of n){let n=XO(t,e=>Z(e)&&!e.isInline());n!==null&&n.setFormat(e)}return!0},0),e.registerCommand(UC,e=>{let t=$();return!!Q(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(WC,()=>{let e=$();return!!Q(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(dw,()=>{let e=PE(),t=$();return Q(t)&&(e.setFormat(t.format),e.setStyle(t.style)),mj([e]),!0},0),e.registerCommand(fw,()=>BM(e=>{let t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(pw,()=>BM(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(iw,e=>{let t=$();if(FA(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!HI(t,`previous`))return e.preventDefault(),VI(n[0],`previous`),!0;t=$()}}return Q(t)&&(MI(t)||!e.shiftKey&&FI(t,`previous`)||!e.shiftKey&&RI(t,!0)||!e.shiftKey&&BI(t,!0))?(e.preventDefault(),!0):!1},0),e.registerCommand(aw,e=>{let t=$();if(FA(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!HI(t,`next`))return e.preventDefault(),VI(n[0],`next`),!0;t=$()}}return Q(t)&&(jI(t)||!e.shiftKey&&FI(t,`next`)||!e.shiftKey&&RI(t,!1)||!e.shiftKey&&BI(t,!1))?(e.preventDefault(),!0):!1},0),e.registerCommand(nw,e=>{let n=$();if(FA(n)){let t=n.getNodes();if(t.length>0){let r=DM(t[0])?`next`:`previous`;if(!e.shiftKey||!HI(n,r))return e.preventDefault(),VI(t[0],r),!0;n=$()}}if(!Q(n))return!1;let r=DM(n.anchor.getNode())?`next`:`previous`;if(NI(n,r)||!e.shiftKey&&FI(n,r))return e.preventDefault(),!0;if(e.shiftKey||PI(n,`arrow`,`start`,t.peek()),MM(n,!0)){let t=e.shiftKey;return e.preventDefault(),PM(n,t,!0),!0}return!1},0),e.registerCommand(ew,e=>{let n=$();if(FA(n)){let t=n.getNodes();if(t.length>0){let r=DM(t[0])?`previous`:`next`;if(!e.shiftKey||!HI(n,r))return e.preventDefault(),VI(t[0],r),!0;n=$()}}if(!Q(n))return!1;let r=DM(n.anchor.getNode())?`previous`:`next`;if(NI(n,r)||!e.shiftKey&&FI(n,r))return e.preventDefault(),!0;if(e.shiftKey||PI(n,`arrow`,`end`,t.peek()),MM(n,!1)){let t=e.shiftKey;return e.preventDefault(),PM(n,t,!1),!0}return!1},0),e.registerCommand(sw,t=>{let n=$();if(!FA(n)&&AI(t.target))return!1;if(Q(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(YT(n))return!1;let r=Jye(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(pw);if(DC&&EC)return!1}else if(!FA(n))return!1;return t.preventDefault(),e.dispatchCommand(HC,!0)},0),e.registerCommand(lw,t=>{let n=$();return!(!FA(n)&&AI(t.target))&&!(!Q(n)&&!FA(n))&&(t.preventDefault(),e.dispatchCommand(HC,!1))},0),e.registerCommand(ow,n=>{let r=$();if(FA(r)){let e=r.getNodes();e.length===1&&KT(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!Q(r))return!1;if(PI(r,`enter`,`both`,t.peek()),n!==null){if((DC||OC||jC)&&EC)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(UC,!1)}return e.dispatchCommand(WC)},0),e.registerCommand(cw,()=>!!Q($())&&(e.blur(),!0),0),e.registerCommand(ige,t=>{let[,n]=zM(t);if(n.length>0){let r=t.clientX,i=t.clientY,a=ZF(r,i,e.getRootElement());if(a!==null){let{offset:e,node:t}=a,n=cD(t);if(n!==null){let t=nj();if(uE(n))t.anchor.set(n.getKey(),e,`text`),t.focus.set(n.getKey(),e,`text`);else{let e=n.getParentOrThrow().getKey(),r=n.getIndexWithinParent()+1;t.anchor.set(e,r,`element`),t.focus.set(e,r,`element`)}pD(VT(t))}}return!(!e.dispatchCommand(bI,n)&&DC&&n.every(e=>e.type===`text/plain`)||(t.preventDefault(),0))}return $xe(t,e)},0),e.registerCommand(age,t=>{let[n]=zM(t),r=$();return!(n&&!Q(r)||(Q(r)&&!r.isCollapsed()&&t.dataTransfer!==null&&(mI(t.dataTransfer,pI(r)),Zxe(t.dataTransfer,e)),0))},0),e.registerCommand(oge,t=>{let[n]=zM(t),r=$();if(n&&!Q(r))return!1;let i=t.clientX,a=t.clientY,o=ZF(i,a,e.getRootElement());return o!==null&&KT(cD(o.node))&&t.preventDefault(),!0},0),e.registerCommand(_w,()=>{let e=$();return vve(Q(e)&&Fj(e.anchor.getNode())!==null?e:null),!0},0),e.registerCommand(hw,t=>!HE(t)&&(dI(e,RM(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(gw,t=>!HE(t)&&(async function(e,t){t.update(()=>{let e=$();Q(e)&&!e.isCollapsed()&&zA(e)},{discrete:!0,tag:`cut`}),await dI(t,RM(e,ClipboardEvent)?e:null),t.update(()=>{let e=$();Q(e)?e.removeText():FA(e)&&e.getNodes().forEach(e=>e.remove())},{tag:`cut`})}(t,e),!0),0),e.registerCommand(KC,t=>{let[,r,i]=zM(t);return!(!n.peek()(r,i)||!e.dispatchCommand(bI,r))||!HE(t)&&$()!==null&&(function(e,t){e.preventDefault(),t.update(()=>{let n=$(),r=RM(e,InputEvent)||RM(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&aI(r,n,t)},{tag:`paste`})}(t,e),!0)},0),e.registerCommand(rge,()=>{let e=$();return Q(e)&&PI(e,`space`,`both`,t.peek()),!1},0),e.registerCommand(uw,()=>{let e=$();return Q(e)&&PI(e,`tab`,`both`,t.peek()),!1},0),e.registerCommand(tw,e=>{let t=$();if(FA(t))return UI(t,!1,e);if(!Q(t))return!1;let{anchor:n}=t;if(n.type!==`element`||n.offset!==0)return!1;let r=n.getNode();if(!Z(r))return!1;let i=r.getFirstChild();if(!KT(i)||!i.isInline())return!1;let a=r.getKey(),o=r.selectEnd();return e.shiftKey&&o.anchor.set(a,0,`element`),e.preventDefault(),e.stopPropagation(),!0},0),e.registerCommand(rw,e=>{let t=$();if(FA(t))return UI(t,!0,e);if(!Q(t))return!1;let{anchor:n,focus:r}=t,i=XO(r.getNode(),e=>Z(e)&&!e.isInline());if(i===null)return!1;let a=i.getFirstChild();if(!KT(a)||!a.isInline()||XO(n.getNode(),e=>Z(e)&&!e.isInline())!==i)return!1;let o=i.getKey();return(r.type!==`element`||r.key!==o||r.offset!==0)&&(t.focus.set(o,0,`element`),e.shiftKey||t.anchor.set(o,0,`element`),e.preventDefault(),e.stopPropagation(),!0)},0))}function WI(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function GI(e){let t=WI(e,e=>e.type);return{element:t.element||[],multilineElement:t[`multiline-element`]||[],textFormat:t[`text-format`]||[],textMatch:t[`text-match`]||[]}}var KI=/[!-/:-@[-`{-~\s]/,qI=/\s/,JI=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,bSe=/^\s{0,3}$/;function YI(e){if(!ME(e))return!1;let t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&uE(t)&&bSe.test(t.getTextContent())}function XI(e){return e.replace(/\\([!-/:-@[-`{-~])|&#(?:(\d{1,7})|[xX]([\da-fA-F]{1,6}));/g,(e,t,n,r)=>t??function(e,t){let n=e===void 0?parseInt(t,16):Number(e);return n===0||n>=55296&&n<=57343||n>1114111?`�`:String.fromCodePoint(n)}(n,r))}function ZI(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1}function QI(e){let t=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},n=[],r=0;for(;r=2&&c.startsWith(` `)&&c.endsWith(` `)&&/[^ ]/.test(c)&&(c=c.slice(1,-1)),i.push({content:c,endIndex:s.index+s.length,startIndex:r.index}),a=o+1}return i}function $I(e,t,n,r,i){if(!eL(t,n,r,i))return!1;if(e===`*`)return!0;if(e===`_`){if(!eL(t,n,r,!i))return!0;let e=i?t[n-1]:t[n+r];return e!==void 0&&JI.test(e)}return!0}function eL(e,t,n,r){let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o!==void 0&&!qI.test(o)&&(!JI.test(o)||s===void 0||qI.test(s)||JI.test(s))}var tL=/^(\s*)(\d{1,})\.\s/,nL=/^(\s*)[-*+]\s/,xSe=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,rL=/^(#{1,6})\s/,iL=/^>\s/,aL=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,oL=/^[ \t]*`{3,}$/,SSe=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,CSe=/^(?:\|)(.+)(?:\|)\s?$/;function wSe(e){if(e[0]!==`|`)return!1;let{length:t}=e,n=1,r=0;for(;n0&&(n===t||n===t-1&&/\s/.test(e[n]))}var sL=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,cL=/^<\/[a-z_][\w-]*\s*>/i,lL=e=>RegExp(`(?:${e.source})$`,e.flags),uL=$w(`mdListMarker`,{parse:e=>typeof e==`string`&&/^[-*+]$/.test(e)?e:`-`,resetOnCopyNode:!0}),dL=$w(`mdCodeFence`,{parse:e=>typeof e==`string`&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),fL=$w(`mdCodeMeta`,{parse:e=>typeof e==`string`?e:``,resetOnCopyNode:!0}),pL=$w(`mdHardLineBreak`,{parse:e=>typeof e==`string`&&/^(\\| {2,})$/.test(e)?e:``,resetOnCopyNode:!0});function mL(e){if(e.endsWith(`\\`)){let t=0;for(let n=e.length-1;n>=0&&e[n]===`\\`;n--)t++;return t%2==1?[e.slice(0,-1),`\\`]:null}let t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function hL(e){let t=ak(),n=function(e){let t=e.getChildren(),n=t.length-1,r=t[n];if(!uE(r))return null;let i=r.getTextContent(),a=mL(i);if(a!==null){let[e,t]=a;return r.setTextContent(e),t}return/^ {2,}$/.test(i)&&function(e,t){for(let n=t-1;n>=0;n--){if(ok(e[n]))return!1;if(/\S/.test(e[n].getTextContent()))return!0}return!1}(t,n)?(r.setTextContent(``),i):null}(e);return n!==null&&tT(t,pL,n),t}function gL(e){return wI(e)}function _L(e,t){let n=0;for(;n(t,n,r,i)=>{let a=e(r);a.append(...n),t.replace(a),i||a.select(0,0)};function yL(e){let t=0;for(let n of e)t+=n===` `?4-t%4:1;return t}var bL=null,xL=!1,SL=e=>(t,n,r,i)=>{if(kI(t)||!i&&gL(t))return!1;let a=t.getPreviousSibling(),o=t.getNextSibling(),s=qF(e===`check`?/^x$/i.test(r[3]||``):void 0),c=r[0].trim()[0],l=e!==`bullet`&&e!==`check`||c!==uL.parse(c)?void 0:c,u=bL,d=a;if(u!==null){if(xL)for(;d!==null&&YI(d);)d=d.getPreviousSibling();UF(d)||(u.length=0)}let f=u===null||u.length===0?function(e){let t=e.match(/\t/g),n=e.match(/ /g),r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]):function(e,t){let n=yL(t);for(let t=e.length-1;t>=0;t--)if(n>=e[t])return t+1;return 0}(u,r[1]);if(UF(o)&&o.getListType()===e){let n=o.getFirstChild();n===null?o.append(s):n.insertBefore(s),e===`number`&&f===0&&o.setStart(Number(r[2])),t.remove()}else if(UF(d)&&(d.getListType()===e||f>0))d.append(s),t.remove();else{let n=HF(e,e===`number`?Number(r[2]):void 0);n.append(s),t.replace(n)}s.append(...n),i||s.select(0,0),f&&(s.setIndent(f),function(e,t,n){let r=e.getParent();if(!UF(r)||r.getListType()===t)return;let i=r.getParent();if(!JF(i))return;let a=HF(t,t===`number`?Number(n[2]):void 0),o=e.getPreviousSibling()===null;a.append(e);let s=qF();s.append(a),o?i.insertBefore(s):i.insertAfter(s),r.getChildrenSize()===0&&i.remove()}(s,e,r));let p=s.getParent();l&&UF(p)&&tT(p,uL,l),u!==null&&function(e,t,n,r){for(let n=e.length;n{let i=[],a=e.getChildren(),o=0;for(let s of a)if(JF(s)){if(s.getChildrenSize()===1){let e=s.getFirstChild();if(UF(e)){let a=CL(e,t,n+1,r);a&&i.push(a);continue}}if(r&&!s.getChildren().some(e=>e.isSelected(r)))continue;let a=` `.repeat(4*n),c=e.getListType(),l=eT(e,uL),u=c===`number`?`${e.getStart()+o}. `:c===`check`?`${l} [${s.getChecked()?`x`:` `}] `:l+` `,d=t(s);c!==`number`&&(d=d.replace(/^(\s{0,3}\d+)(\.\s)/,`$1\\$2`)),i.push(a+u+d),o++}return i.join(` `)},ESe=vL(e=>OI(`h`+e[1].length)),wL={dependencies:[TI],export:(e,t)=>{if(!kI(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:rL,replace:(e,t,n,r)=>!(!r&&gL(e))&&ESe(e,t,n,r),triggerOnEnter:!0,type:`element`},TL={dependencies:[SI],export:(e,t)=>{if(!wI(e))return null;let n=t(e).split(` `),r=[];for(let e of n)r.push(`> `+e);return r.join(` `)},regExp:iL,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if(wI(n))return n.splice(n.getChildrenSize(),0,[hL(n),...t]),void e.remove()}let i=CI();i.append(...t),e.replace(i),r||i.select(0,0)},triggerOnEnter:!0,type:`element`},EL={dependencies:[KP],export:e=>{if(!JP(e))return null;let t=e.getTextContent(),n=eT(e,dL);if(t.indexOf(n)>-1){let e=t.match(/`{3,}/g);if(e){let t=Math.max(...e.map(e=>e.length));n="`".repeat(t+1)}}let r=e.getLanguage()||``,i=r?eT(e,fL):``;return n+r+(i?` `+i:``)+(t?` `+t:``)+` `+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{let i=r[1],a=i.trim().length,o=e[n],s=r.index+i.length,c=o.slice(s),l=RegExp(`\`{${a},}$`);if(l.test(c)){let e=c.match(l),i=c.slice(0,c.lastIndexOf(e[0])),a=[...r];return a[2]=``,EL.replace(t,null,a,e,[i],!0),[!0,n]}let u=RegExp(`^[ \\t]*\`{${a},}$`);for(let i=n+1;i{let o,s,c=n[1]?n[1].trim():"```",l=n[2]||void 0,u=n[1]?n[1].length-n[1].trimStart().length:0;if(!t&&i){if(i.length===1)r?(o=qP(l),s=_L(i[0],u)):(o=qP(l),s=i[0].startsWith(` `)?i[0].slice(1):i[0]);else{for(o=qP(l),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(` `)&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();s=i.map(e=>_L(e,u)).join(` `)}tT(o,dL,c);let t=lE(s);o.append(t),e.append(o)}else if(t){if(!a&&gL(e))return!1;vL(e=>qP(e?e[2]:void 0))(e,t,n,a)}},type:`multiline-element`},DL={dependencies:[zF,WF],export:(e,t,n)=>UF(e)?CL(e,t,0,n):null,regExp:nL,replace:SL(`bullet`),triggerOnEnter:!0,type:`element`},OL={dependencies:[zF,WF],export:(e,t,n)=>UF(e)?CL(e,t,0,n):null,regExp:tL,replace:SL(`number`),triggerOnEnter:!0,type:`element`},kL={format:[`code`],tag:"`",type:`text-format`},DSe={format:[`highlight`],tag:`==`,type:`text-format`},AL={format:[`bold`,`italic`],tag:`***`,type:`text-format`},jL={format:[`bold`,`italic`],intraword:!1,tag:`___`,type:`text-format`},ML={format:[`bold`],tag:`**`,type:`text-format`},NL={format:[`bold`],intraword:!1,tag:`__`,type:`text-format`},PL={format:[`strikethrough`],tag:`~~`,type:`text-format`},FL={format:[`italic`],tag:`*`,type:`text-format`},IL={format:[`italic`],intraword:!1,tag:`_`,type:`text-format`};function LL(e){return e.replace(/&(?=#\d+;|#[Xx][\dA-Fa-f]+;|[A-Za-z][\dA-Za-z]*;)/g,`&`)}var RL={dependencies:[bF],export:(e,t,n)=>{if(!SF(e)||CF(e))return null;let r=t(e),i=e.getTitle();i!=null&&(i=LL(i).replace(/([\\"])/g,`\\$1`));let a=e.getURL(),o=LL(a),s=a===``||/\s/.test(a)?`<${o.replace(/([\\<>])/g,`\\$1`).replace(/\r/g,` `).replace(/\n/g,` `)}>`:o.replace(/([\\()])/g,`\\$1`).replace(/^\n\\])*)>|((?!<)(?:\\[^\s]|\\(?=\s)|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\])*\))*\))*\)|[^\s()\\])+))(?:\s+(?:"((?:[^"]*\\")*[^"]*)"|'((?:[^']*\\')*[^']*)'|\(((?:\\.|[^()\\])*)\)))?\s*)?\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\(\s*(?:(?:<((?:\\.|[^<>\n\\])*)>|((?!<)(?:\\[^\s]|\\(?=\s)|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\])*\))*\))*\)|[^\s()\\])+))(?:\s+(?:"((?:[^"]*\\")*[^"]*)"|'((?:[^']*\\')*[^']*)'|\(((?:\\.|[^()\\])*)\)))?\s*)?\))$/,replace:(e,t)=>{let n=t.input||``,r=t.index||0;if(XO(e,SF)||ZI(n,r)||ZI(n,r+t[1].length+1))return;let[,i,a,o,s,c,l]=t,u=XI(a??o??``),d=s??c??l,f=xF(u,{title:d==null?void 0:XI(d)}),p=function(e){let t=QI(e),n=0,r=e.replace(/\\.|[[\]]/g,(e,r)=>{for(;n=t[n].endIndex;)n++;return n=t[n].startIndex||e[0]===`\\`?` `.repeat(e.length):e}),i=[],a=!1;for(let e=0;e=r){r=0,i.push(o);continue}i.push(a)}}return i.join(` `)}function NSe(e,t,n,r,i){for(let a of t){if(!a.export)continue;let t=a.export(e,e=>VL(e,n,r,void 0,void 0,i));if(t!=null)return t}return Z(e)?VL(e,n,r,void 0,void 0,i):KT(e)?e.getTextContent():null}function VL(e,t,n,r,i,a=!1){let o=[],s=e.getChildren();r||=[],i||=[];t:for(let e of s){for(let s of n){if(!s.export)continue;let c=s.export(e,e=>VL(e,t,n,r,[...i,...r],a),(e,n)=>HL(e,n,t,r,i,a));if(c!=null){o.push(c);continue t}}ok(e)?o.push(PSe(e)):uE(e)?o.push(HL(e,e.getTextContent(),t,r,i,a)):Z(e)?o.push(VL(e,t,n,r,i,a)):KT(e)&&o.push(e.getTextContent())}return o.join(``)}function PSe(e){return eT(e,pL)+` `}function HL(e,t,n,r,i,a=!1){let o=e.hasFormat(`code`),s,c,l,u,d=t;if(o||(d=a?d.replace(/([*_`~])/g,`\\$1`):d.replace(/([[\]*_`~\\]|<(?=\S|$)|&(?=#|$))/g,e=>/[*_`~\\]/.test(e)?`\\${e}`:`&#${e.charCodeAt(0)};`)),o){let{fence:e,padded:n}=function(e){let t=e.match(/`+/g),n=t?Math.max(...t.map(e=>e.length)):0;return{fence:"`".repeat(n+1),padded:e.length===0||e.includes("`")||/^\s/.test(e)&&/\s$/.test(e)?` ${e} `:e}}(t);s=``,l=``,c=e+n+e,u=!1}else{let e=d.match(/^(\s*)(.*?)(\s*)$/s)||[``,``,d,``];s=e[1],c=e[2],l=e[3],u=c===``}let f=``,p=``,m=``,h=UL(e,!0),g=UL(e,!1),_=new Set;for(let t of n){let n=t.format[0],i=t.tag;n!==`code`&&(u||!GL(e,n)||_.has(n)||(_.add(n),GL(h,n)&&r.find(e=>e.tag===i)||(r.push({format:n,tag:i}),f+=i)))}for(let t=0;tt;){let e=o.pop();i&&e&&i.find(t=>t.tag===e.tag)||(e&&typeof e.tag==`string`&&(n?a||(m+=e.tag):p+=e.tag),r.pop())}break}return u&&!e.hasFormat(`code`)?p+d:p+s+f+c+m+l}function UL(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();return uE(n)?n:null}function WL(e,t){return uE(e)&&e.hasFormat(t)}function GL(e,t){return!(!WL(e,t)||t!==`code`&&e&&/^\s*$/.test(e.getTextContent()))}function FSe(e,t){let n=new RegExp(t.source,t.flags.replace(/[gy]/g,``)+`g`),r;for(;(r=n.exec(e))!==null;){if(!ZI(e,r.index))return r;n.lastIndex=r.index+1}return null}function KL(e){return uE(e)&&!e.hasFormat(`code`)}function qL(e,t,n){let r=function(e,t){let n=e.getTextContent(),r=t.transformersByTag["`"],i=[],a=null;if(r){let e=QI(n);for(let t of e)a||={content:t.content,endIndex:t.endIndex,startIndex:t.startIndex,tag:"`"},i.push({end:t.endIndex,start:t.startIndex})}let o=function(e,t,n=[]){let r=[],i=new Set(Object.keys(t.transformersByTag).filter(e=>e[0]!=="`").map(e=>e[0])),a=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},o=e=>n.some(t=>e>=t.start&&e0?function(e,t,n){let r={},i=0,a=null;for(;ic;r--){let s=t[r];if(!s.active||!s.canOpen||s.length===0||s.char!==o.char||(s.canClose||o.canOpen)&&(s.length+o.length)%3==0&&s.length%3!=0&&o.length%3!=0)continue;let c=Math.min(s.length,o.length),u=Object.keys(n.transformersByTag).filter(e=>e[0]===s.char&&e.length<=c).sort((e,t)=>t.length-e.length)[0];if(!u)continue;l=!0;let d=u.length,f={content:e.slice(s.index+s.length,o.index),endIndex:o.index+d,startIndex:s.index+(s.length-d),tag:u};(!a||f.startIndexa.endIndex)&&(a=f);for(let e=r+1;e0,o.length>0?o.index+=d:(o.active=!1,i++);break}l||(r[s]=i-1,o.canOpen||(o.active=!1),i++)}return a}(n,o,t):null,c=null,l=null;if(a&&s?s.startIndex<=a.startIndex&&s.endIndex>=a.endIndex?(c=s,l=t.transformersByTag[s.tag]):(c=a,l=r):a?(c=a,l=r):s&&(c=s,l=t.transformersByTag[s.tag]),!c||!l)return null;let u=[n.slice(c.startIndex,c.endIndex),c.tag,c.content];return u.index=c.startIndex,u.input=n,{endIndex:c.endIndex,isCodeSpan:l===r,match:u,startIndex:c.startIndex,transformer:l}}(e,t),i=function(e,t){let n=e,r,i,a,o;for(let e of t){if(!e.replace||!e.importRegExp)continue;let t=n.getTextContent(),s=RL.importRegExp!==void 0&&e.importRegExp.source===RL.importRegExp.source?FSe(t,e.importRegExp):t.match(e.importRegExp);if(!s)continue;let c=s.index||0,l=e.getEndIndex?e.getEndIndex(n,s):c+s[0].length;!1!==l&&(r===void 0||i===void 0||ci||l<=r))&&(r=c,i=l,a=e,o=s)}return r===void 0||i===void 0||a===void 0||o===void 0?null:{endIndex:i,match:o,startIndex:r,transformer:a}}(e,n);if(r&&i&&(r.isCodeSpan?i.startIndex<=r.startIndex&&i.endIndex>=r.endIndex?r=null:i=null:r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){let i=function(e,t,n,r,i){let a=e.getTextContent(),o,s,c;if(i[0]===a?o=e:t===0?[o,s]=e.splitText(n):[c,o,s]=e.splitText(t,n),o.setTextContent(i[2]),r)for(let e of r.format)o.hasFormat(e)||o.toggleFormat(e);return{nodeAfter:s,nodeBefore:c,transformedNode:o}}(e,r.startIndex,r.endIndex,r.transformer,r.match);KL(i.nodeAfter)&&qL(i.nodeAfter,t,n),KL(i.nodeBefore)&&qL(i.nodeBefore,t,n),KL(i.transformedNode)&&qL(i.transformedNode,t,n)}else if(i){let r=function(e,t,n,r,i){let a,o,s;return t===0?[a,o]=e.splitText(n):[s,a,o]=e.splitText(t,n),r.replace?{matchedNode:a,nodeAfter:o,nodeBefore:s,transformedNode:r.replace(a,i)||void 0}:null}(e,i.startIndex,i.endIndex,i.transformer,i.match);if(!r)return;KL(r.nodeAfter)&&qL(r.nodeAfter,t,n),KL(r.nodeBefore)&&qL(r.nodeBefore,t,n),KL(r.transformedNode)?qL(r.transformedNode,t,n):r.transformedNode===void 0&&KL(r.matchedNode)&&r.matchedNode.getParent()!==null&&r.matchedNode.setTextContent(XI(r.matchedNode.getTextContent()))}if(!r&&!i){let t=XI(e.getTextContent());e.setTextContent(t)}}function JL(e,t,n,r=!1){let i=GI(n),a=function(e){let t={},n={},r=[];for(let i of e){let{tag:e}=i;t[e]=i;let a=e.replace(/(\*|\^|\+)/g,`\\$1`);r.push(a),n[e]=e.length===1?RegExp(e==="`"?"(^|[^\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)":`(^|[^\\\\${a}])(${a})((\\\\${a})?.*?[^${a}\\s](\\\\${a})?)(${a})(?![\\\\${a}])`):RegExp(`(^|[^\\\\])(${a})((\\\\${a})?.*?[^\\s](\\\\${a})?)(${a})(?!\\\\)`)}return{fullMatchRegExpByTag:n,openTagsRegExp:RegExp(`(${r.join(`|`)})`,`g`),transformersByTag:t}}(i.textFormat),o=e.split(` `),s=o.length;(function(e){let n=bL,c=xL;bL=[],xL=e;try{return(()=>{for(let e=0;e1)e.remove();else if(Z(e))for(let t of e.getAllTextNodes())RSe(t)}function ISe(e,t,n,r){for(let i of n){let{handleImportAfterStartMatch:n,regExpEnd:a,regExpStart:o,replace:s}=i,c=e[t].match(o);if(!c)continue;if(n){let a=n({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:i});if(a===null)continue;if(a)return a}let l=typeof a==`object`&&`regExp`in a?a.regExp:a,u=a&&typeof a==`object`&&`optional`in a?a.optional:!a,d=t,f=e.length;for(;d0){let e=s.getPreviousSibling();if(!a&&(ME(e)||wI(e)||UF(e))){let t=e;if(UF(e)){let n=e.getLastDescendant();t=n==null?null:XO(n,JF)}t!=null&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[hL(t),...s.getChildren()]),s.remove())}}}function RSe(e){if(FE(e))return;let t=e.getTextContent();if(!t.includes(` `))return;let n=e.getFormat(),r=e.getStyle(),i=[],a=0;for(let e=t.indexOf(` `);e!==-1;e=t.indexOf(` `,e+1))e>a&&i.push(lE(t.slice(a,e)).setFormat(n).setStyle(r)),i.push(PE()),a=e+1;a=r;i--){let t=i-r;if($L(e,t,n,0,r)&&e[t+r]!==` `)return t}return-1}function QL(e){let t=e.getNode(),n=0;if(uE(t))n=e.offset;else if(Z(t))for(let r of t.getChildren().slice(0,e.offset))n+=r.getTextContentSize();for(let e=t.getPreviousSibling();e!==null;e=e.getPreviousSibling())n+=e.getTextContentSize();return n}function $L(e,t,n,r,i){for(let a=0;ae.triggerOnEnter),i=WI(n.textFormat,({tag:e})=>e[e.length-1]),a=WI(n.textMatch,({trigger:e})=>e),o=new Set([` `]);for(let e of n.textFormat)o.add(e.tag.slice(-1));for(let e of n.textMatch)e.trigger!==void 0&&o.add(e.trigger);for(let n of t){let t=n.type;if(t===`element`||t===`text-match`||t===`multiline-element`){let t=n.dependencies;for(let n of t)e.hasNode(n)||zSe(173,n.getType())}}return qk(e.registerUpdateListener(({tags:t,dirtyLeaves:r,editorState:s,prevEditorState:c})=>{if(t.has(`collaboration`)||t.has(`historic`)||e.isComposing())return;let l=t.has(`composition-end`),u=s.read($),d=c.read($);if(!Q(d)||!Q(u)||!u.isCollapsed()||u.is(d)&&!l)return;let f=u.anchor.key,p=u.anchor.offset,m=s._nodeMap.get(f);if(uE(m)&&r.has(f)&&(l||p===1||!(s.read(()=>QL(u.anchor))>c.read(()=>QL(d.anchor))+1))){if(l){let e=s.read(()=>m.getTextContent())[p-1];if(!o.has(e))return}e.update(()=>{if(!KL(m))return;let e=m.getParent();e===null||JP(e)||((e,t,r)=>!!(YL(e,t,r,n.element)||XL(e,t,r,n.multilineElement)||function(e,t,n){let r=e.getTextContent(),i=n[r[t-1]];if(i==null)return!1;t1&&!$L(r,s,n,0,o)||r[s-1]===` `)continue;let c=r[i+1];if(!1===t.intraword&&c&&!KI.test(c))continue;let l=e,u=l,d=ZL(r,s,n),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!ok(f);)if(uE(f)){if(f.hasFormat(`code`))continue;let e=f.getTextContent();u=f,d=ZL(e,e.length,n)}if(d<0||u===l&&d+o===s)continue;let p=u.getTextContent();if(d>0&&p[d-1]===a)continue;let m=p[d-1];if(!1===t.intraword&&m&&!KI.test(m)||!t.format.includes(`code`)&&BSe(u,d))continue;let h=l.getTextContent(),g=h.slice(0,s)+h.slice(i+1);l.setTextContent(g);let _=u===l?g:p;u.setTextContent(_.slice(0,d)+_.slice(d+o));let v=$(),y=nj();pD(y);let b=i-o*(u===l?2:1)+1;y.anchor.set(u.__key,d,`text`),y.focus.set(l.__key,b,`text`);for(let e of t.format)y.formatText(e,FC[e]);y.anchor.set(y.focus.key,y.focus.offset,y.focus.type);for(let e of t.format)y.hasFormat(e)&&y.toggleFormat(e);return Q(v)&&(y.format=v.format),!0}return!1}(t,r,i)))(e,m,u.anchor.offset)&&LD(`history-push`)})}}),e.registerCommand(ow,e=>{if(e!==null&&e.shiftKey)return!1;let t=$();if(!Q(t)||!t.isCollapsed())return!1;let i=t.anchor.offset,a=t.anchor.getNode();if(!uE(a)||!KL(a))return!1;let o=a.getParent();return o!==null&&!JP(o)&&!(i!==a.getTextContent().length||!XL(o,a,i,n.multilineElement,!0)&&!YL(o,a,i,r,!0)||(e!==null&&e.preventDefault(),0))},1))}function eR(e,t=zL,n,r=!1,i=!1){let a=r?e:BL(e,i),o=n||dD();o.clear(),JL(a,o,t,r),$()!==null&&o.selectStart()}function HSe(e,t=zL,n=!1,r=!1){let i=n?e:BL(e,r),a=new rk;return JL(i,a,t,n),a.getChildren()}function tR(e=zL,t,n=!1){return function(e,t=!1){let n=GI(e),r=[...n.multilineElement,...n.element],i=!t,a=n.textFormat.filter(e=>e.format.length===1).sort((e,t)=>Number(e.format.includes(`code`))-Number(t.format.includes(`code`)));return e=>{let o=[],s=(e||dD()).getChildren();for(let e=0;e0&&!YI(c)&&!YI(s[e-1])?` ${l}`:l)}return o.join(` `)}}(e,n)(t)}var USe=/^([ \t]*`{3,})[ \t]*([\w-]+)?[ \t]*/,nR={...EL,export:(e,t)=>{let n=EL.export?.(e,t)??null,[r]=n?.split(` `,1)??[];if(!n||!r.includes(``))return n;let i=n.slice(r.length,n.lastIndexOf(` `)),a=Math.max(2,...(i.match(/^[ \t]*~+/gm)??[]).map(e=>e.trim().length)),o=`~`.repeat(a+1);return`${r.replace(/^`+/,o).replaceAll(``,"`")}${i}\n${o}`},handleImportAfterStartMatch:({lines:e,startLineIndex:t,...n})=>{let r=e[t].match(USe),i=r[1].trim(),a=RegExp(`^[ \\t]*\`{${i.length},}$`),o=e.slice(t+1).some(e=>a.test(e)),s=EL.handleImportAfterStartMatch?.({...n,lines:o?e:[...e,i],startLineIndex:t,startMatch:r});return s&&[s[0],Math.min(s[1],e.length-1)]},regExpStart:RegExp(`${EL.regExpStart.source}(?=[^\`]*$)`)},rR=e=>uE(e)&&e.hasFormat(`code`)&&/^\s+$/.test(e.getTextContent()),iR=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();if(![e,t,n].some(rR))return e;let r=e=>rR(e)?Object.create(e,{getTextContent:{value:()=>``}}):e;return Object.create(r(e),{getPreviousSibling:{value:()=>r(t)},getNextSibling:{value:()=>r(n)}})},aR=e=>{if(!ME(e))return!1;let t=e.getFirstChild();return!t||e.getChildrenSize()===1&&uE(t)&&/^\s{0,3}$/.test(t.getTextContent())},WSe=e=>{let t=e.getParent();if(!aR(t)||!YT(t?.getParent()))return[``,``];let n=t?.getPreviousSibling()??null,r=t?.getNextSibling()??null;return[n&&!aR(n)?` `:``,r&&!(e=>{let t=e?.getFirstChild();return aR(e)&&!(uE(t)&&t.hasFormat(`code`))})(r)?` `:``]},oR={dependencies:[],export:(e,t,n)=>{if(!uE(e)||!e.hasFormat(`code`))return null;let r=e.getTextContent(),i=iR(e),[a,o]=rR(e)?WSe(e):[``,``],s=!r.includes("`")&&/^\s/.test(r)&&/\s$/.test(r)&&!(r.startsWith(` `)&&r.endsWith(` `)&&/[^ ]/.test(r));if(!s&&i===e&&!a&&!o)return null;let c=n(i,r);return`${a}${s?c.replace(`\` ${r} \``,()=>`\`${r}\``):c}${o}`},importRegExp:/^(`+)(?!`)([^]*?[^`])\1(?!`)/,regExp:/(?!)/,replace:(e,[,,t])=>{let n=lE(/^ .*[^ ].* $/s.test(t)?t.slice(1,-1):t).setFormat(e.getFormat()).setStyle(e.getStyle()).toggleFormat(`code`);return e.replace(n),n},type:`text-match`},sR={bold:[`**`,`__`],italic:[`_`,`*`],strikethrough:[`~~`]},GSe=/^(?:\*\*|__|~~|\*|_)/,cR=e=>uE(e)&&e.hasFormat(`code`)?"`":e?.getTextContent()??``,KSe=e=>{let t=e.getChildren();if(!t.length||!t.every(e=>uE(e)&&/\S/.test(cR(e)))||/^\s/.test(cR(t[0]))||/\s$/.test(cR(t.at(-1))))return[];let n=Object.keys(sR).filter(e=>t.every(t=>t.hasFormat(e))),r=(e,t)=>{if(!e||ok(e))return!0;if(!uE(e))return!1;let r=t(cR(e))??``;return n.some(t=>e.hasFormat(t))?/\s/.test(r):/[\s\p{P}\p{S}]/u.test(r)};return n.length&&r(e.getPreviousSibling(),e=>e.at(-1))&&r(e.getNextSibling(),e=>e[0])?n:[]},qSe=(e,t)=>{let n=[...t],r=``;for(;n.length;){let[t]=e.slice(r.length).match(GSe)??[],i=n.findIndex(e=>sR[e]?.includes(t??``));if(!t||i===-1)return;n.splice(i,1),r+=t}let i=[...r].reverse().join(``);if(!(e.length{let r=SF(e)?KSe(e):[],i,a=RL.export?.(e,e=>{let n=t(e),a=r.length?qSe(n,r):void 0;return i=a?.delimiters,a?.text??n},n);return a&&i?`${i}${a}${[...i].reverse().join(``)}`:a??null}},JSe={text:{italic:`italic`,strikethrough:`strikethrough`},list:{nested:{listitem:`nested`}},code:`code-block`,tableScrollableWrapper:`table-wrapper`,tableCellSelected:`selected`,tableSelection:`table-selection`},uR={bold:{labelKey:`bold`,icon:`format_bold`,inline:!0},italic:{labelKey:`italic`,icon:`format_italic`,inline:!0},strikethrough:{labelKey:`strikethrough`,icon:`strikethrough_s`,inline:!0},code:{labelKey:`code`,icon:`code`,inline:!0},link:{labelKey:`link`,icon:`link`,inline:!0},paragraph:{labelKey:`paragraph`,icon:`format_paragraph`,inline:!1},"heading-1":{labelKey:`heading_1`,icon:`format_h1`,inline:!1},"heading-2":{labelKey:`heading_2`,icon:`format_h2`,inline:!1},"heading-3":{labelKey:`heading_3`,icon:`format_h3`,inline:!1},"heading-4":{labelKey:`heading_4`,icon:`format_h4`,inline:!1},"heading-5":{labelKey:`heading_5`,icon:`format_h5`,inline:!1},"heading-6":{labelKey:`heading_6`,icon:`format_h6`,inline:!1},"bulleted-list":{labelKey:`bulleted_list`,icon:`format_list_bulleted`,inline:!1},"numbered-list":{labelKey:`numbered_list`,icon:`format_list_numbered`,inline:!1},blockquote:{labelKey:`blockquote`,icon:`format_quote`,inline:!1},"code-block":{labelKey:`code_block`,icon:`code_blocks`,inline:!1},table:{labelKey:`insert_table`,icon:`table`,inline:!1},"horizontal-rule":{labelKey:`insert_horizontal_rule`,icon:`horizontal_rule`,inline:!1}},dR=[`bold`,`italic`,`strikethrough`,`code`],fR=[...dR,`link`],pR=[`paragraph`,`heading-1`,`heading-2`,`heading-3`,`heading-4`,`heading-5`,`heading-6`,`bulleted-list`,`numbered-list`,`blockquote`,`code-block`],YSe={"heading-1":[TI],"heading-2":[TI],"heading-3":[TI],"heading-4":[TI],"heading-5":[TI],"heading-6":[TI],"bulleted-list":[zF,WF],"numbered-list":[zF,WF],blockquote:[SI],"code-block":[KP,eF],link:[bF]},XSe={"heading-1":[wL],"heading-2":[wL],"heading-3":[wL],"heading-4":[wL],"heading-5":[wL],"heading-6":[wL],"bulleted-list":[DL],"numbered-list":[OL],blockquote:[TL],"code-block":[nR],code:[kL,oR],bold:[ML,NL,AL,jL],italic:[IL,FL,AL,jL],strikethrough:[PL],link:[lR]},ZSe=[`*`,`__`,`***`,`___`],mR=zC(`OPEN_LINK_EDITOR_COMMAND`),hR=[{type:`left`,labelKey:`align_left`,icon:`format_align_left`},{type:`center`,labelKey:`align_center`,icon:`format_align_center`},{type:`right`,labelKey:`align_right`,icon:`format_align_right`},{type:`justify`,labelKey:`align_justify`,icon:`format_align_justify`}],QSe=`input, textarea, select, button, a[href], label, summary, video[controls], audio[controls], [tabindex], [draggable="true"], [contenteditable]:not([contenteditable="false"])`,gR=e=>{if(!(e instanceof Element))return!1;let t=e.closest(`[data-lexical-decorator]`);if(!t)return!1;let n=e.closest(QSe);return!n||!t.contains(n)},$Se=()=>{let e=$();if(!Q(e)||!e.isCollapsed()||e.anchor.type!==`element`)return!1;let t=dD();if(!e.anchor.getNode().is(t))return!1;let{offset:n}=e.anchor,r=t.getChildAtIndex(n-1),i=t.getChildAtIndex(n);if(Z(i))i.selectStart();else if(Z(r))r.selectEnd();else{let e=jE();r?r.insertAfter(e):i?i.insertBefore(e):t.append(e),e.select()}return!0},_R=(e,t,n)=>{e.getRootElement()?.focus({preventScroll:!0}),e.update(()=>{n(cD(t))})},vR=(e,t)=>{_R(e,t,e=>{KT(e)&&(e.selectNext(),$Se())})},eCe=(e,t)=>{_R(e,t,e=>{Z(e)&&e.selectEnd()})},tCe=(e,t)=>{let{target:n,button:r,shiftKey:i,clientY:a}=t,o=e.getRootElement();if(!o||!e.isEditable()||t.defaultPrevented||r!==0||i||!(n instanceof Element))return!1;if(gR(n)){let r=n.closest(`[data-lexical-decorator]`);return r.parentElement?.closest(`[data-lexical-editor]`)===o&&(t.preventDefault(),vR(e,r),!0)}if(n!==o)return!1;let s=[...o.children].filter(e=>!e.hasAttribute(`data-lexical-decorator-boundary`)).findLast(e=>e.getBoundingClientRect().top<=a);return s?s.hasAttribute(`data-lexical-decorator`)?(t.preventDefault(),vR(e,s),!0):a<=s.getBoundingClientRect().bottom?!1:(t.preventDefault(),eCe(e,s),!0):!1},yR=async e=>new Promise(t=>{e.focus(()=>{t(void 0)})});function bR(e){return JSON.stringify([e.exportJSON(),Z(e)?e.getChildrenKeys():null])}function nCe(e,t,n){let r=n(),i=0,a=r,o=0,s=null,c=new Set;return(l,u,d,f,p,m)=>{let h=n();if(m.has(`composition-start`)&&(a=r,o=i,s=l,c.clear()),s!==null){for(let e of f)c.add(e);for(let e of p.keys())c.add(e)}if(m.has(`historic`))return i=0,r=h,s=null,c.clear(),2;let g=m.has(`composition-end`);g&&s&&(r=a,i=o,l=s);let _=m.has(`paste`)||m.has(`cut`)?0:function(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(Q(a)&&Q(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||YT(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&uE(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!uE(l)||!uE(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}(l,u,f,p,e.isComposing()),v=!1,y=(()=>{let n=d===null||d.editor===e,a=m.has(`history-push`),o=!a&&n&&m.has(`history-merge`);if(g&&s!==null&&n&&!a&&function(e,t,n){for(let r of e){let e=t._nodeMap.get(r),i=n._nodeMap.get(r);if(!(e===i||e&&i&&t.read(()=>bR(e))===n.read(()=>bR(i))))return!1}return!0}(c,s,u))return v=!0,0;if(o)return 0;if(_===1)return 2;if(l===null)return 1;let y=u._selection;if(!(f.size>0||p.size>0))return y===null?2:0;let b=typeof t==`number`?t:t.peek();return!1===a&&_!==0&&_===i&&hr.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(f)[0],l,u)?0:1})();return g&&(s=null,c.clear()),v||(r=h,i=_),y}}function xR(e,t){if(t!==null&&t.editor===e.editor)return t;let{editor:n}=e,r=n.getEditorState();return r.isEmpty()?null:{editor:n,editorState:r}}function SR(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function rCe(e,t,n,r=Date.now,i,a=null){let o=nCe(e,n,r),s=()=>{i&&i(t)};return s(),qk(e.registerCommand(ZC,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(i.length!==0){let a=t.current,o=i.pop();if(o){let t=xR(o,a);t!==null&&(r.push(t),e.dispatchCommand(vw,!0))}i.length===0&&e.dispatchCommand(yw,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(QC,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(r.length!==0){let a=t.current,o=r.pop();if(o){let t=xR(o,a);t!==null&&(i.push(t),e.dispatchCommand(yw,!0))}r.length===0&&e.dispatchCommand(vw,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(cge,()=>(SR(t,i),!1),0),e.registerCommand(lge,()=>(SR(t,i),e.dispatchCommand(vw,!1),e.dispatchCommand(yw,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:c,tags:l})=>{let u=t.current,d=t.redoStack,f=t.undoStack,p=u===null?null:u.editorState;if(u!==null&&n===p)return;let m=o(r,n,u,i,c,l);if(m===1){d.length!==0&&(t.redoStack=[],e.dispatchCommand(vw,!1));let n=function(e,t,n){return n===null?null:n.editor===e?{...n}:t.isEmpty()?null:{editor:e,editorState:t}}(e,r,u);if(n!==null){f.push(n);let t=typeof a==`number`||a===null?a:a.peek();t!==null&&f.length>t&&f.splice(0,f.length-t),e.dispatchCommand(yw,!0)}}else if(m===2)return;t.current={editor:e,editorState:n},s()}))}function iCe(){return{current:null,redoStack:[],undoStack:[]}}var CR=/^(\d+(?:\.\d+)?)px$/,aCe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function wR(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!aCe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function TR(e,t,n,r,i){let a=wR(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function oCe(e,t){e.__colWidths=t.__colWidths,e.__frozenColumnCount=t.__frozenColumnCount,e.__frozenRowCount=t.__frozenRowCount,e.__rowStriping=t.__rowStriping}var sCe=e=>{let t=Pw(e,`format`),n=Fw(e,`format`),r=Lw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],colWidths:e.__colWidths,frozenColumnCount:e.getSerializedFrozenColumnCount(),frozenRowCount:e.getSerializedFrozenRowCount(),rowStriping:e.getSerializedRowStriping(),direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__colWidths;o!==void 0&&(a.colWidths=o);let s=e.getSerializedFrozenColumnCount();s!==void 0&&s!==0&&(a.frozenColumnCount=s);let c=e.getSerializedFrozenRowCount();c!==void 0&&c!==0&&(a.frozenRowCount=c);let l=e.getSerializedRowStriping();l!==void 0&&!1!==l&&(a.rowStriping=l);let u=e.__dir;u!=null&&(a.direction=u);let d=t[e.__format];d!==void 0&&d!==``&&(a.format=d);let f=e.__indent;return f!==void 0&&f!==0&&(a.indent=f),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=TR(t.indent,0,0,1/0),e.__textFormat=wR(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.colWidths;e.setColWidths(s===void 0?void 0:Array.isArray(s)?Array.from(s,e=>wR(e,0)):[]),e.__frozenColumnCount=wR(t.frozenColumnCount,0),e.__frozenRowCount=wR(t.frozenRowCount,0);let c=t.rowStriping;return e.__rowStriping=typeof c==`boolean`&&c,e},afterCloneFrom:oCe}};function cCe(e,t){e.__height=t.__height}var lCe=e=>{let t=Pw(e,`format`),n=Fw(e,`format`),r=Lw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],height:e.__height,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__height;o!==void 0&&(a.height=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=TR(t.indent,0,0,1/0),e.__textFormat=wR(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.height;return e.__height=s===void 0?void 0:wR(s,0),e},afterCloneFrom:cCe}};function uCe(e,t){e.__backgroundColor=t.__backgroundColor,e.__colSpan=t.__colSpan,e.__headerState=t.__headerState,e.__rowSpan=t.__rowSpan,e.__verticalAlign=t.__verticalAlign,e.__width=t.__width}var dCe=e=>{let t=Pw(e,`format`),n=Fw(e,`format`),r=Lw(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],backgroundColor:e.__backgroundColor,colSpan:e.__colSpan,headerState:e.__headerState,rowSpan:e.__rowSpan,verticalAlign:e.getSerializedVerticalAlign(),width:e.__width,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__backgroundColor;o!=null&&(a.backgroundColor=o);let s=e.__colSpan;s!==void 0&&s!==1&&(a.colSpan=s);let c=e.__headerState;c!==void 0&&c!==0&&(a.headerState=c);let l=e.__rowSpan;l!==void 0&&l!==1&&(a.rowSpan=l);let u=e.getSerializedVerticalAlign();u!==void 0&&(a.verticalAlign=u);let d=e.__width;d!==void 0&&(a.width=d);let f=e.__dir;f!=null&&(a.direction=f);let p=t[e.__format];p!==void 0&&p!==``&&(a.format=p);let m=e.__indent;return m!==void 0&&m!==0&&(a.indent=m),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=TR(t.indent,0,0,1/0),e.__textFormat=wR(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.backgroundColor;e.__backgroundColor=typeof s==`string`&&s!==``?s:null,e.__colSpan=TR(t.colSpan,1,1,1/0),e.setHeaderStyles(wR(t.headerState,0)),e.__rowSpan=TR(t.rowSpan,1,1,1/0);let c=t.verticalAlign;e.__verticalAlign=c===`middle`||c===`bottom`?c:void 0;let l=t.width;return e.__width=l===void 0||wR(l,0)===0?void 0:wR(l,0),e},afterCloneFrom:uCe}},ER={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},fCe=Yw()({backgroundColor:Zw(qw(Uw(),{defaultAsNull:!0}),{field:`__backgroundColor`}),colSpan:Zw(Ww(1,{integer:!0,min:1}),{field:`__colSpan`}),headerState:Qw(Ww(0),{getter:{field:`__headerState`,method:`getHeaderStyles`},setter:`setHeaderStyles`}),rowSpan:Zw(Ww(1,{integer:!0,min:1}),{field:`__rowSpan`}),verticalAlign:Qw(Kw([void 0,`middle`,`bottom`]),{getter:`getSerializedVerticalAlign`,setter:{field:`__verticalAlign`}}),width:Zw(Jw(Ww(),{omitDefault:!0}),{field:`__width`})}),DR=class extends WT{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;$config(){return this.config(`tablecell`,{children:`block`,extends:WT,generated:dCe,importDOM:{td:()=>({conversion:kR,priority:0}),th:()=>({conversion:kR,priority:0})},json:fCe})}constructor(e=ER.NO_STATUS,t=1,n,r){super(r),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=n,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let t=rO().createElement(this.getTag());return this.__width&&(t.style.width=`${this.__width}px`),this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(t.style.backgroundColor=this.__backgroundColor),OR(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),SM(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){let t=super.exportDOM(e);if(dO(t.element)){let e=t.element;e.setAttribute(`data-temporary-table-cell-lexical-key`,this.getKey()),e.style.border=`1px solid black`,this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||75}px`,e.style.verticalAlign=this.getVerticalAlign()||`top`,e.style.textAlign=`start`,this.__backgroundColor===null&&this.hasHeader()&&(e.style.backgroundColor=`#f2f3f5`)}return t}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){let t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?`th`:`td`}setHeaderStyles(e,t=ER.BOTH){let n=this.getWritable();return n.__headerState=e&t|n.__headerState&~t,n}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getSerializedVerticalAlign(){let e=this.getLatest().__verticalAlign;return OR(e)?e:void 0}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let t=this.getWritable();return t.__verticalAlign=e||void 0,t}toggleHeaderStyle(e){let t=this.getWritable();return(t.__headerState&e)===e?t.__headerState&=~e:t.__headerState|=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==ER.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}};function OR(e){return e===`middle`||e===`bottom`}function kR(e){let t=e,n=e.nodeName.toLowerCase(),r;CR.test(t.style.width)&&(r=parseFloat(t.style.width));let i=ER.NO_STATUS;if(n===`th`){let e=t.getAttribute(`scope`);if(e===`col`)i=ER.COLUMN;else if(e===`row`)i=ER.ROW;else{let e=t.parentElement,n=dO(e)&&e.nodeName.toLowerCase()===`tr`&&dO(e.parentElement)&&(e.parentElement.nodeName.toLowerCase()===`thead`||e.rowIndex===0),r=t.cellIndex===0;n&&(i|=ER.ROW),r&&(i|=ER.COLUMN),i===ER.NO_STATUS&&(i=ER.ROW)}}let a=AR(i,t.colSpan,r);a.__rowSpan=t.rowSpan;let o=t.style.backgroundColor;o!==``&&(a.__backgroundColor=o);let s=t.style.verticalAlign;OR(s)&&(a.__verticalAlign=s),TO(a,t);let c=t.style,l=(c&&c.textDecoration||``).split(` `),u=c.fontWeight===`700`||c.fontWeight===`bold`,d=l.includes(`line-through`),f=c.fontStyle===`italic`,p=l.includes(`underline`),m=c.color;return{after:e=>{let t=[],n=null,r=()=>{if(n){let e=n.getFirstChild();ok(e)&&n.getChildrenSize()===1&&e.remove()}};for(let i of e)if(HD(i)||uE(i)||ok(i)){if(uE(i)&&(u&&i.toggleFormat(`bold`),d&&i.toggleFormat(`strikethrough`),f&&i.toggleFormat(`italic`),p&&i.toggleFormat(`underline`),m)){let e=i.getStyle();e.includes(`color:`)||i.setStyle(e+`color: ${m};`)}n?n.append(i):(n=jE().append(i),t.push(n))}else t.push(i),r(),n=null;return r(),t.length===0&&t.push(jE()),t},node:a}}function AR(e=ER.NO_STATUS,t=1,n){return qD(new DR(e,t,n))}function jR(e){return e instanceof DR}var pCe=zC(`INSERT_TABLE_COMMAND`);function MR(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var mCe=Yw()({height:Zw(Jw(Ww()),{field:`__height`})}),NR=class extends WT{__height;$config(){return this.config(`tablerow`,{extends:WT,generated:lCe,importDOM:{tr:()=>({conversion:hCe,priority:0})},json:mCe})}constructor(e=void 0,t){super(t),this.__height=e}createDOM(e){let t=rO().createElement(`tr`);return this.__height&&(t.style.height=`${this.__height}px`),SM(t,e.theme.tableRow),t}extractWithChild(e,t,n){return n===`html`}isShadowRoot(){return!0}setHeight(e){let t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}};function hCe(e){let t=e,n;return CR.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:e=>UM(e,jR),node:TO(PR(n),t)}}function PR(e){return qD(new NR(e))}function FR(e){return e instanceof NR}function IR(e,t,n=!0){let r=Bz();for(let i=0;iVz(e));if(Vz(t))return t;throw Error(`Expected table cell to be inside of table.`)}var LR=(e,t)=>e===ER.BOTH||e===t?t:ER.NO_STATUS;function _Ce(e=!0){let t=$();Q(t)||QR(t)||MR(188);let n=t.anchor.getNode(),r=t.focus.getNode(),[i]=KR(n),[a,,o]=KR(r),[,s,c]=UR(o,a,i),{startRow:l}=c,{startRow:u}=s;return e?RR(l+i.__rowSpan>u+a.__rowSpan?i:a,!0):RR(uu+a.__colSpan?i:a,!0):zR(u1&&(r+=i.cell.__colSpan-1)}n===null?VR(f,d(r)):n.insertAfter(d(r))}else a.setColSpan(a.__colSpan+1)}u!==null&&n&&BR(u);let p=r.getColWidths();if(p){let e=[...p],t=c<0?0:c,n=e[t];e.splice(t,0,n),r.setColWidths(e)}return u}function yCe(){let e=$();Q(e)||QR(e)||MR(188);let[t,n]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[r,,i]=KR(t),[a]=KR(n);GR(i);let[o,s,c]=UR(i,r,a),{startRow:l}=s,{startRow:u}=c,d=u+a.__rowSpan-1;if(o.length===d-l+1)return i.selectPrevious(),void i.remove();let f=o[0].length,p=o[d+1],m=i.getChildAtIndex(d+1);for(let e=d;e>=l;e--){for(let t=f-1;t>=0;t--){let{cell:n,startRow:r,startColumn:i}=o[e][t];if(i===t){if(rd){let e=Math.max(r,l),t=Math.min(n.__rowSpan+r-1,d),i=e<=t?t-e+1:0;n.setRowSpan(n.__rowSpan-i)}if(r>=l&&r+n.__rowSpan-1>d&&e===d){FR(m)||MR(387);let r=null;for(let n=0;n1&&(n+=i.__colSpan-1)}r===null?VR(m,n):r.insertAfter(n)}}}let t=i.getChildAtIndex(e);FR(t)||MR(206,String(e)),t.remove()}if(p!==void 0){let{cell:e}=p[0];BR(e)}else{let{cell:e}=o[l-1][0];BR(e)}}function bCe(){let e=$();Q(e)||QR(e)||MR(188);let t=e.anchor.getNode(),n=e.focus.getNode(),[r,,i]=KR(t),[a]=KR(n);GR(i);let[o,s,c]=UR(i,r,a),{startColumn:l}=s,{startRow:u,startColumn:d}=c,f=Math.min(l,d),p=Math.max(l+r.__colSpan-1,d+a.__colSpan-1),m=p-f+1;if(o[0].length===p-f+1)return i.selectPrevious(),void i.remove();let h=o.length;for(let e=0;ep){if(t===p){let e=p-r+1;n.setColSpan(n.__colSpan-e)}}else n.remove()}let g=o[u],_=l>d?g[l+r.__colSpan]:g[d+a.__colSpan];if(_!==void 0){let{cell:e}=_;BR(e)}else{let{cell:e}=de.is(n.cell))){s.add(t);let e=n.startRow,c=n.startColumn,l=n.cell.__rowSpan||1,u=n.cell.__colSpan||1;r=Math.min(r,e),i=Math.max(i,e+l-1),a=Math.min(a,c),o=Math.max(o,c+u-1)}}if(r===1/0||a===1/0)return null;let c=i-r+1,l=o-a+1,u=n[r][a];if(!u.cell)return null;let d=u.cell;d.setColSpan(l),d.setRowSpan(c);let f=new Set([d.getKey()]);for(let e=r;e<=i;e++)for(let t=a;t<=o;t++){let r=n[e][t];if(!r.cell)continue;let i=r.cell,a=i.getKey();f.has(a)||(f.add(a),HR(i)||(HR(d)&&d.clear(),d.append(...i.getChildren())),i.remove())}return d.getChildrenSize()===0&&d.append(jE()),d}function HR(e){if(e.getChildrenSize()!==1)return!1;let t=e.getFirstChildOrThrow();return!(!ME(t)||!t.isEmpty())}function SCe(e){let[t,n,r]=KR(e),i=t.__colSpan,a=t.__rowSpan;if(i===1&&a===1)return;GR(r);let[o,s]=UR(r,t,t),{startColumn:c,startRow:l}=s,u=t.__headerState&ER.COLUMN,d=Array.from({length:i},(e,t)=>{let n=u;for(let e=0;n!==0&&e{let n=f;for(let e=0;n!==0&&eKD(t).setColSpan(1).setRowSpan(1).setHeaderStyles(e).setWidth(void 0).append(jE());if(i>1){for(let e=1;e1){let e;for(let t=1;t1&&(e+=n.__colSpan-1)}if(s===null)for(let n=i-1;n>=0;n--)VR(e,m(d[n]|p[t]));else for(let e=i-1;e>=0;e--)s.insertAfter(m(d[e]|p[t]))}t.setRowSpan(1)}}function UR(e,t,n){let[r,i,a]=WR(e,t,n);return i===null&&MR(207),a===null&&MR(208),[r,i,a]}function WR(e,t,n){let r=[],i=null,a=null;function o(e){let t=r[e];return t===void 0&&(r[e]=t=[]),t}let s=e.getChildren();for(let e=0;e=s.length);t++){let n=o(e+t);for(let e=0;eMath.max(e,t.length),0),r=e.getChildren(),i=!1;for(let e=0;et?1+e:e,0);if(o>=n)continue;let s=a.getLastChild(),c=jR(s)?s.getHeaderStyles()&ER.ROW:ER.NO_STATUS;for(let e=o;e=i,f=c.startRow<=s&&u>=a;if(d&&f){let e=Math.min(i,c.startColumn),t=Math.max(o,l),n=Math.min(a,c.startRow),d=Math.max(s,u);e===i&&t===o&&n===a&&d===s||(i=e,o=t,a=n,s=d,r=!0)}}}while(r);return{maxColumn:o,maxRow:s,minColumn:i,minRow:a}}function JR(e){let[t,,n]=KR(e),r=n.getChildren().filter(FR),i=r.length,a=r[0].getChildren().length,o=Array(i);for(let e=0;ejR(e));if(!(jR(o)&&jR(l)&&FR(s)&&Vz(c)))return!1;GR(c);let[u,d,f]=UR(c,o,l),[p]=WR(e,null,null),m=u.length,h=m>0?u[0].length:0,g=d.startRow,_=d.startColumn,v=p.length,y=v>0?p[0].length:0;if(r){let e=qR(u,d,f),t=e.maxRow-e.minRow+1,n=e.maxColumn-e.minColumn+1;g=e.minRow,_=e.minColumn,v=Math.min(v,t),y=Math.min(y,n)}let b=!1,x=Math.min(m,g+v)-1,S=Math.min(h,_+y)-1,C=new Set;for(let e=g;e<=x;e++)for(let t=_;t<=S;t++){let n=u[e][t];C.has(n.cell.getKey())||n.cell.__rowSpan===1&&n.cell.__colSpan===1||(SCe(n.cell),C.add(n.cell.getKey()),b=!0)}let[w]=WR(c.getWritable(),null,null),T=v-m+g;for(let e=0;e{uE(e)&&jE().append(e),o.append(e)}),l.forEach(e=>e.remove())}if(r&&b){let[e]=WR(c.getWritable(),null,null);e[d.startRow][d.startColumn].cell.selectEnd()}return!0}function XR(e){let[[t,n,r,i],[a,o,s,c]]=[`anchor`,`focus`].map(t=>{let n=e[t].getNode(),r=XO(n,jR);jR(r)||MR(238,t,n.getKey(),n.getType());let i=r.getParent();FR(i)||MR(239,t);let a=i.getParent();return Vz(a)||MR(240,t),[n,r,i,a]});return i.is(c)||MR(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:i,focusCell:o,focusNode:a,focusRow:s,focusTable:c}}var ZR=class e{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,t,n){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey===`root`||this.anchor.key===`root`||this.anchor.type!==`element`||this.focus.key===`root`||this.focus.type!==`element`)return!1;let e=iD(this.tableKey),t=iD(this.anchor.key),n=iD(this.focus.key);return e!==null&&t!==null&&n!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return QR(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,n){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||n!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new e(this.tableKey,DA(this.anchor.key,this.anchor.offset,this.anchor.type),DA(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){if(e===``)return;let t=(e.endsWith(` `)?e.slice(0,-1):e).split(` `).map(e=>e.split(` `)),n=Bz();for(let e of t){let t=PR();for(let n of e){let e=AR(ER.NO_STATUS),r=jE();n&&r.append(lE(n)),e.append(r),t.append(e)}n.append(t)}let{anchorCell:r}=XR(this);YR(n,r.select(0,r.getChildrenSize()))}insertText(){}hasFormat(e){let t=0;this.getNodes().filter(jR).forEach(e=>{let n=e.getFirstChild();ME(n)&&(t|=n.getTextFormat())});let n=FC[e];return(t&n)!==0}insertNodes(e){let t=this.focus.getNode();Z(t)||MR(151),VT(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){let{anchorCell:e,focusCell:t}=XR(this),n=JR(e);n===null&&MR(153);let r=JR(t);r===null&&MR(155);let i=Math.min(n.columnIndex,r.columnIndex),a=Math.max(n.columnIndex+n.colSpan-1,r.columnIndex+r.colSpan-1),o=Math.min(n.rowIndex,r.rowIndex),s=Math.max(n.rowIndex+n.rowSpan-1,r.rowIndex+r.rowSpan-1);return{fromX:Math.min(i,a),fromY:Math.min(o,s),toX:Math.max(i,a),toY:Math.max(o,s)}}getNodes(){if(!this.isValid())return[];let e=this._cachedNodes;if(e!==null)return e;let{anchorTable:t,anchorCell:n,focusCell:r}=XR(this),i=r.getParents()[1];if(i!==t){if(t.isParentOf(r)){let e=i.getParent();e??MR(159),this.set(this.tableKey,r.getKey(),e.getKey())}else{let e=t.getParent();e??MR(158),this.set(this.tableKey,e.getKey(),r.getKey())}return this.getNodes()}let[a,o,s]=UR(t,n,r),{minColumn:c,maxColumn:l,minRow:u,maxRow:d}=qR(a,o,s),f=new Map([[t.getKey(),t]]),p=null;for(let e=u;e<=d;e++)for(let t=c;t<=l;t++){let{cell:n}=a[e][t],r=n.getParent();FR(r)||MR(160),r!==p&&(f.set(r.getKey(),r),p=r),f.has(n.getKey())||CCe(n,e=>{f.set(e.getKey(),e)})}let m=Array.from(f.values());return Ek()||(this._cachedNodes=m),m}getTextContent(){let e=this.getNodes().filter(e=>jR(e)),t=``;for(let n=0;n0;e=n.at(-1)){let r=e.pop();r===void 0?n.pop():!1!==t(r)&&Z(r)&&n.push(r.getChildren())}}function ez(e,t=_O()){let n=iD(e);Vz(n)||MR(231,e);let r=oz(n,t.getElementByKey(e));return r===null&&MR(232,e),{tableElement:r,tableNode:n}}var wCe=class{observers;nextFocus;shouldCheckSelectionForTable;touchTapCellKey;constructor(){this.observers=new Map,this.nextFocus=null,this.shouldCheckSelectionForTable=null,this.touchTapCellKey=null}setNextFocus(e){this.nextFocus=e}getAndClearNextFocus(){let{nextFocus:e}=this;return e!==null&&(this.nextFocus=null),e}setShouldCheckSelectionForTable(e){this.shouldCheckSelectionForTable=e}getAndClearShouldCheckSelectionForTable(){let{shouldCheckSelectionForTable:e}=this;return e?(this.shouldCheckSelectionForTable=null,e):null}removeObserver(e){let t=this.observers.get(e);return t!==void 0&&(t[0].removeListeners(),this.observers.delete(e),!0)}removeAllObservers(){for(let e of Array.from(this.observers.keys()))this.removeObserver(e)}$getTableNodesAndObservers(){let e=[];for(let[t,[n]]of Array.from(this.observers.entries())){let r=iD(t);Vz(r)?e.push([r,n]):this.removeObserver(t)}return e}},TCe=class{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;isPointerDrag;pointerStartCell;pointerType;abortController;listenerOptions;constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.isPointerDrag=!1,this.pointerStartCell=null,this.pointerType=null,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort(`removeListeners`),Array.from(this.listenersToRemove).forEach(e=>e()),this.listenersToRemove.clear()}$lookup(){return ez(this.tableNodeKey,this.editor)}trackTable(){let e=new MutationObserver(e=>{this.editor.read(`latest`,()=>{let t=!1;for(let n=0;ne.disconnect()),this.editor.read(`latest`,()=>{let{tableNode:t,tableElement:n}=this.$lookup();this.table=fz(t,n),e.observe(n,{attributes:!0,childList:!0,subtree:!0})})}$clearHighlight(e=!0){let t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();let{tableNode:n,tableElement:r}=this.$lookup();pz(t,fz(n,r),null),e&&$()!==null&&(pD(null),t.dispatchCommand(BC))}$enableHighlightStyle(){let e=this.editor,{tableElement:t}=this.$lookup();CM(t,e._config.theme.tableSelection),t.classList.remove(`disable-selection`),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();SM(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(e!==null){e.tableKey!==this.tableNodeKey&&MR(233,e.tableKey,this.tableNodeKey);let t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),pz(t,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let e=QD(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,t=!1){let n=this.editor,{tableNode:r}=this.$lookup(),i=e.x,a=e.y;if(this.focusCell=e,this.isHighlightingCells||(t||this.anchorX!==i||this.anchorY!==a||this.tableSelection!=null&&this.anchorCellNodeKey!=null)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle()),this.focusX!==-1&&this.focusY!==-1&&i===this.focusX&&a===this.focusY)return!1;if(this.focusX=i,this.focusY=a,this.isHighlightingCells){let o=Az(r,e.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null){let e=o;if(e===null&&t&&(e=r.getCellNodeFromCords(i,a,this.table)),e!==null){let t=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=e.getKey(),this.tableSelection=$R(r,t,e),pD(this.tableSelection),n.dispatchCommand(BC),pz(n,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){let e=this.anchorCellNodeKey?iD(this.anchorCellNodeKey):null;return jR(e)?e:null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return e===null&&MR(234),e}$getFocusTableCell(){let e=this.focusCellNodeKey?iD(this.focusCellNodeKey):null;return jR(e)?e:null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return e===null&&MR(235),e}$setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.focusX=-1,this.focusY=-1,this.focusCell=null,this.focusCellNodeKey=null;let{tableNode:t}=this.$lookup(),n=Az(t,e.elem);if(n!==null){let e=n.getKey();this.tableSelection==null?this.tableSelection=$R(t,n,n):(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(t.getKey(),e,e)),this.anchorCellNodeKey=e}}$formatCells(e){let t=$();QR(t)||MR(236);let n=nj(),r=n.anchor,i=n.focus,a=t.getNodes().filter(jR);a.length>0||MR(237);let o=a[0].getFirstChild(),s=ME(o)?o.getFormatFlags(e,null):null;a.forEach(t=>{r.set(t.getKey(),0,`element`),i.set(t.getKey(),t.getChildrenSize(),`element`),n.formatText(e,s)}),pD(t),this.editor.dispatchCommand(BC)}$clearText(){let{editor:e}=this,t=iD(this.tableNodeKey);if(!Vz(t))throw Error(`Expected TableNode.`);let n=$();QR(n)||MR(253);let r=n.getNodes().filter(jR),i=t.getFirstChild(),a=t.getLastChild();if(r.length>0&&i!==null&&a!==null&&FR(i)&&FR(a)&&r[0]===i.getFirstChild()&&r[r.length-1]===a.getLastChild()){t.selectPrevious();let n=t.getParent();t.remove(),YT(n)&&n.isEmpty()&&e.dispatchCommand(WC)}else r.forEach(e=>{if(Z(e)){let t=e.getFirstChild(),n=ME(t)?KD(t):jE(),r=lE();n.append(r),e.append(n),e.getChildren().forEach(e=>{e!==n&&e.remove()})}}),pz(e,this.table,null),pD(null),e.dispatchCommand(BC)}},tz=`__lexicalTableSelection`;function nz(e){let t=YD(e);return Vz(t)||MR(386,e),t}var rz=40;function iz(e,t,n,r=1e3/60){let i=e=>Math.max(1,Math.round(Math.max(1,Math.ceil(Math.min(rz,e)/rz*18))*r*60/1e3));return e<=t+rz?-i(t+rz-e):e>=n-rz?i(e-(n-rz)):0}function az(e){return dO(e)&&e.nodeName===`TABLE`}function oz(e,t){if(!t)return t;let n=az(t)?t:t.querySelector(`table`);return az(n)||MR(341,e.constructor.name,e.getType(),e.getKey(),t.nodeName),n}function sz(e){return e._window}function cz(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;jR(n)&&(r=n)}return null}var ECe=[[aw,`down`],[iw,`up`],[nw,`backward`],[ew,`forward`]],DCe=[JC,YC,HC],OCe=[sw,lw];function kCe(e,t){return e.registerRootListener(n=>{if(n===null)return;let r=e._window;if(r===null)return;let i=()=>{t.touchTapCellKey=null};return qk(Jk(r,`pointerdown`,r=>{t.touchTapCellKey=null;let i=lO(r);if(r.button!==0||!fO(i)||!n.contains(i))return;let a=function(e){let t=uz(e);if(t===null)return null;let n=t.elem;for(;n!=null;){if(n.nodeName===`TABLE`&&tz in n&&n[tz])return{cellElement:t,tableElement:n,tableObserver:n[tz]};n=n.parentNode}return null}(i),o=a!==null&&a.tableObserver.editor===e?a:null;e.update(()=>{if(QR($())){for(let[e]of t.observers.values())e.$clearHighlight(!1);pD(null),e.dispatchCommand(BC)}if(!o)return;let{tableObserver:n,tableElement:i,cellElement:a}=o;(function(e,t,n,r,i,a){let o=e._window;if(!o)return;if(i.pointerType=t.pointerType,t.pointerType===`touch`&&!t.shiftKey&&!i.isSelecting){let e=cD(n.elem);a.touchTapCellKey=e?e.getKey():null}let s=nz(i.tableNodeKey),c=sj(),l=Q(c)||QR(c)?Cz(c.anchor.getNode()):null,u=l!==null&&l.isParentOf(s);if(TC&&t.shiftKey&&(Q(c)||QR(c))&&(yz(c,s)||u)){let e=c.anchor.getNode(),r=cz(s,c.anchor.getNode());if(r){let e=kz(i,r);e.elem===n.elem?t.pointerType!==`touch`&&i.$setAnchorCellForSelection(n):(i.$setAnchorCellForSelection(e),i.$setFocusCellForSelection(n),Ez(t))}else(s.isBefore(e)?s.selectStart():s.selectEnd()).anchor.set(c.anchor.key,c.anchor.offset,c.anchor.type),Ez(t)}else t.pointerType!==`touch`&&i.$setAnchorCellForSelection(n);(n=>{if(i.isSelecting)return;i.isSelecting=!0,i.isPointerDrag=!1,i.pointerStartCell=n;let s=t.pointerType===`touch`,c=t.pointerId,l=t.clientX,u=t.clientY,d=!s;s||i.anchorCell!==null||e.update(()=>{i.$setAnchorCellForSelection(n)});let f,p=t.clientX,m=t.clientY,h=null,g=null,_=e=>e.pointerId===c,v=(e,t)=>!(Math.abs(e-l)<=10&&Math.abs(t-u)<=10),y=()=>{i.isSelecting=!1,i.isPointerDrag=!1,i.pointerStartCell=null,h!==null&&(o.cancelAnimationFrame(h),h=null),g!==null&&(g(),g=null)},b=(e,t)=>{let n=r.getRootNode();if(!XE(n)&&!$D(n))return null;for(let i of n.elementsFromPoint(e,t)){let e=dz(r,i);if(e)return e}return null},x=(t,r)=>{if(d||i.isPointerDrag&&t.elem!==n.elem){if(i.anchorCell===null||!d){let r=d?t:n;e.update(()=>{i.$setAnchorCellForSelection(r)})}d=!0,i.focusCell!==null&&t.elem===i.focusCell.elem||(a.setNextFocus({focusCell:t,override:r,tableKey:i.tableNodeKey}),e.dispatchCommand(BC))}},S=e=>{for(let t=r.parentElement;t;t=t.parentElement)if(e===`x`?t.scrollWidth>t.clientWidth:t.scrollHeight>t.clientHeight){let n=o.getComputedStyle(t),r=e===`x`?n.overflowX:n.overflowY;if(r===`auto`||r===`scroll`)return t}return null},C=(e,t,n,r)=>{let i,a;if(e===null)i=0,a=n===`x`?o.innerWidth:o.innerHeight;else{let t=e.getBoundingClientRect();i=n===`x`?t.left:t.top,a=n===`x`?t.right:t.bottom}let s=iz(t,i,a,r);if(s===0)return!1;if(e===null){let e=n===`x`?o.scrollX:o.scrollY;return o.scrollBy(n===`x`?s:0,n===`x`?0:s),(n===`x`?o.scrollX:o.scrollY)!==e}if(n===`x`){let t=e.scrollLeft;return e.scrollLeft+=s,e.scrollLeft!==t}let c=e.scrollTop;return e.scrollTop+=s,e.scrollTop!==c},w=e=>{if(h=null,!i.isSelecting)return;let t=e>f?Math.min(e-f,100):1e3/60;f=e;let n=S(`x`),r=S(`y`),a=n!==null&&C(n,p,`x`,t),s=C(r,m,`y`,t);if(a||s){let[e,t]=((e,t)=>{let n=p,r=m;if(e===null)n=Math.min(Math.max(n,1),o.innerWidth-1);else{let t=e.getBoundingClientRect();n=Math.min(Math.max(n,t.left+1),t.right-1)}if(t===null)r=Math.min(Math.max(r,1),o.innerHeight-1);else{let e=t.getBoundingClientRect();r=Math.min(Math.max(r,e.top+1),e.bottom-1)}return[n,r]})(n,r),i=b(e,t);i&&x(i,!1),h=o.requestAnimationFrame(w)}},T=()=>{h!==null||s&&!i.isPointerDrag||!(()=>{let e=S(`x`);if(e!==null){let t=e.getBoundingClientRect();if(iz(p,t.left,t.right)!==0)return!0}let t=S(`y`),n=t===null?0:t.getBoundingClientRect().top,r=t===null?o.innerHeight:t.getBoundingClientRect().bottom;return iz(m,n,r)!==0})()||(f=1/0,h=o.requestAnimationFrame(w))},ee=e=>{_(e)&&(a.touchTapCellKey=null,y())};g=Yk(o,{lostpointercapture:ee,pointercancel:ee,pointermove:e=>{if(!_(e))return;if(!(e=>!(1&~e.buttons))(e)&&i.isSelecting)return a.touchTapCellKey=null,void y();let t=lO(e);if(!fO(t))return;p=e.clientX,m=e.clientY,!i.isPointerDrag&&v(p,m)&&(i.isPointerDrag=!0,a.touchTapCellKey=null);let n=null,o=!(TC||r.contains(t));n=o?dz(r,t):b(e.clientX,e.clientY),n&&x(n,o),T()},pointerup:e=>{_(e)&&(v(e.clientX,e.clientY)&&(a.touchTapCellKey=null),y())}},i.listenerOptions)})(n)})(e,r,a,i,n,t)})}),Yk(r,{blur:i,keydown:i},{capture:!0}),i)})}function ACe(e,t,n,r,i){let a=n.getRootElement(),o=sz(n);a!==null&&o!==null||MR(246);let s=new TCe(n,e.getKey()),c=oz(e,t);(function(e,t){lz(e)!==null&&MR(205),e[tz]=t})(c,s),s.listenersToRemove.add(()=>function(e,t){lz(e)===t&&delete e[tz]}(c,s)),s.listenersToRemove.add(Jk(c,`mousedown`,e=>{let t=lO(e);e.detail>=3&&fO(t)&&uz(t)!==null&&e.preventDefault()},s.listenerOptions));for(let[t,r]of ECe)s.listenersToRemove.add(n.registerCommand(t,t=>Tz(n,t,r,e,s,i),3));s.listenersToRemove.add(n.registerCommand(cw,t=>{let n=$();if(QR(n)){let r=cz(e,n.focus.getNode());if(r!==null)return Ez(t),r.selectEnd(),!0}return!1},3));let l=()=>{let t=$();return!!yz(t,e)&&!!QR(t)&&(s.$clearText(),!0)};for(let e of DCe)s.listenersToRemove.add(n.registerCommand(e,l,3));let u=t=>{let n=$();if(!QR(n)&&!Q(n))return!1;let r=e.isParentOf(n.anchor.getNode());if(r!==e.isParentOf(n.focus.getNode())){let t=r?`anchor`:`focus`,i=r?`focus`:`anchor`,{key:a,offset:o,type:s}=n[i];return e[n[t].isBefore(n[i])?`selectPrevious`:`selectNext`]()[i].set(a,o,s),!1}return!!yz(n,e)&&!!QR(n)&&(t&&(t.preventDefault(),t.stopPropagation()),s.$clearText(),!0)};for(let e of OCe)s.listenersToRemove.add(n.registerCommand(e,u,3));s.listenersToRemove.add(n.registerCommand(gw,e=>{let t=$();if(t){if(!QR(t)&&!Q(t))return!1;dI(n,RM(e,ClipboardEvent)?e:null,pI(t));let r=u(e);return Q(t)?(t.removeText(),!0):r}return!1},3));let d=a.ownerDocument;return s.listenersToRemove.add(Jk(d,`paste`,t=>{t.defaultPrevented||n.read(`latest`,()=>{let t=$();return a.contains(d.activeElement)&&QR(t)&&yz(t,e)})&&(t.preventDefault(),n.dispatchCommand(KC,t))})),s.listenersToRemove.add(Jk(d,`copy`,t=>{if(t.defaultPrevented)return;let r=lO(t);r===a||fO(r)&&a.contains(r)||n.read(`latest`,()=>{let t=$();return a.contains(sO(a))&&QR(t)&&yz(t,e)})&&(t.preventDefault(),n.dispatchCommand(hw,t))})),s.listenersToRemove.add(n.registerCommand(XC,t=>{let n=$();return!!yz(n,e)&&!!QR(n)&&(s.$formatCells(t),!0)},3)),s.listenersToRemove.add(n.registerCommand(mw,t=>{let n=$();if(!QR(n)||!yz(n,e))return!1;let r=n.anchor.getNode(),i=n.focus.getNode();if(!jR(r)||!jR(i))return!1;let[a,o,s]=UR(e,r,i),{minColumn:c,maxColumn:l,minRow:u,maxRow:d}=qR(a,o,s);if(u===0&&c===0&&d===a.length-1&&l===a[0].length-1)return e.setFormat(t),!0;let f=new Set;for(let e=u;e<=d;e++)for(let n=c;n<=l;n++){let r=a[e][n].cell;if(f.has(r))continue;f.add(r),r.setFormat(t);let i=r.getChildren();for(let e=0;e{let r=$();if(!yz(r,e))return!1;if(QR(r))return s.$clearHighlight(),!1;if(Q(r)){if(!jR(XO(r.anchor.getNode(),e=>jR(e))))return!1;if(typeof t==`string`){let i=Oz(n,r,e);if(i)return Dz(i,e,[lE(t)]),!0}}return!1},3)),r&&s.listenersToRemove.add(n.registerCommand(uw,t=>{let n=$();if(!Q(n)||!n.isCollapsed()||!yz(n,e))return!1;let r=Cz(n.anchor.getNode());return!(r===null||!e.is(wz(r))||(Ez(t),function(e,t){let n=t===`next`?`getNextSibling`:`getPreviousSibling`,r=t===`next`?`getFirstChild`:`getLastChild`,i=e[n]();if(Z(i))return i.selectEnd();let a=XO(e,FR);a===null&&MR(247);for(let e=a[n]();FR(e);e=e[n]()){let t=e[r]();if(Z(t))return t.selectEnd()}let o=XO(a,Vz);o===null&&MR(248),t===`next`?o.selectNext():o.selectPrevious()}(r,t.shiftKey?`previous`:`next`),0))},3)),s.listenersToRemove.add(n.registerCommand(uge,t=>e.isSelected(),3)),s.listenersToRemove.add(n.registerCommand(WC,()=>{let t=$();if(!Q(t)||!t.isCollapsed()||!yz(t,e))return!1;let r=Oz(n,t,e);return!!r&&(Dz(r,e),!0)},3)),s}function jCe(e,t,n){let r=$(),i=t.isSelected();if(!(QR(r)&&r.tableKey===t.getKey()||n.isHighlightingCells||n.hasHijackedSelectionStyles||i))return;let{tableElement:a}=n.$lookup();if(n.table=fz(t,a),QR(r)&&r.tableKey===t.getKey()){let e=iD(r.anchor.key),t=iD(r.focus.key);if(jR(e)&&jR(t)){let r=kz(n,e),i=kz(n,t);n.anchorCell=r,n.anchorCellNodeKey=e.getKey(),n.anchorX=r.x,n.anchorY=r.y,n.focusCell=i,n.focusCellNodeKey=t.getKey(),n.focusX=i.x,n.focusY=i.y}n.$updateTableTableSelection(r)}else n.isHighlightingCells&&n.$clearHighlight(!1);n.hasHijackedSelectionStyles&&!i?function(e,t){t.$enableHighlightStyle(),mz(t.table,t=>{let n=t.elem;t.highlighted=!1,Sz(e,t),n.getAttribute(`style`)||n.removeAttribute(`style`)})}(e,n):!n.hasHijackedSelectionStyles&&i&&function(e,t){t.$disableHighlightStyle(),mz(t.table,t=>{t.highlighted=!0,xz(e,t)})}(e,n)}function lz(e){return e[tz]||null}function uz(e){let t=e;for(;t!=null;){let e=t.nodeName;if(e===`TD`||e===`TH`){let e=t._cell;return e===void 0?null:e}t=t.parentNode}return null}function dz(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;r!=null;r=r.parentNode){if(r===e)return n;let t=r.nodeName;t!==`TD`&&t!==`TH`||(n=r._cell||null)}return null}function fz(e,t){let n=[],r={columns:0,domRows:n,rows:0},i=oz(e,t).querySelector(`tr`),a=0,o=0;for(n.length=0;i!=null;){let e=i.nodeName;if(e===`TD`||e===`TH`){let e={elem:i,hasBackgroundColor:i.style.backgroundColor!==``,highlighted:!1,x:a,y:o};i._cell=e;let t=n[o];t===void 0&&(t=n[o]=[]),t[a]=e}else{let e=i.firstChild;if(e!=null){i=e;continue}}let t=i.nextSibling;if(t!=null){a++,i=t;continue}let r=i.parentNode;if(r!=null){let e=r.nextSibling;if(e==null)break;o++,a=0,i=e}}return r.columns=a+1,r.rows=o+1,r}function pz(e,t,n){let r=new Set(n?n.getNodes():[]);mz(t,(t,n)=>{let i=t.elem;r.has(n)?(t.highlighted=!0,xz(e,t)):(t.highlighted=!1,Sz(e,t),i.getAttribute(`style`)||i.removeAttribute(`style`))})}function mz(e,t){let{domRows:n}=e;for(let e=0;e{let a=i===`forward`;switch(i){case`backward`:case`forward`:return n===(a?e.table.columns-1:0)?r===(a?e.table.rows-1:0)?a?t.selectNext():t.selectPrevious():bz(t.getCellNodeFromCordsOrThrow(a?0:e.table.columns-1,r+(a?1:-1),e.table),a):bz(t.getCellNodeFromCordsOrThrow(n+(a?1:-1),r,e.table),a),!0;case`up`:return r===0?t.selectPrevious():bz(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1),!0;case`down`:return r===e.table.rows-1?t.selectNext():bz(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0),!0;default:return!1}};function hz(e,t){let n,r;if(t.startColumn===e.minColumn)n=`minColumn`;else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n=`maxColumn`}if(t.startRow===e.minRow)r=`minRow`;else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r=`maxRow`}return[n,r]}function gz(e,t,n){let r=hz(e,t);if(r)return r;let i=hz(e,n);return i?_z(i):[`minColumn`,`minRow`]}function _z([e,t]){return[e===`minColumn`?`maxColumn`:`minColumn`,t===`minRow`?`maxRow`:`minRow`]}function vz(e,t,[n,r]){let i=t[r],a=e[i];a===void 0&&MR(250,r,String(i));let o=t[n],s=a[o];return s===void 0&&MR(250,n,String(o)),s}function yz(e,t){if(Q(e)||QR(e)){let n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function bz(e,t){t?e.selectStart():e.selectEnd()}function xz(e,t){let n=t.elem,r=e._config.theme;jR(cD(n))||MR(131),SM(n,r.tableCellSelected)}function Sz(e,t){let n=t.elem;jR(cD(n))||MR(131);let r=e._config.theme;CM(n,r.tableCellSelected)}function Cz(e){let t=XO(e,jR);return jR(t)?t:null}function wz(e){let t=XO(e,Vz);return Vz(t)?t:null}function Tz(e,t,n,r,i,a){if((n===`up`||n===`down`)&&function(e){let t=e.getRootElement();return!!t&&t.hasAttribute(`aria-controls`)&&t.getAttribute(`aria-controls`)===`typeahead-menu`}(e))return!1;let o=$();if(!yz(o,r)){if(Q(o)){if(n===`backward`){if(o.focus.offset>0)return!1;let e=function(e){for(let t=e,n=e;n!==null;t=n,n=n.getParent())if(Z(n)){if(n!==t&&n.getFirstChild()!==t)return null;if(!n.isInline())return n}return null}(o.focus.getNode());if(!e)return!1;let n=e.getPreviousSibling();return!!Vz(n)&&(Ez(t),t.shiftKey?o.focus.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent(),`element`):n.selectEnd(),!0)}if(t.shiftKey&&(n===`up`||n===`down`)){let e=o.focus.getNode();if(!o.isCollapsed()&&(n===`up`&&!o.isBackward()||n===`down`&&o.isBackward())){let i=XO(e,e=>Vz(e));if(jR(i)&&(i=XO(i,Vz)),i!==r||!i)return!1;let a=n===`down`?i.getNextSibling():i.getPreviousSibling();if(!a)return!1;let s=0;n===`up`&&Z(a)&&(s=a.getChildrenSize());let c=a;n===`up`&&Z(a)&&(c=a.getLastChild()||a,s=uE(c)?c.getTextContentSize():0);let l=o.clone();return l.focus.set(c.getKey(),s,uE(c)?`text`:`element`),pD(l),Ez(t),!0}if(GD(e)){let e=n===`up`?o.getNodes()[o.getNodes().length-1]:o.getNodes()[0];if(e&&cz(r,e)!==null){let e=r.getFirstDescendant(),t=r.getLastDescendant();if(!e||!t)return!1;let[n]=KR(e),[a]=KR(t),o=r.getCordsFromCellNode(n,i.table),s=r.getCordsFromCellNode(a,i.table),c=r.getDOMCellFromCordsOrThrow(o.x,o.y,i.table),l=r.getDOMCellFromCordsOrThrow(s.x,s.y,i.table);return i.$setAnchorCellForSelection(c),i.$setFocusCellForSelection(l,!0),!0}return!1}{let r=XO(e,e=>Z(e)&&!e.isInline());if(jR(r)&&(r=XO(r,Vz)),!r)return!1;let a=n===`down`?r.getNextSibling():r.getPreviousSibling();if(Vz(a)&&i.tableNodeKey===a.getKey()){let e=a.getFirstDescendant(),r=a.getLastDescendant();if(!e||!r)return!1;let[i]=KR(e),[s]=KR(r),c=o.clone();return c.focus.set((n===`up`?i:s).getKey(),n===`up`?0:s.getChildrenSize(),`element`),Ez(t),pD(c),!0}}}}return n===`down`&&Lz(e)&&function(e,t){if(!Q(e))return!1;let n=fE(e.focus,`next`),r=iM(t,`next`);return yM(n.origin,r.origin)!==null&&pM(n,r)<0}(o,r)&&a.setShouldCheckSelectionForTable(r.getKey()),!1}if(Q(o)){if(n===`backward`||n===`forward`)return function(e,t,n,r,i,a,o){let s=fE(n.focus,i?`previous`:`next`);if(xE(s))return!1;let c=s;for(let e of lM(s).iterNodeCarets(`shadowRoot`)){if(!Qj(e)||!Z(e.origin))return!1;c=e}let l=c.getParentAtCaret();if(!jR(l))return!1;let u=l,d=function(e){for(let t of lM(e).iterNodeCarets(`root`)){let{origin:n}=t;if(jR(n)){if($j(t))return iM(n,e.direction)}else if(!FR(n))break}return null}(eM(u,c.direction)),f=XO(u,Vz);if(!f||!f.is(a))return!1;let p=e.getElementByKey(u.getKey()),m=uz(p);if(!p||!m)return!1;if(o.table=LCe(e,f),d){if(r===`extend`){let t=uz(e.getElementByKey(d.origin.getKey()));if(!t)return!1;o.$setAnchorCellForSelection(m),o.$setFocusCellForSelection(t,!0)}else{let e=bE(d);pE(n.anchor,e),pE(n.focus,e)}}else if(r===`extend`)o.$setAnchorCellForSelection(m),o.$setFocusCellForSelection(m,!0);else{let e=function(e){let t=oM(e);return $j(t)?bE(t):e}(eM(f,s.direction));pE(n.anchor,e),pE(n.focus,e)}return Ez(t),!0}(e,t,o,t.shiftKey?`extend`:`move`,n===`backward`,r,i);if(o.isCollapsed()){let{anchor:s,focus:c}=o,l=XO(s.getNode(),jR),u=XO(c.getNode(),jR);if(!jR(l)||!l.is(u))return!1;let d=wz(l);if(d!==r&&d!=null){let r=oz(d,e.getElementByKey(d.getKey()));if(r!=null)return i.table=fz(d,r),Tz(e,t,n,d,i,a)}let f=e.getElementByKey(l.__key),p=e.getElementByKey(s.key);if(p==null||f==null)return!1;let m;if(s.type===`element`)m=p.getBoundingClientRect();else{let t=QD(sz(e));if(t===null||t.rangeCount===0)return!1;let n=aO(t,e.getRootElement());if(n===null)return!1;m=n.getBoundingClientRect()}let h=n===`up`?l.getFirstChild():l.getLastChild();if(h==null)return!1;let g=e.getElementByKey(h.__key);if(g==null)return!1;let _=g.getBoundingClientRect();if(n===`up`?_.top>m.top-m.height:m.bottom+m.height>_.bottom){Ez(t);let e=r.getCordsFromCellNode(l,i.table);if(!t.shiftKey)return MCe(i,r,e.x,e.y,n);{let t=r.getDOMCellFromCordsOrThrow(e.x,e.y,i.table);i.$setAnchorCellForSelection(t),i.$setFocusCellForSelection(t,!0)}return!0}}}else if(QR(o)){let{anchor:a,focus:s,tableKey:c}=o;if(c!==r.getKey())return!1;let l=XO(a.getNode(),jR),u=XO(s.getNode(),jR),[d]=o.getNodes();Vz(d)||MR(251);let f=oz(d,e.getElementByKey(d.getKey()));if(!jR(l)||!jR(u)||!Vz(d)||f==null)return!1;i.$updateTableTableSelection(o);let p=fz(d,f),m=r.getCordsFromCellNode(l,p),h=r.getDOMCellFromCordsOrThrow(m.x,m.y,p);if(i.$setAnchorCellForSelection(h),Ez(t),t.shiftKey){let[e,t,a]=UR(r,l,u);return function(e,t,n,r,i){let a=qR(t,n,r),{topSpan:o,leftSpan:s,bottomSpan:c,rightSpan:l}=function(e,t){let{minColumn:n,maxColumn:r,minRow:i,maxRow:a}=t,o=1,s=1,c=1,l=1,u=e[i],d=e[a];for(let e=n;e<=r;e++)o=Math.max(o,u[e].cell.__rowSpan),l=Math.max(l,d[e].cell.__rowSpan);for(let t=i;t<=a;t++)s=Math.max(s,e[t][n].cell.__colSpan),c=Math.max(c,e[t][r].cell.__colSpan);return{bottomSpan:l,leftSpan:s,rightSpan:c,topSpan:o}}(t,a),[u,d]=_z(gz(a,n,r)),f=a[u],p=a[d];i===`forward`?f+=u===`maxColumn`?1:s:i===`backward`?f-=u===`minColumn`?1:l:i===`down`?p+=d===`maxRow`?1:o:i===`up`&&(p-=d===`minRow`?1:c);let m=t[p];if(m===void 0)return!1;let h=m[f];if(h===void 0)return!1;let[g,_]=function(e,t,n){let r=qR(e,t,n),i=gz(r,t,n);return[vz(e,r,i),vz(e,r,_z(i))]}(t,n,h),v=kz(e,g.cell),y=kz(e,_.cell);return e.$setAnchorCellForSelection(v),e.$setFocusCellForSelection(y,!0),!0}(i,e,t,a,n)}return u.selectEnd(),!0}return!1}function Ez(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function Dz(e,t,n){let r=jE();e===`first`?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function Oz(e,t,n){let r=n.getParent();if(!r)return;let i=QD(sz(e));if(!i)return;let a=oO(i,e.getRootElement()).anchorNode,o=e.getElementByKey(r.getKey()),s=oz(n,e.getElementByKey(n.getKey()));if(!a||!o||!s||!o.contains(a)||s.contains(a))return;let c=XO(t.anchor.getNode(),e=>jR(e));if(!c)return;let l=XO(c,e=>Vz(e));if(!Vz(l)||!l.is(n))return;let[u,d]=UR(n,c,c),f=u[0][0],p=u[u.length-1][u[0].length-1],{startRow:m,startColumn:h}=d,g=m===f.startRow&&h===f.startColumn,_=m===p.startRow&&h===p.startColumn;return g?`first`:_?`last`:void 0}function kz(e,t){let{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function Az(e,t,n){return cz(e,cD(t,n))}function jz(e){return dO(e)&&e.nodeName===`DIV`}var NCe=Yw()({colWidths:Qw(Jw(Kge(Ww())),{getter:{field:`__colWidths`}}),frozenColumnCount:Qw(Ww(),{getter:`getSerializedFrozenColumnCount`,setter:{field:`__frozenColumnCount`,method:`setFrozenColumns`}}),frozenRowCount:Qw(Ww(),{getter:`getSerializedFrozenRowCount`,setter:{field:`__frozenRowCount`,method:`setFrozenRows`}}),rowStriping:Qw(Gw(),{getter:`getSerializedRowStriping`,setter:{field:`__rowStriping`}})});function Mz(e,t,n){let r=e.querySelector(`:scope > colgroup`);if(!n)return void(r&&r.remove());r||(r=rO().createElement(`colgroup`),DO(r),e.insertBefore(r,e.firstChild));let i=[];for(let e=0;e{};let i=t.scrollLeft,a=n.scrollLeft,o=()=>{t.scrollLeft!==i&&(n.scrollLeft=i=t.scrollLeft,a=n.scrollLeft)},s=()=>{n.scrollLeft!==a&&(t.scrollLeft=a=n.scrollLeft,i=t.scrollLeft)};t.addEventListener(`scroll`,o,{passive:!0}),n.addEventListener(`scroll`,s,{passive:!0});let c=null;return typeof ResizeObserver<`u`&&(c=new ResizeObserver(()=>{Fz(t,n)}),c.observe(t),c.observe(r)),Fz(t,n),()=>{t.removeEventListener(`scroll`,o),n.removeEventListener(`scroll`,s),c&&c.disconnect()}}function Fz(e,t){if(Pz.has(t))return;let n=t.firstElementChild;if(!n||!dO(n)||!e.isConnected)return;let r=e.ownerDocument.defaultView;if(!r)return void(t.style.display=`none`);let i=r.getComputedStyle(e).overflowX,a=i===`auto`||i===`scroll`,o=e.scrollWidth,s=e.clientWidth,c=o+`px`;n.style.width!==c&&(n.style.width=c);let l=a&&o>s;t.style.display=l?``:`none`}function FCe(e){if(!e.hasAttribute(`data-lexical-sticky-scrollbar`))return null;let t=e.firstElementChild;if(!jz(t))return null;let n=t.querySelector(`:scope > table`);if(!az(n))return null;let r=t.nextElementSibling;return jz(r)?{scrollable:t,scrollbar:r,tableElement:n}:null}var Iz=new WeakSet;function Lz(e=_O()){return Iz.has(e)}function Rz(e=_O()){let t=aN(e,`@lexical/table/Table`);return!!t&&t.output.hasStickyScrollbar.peek()&&t.output.hasHorizontalScroll.peek()}function ICe(e,t){t?Iz.add(e):Iz.delete(e)}var zz=class extends WT{__rowStriping=!1;__frozenColumnCount=0;__frozenRowCount=0;__colWidths=void 0;$config(){return this.config(`table`,{extends:WT,generated:sCe,importDOM:{table:()=>({conversion:RCe,priority:1})},json:NCe})}getSerializedFrozenColumnCount(){return this.getLatest().__frozenColumnCount||void 0}getSerializedFrozenRowCount(){return this.getLatest().__frozenRowCount||void 0}getSerializedRowStriping(){return this.getLatest().__rowStriping||void 0}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let t=this.getWritable();return t.__colWidths=e,t}extractWithChild(e,t,n){return n===`html`}getDOMSlot(e){let t=az(e)?e:e.querySelector(`table`);return az(t)||MR(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector(`:scope > colgroup`))}createDOM(e,t){let n=rO().createElement(`table`);if(this.__style&&ZT(n.style,this.__style),this.getColWidths()){let e=rO().createElement(`colgroup`);n.appendChild(e),DO(e)}if(SM(n,e.theme.table),this.updateTableElement(null,n,e),Lz(t)){let r=Rz(t),i=function(e,t,n){let r=rO().createElement(`div`),i=t.theme.tableScrollableWrapper;return i?SM(r,i):r.style.overflowX=`auto`,n&&(r.style.scrollbarWidth=`none`),r.appendChild(e),r}(n,e,r);if(this.updateTableWrapper(null,i,n,e),r){let t=function(e){let t=rO(),n=t.createElement(`div`),r=e.theme.tableStickyScrollbar;r?SM(n,r):(n.style.position=`sticky`,n.style.bottom=`0`,n.style.overflowX=`scroll`,n.style.overflowY=`hidden`),n.style.display=`none`,n.setAttribute(`aria-hidden`,`true`),n.tabIndex=-1;let i=t.createElement(`div`);return i.style.height=`1px`,i.style.width=`0px`,n.appendChild(i),n}(e),n=rO().createElement(`div`);return n.setAttribute(`data-lexical-sticky-scrollbar`,`true`),n.appendChild(i),n.appendChild(t),DO(t),n}return i}return n}updateTableWrapper(e,t,n,r){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(e,t,n,r){r>0?(SM(e,n.theme.tableFrozenColumn),t.setAttribute(`data-lexical-frozen-column`,`true`)):(CM(e,n.theme.tableFrozenColumn),t.removeAttribute(`data-lexical-frozen-column`))}(t,n,r,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(e,t,n,r){r>0?(SM(e,n.theme.tableFrozenRow),t.setAttribute(`data-lexical-frozen-row`,`true`)):(CM(e,n.theme.tableFrozenRow),t.removeAttribute(`data-lexical-frozen-row`))}(t,n,r,this.__frozenRowCount)}updateTableElement(e,t,n){this.__style!==(e?e.__style:``)&&ZT(t.style,this.__style,e?e.__style:``),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(e,t,n){n?(SM(e,t.theme.tableRowStriping),e.setAttribute(`data-lexical-row-striping`,`true`)):(CM(e,t.theme.tableRowStriping),e.removeAttribute(`data-lexical-row-striping`))}(t,n,this.__rowStriping);let r=e?e.getColumnCount():0,i=e?e.__colWidths:void 0;this.getColumnCount()===r&&this.getColWidths()===i||Mz(t,this.getColumnCount(),this.getColWidths()),Nz(t,n,this.getFormatType())}updateDOM(e,t,n){let r=oz(this,t);if(t===r===Lz())return!0;if(jz(t)){if(t.hasAttribute(`data-lexical-sticky-scrollbar`)!==Rz())return!0;let i=r.parentElement;jz(i)&&this.updateTableWrapper(e,i,r,n)}return this.updateTableElement(e,r,n),!1}scaleDOMColWidths(e,t){let n=this.getColWidths();n&&Mz(oz(this,e),this.getColumnCount(),n.map(e=>e*t))}exportDOM(e){let t=super.exportDOM(e),{element:n}=t,r=!az(n)&&dO(n)?n.querySelector(`table`):n;if(dO(n)&&az(r)&&r!==n){n.dir&&(r.dir=n.dir);let{paddingInlineStart:e}=n.style;e&&(r.style.paddingInlineStart=e);let t=n.getAttribute(`data-lexical-indent`);t!==null&&r.setAttribute(`data-lexical-indent`,t)}return{after:n=>{if(t.after&&(n=t.after(n)),!az(n)&&dO(n)&&(n=n.querySelector(`table`)),!az(n))return null;Nz(n,e._config,this.getFormatType());let[r]=WR(this,null,null),i=new Map;for(let e of r)for(let t of e){let e=t.cell.getKey();i.has(e)||i.set(e,{colSpan:t.cell.getColSpan(),startColumn:t.startColumn})}let a=new Set;for(let e of n.querySelectorAll(`:scope > tr > [data-temporary-table-cell-lexical-key]`)){let t=e.getAttribute(`data-temporary-table-cell-lexical-key`);if(t){let n=i.get(t);if(e.removeAttribute(`data-temporary-table-cell-lexical-key`),n){i.delete(t);for(let e=0;e colgroup`);if(o){let e=Array.from(n.querySelectorAll(`:scope > colgroup > col`)).filter((e,t)=>a.has(t));o.replaceChildren(...e)}let s=n.querySelectorAll(`:scope > tr`);if(s.length>0){let e=rO().createElement(`tbody`);for(let t of s)e.appendChild(t);n.append(e)}return n},element:r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){let{rows:n,domRows:r}=t;for(let t=0;t{jR(e)&&(t+=e.getColSpan())}),t}};function LCe(e,t){let n=e.getElementByKey(t.getKey());return n===null&&MR(230),fz(t,n)}function RCe(e){let t=Bz();e.hasAttribute(`data-lexical-row-striping`)&&t.setRowStriping(!0),e.hasAttribute(`data-lexical-frozen-column`)&&t.setFrozenColumns(1),e.hasAttribute(`data-lexical-frozen-row`)&&t.setFrozenRows(1);let n=e.querySelector(`:scope > colgroup`);if(n){let e=[];for(let t of n.querySelectorAll(`:scope > col`)){let n=t.style.width||``;if(!CR.test(n)&&(n=t.getAttribute(`width`)||``,!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&t.setColWidths(e)}return TO(t,e),{after:e=>UM(e,FR),node:t}}function Bz(){return qD(new zz)}function Vz(e){return e instanceof zz}function zCe(e){FR(e.getParent())?e.isEmpty()&&e.append(jE()):e.remove()}function BCe(e){Vz(e.getParent())?VM(e,jR):e.remove()}function VCe(e){VM(e,FR),GR(e);let t=e.getColWidths(),n=e.getColumnCount();if(t&&t.length!==n){let r;if(n0){let e=t[t.length-1];r=[...t,...Array(n-t.length).fill(e)]}e.setColWidths(r)}}function HCe(e){if(e.detail<3||!fO(e.target))return!1;let t=cD(e.target);if(t===null)return!1;let n=XO(t,e=>Z(e)&&!e.isInline());return n!==null&&!!jR(n.getParent())&&(VT(n.select(0)),!0)}function UCe(){let e=$();if(!Q(e))return!1;let t=wz(e.anchor.getNode());if(t===null)return!1;let n=dD();if(!n.is(t.getParent())||n.getChildrenSize()!==1)return!1;let[r]=WR(t,null,null);if(r.length===0||r[0].length===0)return!1;let i=r[0][0];if(!i||!i.cell)return!1;let a=r[r.length-1],o=a[a.length-1];return!o||!o.cell?!1:(pD($R(t,i.cell,o.cell)),!0)}function WCe(e){return e.registerNodeTransform(DR,e=>{if(e.getColSpan()>1||e.getRowSpan()>1){let[,,t]=KR(e),[n]=UR(t,e,e),r=n.length,i=n[0].length,a=t.getFirstChild();FR(a)||MR(175);let o=[];for(let e=0;e1||s.getRowSpan()>1){jR(s)||MR(176);let e=AR(s.__headerState);t===null?Yye(a,e):t.insertAfter(e)}}}for(let e of o)e.setColSpan(1),e.setRowSpan(1)}})}function GCe(e,t=!0){let n=new wCe,r=!1,i=(r,i,a)=>{let o=oz(r,a),s=ACe(r,o,e,t,n);n.observers.set(i,[s,o])};return qk(kCe(e,n),e.registerCommand(BC,()=>e.getRootElement()!==null&&(r=!0,function(e,t){let n=$(),r=sj(),i=e.getAndClearNextFocus();if(i!==null&&Vz(iD(i.tableKey))){let{tableKey:t,focusCell:r}=i,a=e.observers.get(t);a||MR(335,t);let[o]=a;if(QR(n)&&n.tableKey===o.tableNodeKey)return(r.x!==o.focusX||r.y!==o.focusY)&&(o.$setFocusCellForSelection(r),!0);if(o.anchorCell!==null&&o.anchorCellNodeKey!==null&&r.elem!==o.anchorCell.elem&&o.tableSelection!==null)return o.$setFocusCellForSelection(r,!0),!0}let a=e.getAndClearShouldCheckSelectionForTable();if(a&&Q(r)&&Q(n)&&n.isCollapsed()){let e=iD(a);if(Vz(e)){let t=n.anchor.getNode(),r=e.getFirstChild(),i=Cz(t);if(i!==null&&FR(r)){let t=r.getFirstChild();if(jR(t)&&e.is(XO(i,n=>n.is(e)||n.is(t))))return t.selectStart(),!0}}}return QR(n)&&function(e,t){let n=sz(e),r=sj();if(!t.is(r))return;let i=nz(t.tableKey),a=QD(n),o=a&&oO(a,e.getRootElement());if(a&&o&&o.anchorNode&&o.focusNode){let n=cD(o.focusNode),r=n&&!i.isParentOf(n),s=cD(o.anchorNode),c=s&&i.isParentOf(s);if(r&&c&&a.rangeCount>0){let n=ij(a,e);n&&(n.anchor.set(i.getKey(),t.isBackward()?i.getChildrenSize():0,`element`),a.removeAllRanges(),pD(n))}}}(t,n),Q(n)&&function(e,t){let n=sj(),{anchor:r,focus:i}=e,a=r.getNode(),o=i.getNode(),s=Cz(a),c=Cz(o),l=s?wz(s):null,u=c?wz(c):null;if(t.touchTapCellKey!==null&&!e.dirty&&!e.isCollapsed()&&Q(n)&&n.isCollapsed()&&(!s||!s.is(c))){let e=iD(n.anchor.key),a=e&&e.getParent();if(Z(e)&&e.isEmpty()&&jR(a)&&a.getKey()===t.touchTapCellKey&&a.getChildren().every(e=>Z(e)&&e.isEmpty())&&(r.is(n.anchor)||i.is(n.anchor)))return void pD(n.clone())}let d=e.isBackward(),f=s&&c&&l&&u&&l.is(u),p=u&&(!l||l.isParentOf(u)),m=l&&(!u||u.isParentOf(l));if(p){let t=e.clone(),[n]=UR(u,c,c),r=n[0][0].cell,i=n[n.length-1].at(-1).cell;t.focus.set(d?r.getKey():i.getKey(),d?0:i.getChildrenSize(),`element`),pD(t)}else if(m){let t=e.clone(),[n]=UR(l,s,s),r=n[0][0].cell,i=n[n.length-1].at(-1).cell;t.anchor.set(d?i.getKey():r.getKey(),d?i.getChildrenSize():0,`element`),pD(t)}else if(f){if(!s.is(c))return void pD($R(l,s,c));let r=t.observers.get(l.getKey());if(r===void 0)return;let[i]=r;if(i.pointerType===`touch`&&i.isSelecting&&i.isPointerDrag&&e.isCollapsed()&&Q(n)&&n.isCollapsed()){let e=iD(n.anchor.key),t=e&&Cz(e),{pointerStartCell:r}=i,a=r&&cD(r.elem);a!==null&&!a.is(c)&&t&&l.is(wz(t))&&!t.is(c)&&(pD($R(l,t,c)),i.pointerType=null)}}}(n,e),!1}(n,e)),3),e.registerUpdateListener(({dirtyElements:t})=>{if(!r){for(let e of t.keys())if(n.observers.has(e)){r=!0;break}}r&&(r=!1,e.getRootElement()!==null&&e.read(`latest`,()=>{(function(e,t){for(let[n,r]of e.$getTableNodesAndObservers())jCe(t,n,r)})(n,e)}))}),e.registerMutationListener(zz,t=>{r=!0,e.read(`latest`,()=>{for(let[e,r]of t){let t=n.observers.get(e);if(r===`created`||r===`updated`){let{tableNode:r,tableElement:a}=ez(e);t===void 0?i(r,e,a):a!==t[1]&&(n.removeObserver(e),i(r,e,a))}else r===`destroyed`&&n.removeObserver(e)}})},{skipInitialization:!1}),()=>{n.removeAllObservers()})}function KCe(e,t){e.hasNodes([zz])||MR(255);let{hasNestedTables:n=vN(!1)}=t??{};return qk(e.registerCommand(pCe,e=>function({rows:e,columns:t,includeHeaders:n},r){let i=$()||sj();if(!i||!Q(i)||!r&&wz(i.anchor.getNode()))return!1;let a=IR(Number(e),Number(t),n);LM(a);let o=a.getFirstDescendant();return uE(o)&&o.select(),!0}(e,n.peek()),0),e.registerCommand(Zhe,(t,r)=>e===r&&function(e,t){let{nodes:n,selection:r}=e;if(!n.some(e=>Vz(e)||Wye(e).some(e=>Vz(e.node)))){if(QR(r)){let e=``,t=!1;for(let r of n){let n=Z(r)&&!r.isInline();e.length>0&&(n||t)&&(e+=` `),e+=r.getTextContent(),t=n}return r.insertRawText(e),!0}return!1}let i=QR(r),a=Q(r);return!!(a&&XO(r.anchor.getNode(),e=>jR(e))!==null&&XO(r.focus.getNode(),e=>jR(e))!==null||i)&&(n.length===1&&Vz(n[0])?YR(n[0],r):!(a&&t.peek()&&!function(e){return!(!QR(e)||e.focus.getNode().is(e.anchor.getNode()))||!(!Q(e)||!jR(e.anchor.getNode())||e.anchor.getNode().is(e.focus.getNode()))}(r)))}(t,n),0),e.registerCommand(_w,UCe,1),e.registerCommand(VC,HCe,0),e.registerNodeTransform(zz,VCe),e.registerNodeTransform(NR,BCe),e.registerNodeTransform(DR,zCe))}var qCe={build:(e,t,n)=>exe(t),config:{hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasNestedTables:!1,hasStickyScrollbar:!1,hasTabHandler:!0},dependencies:[OP,[DP,{rules:[{$import:(e,t)=>{let n=Bz();t.hasAttribute(`data-lexical-row-striping`)&&n.setRowStriping(!0),t.hasAttribute(`data-lexical-frozen-column`)&&n.setFrozenColumns(1),t.hasAttribute(`data-lexical-frozen-row`)&&n.setFrozenRows(1);let r=t.querySelector(`:scope > colgroup`);if(r){let e=[];for(let t of r.querySelectorAll(`:scope > col`)){let n=t.style.width||``;if(!CR.test(n)&&(n=t.getAttribute(`width`)||``,!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&n.setColWidths(e)}return[n.splice(0,0,UM(e.$importChildren(t),FR))]},match:kP.tag(`table`),name:`@lexical/table/table`},{$import:(e,t)=>[PR(CR.test(t.style.height)?parseFloat(t.style.height):void 0).splice(0,0,UM(e.$importChildren(t),jR))],match:kP.tag(`tr`),name:`@lexical/table/tr`},{$import:(e,t)=>{let n=t.nodeName===`TH`,r=CR.test(t.style.width)?parseFloat(t.style.width):void 0,i=ER.NO_STATUS;if(n){let e=t.getAttribute(`scope`);if(e===`col`)i=ER.COLUMN;else if(e===`row`)i=ER.ROW;else{let e=t.parentElement,n=Tve(e)&&(e.parentElement&&e.parentElement.nodeName===`THEAD`||e.rowIndex===0),r=t.cellIndex===0;n&&(i|=ER.ROW),r&&(i|=ER.COLUMN),i===ER.NO_STATUS&&(i=ER.ROW)}}let a=AR(i,t.colSpan,r);a.__rowSpan=t.rowSpan;let o=t.style.backgroundColor;o!==``&&(a.__backgroundColor=o);let s=t.style.verticalAlign;(function(e){return e===`middle`||e===`bottom`})(s)&&(a.__verticalAlign=s);let c=e.get(sP),l=c|function(e){let t=0,n=e.fontWeight;n!==`700`&&n!==`bold`||(t|=1),e.fontStyle===`italic`&&(t|=2);let r=(e.textDecoration||``).split(` `);return r.includes(`underline`)&&(t|=8),r.includes(`line-through`)&&(t|=4),t}(t.style),u=e.get(cP),d=t.style.color,f=d?{...u,color:d}:u,p=[];l!==c&&p.push(BN(sP,l)),f!==u&&p.push(BN(cP,f));let m=function(e){let t=[],n=null,r=()=>{if(n!==null){let e=n.getFirstChild();ok(e)&&n.getChildrenSize()===1&&e.remove()}};for(let i of e)HD(i)||uE(i)||ok(i)?n===null?(n=jE().append(i),t.push(n)):n.append(i):(r(),n=null,t.push(i));return r(),t.length===0&&t.push(jE()),t}(e.$importChildren(t,{context:p})),h=n?m:pP(m,t);return[a.splice(0,0,h)]},match:kP.tag(`td`,`th`),name:`@lexical/table/cell`}]}]],name:`@lexical/table/Table`,nodes:()=>[zz,NR,DR],register(e,t,n){let r=n.getOutput(),i=!1;return qk(EN(()=>{let t=r.hasHorizontalScroll.value,n=r.hasStickyScrollbar.value&&t,a=Lz(e);a!==t&&ICe(e,t),a===t&&i===n||e.update(jk),i=n}),KCe(e,r),EN(()=>GCe(e,r.hasTabHandler.value)),EN(()=>{if(r.hasStickyScrollbar.value&&r.hasHorizontalScroll.value)return e.registerRootListener(t=>{if(t)return function(e){let t=new Map;return qk(()=>{for(let{cleanup:e}of t.values())e();t.clear()},e.registerMutationListener(zz,n=>{for(let[r,i]of n){let n=t.get(r);if(i===`destroyed`){n&&(n.cleanup(),t.delete(r));continue}let a=e.getElementByKey(r),o=a&&dO(a)?FCe(a):null;n&&o&&n.parts.scrollable===o.scrollable&&n.parts.scrollbar===o.scrollbar&&n.parts.tableElement===o.tableElement?Fz(o.scrollable,o.scrollbar):(n&&(n.cleanup(),t.delete(r)),o&&t.set(r,{cleanup:PCe(o),parts:o}))}},{skipInitialization:!1}))}(e)})}),EN(()=>r.hasCellMerge.value?void 0:WCe(e)),EN(()=>r.hasCellBackgroundColor.value?void 0:e.registerNodeTransform(DR,e=>{e.getBackgroundColor()!==null&&e.setBackgroundColor(null)})))}},Hz=(e,t=[])=>e.getRootElement()?.contains(document.activeElement)?t:[...t,`skip-dom-selection`],Uz=[{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`]},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`]},{id:`abap`,name:`ABAP`},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`]},{id:`ada`,name:`Ada`},{id:`angular-html`,name:`Angular HTML`},{id:`angular-ts`,name:`Angular TypeScript`},{id:`apache`,name:`Apache Conf`},{id:`apex`,name:`Apex`},{id:`apl`,name:`APL`},{id:`applescript`,name:`AppleScript`},{id:`ara`,name:`Ara`},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`]},{id:`razor`,name:`ASP.NET Razor`},{id:`asm`,name:`Assembly`},{id:`astro`,name:`Astro`},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`]},{id:`ahk2`,name:`AutoHotkey2`},{id:`awk`,name:`AWK`},{id:`ballerina`,name:`Ballerina`},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`]},{id:`beancount`,name:`Beancount`},{id:`berry`,name:`Berry`,aliases:[`be`]},{id:`bibtex`,name:`BibTeX`},{id:`bicep`,name:`Bicep`},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`]},{id:`blade`,name:`Blade`},{id:`c`,name:`C`},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`]},{id:`cpp`,name:`C++`,aliases:[`c++`]},{id:`c3`,name:`C3`},{id:`cadence`,name:`Cadence`,aliases:[`cdc`]},{id:`cairo`,name:`Cairo`},{id:`chapel`,name:`Chapel`,aliases:[`chpl`]},{id:`clarity`,name:`Clarity`},{id:`clojure`,name:`Clojure`,aliases:[`clj`]},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`]},{id:`cmake`,name:`CMake`},{id:`cobol`,name:`COBOL`},{id:`codeowners`,name:`CODEOWNERS`},{id:`codeql`,name:`CodeQL`,aliases:[`ql`]},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`]},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`]},{id:`crystal`,name:`Crystal`},{id:`css`,name:`CSS`},{id:`csv`,name:`CSV`},{id:`cue`,name:`CUE`},{id:`cypher`,name:`Cypher`,aliases:[`cql`]},{id:`d`,name:`D`},{id:`dart`,name:`Dart`},{id:`dax`,name:`DAX`},{id:`desktop`,name:`Desktop`},{id:`diff`,name:`Diff`},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`]},{id:`dotenv`,name:`dotEnv`},{id:`dream-maker`,name:`Dream Maker`},{id:`edge`,name:`Edge`},{id:`elixir`,name:`Elixir`},{id:`elm`,name:`Elm`},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`]},{id:`erb`,name:`ERB`},{id:`erlang`,name:`Erlang`,aliases:[`erl`]},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`]},{id:`fennel`,name:`Fennel`},{id:`fish`,name:`Fish`},{id:`fluent`,name:`Fluent`,aliases:[`ftl`]},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`]},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`]},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`]},{id:`gdscript`,name:`GDScript`,aliases:[`gd`]},{id:`gdshader`,name:`GDShader`},{id:`genie`,name:`Genie`},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`]},{id:`gherkin`,name:`Gherkin`},{id:`git-commit`,name:`Git Commit Message`},{id:`git-rebase`,name:`Git Rebase Message`},{id:`gleam`,name:`Gleam`},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`]},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`]},{id:`glsl`,name:`GLSL`},{id:`gn`,name:`GN`},{id:`smalltalk`,name:`GNU Smalltalk`},{id:`gnuplot`,name:`Gnuplot`},{id:`go`,name:`Go`},{id:`graphql`,name:`GraphQL`,aliases:[`gql`]},{id:`groovy`,name:`Groovy`},{id:`hack`,name:`Hack`},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`]},{id:`hcl`,name:`HashiCorp HCL`},{id:`haskell`,name:`Haskell`,aliases:[`hs`]},{id:`haxe`,name:`Haxe`},{id:`hjson`,name:`Hjson`},{id:`hlsl`,name:`HLSL`},{id:`html`,name:`HTML`},{id:`html-derivative`,name:`HTML (Derivative)`},{id:`http`,name:`HTTP`},{id:`hurl`,name:`Hurl`},{id:`hxml`,name:`HXML`},{id:`hy`,name:`Hy`},{id:`imba`,name:`Imba`},{id:`ini`,name:`INI`,aliases:[`properties`]},{id:`java`,name:`Java`},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`]},{id:`jinja`,name:`Jinja`},{id:`jison`,name:`Jison`},{id:`json`,name:`JSON`},{id:`jsonl`,name:`JSON Lines`},{id:`jsonc`,name:`JSON with Comments`},{id:`json5`,name:`JSON5`},{id:`jsonnet`,name:`Jsonnet`},{id:`jssm`,name:`JSSM`,aliases:[`fsl`]},{id:`jsx`,name:`JSX`},{id:`julia`,name:`Julia`,aliases:[`jl`]},{id:`just`,name:`Just`,aliases:[`justfile`]},{id:`kdl`,name:`KDL`},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`]},{id:`kusto`,name:`Kusto`,aliases:[`kql`]},{id:`latex`,name:`LaTeX`},{id:`lean`,name:`Lean 4`,aliases:[`lean4`]},{id:`less`,name:`Less`},{id:`liquid`,name:`Liquid`},{id:`llvm`,name:`LLVM IR`},{id:`log`,name:`Log file`},{id:`logo`,name:`Logo`},{id:`lua`,name:`Lua`},{id:`luau`,name:`Luau`},{id:`make`,name:`Makefile`,aliases:[`makefile`]},{id:`markdown`,name:`Markdown`,aliases:[`md`]},{id:`marko`,name:`Marko`},{id:`matlab`,name:`MATLAB`},{id:`mdc`,name:`MDC`},{id:`mdx`,name:`MDX`},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`]},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`]},{id:`mojo`,name:`Mojo`},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`]},{id:`move`,name:`Move`},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`]},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`]},{id:`nextflow-groovy`,name:`Nextflow Groovy`},{id:`nginx`,name:`Nginx`},{id:`nim`,name:`Nim`},{id:`nix`,name:`Nix`},{id:`nsis`,name:`NSIS`},{id:`nushell`,name:`nushell`,aliases:[`nu`]},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`]},{id:`objective-cpp`,name:`Objective-C++`},{id:`ocaml`,name:`OCaml`},{id:`odin`,name:`Odin`},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`]},{id:`org`,name:`Org Markup`},{id:`pascal`,name:`Pascal`},{id:`perl`,name:`Perl`},{id:`php`,name:`PHP`},{id:`pkl`,name:`Pkl`},{id:`plsql`,name:`PL/SQL`},{id:`polar`,name:`Polar`},{id:`postcss`,name:`PostCSS`},{id:`powerquery`,name:`PowerQuery`},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`]},{id:`prisma`,name:`Prisma`},{id:`prolog`,name:`Prolog`},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`]},{id:`pug`,name:`Pug`,aliases:[`jade`]},{id:`puppet`,name:`Puppet`},{id:`purescript`,name:`PureScript`},{id:`python`,name:`Python`,aliases:[`py`]},{id:`qml`,name:`QML`},{id:`qmldir`,name:`QML Directory`},{id:`qss`,name:`Qt Style Sheets`},{id:`r`,name:`R`},{id:`racket`,name:`Racket`},{id:`raku`,name:`Raku`,aliases:[`perl6`]},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`]},{id:`regexp`,name:`RegExp`,aliases:[`regex`]},{id:`rel`,name:`Rel`},{id:`rst`,name:`reStructuredText`},{id:`riscv`,name:`RISC-V`},{id:`coq`,name:`Rocq`},{id:`ron`,name:`RON`},{id:`rosmsg`,name:`ROS Interface`},{id:`ruby`,name:`Ruby`,aliases:[`rb`]},{id:`haml`,name:`Ruby Haml`},{id:`rust`,name:`Rust`,aliases:[`rs`]},{id:`sas`,name:`SAS`},{id:`sass`,name:`Sass`},{id:`scala`,name:`Scala`},{id:`scheme`,name:`Scheme`},{id:`scss`,name:`SCSS`},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`]},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`]},{id:`shellsession`,name:`Shell Session`,aliases:[`console`]},{id:`smithy`,name:`Smithy`},{id:`solidity`,name:`Solidity`},{id:`sparql`,name:`SPARQL`},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`]},{id:`sql`,name:`SQL`},{id:`ssh-config`,name:`SSH Config`},{id:`stata`,name:`Stata`},{id:`stylus`,name:`Stylus`,aliases:[`styl`]},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`]},{id:`svelte`,name:`Svelte`},{id:`swift`,name:`Swift`},{id:`systemd`,name:`Systemd Units`},{id:`system-verilog`,name:`SystemVerilog`},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`]},{id:`tasl`,name:`Tasl`},{id:`tcl`,name:`Tcl`},{id:`templ`,name:`Templ`},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`]},{id:`tex`,name:`TeX`},{id:`toml`,name:`TOML`},{id:`tsv`,name:`TSV`},{id:`tsx`,name:`TSX`},{id:`turtle`,name:`Turtle`},{id:`twig`,name:`Twig`},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`]},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`]},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`]},{id:`typst`,name:`Typst`,aliases:[`typ`]},{id:`v`,name:`V`},{id:`vala`,name:`Vala`},{id:`verilog`,name:`Verilog`},{id:`vhdl`,name:`VHDL`},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`]},{id:`vb`,name:`Visual Basic`},{id:`vue`,name:`Vue`},{id:`vue-html`,name:`Vue HTML`},{id:`vue-vine`,name:`Vue Vine`},{id:`vyper`,name:`Vyper`,aliases:[`vy`]},{id:`wasm`,name:`WebAssembly`},{id:`wit`,name:`WebAssembly Interface Types`},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`]},{id:`wgsl`,name:`WGSL`},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`]},{id:`reg`,name:`Windows Registry Script`},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`]},{id:`xml`,name:`XML`},{id:`xsl`,name:`XSL`},{id:`yaml`,name:`YAML`,aliases:[`yml`]},{id:`zenscript`,name:`ZenScript`},{id:`zig`,name:`Zig`}],JCe=[{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`},{id:`github-light`,displayName:`GitHub Light`,type:`light`},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`},{id:`horizon`,displayName:`Horizon`,type:`dark`},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`},{id:`houston`,displayName:`Houston`,type:`dark`},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`},{id:`laserwave`,displayName:`LaserWave`,type:`dark`},{id:`light-plus`,displayName:`Light Plus`,type:`light`},{id:`material-theme`,displayName:`Material Theme`,type:`dark`},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`},{id:`min-dark`,displayName:`Min Dark`,type:`dark`},{id:`min-light`,displayName:`Min Light`,type:`light`},{id:`monokai`,displayName:`Monokai`,type:`dark`},{id:`night-owl`,displayName:`Night Owl`,type:`dark`},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`},{id:`nord`,displayName:`Nord`,type:`dark`},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`},{id:`one-light`,displayName:`One Light`,type:`light`},{id:`plastic`,displayName:`Plastic`,type:`dark`},{id:`poimandres`,displayName:`Poimandres`,type:`dark`},{id:`red`,displayName:`Red`,type:`dark`},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`},{id:`vesper`,displayName:`Vesper`,type:`dark`},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`}],YCe=`sveltia-ui`,XCe=`shiki`,Wz,Gz,Kz=!0,qz=(e,t)=>`4.6.0/${e}/${t}`,Jz=()=>(Wz===void 0&&(Wz=typeof indexedDB>`u`?null:new yu(YCe,XCe)),Wz),ZCe=async e=>(Gz??=(async()=>{let t=(await e.keys()).filter(e=>typeof e==`string`&&!e.startsWith(`4.6.0/`));t.length&&await e.deleteEntries(t)})(),Gz),QCe=async(e,t)=>{let n=Kz?Jz():null;if(n)try{return await ZCe(n),await n.get(qz(e,t))}catch{return}},$Ce=async(e,t,n)=>{let r=Kz?Jz():null;if(r)try{await r.set(qz(e,t),n)}catch{}},Yz=`https://unpkg.com/@shikijs`,ewe=`https://unpkg.com/@sveltia/ui`,twe=()=>`${ewe}@0.90.0/dist/shiki-engine.js`,nwe=e=>`${Yz}/langs@4.6.0/dist/${e}.mjs`,rwe=e=>`${Yz}/themes@4.6.0/dist/${e}.mjs`,iwe={loadEngine:async()=>import(twe()),loadLanguage:async e=>import(nwe(e)),loadTheme:async e=>import(rwe(e))},Xz=()=>iwe,Zz=()=>{if(typeof document>`u`)return`github-light`;let{theme:e}=document.documentElement.dataset;return e?e===`dark`?`github-dark`:`github-light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`github-dark`:`github-light`},Qz=e=>{if(typeof document>`u`)return()=>void 0;let t=new MutationObserver(e);t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]});let n=window.matchMedia(`(prefers-color-scheme: dark)`);return n.addEventListener(`change`,e),()=>{t.disconnect(),n.removeEventListener(`change`,e)}},awe=e=>Qz(()=>{let t=Zz();e.update(()=>{dD().getChildren().forEach(e=>{JP(e)&&e.getTheme()!==t&&(e.setTheme(t),e.markDirty())})},{tag:Hz(e,[`history-merge`])})}),owe=[``,`plain`,`plaintext`,`text`,`txt`],swe=/^diff-([\w-]+)/i,$z=null,eB=null,tB=!1,nB=e=>swe.exec(e)?.[1]??null,rB=e=>owe.includes(e??``),iB=()=>!!eB,cwe=()=>tB,aB=e=>{if(!eB)return!1;let t=nB(e)??e;return $z.isSpecialLang(t)?!0:eB.getLoadedLanguages().includes(t)},lwe=(e,t)=>{e.update(()=>{let e=iD(t);if(!JP(e))return;let n=e.getLanguage();n&&aB(n)&&!e.getIsSyntaxHighlightSupported()&&e.setIsSyntaxHighlightSupported(!0),e.markDirty()},{tag:Hz(e,[`history-merge`])})},oB=new Map,sB=(e,t,n,r)=>{let i=oB.get(e);if(!i){let n=new Map;i={promise:(async()=>{try{await t()}catch{}oB.delete(e),n.forEach((e,t)=>lwe(e,t))})(),targets:n},oB.set(e,i)}return n&&r&&i.targets.set(r,n),i.promise},cB=(e,t)=>{if(!(eB||tB))return sB(`engine`,async()=>{try{$z=await Xz().loadEngine(),eB=$z.createHighlighterCoreSync({engine:$z.createJavaScriptRegexEngine(),langs:[],themes:[]})}catch{tB=!0}},e,t)},uwe=async(e,t,n)=>{let r=await QCe(e,t);if(r)return r;let i=await n();if(!i)return;let a=i.default??i;return await $Ce(e,t,a),a},lB=(e,t,n,r)=>{let i=e===`lang`?`loadLanguage`:`loadTheme`;return sB(`${e}/${t}`,async()=>{let n=await uwe(e,t,()=>Xz()[i](t));n&&await eB[i](n)},n,r)},uB=e=>Uz.find(({id:t,aliases:n})=>t===e||n?.includes(e)),dB=e=>uB(e)?.id??e,fB=(e,t,n)=>{let r=nB(e)??e;if(!eB||aB(r))return;let i=uB(r);if(i)return lB(`lang`,i.id,t,n)},pB=e=>eB?$z.isSpecialTheme(e)||eB.getLoadedThemes().includes(e):!1,mB=(e,t,n)=>{if(eB&&!pB(e)&&JCe.some(({id:t})=>t===e))return lB(`theme`,e,t,n)},dwe=(e,t)=>{let n=[];return e.forEach((e,r)=>{r&&n.push(ak()),e.forEach((e,r)=>{let{content:i}=e;if(t&&r===0&&i.length>0){let e=[`+`,`-`,`>`,`<`,` `],t=[`inserted`,`deleted`,`inserted`,`deleted`,`unchanged`],r=e.indexOf(i[0]);r!==-1&&(n.push(nF(e[r],t[r])),i=i.slice(1))}let a=$z.stringifyTokenStyle(e.htmlStyle||$z.getTokenStyleObject(e));hj(i,{linebreak:()=>n.push(ak()),tab:()=>n.push(PE()),text:e=>{let t=nF(e);t.setStyle(a),n.push(t)}})})}),n},fwe=(e,t)=>{let n=nB(t),{tokens:r}=eB.codeToTokens(e.getTextContent(),{lang:n??t,theme:e.getTheme()});return dwe(r,!!n)},hB=(e,t)=>{if(!eB||rB(e)||!aB(e))return;let n=t??Zz();return pB(n)?n:void 0},pwe=(e,t,{theme:n}={})=>{let r=dB(nB(t)??t),i=hB(r,n);if(i!==void 0)return eB.codeToHtml(e,{lang:r,theme:i})},mwe=(e,t,{theme:n}={})=>{let r=dB(t),i=hB(r,n);if(i===void 0)return;let{tokens:a,fg:o=``}=eB.codeToTokens(e,{lang:r,theme:i});return a.map(e=>e.map(({content:e,color:t,fontStyle:n=0})=>{let r={content:e};return t&&t.toLowerCase()!==o.toLowerCase()&&(r.color=t),n&2&&(r.bold=!0),n&4&&(r.underline=!0),n&8&&(r.strikethrough=!0),r}))},hwe={a:[`href`,`rel`,`target`,`title`],ol:[`start`],td:[`colspan`,`rowspan`],th:[`colspan`,`rowspan`]},gB=[[`code`,`code`],[`subscript`,`sub`],[`superscript`,`sup`],[`highlight`,`mark`],[`underline`,`u`],[`strikethrough`,`s`],[`italic`,`em`],[`bold`,`strong`]],gwe=[`tbody`,`thead`,`tfoot`,`colgroup`,`col`],_we=[`html`,`head`,`body`],_B=e=>e.className.match(/(?:^|\s)(?:lang|language)-(\S+)/)?.[1],vwe=[`p`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`blockquote`,`li`],vB=e=>{let t=hwe[e.localName]??[],n=vwe.includes(e.localName)?e.style.textAlign:``;[...e.attributes].forEach(({name:n})=>{t.includes(n)||e.removeAttribute(n)}),n&&(e.style.textAlign=n)},yB=(e,t)=>{let{after:n,...r}=t.exportDOM(e);return dO(r.element)&&vB(r.element),{...r,after:e=>{let r=n?n.call(t,e):void 0,i=r??e;return dO(i)&&(vB(i),i.querySelectorAll(`:scope > br`).forEach(vB)),r===e?void 0:r}}},ywe=`address.article.aside.blockquote.center.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.hr.li.listing.main.menu.nav.ol.p.plaintext.pre.search.section.summary.table.ul.xmp`.split(`.`),bB=e=>dO(e)&&ywe.includes(e.localName),xB=e=>{for(let t=e.parentElement;t;t=t.parentElement)if(t.localName===`pre`||t.style.whiteSpace.startsWith(`pre`))return!0;return!1},SB=(e,t)=>{let n=e??null;for(;n&&!YE(n);)n=t?n.firstChild:n.lastChild;return n??void 0},bwe=gB.map(([,e])=>e),CB=e=>YE(e)?!e.data.trim():dO(e)&&bwe.includes(e.localName)&&[...e.childNodes].every(CB),xwe=e=>{let t=[...e.childNodes];if(!t.some(bB))return;let n=document.createDocumentFragment(),r=[],i=()=>{let t=SB(r[0],!0),i=SB(r.at(-1),!1);if(t&&!xB(t)&&(t.data=t.data.trimStart()),i&&!xB(i)&&(i.data=i.data.trimEnd()),!r.every(CB)){let t=e.cloneNode(!1);t.append(...r),n.append(t)}r=[]};return t.forEach(e=>{bB(e)?(i(),n.append(e)):r.push(e)}),i(),n},Swe=(e,t)=>{let n=t.getParent();if(n instanceof DR&&n.getChildrenSize()===1&&!t.getFormatType())return{element:document.createDocumentFragment()};if(t.isEmpty()&&t.getNextSiblings().every(e=>ME(e)&&e.isEmpty()))return{element:null};let{after:r,...i}=yB(e,t);return{...i,after:e=>{let n=r.call(t,e),i=n??e;return dO(i)&&xwe(i)||n}}},wB=(e,t)=>{let n=document.createTextNode(t.getTextContent());return gB.forEach(([e,r])=>{if(t.hasFormat(e)){let e=document.createElement(r);e.append(n),n=e}}),{element:n}},Cwe=(e,t)=>({element:document.createElement(`pre`),after:e=>{if(!dO(e))return;let n=document.createElement(`code`),r=t.getLanguage();r&&!rB(r)&&(n.className=`language-${r}`),n.textContent=[...e.childNodes].map(e=>e.nodeName===`BR`?dO(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)?``:` `:e.textContent).join(``),e.replaceChildren(n)}}),wwe=`:scope > :is(thead, tbody, tfoot), :scope > :is(thead, tbody, tfoot) > tr, :scope > :is(thead, tbody, tfoot) > tr > :is(th, td), :scope > tr, :scope > tr > :is(th, td)`,Twe=new Map([[aE,wB],[NE,wB],[eF,wB],[AE,Swe],[TI,yB],[SI,yB],[zF,yB],[WF,yB],[bF,yB],[AN,yB],[KP,Cwe],[zz,(e,t)=>{let{after:n,...r}=t.exportDOM(e);return{...r,after:e=>{let r=n?n.call(t,e):void 0,i=r??e;return dO(i)&&(i.querySelectorAll(`:scope > colgroup`).forEach(e=>e.remove()),[i,...i.querySelectorAll(wwe)].forEach(vB)),r===e?void 0:r}}}]]),Ewe=e=>{let t=document.createTreeWalker(e,NodeFilter.SHOW_ALL),n=``;for(let e=t.nextNode();e;e=t.nextNode())e.nodeType===Node.TEXT_NODE?n+=e.data:e.nodeName===`BR`&&(n+=` `);return n},Dwe=e=>{let t=e.querySelector(`:scope > code`),n=qP((t?_B(t):void 0)??e.getAttribute(`data-language`)),r=Ewe(e).replace(/\n$/,``);return r&&n.append(lE(r)),{node:n,after:()=>[]}},TB=new WeakMap,EB=new WeakMap,DB=e=>{let t=EB.get(e);return t||(t=e.importDOM?.()??{},EB.set(e,t)),t},OB=new WeakMap,kB=(e,t)=>{let n=OB.get(t);return n===void 0&&(n=TB.get(e)?.find(({node:e})=>!!DB(e)[t.localName]?.(t))??null,OB.set(t,n)),n??void 0},AB=e=>{let t=kB(_O(),e);return!!t&&!!t.node.prototype.isInline?.()},jB=(e,t)=>{let n=e;for(;;){let e=t?n.nextSibling:n.previousSibling;for(;!e;){let{parentElement:r}=n;if(!r)return null;n=r,e=t?n.nextSibling:n.previousSibling}if(n=e,dO(n)){if(AB(n))return n;let{display:e}=n.style;if(e?!e.startsWith(`inline`):!mO(n))return null}let r=t?n.firstChild:n.lastChild;for(;r;){if(n=r,dO(n)&&AB(n))return n;r=t?n.firstChild:n.lastChild}if(YE(n))return n;if(n.nodeName===`BR`)return null}},Owe=e=>{let t=e.data.replace(/\r/g,``).replace(/[ \t\n]+/g,` `);if(t.startsWith(` `)){let n=jB(e,!1),r=!0;for(;n;n=jB(n,!1)){if(!YE(n)){r=!1;break}let e=n.data;if(e){r=/[ \t\n]$/.test(e);break}}r&&(t=t.slice(1))}if(t.endsWith(` `)){let n=jB(e,!0),r=!0;for(;n;n=jB(n,!0))if(!YE(n)||n.data.replace(/^[ \t\n]+/,``)){r=!1;break}r&&(t=t.slice(0,-1))}return{node:t?lE(t):null}},kwe={"#text":e=>xB(e)?null:{conversion:e=>Owe(e),priority:1}},Awe={pre:()=>({conversion:Dwe,priority:2})},jwe=e=>{let t=TB.get(e)??[],n=new Set(t.map(({node:e})=>e)),r=new Set([...e._nodes.values()].filter(({klass:e})=>!n.has(e)).flatMap(({klass:e})=>Object.keys(e.importDOM?.()??{})));return new Set(t.flatMap(({node:e})=>Object.keys(DB(e))).filter(e=>!r.has(e)))},Mwe=(e,t)=>{let n=jwe(e),r=i=>{let a;return[...i.childNodes].some(i=>{if(i.nodeType===Node.COMMENT_NODE)return a=i,!0;if(i.nodeType!==Node.ELEMENT_NODE)return!1;let o=i,s=o.localName;return kB(e,o)?!1:!_we.includes(s)&&!gwe.includes(s)&&(!e._htmlConversions.has(s)||n.has(s))?(a=o,!0):(a=s===`pre`?t.createTreeWalker(o,NodeFilter.SHOW_COMMENT).nextNode()??void 0:r(o),!!a)}),a};return r(t)},MB=e=>MP(e),NB={defaultLanguage:`javascript`,defaultTheme:`github-light`,tokenize(e,t){let n=t||this.defaultLanguage;return n===null||rB(n)||!iB()?zP(e.getTextContent()):fwe(e,n)}},Nwe=(e,t)=>{let n=t.getElementByKey(e.getKey());if(n===null)return;let r=e.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let a=`1`,o=1;for(let e=0;erF(e)&&rF(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType&&e.__style===t.__style||FE(e)&&FE(t)||ok(e)&&ok(t),Pwe=(e,t)=>{let n=0;for(;n{let n=iD(e);if(!JP(n)||!n.isAttached())return;let r=$();if(!Q(r)){t();return}let{anchor:i}=r,a=i.getNode();if(a!==n&&!n.isParentOf(a)){t();return}let o=i.offset,s=i.type===`element`&&ok(n.getChildAtIndex(i.offset-1)),c=0;if(s||(c=o+a.getPreviousSiblings().reduce((e,t)=>e+t.getTextContentSize(),0)),!t())return;if(s){i.getNode().select(o,o);return}let l=n.getChildren();for(let e=0;e=c){t.select(c,c);return}c-=e}else if(ok(t)){if(c===0){n.select(e,e);return}--c}}n.select(l.length,l.length)},FB=(e,t,n,r)=>{let i=r.getKey(),{nodesCurrentlyHighlighting:a}=n,o=r.getLanguage();!o&&t.defaultLanguage!==null&&(o=t.defaultLanguage,r.setLanguage(o));let s=r.getTheme();s||(s=t.defaultTheme,r.setTheme(s));let c=!o||rB(o),l=!1;c||!o||cwe()?r.getIsSyntaxHighlightSupported()&&r.setIsSyntaxHighlightSupported(!1):iB()?(pB(s)||(mB(s,e,i),l=!0),aB(o)?r.getIsSyntaxHighlightSupported()||r.setIsSyntaxHighlightSupported(!0):(!fB(o,e,i)&&r.getIsSyntaxHighlightSupported()&&r.setIsSyntaxHighlightSupported(!1),l=!0)):(cB(e,i),l=!0),l||(a.has(i)?n.pendingRefresh.has(i)||(n.pendingRefresh.add(i),RD(()=>{n.pendingRefresh.delete(i),e.update(()=>{let e=iD(i);JP(e)&&e.markDirty()},{tag:Hz(e,[`history-merge`])})})):(a.add(i),n.didTransform||(n.didTransform=!0,RD(()=>{n.didTransform=!1,a.clear()})),Fwe(i,()=>{let e=iD(i);if(!JP(e)||!e.isAttached())return!1;let n=e.getLanguage()||t.defaultLanguage,a=t.tokenize(e,n??void 0),{from:o,to:s,nodesForReplacement:c}=Pwe(e.getChildren(),a);return o!==s||c.length?(r.splice(o,s-o,c),!0):!1})))},IB=(e,t,n,r)=>{let i=r.getParent();JP(i)?FB(e,t,n,i):rF(r)&&r.replace(lE(r.__text))},Iwe=(e,t=NB)=>{if(!e.hasNodes([KP,eF]))throw Error(`CodeNode or CodeHighlightNode not registered on editor`);let n=[];e._headless!==!0&&n.push(e.registerMutationListener(KP,t=>{e.read(`latest`,()=>{t.forEach((t,n)=>{if(t!==`destroyed`){let t=iD(n);t!==null&&Nwe(t,e)}})})},{skipInitialization:!1}));let r={didTransform:!1,nodesCurrentlyHighlighting:new Set,pendingRefresh:new Set};return n.push(e.registerNodeTransform(KP,FB.bind(null,e,t,r)),e.registerNodeTransform(aE,IB.bind(null,e,t,r)),e.registerNodeTransform(eF,IB.bind(null,e,t,r)),bxe(e)),qk(...n)},Lwe={dependencies:[AN],export:e=>MN(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=jN();r||e.getNextSibling()!==null?e.replace(i):e.insertBefore(i),i.isAttached()&&i.selectNext()},type:`element`},LB=`[ \\t\\uE005]`;`${LB}${LB}${LB}${LB}${LB}`;var RB=String.raw`(?=<)(?\`\\uE005]+|'[^'\\n]*'|"[^"\\n]*"))?)*[ \\t\\uE005]*/?>|`,String.raw`||`,String.raw`<\?.*?\?>`,String.raw`]*>`,String.raw``].join(`|`),`)`].join(``)),Rwe=`(?:${[`javascript`,`vbscript`,`data`].map(e=>e.replace(/[a-z]/g,e=>`[${e}${e.toUpperCase()}]`)).join(`|`)})`,zwe=new RegExp([RB,`(?:`,[String.raw`<(?!${Rwe}:)[A-Za-z][A-Za-z0-9+.-]{1,31}:[^\s<>]*>`,String.raw`<[\w.!#$%&'*+/=?^\x60{|}~-]+@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?`+String.raw`(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*>`].join(`|`),`)`].join(``)),Bwe=/(?|`{3,}|~{3,}/].map(({source:e})=>e).join(`|`),Hwe=String.raw`\[(?:[^\\[\]]|\\.)+\]:`,Uwe=RegExp(`^ {0,3}(?:${Vwe}|${Hwe})`),BB=$w(`suiRawSyntax`,{parse:e=>typeof e==`string`?e:``}),Wwe=e=>eT(e,BB)||void 0,Gwe=e=>{if(eT(e,BB))return e.getTextContent()},VB={dependencies:[],export:()=>null,importRegExp:Uwe,regExp:/(?!)/,replace:e=>{tT(e,BB,e.getTextContent())},type:`text-match`},HB={dependencies:[],export:()=>null,importRegExp:new RegExp([`^(?=[*_~=]).+`,`(?<=^).+`,zB.source,zwe.source,Bwe.source].join(`|`)),regExp:/(?!)/,replace:VB.replace,type:`text-match`},UB=e=>{let t=$()??sj();t&&!$()&&pD(t.clone());let n=Q(t)?t.anchor.getNode():null;return ME(n)&&n.isEmpty()&&YT(n.getParent())?n.replace(e):LM(e)},Kwe=()=>{let e=UB(jN()),t=e.getNextSibling();return Z(t)?t.selectStart():e.insertAfter(jE()).selectStart(),e},WB=e=>{let t=Number(e);return Number.isInteger(t)&&t>=1&&t<=50?t:void 0},qwe=(e,t)=>{let n=`| ${Array(t).fill(``).join(` | `)} |`;return[n,`| ${Array(t).fill(`---`).join(` | `)} |`,...Array(e-1).fill(n)].join(` `)},GB=e=>{let t=e.closest(`table`);return!!t&&getComputedStyle(t).direction===`rtl`},KB=e=>e?XO(e,jR):null,qB=()=>{let e=$();return!Q(e)&&!QR(e)?null:KB(e.focus.getNode())?.getKey()??null},Jwe=(e,t)=>{let n=$()??sj();return(Q(n)||QR(n))&&wz(n.anchor.getNode())?!1:(UB(IR(e,t,{rows:!0,columns:!1})).getFirstChildOrThrow().getFirstChildOrThrow().selectStart(),!0)},Ywe=e=>{!e.getNextSibling()&&YT(e.getParent())&&e.insertAfter(jE())},Xwe=e=>{e.getChildren().forEach((e,t)=>{if(!FR(e))return;let n=t===0?ER.ROW:ER.NO_STATUS;e.getChildren().forEach(e=>{jR(e)&&e.getHeaderStyles()!==n&&e.setHeaderStyles(n)})})},Zwe=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();Z(t)?t.selectEnd():Z(n)?n.selectStart():e.insertAfter(jE()).selectStart()},Qwe=e=>e===`delete-row`||e===`delete-column`,$we=(e,t)=>{let n=$(),[r,i]=[n.anchor,n.focus].map(e=>KB(e.getNode())).map(e=>t===`delete-row`?e.getParentOrThrow().getIndexWithinParent():e.getIndexWithinParent()).sort((e,t)=>e-t);return i-r+1===(t===`delete-row`?e.getChildrenSize():e.getColumnCount())},eTe=(e,t,{rtl:n=!1}={})=>{let r=iD(t);if(!jR(r))return!1;let i=wz(r),a=$()??sj();return(Q(a)||QR(a))&&wz(a.anchor.getNode())?.is(i)&&wz(a.focus.getNode())?.is(i)?$()||pD(a.clone()):r.selectStart(),e===`delete-table`||Qwe(e)&&$we(i,e)?(Zwe(i),i.remove()):e===`delete-row`?yCe():e===`delete-column`?bCe():e===`insert-row-above`||e===`insert-row-below`?_Ce(e===`insert-row-below`):vCe(e===`insert-column-right`!==n),!0},tTe=e=>e.replace(/^( {0,3})(#{1,6}(?=[ \t]|$)|[-+](?=[ \t]|$)|>|=+[ \t]*$|-{2,}[ \t]*$)/,`$1\\$2`).replace(/^( {0,3}\d{1,9})([.)])(?=[ \t]|$)/,`$1\\$2`),JB=e=>!!e&&/[^\s\p{P}\p{S}]/u.test(e),nTe=e=>e.replace(/((?:\\_)+)|\\(.)/gs,(e,t,n,r,i)=>{if(t)return JB(i[r-1])&&JB(i[r+e.length])?t.replaceAll(`\\`,``):e;if(n===`\\`){let t=i[r+2];return t&&!/[\n\r!-/:-@[-`{-~]/.test(t)?n:e}return e}),rTe={38:`&`,60:`<`,91:`[`,93:`]`},iTe=/^[\w.!#$%&'*+/=?^`{|}~-]{1,64}@[A-Za-z\d]/,aTe=(e,{isInLink:t,isAtLineEnd:n})=>e.replace(/&#(38|60|91|93);/g,(e,r,i,a)=>{let o=rTe[r],s=a.slice(i+e.length,i+e.length+70);return!s&&!n||o===`<`&&(/^[A-Za-z/!?]/.test(s)||iTe.test(s))||o===`&`&&/^#(?:\d{1,7}|[xX][\dA-Fa-f]{1,6});/.test(s)||o===`[`&&(t||s.startsWith(`^`))||o===`]`&&(t||/^[(:[]/.test(s))?`\\${o}`:o}),oTe=e=>{if(!e.hasFormat(`italic`))return!1;let t=e=>uE(e)&&e.hasFormat(`italic`),n=e,r=e;for(;t(n.getPreviousSibling());)n=n.getPreviousSibling();for(;t(r.getNextSibling());)r=r.getNextSibling();let i=n.getTextContent(),a=r.getTextContent(),o=/^\s/.test(i)?` `:n.getPreviousSibling()?.getTextContent().at(-1),s=/\s$/.test(a)?` `:r.getNextSibling()?.getTextContent()[0];return JB(o)||JB(s)},YB=``,XB={dependencies:[],export:(e,t,n)=>{if(!uE(e)||e.hasFormat(`code`))return null;let r=e.getTextContent();if(e.getFormat()&&/^\s+$/.test(r))return`${n(iR(e),YB).replace(YB,``)}${r}`;let i=Gwe(e),a=n(iR(e),i===void 0?r:YB);if(oTe(e)&&(a=a.replace(/\\.|_/gs,e=>e===`_`?`*`:e)),i!==void 0)return a.replace(YB,()=>i);let o=e.getParent(),s=e.getPreviousSibling(),c=e.getNextSibling();return a=aTe(nTe(a),{isInLink:!!o?.isInline(),isAtLineEnd:!c||ok(c)}),!o||o.isInline()||[`code`,`heading`].includes(o.getType())||s&&!ok(s)?a:tTe(a)},regExp:/(?!)/,type:`text-match`},ZB=/^(?:\|)(.+)(?:\|)\s?$/,sTe=/^(?:\|[ \t]*:?-+:?[ \t]*)+\|\s?$/,cTe={left:`:---`,center:`:---:`,right:`---:`},lTe=e=>{let t=e.trim(),n=t.startsWith(`:`),r=t.endsWith(`:`);return n&&r?`center`:n?`left`:r?`right`:``},QB=e=>{let t=e.getFirstChild();return FR(t)?t.getChildrenSize():0},$B=(e,t)=>{e=e.trim().replace(/\\n/g,` `).replace(/\\\|/g,`|`);let n=AR(ER.NO_STATUS);return eR(e,t,n),n},eV=(e,t)=>{let[,n]=e.match(ZB)??[];return n?n.split(/(?<=(?$B(e,t)):null},uTe=(e,t)=>{let n=[],r=[],i=!1;e.getChildren().forEach(e=>{jR(e)&&(n.push(tR(t,e).replace(/\|/g,`\\|`).replace(/\n/g,`\\n`).trim()),r.push(e),e.__headerState===ER.ROW&&(i=!0))});let a=[`| ${n.join(` | `)} |`];return i&&a.push(`| ${r.map(e=>cTe[e.getFormatType()]??`---`).join(` | `)} |`),a},dTe=(e,t)=>{let n=e.getPreviousSibling();if(!n||!Vz(n))return;let r=n.getChildren(),i=r[r.length-1];if(!i||!FR(i))return;let a=t.trim().slice(1,-1).split(`|`).map(lTe);i.getChildren().forEach((e,t)=>{jR(e)&&(e.setHeaderStyles(ER.ROW,ER.ROW),e.setFormat(a[t]??``))}),e.remove()},fTe=(e,t)=>{let n=[],r=e.getPreviousSibling();for(;r&&ME(r)&&r.getChildrenSize()===1;){let e=r.getFirstChild();if(!uE(e))break;let i=eV(e.getTextContent(),t);if(!i)break;n.unshift(i);let a=r.getPreviousSibling();r.remove(),r=a}return n},pTe=(e,t)=>{let n=Math.max(...e.map(e=>e.length)),r=Bz();return e.forEach(e=>{let i=PR();r.append(i);for(let r=0;r{let n=e.getPreviousSibling();if(Vz(n)&&QB(n)===QB(t)){let r=n.getFirstChild().getChildren();t.getChildren().forEach(e=>{e.getChildren().forEach((e,t)=>{e.setFormat(r[t].getFormatType())})}),n.append(...t.getChildren()),e.remove()}else e.replace(t);t.selectEnd()},hTe=(e=[])=>{let t=[...e,...zL.map(e=>e===RL?lR:e),oR,HB,VB],n=[...t,XB];return{dependencies:[zz,NR,DR],export:e=>Vz(e)?e.getChildren().flatMap(e=>FR(e)?uTe(e,n):[]).join(` `):null,regExp:ZB,replace:(e,n,[r])=>{if(sTe.test(r)){dTe(e,r);return}let i=eV(r,t);i&&mTe(e,pTe([...fTe(e,t),i],t))},type:`element`}},tV=e=>{let t=[],n;return e.forEach((e,r)=>{let i=e.match(/^[ \t]*(`{3,}(?=[^`]*$)|~{3,})/)?.[1];n?i?.[0]===n.fence[0]&&i.length>=n.fence.length&&!e.trim().slice(i.length)&&(t.push({...n,end:r,closed:!0}),n=void 0):i&&(n={start:r,fence:i})}),n&&t.push({...n,end:e.length-1,closed:!1}),t},nV=(e,t)=>{let n=e.split(` `),r=[],i=0,a=e=>{if(e>i){let a=i>0?` `:``,o=e{a(e),r.push(n.slice(e,t+1).join(` `)),i=t+1}),a(n.length),r.join(` `)},rV=(e,t)=>{let n=e.split(` `),r=new Set(tV(n).flatMap(({start:e,end:t})=>Array.from({length:t-e+1},(t,n)=>e+n)));return n.map((e,n)=>r.has(n)?e:t(e)).join(` `)},iV=/^ {0,3}(=+|-+)[ \t]*$/,aV=/^ {0,3}#{1,6}(?:[ \t]|$)/,oV=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/,sV=[[`(?:script|pre|style|textarea)(?:[ \\t>]|$)`,/<\/(?:pre|script|style|textarea)>/i],[`!--`,/-->/],[`\\?`,/\?>/],[`![A-Za-z]`,/>/],[`!\\[CDATA\\[`,/\]\]>/],[`/?(?:${`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h[1-6].head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`).join(`|`)})(?:[ \\t>]|/>|$)`,null]],gTe=RegExp(`<(?:${sV.map(([e])=>e).join(`|`)})`,`i`),_Te=sV.map(([e,t])=>[RegExp(`^ {0,3}<(?:${e})`,`i`),t]),vTe=new RegExp(zB,`g`),yTe=RegExp(`^ {0,3}(?!\`\\uE005]+|'[^'\\n]*'|"[^"\\n]*"))?)*[ \\t\\uE005]*/?>|)[ \\t]*$`,`i`),cV=new RegExp([aV.source,"^ {0,3}(?:>|[-+*](?:[ \\t]|$)|\\d{1,9}[.)](?:[ \\t]|$)|`{3,}|~{3,}|\\|)",`^ {0,3}${gTe.source}`,`^(?: {4}|\\t)`,oV.source,iV.source].join(`|`),`i`),bTe=new RegExp([aV.source,oV.source].join(`|`)),xTe=new RegExp(cV.source.replace(`|^(?: {4}|\\t)`,``),`i`),lV=(e,t)=>{let n=`[${e}]`.repeat(t),r=String.raw`(?:\\[^\s]|[^${e}\\\n])`,i=String.raw`(?:\\[^\s]|[^${e}\s\\])`,a=`${i}(?:${r}*?${i})?`,o=String.raw`[\s\p{P}\p{S}]`,s=e===`*`,c=s?`(?:(?<=^|${o})${n}|${n}(?!${o}))`:`(?<=^|${o})${n}`,l=s?`(?:(?e.split(` `).map(e=>{let t=e.length-e.trimStart().length,n=e.length,r=0;for(;n>t&&/[ \t]/.test(e[n-1]);)--n;for(;e[n-r-1]===`\\`;)r+=1;return r%2&&--n,{indent:e.slice(0,t),text:e.slice(t,n),lineEnd:e.slice(n)}}),CTe=e=>uV.some(([,t])=>e.search(t)!==-1),dV=e=>{let t=[...e.matchAll(/`+/g)].map(({0:{length:t},index:n})=>{let r=0;for(;e[n-r-1]===`\\`;)r+=1;return{index:n,length:t,escaped:r%2==1}}),n=[];for(let e=0;ee.replace(/(?<=^|[\s\p{P}\p{S}])(?{if(!e.includes(`[`))return e;let t=dV(e);return e.replace(wTe,(e,n,r,i,a,o)=>t.some(({start:e,end:t})=>o>=e&&odV(e).some(({start:t,end:n})=>e.slice(t,n).includes(` `))||/(?nV(e,e=>{let t=TTe(e),n;for(;t!==n;)n=t,t=uV.reduce((e,[t,n])=>e.replace(n,(e,n)=>{if(CTe(n))return e;let r=ETe(n);if(DTe(r))return e;let i=STe(r);return i.some(({text:e})=>/^[*_~]+$/.test(e))||i.slice(1).some(({indent:e,text:t})=>xTe.test(`${e}${t}`))?e:i.map(({indent:e,text:n,lineEnd:r})=>`${e}${t}${n}${t}${r}`).join(` `)}),t);return t}),fV=``,pV=``,mV=``,hV=``,kTe=e=>{if(!/[\\`][*_~]*$/.test(e))return e;let t=dV(e).findLast(({end:t})=>/^[*_~]*$/.test(e.slice(t)));if(t){let n=t.end-t.fenceLength;return e[n-1]===`\\`?`${e.slice(0,n)}${fV}${e.slice(n)}`:e}let n=[!0,!1].map(t=>{let n=e.length-(t&&e.endsWith(`\\`)?1:0),r=0;for(;n>0&&`*_~`.includes(e[n-1]);)--n;for(;e[n-r-1]===`\\`;)r+=1;return r&&r%2==0?n:-1}).find(e=>e!==-1);return n===void 0?e:`${e.slice(0,n)}${fV}${e.slice(n)}`},ATe=/(?=\\)(?<=(?:^|[^\\])(?:\\\\)*[*_~])|(?=[*_~])(?<=(?:^|[^\\])(?:\\\\)+)/g,jTe=e=>/[*_~]\\|\\[*_~]/.test(e)?e.replace(ATe,(t,n)=>`*_~`.includes(e[n])?`${pV}.`:`.${pV}`):e,MTe=/(?<=[*_~])(?=(?![\0-\x7F])[\p{P}\p{S}])|(?<=(?![\0-\x7F])[\p{P}\p{S}])(?=[*_~])/gu,NTe=e=>/[^\0-\x7F]/.test(e)?e.replace(MTe,(t,n)=>`*_~`.includes(e[n-1])?`.${pV}`:`${pV}.`):e,PTe=e=>{if(!/`[ \t]|\t/.test(e))return e;let t=``,n=0;return dV(e).forEach(({start:r,end:i,fenceLength:a})=>{let o=e.slice(r+a,i-a);t+=`${e.slice(n,r+a)}${/^ +$/.test(o)?hV.repeat(o.length):o.replaceAll(` `,mV)}`,n=i-a}),t+e.slice(n)},FTe=e=>{let t,n=!1;return e.split(` `).map(e=>{let r=!e.trim();if(t===null&&r&&(t=void 0),t===void 0){let i=_Te.find(([t])=>t.test(e));if(i)[,t]=i;else if(!n&&yTe.test(e))t=null;else return n=!r&&!bTe.test(e)&&!(n&&iV.test(e)),e.includes(` `)?e.replace(vTe,e=>e.replaceAll(` `,mV)):e}return t?.test(e)&&(t=void 0),n=!1,`${e.replaceAll(` `,mV)}`}).join(` `)},ITe=e=>rV(e.includes(`<`)?nV(e,FTe):e,e=>PTe(NTe(jTe(kTe(e))))),gV=e=>e.replace(RegExp(`\\.${pV}|${pV}\\.`,`g`),``).replaceAll(fV,``).replaceAll(``,``).replaceAll(mV,` `).replaceAll(hV,` `),LTe=e=>{if(!/^[ \t]*~{3,}/m.test(e))return e;let t=e.split(` `);return tV(t).filter(({fence:e})=>e.startsWith(`~`)).forEach(({start:e,end:n,closed:r})=>{let i=t.slice(e+1,r?n:n+1),a=Math.max(2,...i.map(e=>e.match(/^[ \t]*(`*)/)[1].length)),o="`".repeat(a+1);t[e]=t[e].replace(/^([ \t]*)~+([ \t]*[\w-]+)?(.*)$/,(e,t,n,r)=>`${t}${o}${n??``}${r.replaceAll("`",n?``:``)}`),r&&(t[n]=t[n].replace(/^([ \t]*)~+[ \t]*$/,`$1${o}`))}),t.join(` `)},RTe=e=>!!e.trim()&&!cV.test(e),zTe=e=>/^ {0,3}(?:=+|-+)[ \t]*$/m.test(e)?nV(e,e=>{let t=[];return e.split(` `).forEach(e=>{let[,n]=e.match(iV)??[],r=t.length;for(;r>0&&RTe(t[r-1]);)--r;let i=t[r-1];if(!n||r===t.length||i!==void 0&&i.trim()&&!aV.test(i)){t.push(e);return}let a=t.splice(r).map(e=>e.trim()).join(` `);t.push(`${n.startsWith(`=`)?`#`:`##`} ${a}`)}),t.join(` `)}):e,BTe=e=>/^>$/m.test(e)?rV(e,e=>e===`>`?`> `:e):e,VTe=e=>/^> $/m.test(e)?rV(e,e=>e===`> `?`>`:e):e,HTe=()=>{let e=$();return Q(e)?XO(e.anchor.getNode(),e=>Z(e)&&!e.isInline())?.getFormatType()??``:``},_V=e=>e instanceof WT?e:IM(e,WT),UTe=()=>{let e=$();if(!Q(e))return{blockNodeKey:null,blockType:`paragraph`,inlineTypes:[],tableCellKey:qB(),alignment:``};let t=e.anchor.getNode(),n=null,r=dR.filter(t=>e.hasFormat(t));t.getType()!==`root`&&(n=_V(t),SF(n)&&(r.push(`link`),n=n.getParent()),JF(n)&&(n=IM(n,zF)));let i=(()=>{if(!n)return`paragraph`;if(kI(n))return`heading-${n.getTag().match(/\d/)?.[0]}`;if(UF(n))return n.getListType()===`bullet`?`bulleted-list`:`numbered-list`;if(wI(n))return`blockquote`;if(JP(n)||rF(n))return`code-block`;let e=n.getType();return pR.includes(e)?e:`paragraph`})();return{blockNodeKey:n?.getKey()??null,blockType:i,inlineTypes:r,tableCellKey:qB(),alignment:HTe()}},vV=(...e)=>{let t=e.filter(e=>typeof e==`function`);return()=>{t.forEach(e=>e())}},yV=e=>VTe(tR([...e.filter(({tag:e})=>!ZSe.includes(e)),XB]).replace(/\n+$/,``)),bV=(e,t,n,r=`markdown`)=>{let i=n??(r===`html`?MB(e):yV(t));return e.getRootElement()?.dispatchEvent(new CustomEvent(`Update`,{detail:{value:i,selection:UTe()}})),i},WTe=(e,t,n)=>{let r=0,i=!0,a,o=!1;return vV(()=>{o=!0},e.registerUpdateListener(({dirtyElements:s,dirtyLeaves:c}={})=>{if(i||=!s||s.size>0||c.size>0,e?.isComposing())return;r+=1;let l=r;(async()=>{await Bu(100),l!==r||o||e.update(()=>{a=bV(e,t,i?void 0:a,n),i=!1})})()}))},GTe=({node:e,createNode:t,transformer:n,createMarkdown:r})=>{if(r)return r().trim();let i=fk({namespace:`component`,nodes:e?[e]:[],onError:e=>{throw e}}),a=``;try{i.update(()=>{let e=t();dD().append(e.isInline()?jE().append(e):e),a=bV(i,[n])},{discrete:!0})}catch{}return a.trim()},xV=({transformer:e})=>e.type===`text-match`,KTe=e=>{let t=e=>e===void 0?e:gV(e);return Object.assign(e.map(t),{index:e.index,input:e.input,groups:e.groups?Object.fromEntries(Object.entries(e.groups).map(([e,n])=>[e,t(n)])):void 0})},SV=(e,t)=>Object.assign(new RegExp(e),{[Symbol.match]:n=>{let r=+!!n.startsWith(``),i=n.slice(r).match(e);return!i||!r||(i.input=n,t&&i.index===0?i[0]=`${i[0]}`:i.index+=r),i}}),qTe=e=>Array.isArray(e)?`index`in e?KTe(e):e.every(e=>typeof e==`string`)?e.map(e=>gV(e)):e:e,JTe=e=>{let{type:t,handleImportAfterStartMatch:n,importRegExp:r,regExp:i,regExpStart:a,regExpEnd:o,replace:s}=e,c={};return n&&(c.handleImportAfterStartMatch=e=>n({...e,lines:e.lines.map(e=>gV(e))})),r&&(c.importRegExp=SV(r,!1)),t===`element`&&i&&(c.regExp=SV(i,!0)),a&&(c.regExpStart=SV(a,!0)),o instanceof RegExp?c.regExpEnd=SV(o,!0):o?.regExp&&(c.regExpEnd={...o,regExp:SV(o.regExp,!0)}),s&&(c.replace=(...e)=>s(...e.map(qTe))),{...e,...c}},CV=e=>e.multiline!==!1||e.isCodeEditor?e:{...e,modes:e.format===`html`?[`rich-text`]:e.modes,enabledButtons:(e.enabledButtons??[]).filter(e=>fR.includes(e)),components:(e.components??[]).filter(xV)},wV=e=>Z(e)&&!e.isInline()?e.getChildren().flatMap(wV):e.isInline()?[e]:[],YTe=e=>{let t=e.getChildren(),[n]=t;if(!n||t.length===1&&ME(n))return;let r=ME(n)?n:jE();r!==n&&n.insertBefore(r);let i=r.getTextContent().at(-1)??``;t.filter(e=>e!==r).forEach(e=>{let t=wV(e),n=t.map(e=>e.getTextContent()).join(``);t.length&&r.getChildrenSize()&&!/\s/.test(i+n.charAt(0))&&r.append(lE(` `)),r.append(...t),i=n.at(-1)??i,e.remove()})},XTe=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();if(!t||!n||/\s$/.test(t.getTextContent())||/^\s/.test(n.getTextContent())){e.remove();return}let r=lE(` `),i=SF(t)&&SF(n)&&t.getURL()===n.getURL()&&t.getTitle()===n.getTitle()&&t.getTarget()===n.getTarget()&&t.getRel()===n.getRel(),a=Z(t)?t.getLastDescendant():t,o=Z(n)?n.getFirstDescendant():n;uE(a)&&uE(o)&&(dR.forEach(e=>{a.hasFormat(e)&&o.hasFormat(e)&&r.toggleFormat(e)}),a.getStyle()===o.getStyle()&&r.setStyle(a.getStyle())),i?(t.append(r,...n.getChildren()),n.remove(),e.remove()):e.replace(r)},ZTe=e=>vV(e.registerCommand(ow,e=>(e?.preventDefault(),!0),3),e.registerCommand(WC,()=>!0,3),e.registerCommand(UC,()=>!0,3),e.registerNodeTransform(ik,XTe),e.registerNodeTransform(JT,YTe)),QTe=(e,t)=>vV(e.registerCommand(HC,e=>{let t=$();if(!e||!Q(t)||!t.isCollapsed())return!1;let{offset:n}=t.anchor,r=t.anchor.getNode(),i=JP(r)?r:IM(r,KP);return!!i&&n===0&&(r.is(i)||!!i.getFirstDescendant()?.is(r))},1),e.registerCommand(ow,t=>Q($())?(t?.preventDefault(),e.dispatchCommand(WC,void 0)):!1,2),e.registerNodeTransform(JT,e=>{let n=e.getChildren();if(n.length===1&&JP(n[0]))return;let[r]=n;if(n.length===1&&Z(r)){let e=qP(t);r.replace(e,!0)}else if(n.length===0){let n=qP(t);e.append(n),n.selectStart()}})),$Te=[[`bulleted-list`,YF,`bullet`],[`numbered-list`,XF,`number`]],eEe=(e,t=[])=>{let n=$Te.filter(([e])=>t.includes(e));return vV(...n.map(([,t,n])=>e.registerCommand(t,()=>(Fxe(n),!0),2)),n.length?e.registerCommand(WC,()=>Rxe(),2):void 0)},tEe=e=>e.registerRootListener(t=>{if(!t)return;let n=t=>{e.update(()=>{if(t.key===`Tab`){let n=$();if(!Q(n))return;let r=_V(n.anchor.getNode());JF(r)&&r.canIndent()&&(t.shiftKey?r.getIndent()>0&&(t.preventDefault(),e.dispatchCommand(pw,void 0)):(t.preventDefault(),e.dispatchCommand(fw,void 0)))}})};return t.addEventListener(`keydown`,n),()=>{t.removeEventListener(`keydown`,n)}}),nEe=[`http`,`https`,`mailto`,`sms`,`tel`],TV=e=>{let t=e.replace(/[\u0000-\u0020]/g,``);if(/^[^/?#]*[&\\]/.test(t))return!1;let n=/^([a-z][a-z\d+.-]*):/i.exec(t)?.[1];return!n||nEe.includes(n.toLowerCase())},rEe=e=>vV(e.registerNodeTransform(bF,e=>{TV(e.getURL())||Zye(e)}),e.registerCommand(wF,e=>{let t=typeof e==`string`?e:e?.url??null;return t!==null&&!TV(t)||Axe(t===null?null:e),!0},2),e.registerCommand(KC,t=>{let n=$();if(!Q(n)||!RM(t,ClipboardEvent)||!t.clipboardData||t.target.matches(`input, textarea`))return!1;let r=t.clipboardData.getData(`text`).trim();return!Uc(r)||!TV(r)?!1:(n.isCollapsed()&&mj([lE(r)]),!n.getNodes().some(e=>Z(e)||uE(e)&&!e.isSimpleText())&&(e.dispatchCommand(wF,r),t.preventDefault(),!0))},1)),EV=()=>{let e=$();if(!Q(e))return null;let t=XO(e.anchor.getNode(),SF);return t&&XO(e.focus.getNode(),SF)===t?t:null},iEe=(e,t)=>{let n;return e.getEditorState().read(()=>{let[r,i]=t.isBackward()?[t.focus,t.anchor]:[t.anchor,t.focus];r.getNode().isAttached()&&i.getNode().isAttached()&&(n=zye(e,r.getNode(),r.offset,i.getNode(),i.offset)?.getBoundingClientRect())}),n},aEe=(e,t)=>{let n=`selection`in t?iEe(e,t.selection):t.linkKey?e.getElementByKey(t.linkKey)?.getBoundingClientRect():void 0;if(!n||!(n.top||n.bottom||n.left||n.width||n.height))return;let{top:r,bottom:i,left:a,right:o}=n;return{top:r,bottom:i,left:a,right:o}},DV=async e=>{rB(e)||(await cB(),await Promise.all([fB(dB(e)),mB(Zz())]))},OV=/\s/,kV=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,oEe=(e,t)=>{let n=0;for(;e[t-n-1]===`\\`;)n+=1;return n%2==1},AV=(e,t,n,r)=>{let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o===void 0||OV.test(o)?!1:!kV.test(o)||s===void 0||OV.test(s)||kV.test(s)},jV=(e,t,n,r)=>{if(!AV(e,t,n,r))return!1;if(e[t]!==`_`||!AV(e,t,n,!r))return!0;let i=r?e[t-1]:e[t+n];return i!==void 0&&kV.test(i)},sEe=(e,t,n)=>{let r=[],i=0,a=0;for(;a{let n={},r=[],i=0;for(;is&&!c;--n){let o=e[n],s=o.active&&o.canOpen&&o.length>0&&o.char===a.char&&(!o.canClose&&!a.canOpen||(o.length+a.length)%3!=0||o.length%3==0||a.length%3==0),l=Math.min(o.length,a.length),u=s?t.filter(e=>e[0]===o.char&&e.length<=l).sort((e,t)=>t.length-e.length)[0]:void 0;if(u){c=!0,r.push({start:o.index+o.length-u.length,end:a.index+u.length});for(let t=n+1;t0,a.length>0?a.index+=u.length:(a.active=!1,i+=1)}}c||(n[o]=i-1,a.active=a.canOpen,i+=1)}}return r},lEe=(e,t)=>{let n=new Set(e.map(e=>e[0])),r=t.flatMap(({importRegExp:e})=>e?[new RegExp(e.source,`${e.flags.replace(`g`,``)}g`)]:[]),i,a=t=>{let i=dV(t),[a]=i;if(!a)return;let o=cEe(sEe(t,n,i),e),s=({start:e,end:t})=>e<=a.start&&t>=a.end,[c]=[...o].sort((e,t)=>e.start-t.start||t.end-e.end);if(!c||s(c))return;let[l]=o.filter(s).sort((e,t)=>e.start-t.start);if(l&&!r.some(e=>[...t.matchAll(e)].some(({0:{length:e},index:t})=>tl.start)))return l.start};return e=>(i?.text!==e&&(i={text:e,index:a(e)}),i.index)},uEe=e=>{let t=e.filter(e=>e.type===`text-format`).map(e=>e.tag);if(!t.includes("`"))return e;let n=lEe(t.filter(e=>e!=="`"),e.filter(e=>e.type===`text-match`));return[{dependencies:[],export:()=>null,importRegExp:Object.assign(/(?!)/,{[Symbol.match]:e=>{let t=n(e);return t===void 0?null:Object.assign([e.slice(t)],{index:t,input:e})}}),regExp:/(?!)/,replace:e=>e,type:`text-match`},...e.map(e=>{if(e.type!==`text-match`)return e;let{getEndIndex:t}=e;return{...e,getEndIndex:(e,r)=>{let i=t?t(e,r):(r.index??0)+r[0].length,a=n(e.getTextContent());return i!==!1&&a!==void 0&&i<=a?!1:i}}})]},dEe=e=>{e.flatMap(e=>Z(e)?e.getAllTextNodes():e).filter(e=>uE(e)).forEach(e=>{let t=e.getTextContent(),n=gV(Wwe(e)??t),r=e.getParent();if(n!==t&&e.setTextContent(n),SF(r)){let e=r.getURL(),t=r.getTitle();gV(e)!==e&&r.setURL(gV(e)),t&&gV(t)!==t&&r.setTitle(gV(t))}})},MV=(e,t)=>{let n=t.some(e=>`regExpStart`in e&&e.regExpStart===nR.regExpStart),r=t.some(e=>`regExp`in e&&e.regExp===wL.regExp),i=n?LTe(e):e,a=r?zTe(i):i;return{markdown:a,languages:[...a.matchAll(/^`{3,}[ \t]*(?[\w-]+)/gm)].map(({groups:{lang:e=`plain`}={}})=>e)}},NV=(e,t,{toRoot:n=!1}={})=>{let r=OTe(e),i=ITe(r),a=BTe(i),o=uEe(t),s;return n?(eR(a,o),s=dD().getChildren()):s=HSe(a,o),(i!==r||/[\\&]/.test(i))&&dEe(s),s},PV=new WeakMap,FV=async(e,{languages:t,$import:n,$export:r,formatName:i})=>{let a=(PV.get(e)??0)+1;PV.set(e,a);let o=()=>PV.get(e)!==a;try{await Promise.all(t.map(async e=>DV(e)))}catch(e){if(o())return;throw e}if(o())return;let s=e.getEditorState().isEmpty(),c;if(e.update(()=>{try{n()}catch(e){c=e}},{tag:s?[`sui-import`,`history-merge`]:`sui-import`,discrete:!0}),c)throw Error(`Failed to convert ${i}`,{cause:c});return e.read(r)},fEe=async(e,t,n)=>{let{markdown:r,languages:i}=MV(t,n);return FV(e,{languages:i,$import:()=>{NV(r,n,{toRoot:!0})},$export:()=>yV(n),formatName:`Markdown`})},pEe=async(e,t)=>{let n=new DOMParser().parseFromString(t,`text/html`);return FV(e,{languages:[...n.querySelectorAll(`pre > code`)].map(_B).filter(e=>e!==void 0),$import:()=>{let t=Mwe(e,n);if(t)throw Error(t.nodeType===Node.COMMENT_NODE?`Unsupported comment`:`Unsupported element: <${t.localName}>`);let r=dD(),i=null;r.clear(),jP(e,n).forEach(e=>{(Z(e)||KT(e))&&!e.isInline()?(i=null,r.append(e)):(i||(i=jE(),r.append(i)),i.append(e))}),r.isEmpty()&&r.append(jE()),$()!==null&&r.selectStart()},$export:()=>MB(e),formatName:`HTML`})},mEe=async(e,t,n)=>{let{markdown:r,languages:i}=MV(t,n);await Promise.allSettled(i.map(e=>DV(e))),e.isEditable()&&e.update(()=>{let e=$()?.clone();if(!e)return;let i;try{i=NV(r,n)}catch(e){console.error(e)}pD(e),i?e.insertNodes(i):e.insertRawText(t)},{tag:`paste`})},hEe=1e3,gEe=()=>Ex()?`Meta+Shift+V Meta+Alt+Shift+V`:`Ctrl+Shift+V`,_Ee=(e,t)=>{let n=gEe(),r=!1,i=0;return vV(()=>{clearTimeout(i)},e.registerCommand($C,e=>(r=jx(e,n),clearTimeout(i),r&&(i=window.setTimeout(()=>{r=!1},hEe)),!1),2),e.registerCommand(KC,n=>{if(!r)return!1;r=!1;let i=RM(n,ClipboardEvent),a=(i?n.clipboardData:RM(n,InputEvent)?n.dataTransfer:null)?.getData(`text/plain`);return!a||i&&Uc(a.trim())?!1:(n.preventDefault(),mEe(e,a,t),!0)},2))},vEe=200,yEe=e=>{let{enabledButtons:t=[],components:n=[],useMarkdownShortcuts:r,isCodeEditor:i=!1,defaultLanguage:a=`plain`,format:o=`markdown`,multiline:s=!0}=CV(e);return{enabledButtons:t,components:n,useMarkdownShortcuts:r,isCodeEditor:i,defaultLanguage:a,format:o,multiline:s,hasCodeBlock:t.includes(`code-block`)||i,hasTable:t.includes(`table`)&&!i,hasHorizontalRule:t.includes(`horizontal-rule`)&&!i,hasBlockSyntax:!i&&s}},IV=(e,t)=>[...new Set(Object.entries(e).filter(([e])=>t.includes(e)).flatMap(([,e])=>e))],bEe=({enabledButtons:e,components:t,isCodeEditor:n,format:r,hasCodeBlock:i,hasTable:a,hasHorizontalRule:o,hasBlockSyntax:s})=>Lye({name:`@sveltia/ui/editor`,namespace:`editor`,dependencies:[...i?[yxe]:[],...a?[Rye(qCe,{hasCellMerge:!1,hasCellBackgroundColor:!1,hasHorizontalScroll:!0,hasTabHandler:!0})]:[],...o?[gbe]:[]],$initialEditorState:null,nodes:[...t.map(({node:e})=>e),...IV(YSe,e),...n?[KP,eF]:[],...s?[AN,zz,DR,NR]:[]],theme:JSe,html:r===`html`?{export:Twe,import:{...kwe,...i?Awe:{}}}:void 0,onError:e=>{console.error(e)}}),xEe=({enabledButtons:e,components:t,isCodeEditor:n,hasBlockSyntax:r})=>{let i=t.map(({transformer:e})=>JTe(e));return[...i,...n?[]:[HB],...IV(XSe,e),...n?[nR]:[],...r?[Lwe,hTe(i.filter(({type:e})=>e===`text-match`))]:[],...n?[]:[VB]]},SEe=(e,{enabledButtons:t,useMarkdownShortcuts:n,isCodeEditor:r,defaultLanguage:i,format:a,multiline:o,hasCodeBlock:s,hasTable:c},l)=>vV(ySe(e),lSe(e),rCe(e,iCe(),1e3,void 0,void 0,vEe),r?QTe(e,i):void 0,o||r?void 0:ZTe(e),n?VSe(e,l):void 0,s?Iwe(e,{...NB,defaultLanguage:i,defaultTheme:Zz()}):void 0,s?awe(e):void 0,t.includes(`link`)?rEe(e):void 0,c?e.registerNodeTransform(zz,e=>{Ywe(e),a===`markdown`&&Xwe(e)}):void 0,eEe(e,t),WTe(e,l,a),tEe(e),r?void 0:_Ee(e,l)),CEe=e=>{let t=yEe(e),n=xEe(t),r=obe(bEe(t));TB.set(r,t.components);let i=SEe(r,t,n);return{editor:r,enabledTransformers:n,dispose:()=>{i(),r.dispose()}}},wEe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`dir`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`]),TEe=B(`
    `),EEe={hash:`svelte-4vglyb`,code:`.lexical-root.svelte-4vglyb {overflow:clip;border:1px solid var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius) !important;padding:var(--sui-textbox-multiline-padding);min-height:120px;color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-multiline-line-height);transition-duration:200ms;transition-property:outline-color, border-color, color, background-color;outline-offset:calc(var(--sui-focus-ring-width) * -1);}.lexical-root.svelte-4vglyb:not(:first-child) {border-start-start-radius:0 !important;border-start-end-radius:0 !important;}.lexical-root.code.svelte-4vglyb {padding:0;}.lexical-root.code.svelte-4vglyb .code-block {border-radius:0 !important;min-height:120px;}.lexical-root.svelte-4vglyb:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.lexical-root[aria-invalid=true].svelte-4vglyb {border-color:var(--sui-error-border-color);}.lexical-root.svelte-4vglyb :not(.sui):first-child {margin-top:0;}.lexical-root.svelte-4vglyb :not(.sui):last-child {margin-bottom:0;}.lexical-root.svelte-4vglyb strong.italic {font-style:italic;}.lexical-root.svelte-4vglyb .strikethrough {text-decoration:line-through;}.lexical-root.svelte-4vglyb li.nested {list-style-type:none;}.lexical-root.svelte-4vglyb .code-block {position:relative;display:block;padding-block:8px;padding-inline-start:56px;padding-inline-end:8px;background-color:var(--sui-code-background-color);overflow-x:auto;white-space:pre;}.lexical-root.svelte-4vglyb .code-block:not(:first-child) {margin-top:1em;}.lexical-root.svelte-4vglyb .code-block:not(:last-child) {margin-bottom:1em;}.lexical-root.svelte-4vglyb .code-block::before {position:absolute;inset-block:0;inset-inline-start:0;inset-inline-end:auto;content:attr(data-gutter);padding:8px;min-width:40px;color:var(--sui-tertiary-foreground-color);background-color:var(--sui-tertiary-background-color);text-align:end;}.lexical-root.svelte-4vglyb [data-lexical-text=true] {cursor:text;}.lexical-root.svelte-4vglyb :is(th, td) > p {margin:0;white-space:normal;word-break:normal;}.lexical-root.svelte-4vglyb .table-wrapper {overflow-x:auto;}.lexical-root.svelte-4vglyb .table-wrapper:not(:first-child) {margin-top:1em;}.lexical-root.svelte-4vglyb .table-wrapper:not(:last-child) {margin-bottom:1em;}.lexical-root.svelte-4vglyb :is(th, td) {min-width:80px;vertical-align:top;text-align:start;}.lexical-root.svelte-4vglyb th {background-color:var(--sui-secondary-background-color);}.lexical-root.svelte-4vglyb :is(th, td).selected {background-color:var(--sui-selected-background-color);}.lexical-root.svelte-4vglyb .table-selection ::selection {background-color:transparent;}.lexical-root.svelte-4vglyb hr {margin:var(--sui-paragraph-margin) 0;border:none;padding:0;}.lexical-root.svelte-4vglyb hr.selected {outline:2px solid var(--sui-primary-accent-color);outline-offset:4px;}.lexical-root.svelte-4vglyb hr::after {display:block;height:2px;background-color:var(--sui-control-border-color);line-height:2px;content:"";}`};function LV(e,t){O(t,!0),K(e,EEe);let n=J(t,`dir`,3,void 0),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`readonly`,3,!1),o=J(t,`required`,3,!1),s=J(t,`invalid`,3,!1),c=Ss(t,wEe),l=ii(`editorStore`),u=j(void 0),d=A(()=>!(i()||a()));L(()=>{l.editor?.setEditable(z(d))}),L(()=>{let{editor:e}=l,t=n()===`ltr`||n()===`rtl`?n():null;e&&e.getEditorState().read(()=>dD().getDirection())!==t&&e.update(()=>{dD().setDirection(t)},{tag:`history-merge`})});let f=e=>{let{hasConverterError:t,useRichText:n,inputValue:r}=l;if(l.pending=!1,t||!n||l.importing)return;let{value:i,selection:a}=e.detail,o=l.getImportedValue(i)??i;r!==o&&(l.useRichText=!1,l.inputValue=o,l.useRichText=!0),l.selection=a},p=e=>{e.target?.closest(`a`)&&e.preventDefault()},m=e=>{l.editor&&tCe(l.editor,e)},h=e=>!!e&&!e.contains(z(u)??null),g,_=({target:e})=>{e instanceof Element&&e.closest(`[data-lexical-decorator]`)&&!gR(e)&&(g=e,window.setTimeout(()=>{g=void 0}))},v=({target:e})=>{let t=e;if(z(u)?.contains(t)){if(t===z(u)&&g?.isConnected)return;ao(()=>{l.componentHasFocus=t!==z(u)})}else t instanceof Element&&h(t.closest(`dialog`))||ao(()=>{l.componentHasFocus=!1})},y=()=>{ao(()=>{l.componentHasFocus&&document.activeElement===document.body&&!g?.isConnected&&![...document.querySelectorAll(`:modal`)].some(h)&&(l.componentHasFocus=!1)})},b=({relatedTarget:e})=>{e||queueMicrotask(y)};Do(()=>{let{editor:e,enabledTransformers:t,dispose:n}=CEe(l.config);l.editor=e,l.enabledTransformers=t,z(u)?.addEventListener(`Update`,f),z(u)?.addEventListener(`click`,p),z(u)?.addEventListener(`mousedown`,m),z(u)?.addEventListener(`mousedown`,_),document.addEventListener(`focusin`,v),document.addEventListener(`focusout`,b);let r=e.registerUpdateListener(({dirtyElements:e,dirtyLeaves:t,tags:n})=>{(e.size||t.size)&&!n.has(`sui-import`)&&!n.has(`history-merge`)&&(l.pending=!0),y()});return()=>{r(),z(u)?.removeEventListener(`Update`,f),z(u)?.removeEventListener(`click`,p),z(u)?.removeEventListener(`mousedown`,m),z(u)?.removeEventListener(`mousedown`,_),document.removeEventListener(`focusin`,v),document.removeEventListener(`focusout`,b),n(),e.setRootElement(null),l.initialized=!1,l.editor=void 0}}),L(()=>{l.editor&&z(u)&&(l.editor.setRootElement(z(u)),l.initialized=!0)});var x=TEe();gs(x,()=>({...c,role:`textbox`,"aria-multiline":l.config.multiline!==!1,"aria-hidden":r(),"aria-disabled":i(),"aria-readonly":a(),"aria-required":o(),"aria-invalid":s(),class:`lexical-root`,id:`${l.editorId}-lexical-root`,contenteditable:z(d),hidden:r(),[fs]:{code:l.config.isCodeEditor}}),void 0,void 0,void 0,`svelte-4vglyb`),bs(x,e=>M(u,e),()=>z(u)),U(e,x),k()}var RV=()=>{let e=Bx(`editor`),t=j(!1),n=j(void 0),r=j(ea([])),i=j(ea({modes:[],enabledButtons:[],components:[],useMarkdownShortcuts:!0,isCodeEditor:!1,useEmojiAutocomplete:!1})),a=j(``),o=j(ea({blockNodeKey:null,blockType:`paragraph`,inlineTypes:[]})),s=j(!0),c=j(void 0),l=j(0),u=j(!1),d=j(!1),f=j(!1),p=j(!1),m=j(0),h,g=0,_=!1,v=e=>{M(d,e,!0),e&&(M(s,!1),M(f,!0))},y=async()=>{if(!z(n)||!z(t))return;let e=z(a);g+=1;let o=g;_=!0;try{let t=z(i).format===`html`?await pEe(z(n),z(a)||``):await fEe(z(n),z(a)||``,z(r));t!==void 0&&(h={source:e,exported:t})}catch(t){v(!0),M(a,e,!0),console.error(t)}finally{o===g&&(_=!1)}};return{get editor(){return z(n)},set editor(e){M(n,e,!0)},set enabledTransformers(e){M(r,e,!0)},get enabledTransformers(){return z(r)},get initialized(){return z(t)},set initialized(e){M(t,e,!0)},get config(){return z(i)},set config(e){M(i,CV(e),!0),M(s,z(i).modes[0]===`rich-text`||z(i).isCodeEditor,!0)},get inputValue(){return z(a)},set inputValue(e){let t=z(a)!==e;t&&M(a,e,!0),z(s)&&(t||z(n)?.getEditorState().isEmpty())&&y()},get selection(){return z(o)},set selection(e){M(o,e,!0)},get controlId(){return z(s)?`${e}-lexical-root`:`${e}-plain-text`},get textArea(){return z(c)},set textArea(e){M(c,e,!0)},get toolbarHeight(){return z(l)},set toolbarHeight(e){M(l,e,!0)},get componentHasFocus(){return z(u)},set componentHasFocus(e){M(u,e,!0)},get useRichText(){return z(s)},set useRichText(e){M(s,e,!0)},get hasConverterError(){return z(d)},set hasConverterError(e){v(e)},get showConverterError(){return z(f)},set showConverterError(e){M(f,e,!0)},get pending(){return z(p)||z(m)>0},set pending(e){M(p,e,!0)},get importing(){return _},editorId:e,convertToLexical:y,startOperation:()=>{M(m,z(m)+1);let e=!1;return()=>{e||(e=!0,M(m,z(m)-1))}},getImportedValue:e=>h?.exported===e?h.source:void 0}},zV=(e,{getInputValue:t,setValue:n,setPending:r})=>{L(()=>{r(e.pending)}),L(()=>()=>{r(!1)}),L(()=>{if(!e.initialized)return;let n=t();ao(()=>{e.inputValue=n})}),L(()=>{if(!e.initialized)return;let t=e.inputValue;ao(()=>{n(t)})})},DEe=B(` `,1);function BV(e,t){O(t,!0);let n=J(t,`disabled`,3,!1),r=Uz.map(({id:e,name:t,aliases:n=[]})=>({key:e,label:t,aliases:n})),i=ii(`editorStore`),a=j(`plain`),o=A(()=>r.find(({key:e,aliases:t})=>e===z(a)||t.includes(z(a)))?.key??`plain`),s=()=>{let{blockNodeKey:e}=i.selection,t=i.config.isCodeEditor?dD().getChildren()[0]:e?iD(e):null;return JP(t)?t:null},c=async e=>{let{editor:t}=i;if(!t||z(o)===e)return;let n=i.startOperation();try{await yR(t),await DV(e),t.update(()=>{let t=s();t&&(t.setLanguage(e),M(a,e,!0))},{tag:Hz(t)})}finally{n()}};L(()=>{i.selection.blockNodeKey,i.editor?.read(()=>{let e=s();e&&M(a,e.getLanguage()??i.config.defaultLanguage??`plain`,!0)})});{let t=A(()=>Y(`_sui.text_editor.language`));lC(e,{get disabled(){return n()},get ariaLabel(){return z(t)},get value(){return z(o)},onChange:({detail:{value:e}})=>{c(e)},children:(e,t)=>{var n=DEe(),i=P(n);{let e=A(()=>Y(`_sui.text_editor.plain_text`));ZS(i,{get label(){return z(e)},value:`plain`,dir:`ltr`})}Ro(I(i,2),17,()=>r,({key:e,label:t})=>e,(e,t)=>{let n=()=>z(t).key,r=()=>z(t).label;{let t=A(()=>n()===z(o));ZS(e,{get label(){return r()},get value(){return n()},get selected(){return z(t)},dir:`ltr`})}}),U(e,n)},$$slots:{default:!0}})}k()}var OEe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`variant`,`ariaLabel`,`children`]),kEe=B(`
    `),AEe={hash:`svelte-1g217ex`,code:`[role=toolbar].svelte-1g217ex {--toolbar-size: var(--sui-secondary-toolbar-size);flex:none !important;display:flex;align-items:center;padding-inline:8px;background-color:var(--toolbar-background-color, transparent);}[role=toolbar].primary.svelte-1g217ex {--toolbar-size: var(--sui-primary-toolbar-size);} @media (width < 768px) {[role=toolbar].secondary.svelte-1g217ex {padding-inline:0;} }[role=toolbar][aria-orientation=horizontal].svelte-1g217ex {height:var(--toolbar-size);}[role=toolbar][aria-orientation=vertical].svelte-1g217ex {flex-direction:column;width:var(--toolbar-size);}[role=toolbar].svelte-1g217ex button[role=button]:is([aria-pressed=true], [aria-checked=true]) {background-color:var(--sui-selected-background-color);}[role=toolbar].svelte-1g217ex h2 {flex:auto;display:flex;align-items:center;gap:8px;margin:0;padding-inline-end:12px;min-width:0;font-size:var(--sui-font-size-x-large);}[role=toolbar].svelte-1g217ex h2:first-child {padding-inline-start:12px;}[role=toolbar].svelte-1g217ex h2 span:not(.sui.truncated-text) {font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-normal, normal);opacity:0.8;}[role=toolbar].svelte-1g217ex .divider[aria-orientation=horizontal] {margin:0 4px;width:calc(100% - 8px);}[role=toolbar].svelte-1g217ex .divider[aria-orientation=vertical] {margin:4px 0;height:calc(100% - 8px);}.inner.svelte-1g217ex {display:contents;}`};function VV(e,t){K(e,AEe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`orientation`,3,`horizontal`),a=J(t,`variant`,3,void 0),o=J(t,`ariaLabel`,3,void 0),s=Ss(t,OEe);var c=kEe();gs(c,()=>({...s,role:`toolbar`,class:[`sui`,`toolbar`,i(),a(),t.class],hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-orientation":i(),"aria-label":o()}),void 0,void 0,void 0,`svelte-1g217ex`);var l=N(c);Eo(N(l),()=>t.children??Er),D(l),D(c),R(()=>l.inert=r()),U(e,c)}var jEe=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`children`]),MEe=B(`
    `),NEe={hash:`svelte-mopg5v`,code:`.wrapper.svelte-mopg5v {display:contents;}.wrapper.svelte-mopg5v [role=toolbar] {position:sticky;top:var(--sui-text-editor-toolbar-top, 0px);z-index:var(--sui-text-editor-toolbar-z-index, 100);display:flex;flex-wrap:wrap;gap:4px;border-width:1px 1px 0;border-style:solid;border-color:var(--sui-textbox-border-color);border-start-start-radius:var(--sui-textbox-border-radius);border-start-end-radius:var(--sui-textbox-border-radius);border-end-start-radius:0;border-end-end-radius:0;padding:0 4px;height:auto;min-height:40px;background-color:var(--sui-tertiary-background-color);}.wrapper.svelte-mopg5v [role=toolbar][aria-disabled=true] {filter:none;}.wrapper.svelte-mopg5v .sui.menu-button {padding:0 4px;}.wrapper.svelte-mopg5v .sui.button {flex:none;margin:0 !important;}.wrapper.svelte-mopg5v .sui.button-group {gap:4px;}`};function HV(e,t){O(t,!0),K(e,NEe);let n=J(t,`disabled`,3,!1),r=Ss(t,jEe),i=ii(`editorStore`),a=e=>{let t=new ResizeObserver(([e])=>{i.toolbarHeight=e.borderBoxSize[0].blockSize});return t.observe(e),()=>{t.disconnect(),i.toolbarHeight=0}};var o=MEe();VV(N(o),Cs(()=>r,{get disabled(){return n()},[ko()]:a,children:(e,n)=>{var r=H();Eo(P(r),()=>t.children??Er),U(e,r)},$$slots:{default:!0}})),D(o),U(e,o),k()}function PEe(e,t){O(t,!0);let n=J(t,`disabled`,3,!1),r=J(t,`readonly`,3,!1);{let t=A(()=>n()||r()),i=A(()=>Y(`_sui.text_editor.code_editor`));HV(e,{get disabled(){return z(t)},get ariaLabel(){return z(i)},children:(e,t)=>{{let t=A(()=>n()||r());BV(e,{get disabled(){return z(t)}})}},$$slots:{default:!0}})}k()}var FEe=new Set([`$$slots`,`$$events`,`$$legacy`,`code`,`lang`,`pending`,`showLanguageSwitcher`,`flex`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`ariaLabelledby`,`ariaDescribedby`,`aria-label`,`aria-labelledby`,`aria-describedby`,`children`]),IEe=B(`
    `,1),LEe={hash:`svelte-1qjjbv`,code:`.code-editor.svelte-1qjjbv {margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.code-editor.flex.svelte-1qjjbv:not([hidden]) {display:block;}.code-editor.svelte-1qjjbv {--sui-text-editor-toolbar-top: var(--sui-text-editor-inner-toolbar-top, 0px);--sui-text-editor-toolbar-z-index: var(--sui-text-editor-inner-toolbar-z-index, 100);}.code-editor.svelte-1qjjbv > * {--sui-text-editor-inner-toolbar-top: calc( var(--sui-text-editor-toolbar-top) + var(--sui-text-editor-toolbar-height) );--sui-text-editor-inner-toolbar-z-index: calc(var(--sui-text-editor-toolbar-z-index) - 1);}`};function REe(e,t){O(t,!0),K(e,LEe);let n=J(t,`code`,15,``),r=J(t,`lang`,15,`plain`),i=J(t,`pending`,15,!1),a=J(t,`showLanguageSwitcher`,3,!1),o=J(t,`flex`,3,!1),s=J(t,`hidden`,3,!1),c=J(t,`disabled`,3,!1),l=J(t,`readonly`,3,!1),u=J(t,`required`,3,!1),d=J(t,`invalid`,3,!1),f=J(t,`ariaLabel`,3,void 0),p=J(t,`ariaLabelledby`,3,void 0),m=J(t,`ariaDescribedby`,3,void 0),h=J(t,`aria-label`,3,void 0),g=J(t,`aria-labelledby`,3,void 0),_=J(t,`aria-describedby`,3,void 0),v=Ss(t,FEe),y=A(()=>({"aria-label":f()??h(),"aria-labelledby":p()??g(),"aria-describedby":m()??_()})),b=RV();b.config={...b.config,useMarkdownShortcuts:!1,isCodeEditor:!0,defaultLanguage:r()},ai(`editorStore`,b),zV(b,{getInputValue:()=>khe(r(),n()),setValue:e=>{let{lang:t,code:i}=Ahe(e);r()!==t&&r(t),n()!==i&&n(i)},setPending:e=>{i(e)}});var x=IEe(),S=P(x);gs(S,()=>({...v,role:`none`,class:`sui code-editor`,hidden:s(),[fs]:{flex:o()},[ps]:{"--sui-text-editor-toolbar-height":`${b.toolbarHeight??``}px`}}),void 0,void 0,void 0,`svelte-1qjjbv`);var C=N(S),w=e=>{PEe(e,{get disabled(){return c()},get readonly(){return l()}})};G(C,e=>{a()&&e(w)}),LV(I(C,2),Cs(()=>z(y),{get hidden(){return s()},get disabled(){return c()},get readonly(){return l()},get required(){return u()},get invalid(){return d()}})),D(S);var T=I(S,2),ee=e=>{_C(e,{get show(){return b.showConverterError},set show(e){b.showConverterError=e},children:(e,t)=>{wx(e,{status:`error`,children:(e,t)=>{qr();var n=V();R(e=>W(n,e),[()=>Y(`_sui.text_editor.converter_error`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(T,e=>{b.showConverterError&&e(ee)}),U(e,x),k()}var zEe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`flex`,`dir`,`name`,`autoResize`,`useEmojiAutocomplete`,`highlight`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`]),BEe=B(` `),VEe=B(``),HEe=B(``),UEe=B(`
    `),WEe={hash:`svelte-7qfco4`,code:`.text-area.svelte-7qfco4 {position:relative;display:inline-grid;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-multiline-min-width);}.text-area[hidden].svelte-7qfco4 {display:none;}.text-area.flex.svelte-7qfco4:not([hidden]) {display:inline-grid;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}:is(textarea.svelte-7qfco4, .clone.svelte-7qfco4) {grid-area:1/1/2/2;display:block;margin:0;width:100%;min-height:8em;border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-multiline-padding);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-multiline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));letter-spacing:var(--sui-textbox-letter-spacing, normal);transition:all 200ms;text-align:var(--sui-textbox-text-align, start);text-indent:var(--sui-textbox-text-indent, 0);text-transform:var(--sui-textbox-text-transform, none);word-spacing:var(--sui-word-spacing-normal, normal);}.svelte-7qfco4:is(textarea:where(.svelte-7qfco4), .clone:where(.svelte-7qfco4)):focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}:is(textarea:where(.svelte-7qfco4), .clone:where(.svelte-7qfco4))[aria-invalid=true].svelte-7qfco4 {border-color:var(--sui-error-border-color);}:is(textarea:where(.svelte-7qfco4), .clone:where(.svelte-7qfco4)).resizing.svelte-7qfco4 {transition-duration:0ms;}.svelte-7qfco4:is(textarea:where(.svelte-7qfco4), .clone:where(.svelte-7qfco4)):is(:where(.svelte-7qfco4):disabled, :where(.svelte-7qfco4):read-only):not(.clone) {background-color:var(--sui-disabled-background-color);}textarea.svelte-7qfco4 {resize:vertical;}textarea.auto-resize.svelte-7qfco4 {overflow:hidden;resize:none;}.clone.svelte-7qfco4 {overflow:hidden;visibility:hidden;scroll-behavior:auto;}.clone.svelte-7qfco4:not(.auto-resize) {position:absolute;inset:0;min-height:0;}.highlighted.svelte-7qfco4 textarea:where(.svelte-7qfco4) {z-index:1;caret-color:var(--sui-textbox-foreground-color);color:transparent !important;background-color:transparent !important;}.highlighted.svelte-7qfco4 textarea:where(.svelte-7qfco4):not(.auto-resize) {scrollbar-gutter:stable;}.highlighted.svelte-7qfco4 textarea:where(.svelte-7qfco4)::placeholder {color:var(--sui-textbox-placeholder-foreground-color, var(--sui-textbox-foreground-color));opacity:var(--sui-textbox-placeholder-opacity, 1);}.highlighted.svelte-7qfco4 .clone:where(.svelte-7qfco4) {visibility:visible;pointer-events:none;}.highlighted.svelte-7qfco4 .clone:where(.svelte-7qfco4) .bold:where(.svelte-7qfco4) {-webkit-text-stroke:0.03em currentColor;}.highlighted.svelte-7qfco4 .clone:where(.svelte-7qfco4) .underline:where(.svelte-7qfco4) {text-decoration-line:underline;}.highlighted.svelte-7qfco4 .clone:where(.svelte-7qfco4) .strikethrough:where(.svelte-7qfco4) {text-decoration-line:line-through;}.highlighted.svelte-7qfco4 .clone:where(.svelte-7qfco4) .underline.strikethrough:where(.svelte-7qfco4) {text-decoration-line:underline line-through;}.highlighted.svelte-7qfco4 .clone:where(.svelte-7qfco4):not(.auto-resize) {scrollbar-gutter:stable;}.highlighted.svelte-7qfco4:focus-within .clone:where(.svelte-7qfco4) {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.highlighted.svelte-7qfco4:is(.disabled:where(.svelte-7qfco4), .readonly:where(.svelte-7qfco4)) .clone:where(.svelte-7qfco4) {background-color:var(--sui-disabled-background-color);}textarea.svelte-7qfco4, .clone.svelte-7qfco4 {white-space:pre-wrap;word-break:normal;overflow-wrap:anywhere;}`};function UV(e,t){O(t,!0),K(e,WEe);let n=J(t,`value`,15,``),r=J(t,`element`,15),i=J(t,`flex`,3,!1),a=J(t,`dir`,3,void 0),o=J(t,`name`,3,void 0),s=J(t,`autoResize`,3,!1),c=J(t,`useEmojiAutocomplete`,3,!1),l=J(t,`highlight`,3,void 0),u=J(t,`hidden`,3,!1),d=J(t,`disabled`,3,!1),f=J(t,`readonly`,3,!1),p=J(t,`required`,3,!1),m=J(t,`invalid`,3,!1),h=Ss(t,zEe),g=A(()=>`${n()}\n`),_=A(()=>{let e=l()?.(n()??``);if(!e)return;let t=e.flatMap(e=>[...e,{content:` `}]);return t.map(({content:e})=>e).join(``)===z(g)?t:void 0}),v=j(void 0);L(()=>{if(!r()||!z(v))return;let e=r(),t=z(v),n=()=>{t.scrollTop=e.scrollTop,t.scrollLeft=e.scrollLeft};return n(),e.addEventListener(`scroll`,n),()=>{e.removeEventListener(`scroll`,n)}});var y=UEe();let b;var x=N(y);Bee(x),gs(x,()=>({...h,dir:a(),name:o(),disabled:d()||void 0,readonly:f()||void 0,"aria-hidden":u(),"aria-disabled":d(),"aria-readonly":f(),"aria-required":p(),"aria-invalid":m(),[fs]:{"auto-resize":s()}}),void 0,void 0,void 0,`svelte-7qfco4`),bs(x,e=>r(e),()=>r());var S=I(x,2),C=e=>{var t=VEe();let n;Ro(t,21,()=>z(_),Fo,(e,t)=>{var n=BEe();let r,i;var a=F(n,!0);R(()=>{r=is(n,1,`svelte-7qfco4`,null,r,{bold:z(t).bold,underline:z(t).underline,strikethrough:z(t).strikethrough}),i=os(n,``,i,{color:z(t).color}),W(a,z(t).content)}),U(e,n)}),D(t),bs(t,e=>M(v,e),()=>z(v)),R(()=>{n=is(t,1,`clone svelte-7qfco4`,null,n,{"auto-resize":s()}),q(t,`dir`,a()),t.dir=t.dir}),U(e,t)},w=e=>{var t=HEe(),n=F(t,!0);R(()=>{q(t,`dir`,a()),W(n,z(g)),t.dir=t.dir}),U(e,t)};G(S,e=>{z(_)?e(C):s()&&e(w,1)});var T=I(S,2),ee=e=>{LS(e,{get element(){return r()}})};G(T,e=>{c()&&!d()&&!f()&&e(ee)}),D(y),R(()=>{b=is(y,1,`sui text-area ${t.class??``}`,`svelte-7qfco4`,b,{flex:i(),disabled:d(),readonly:f(),highlighted:!!z(_)}),q(y,`hidden`,u()),x.dir=x.dir}),Qte(x,n),U(e,y),k()}function GEe(e,t){O(t,!0);let n=ii(`editorStore`),r=j(void 0),i=()=>{let e=$();if(!Q(e)||!e.isCollapsed()||e.hasFormat(`code`))return;let t=e.anchor.getNode();if(!uE(t)||!t.isSimpleText()||JP(t.getParent()))return;let{offset:n}=e.anchor,r=PS(t.getTextContent().slice(0,n));if(r===void 0)return;let i=t.getKey();return{id:`${i}:${n-r.length-1}`,query:r,nodeKey:i,offset:n}},a=({query:e})=>{let t=window.getSelection();if(!t?.rangeCount)return;let n=t.getRangeAt(0).cloneRange();try{n.setStart(n.startContainer,Math.max(0,n.startOffset-e.length-1))}catch{}let{top:r,bottom:i,left:a,right:o,width:s,height:c}=n.getBoundingClientRect();return r||i||a||s||c?{top:r,bottom:i,left:a,right:o}:void 0},o=(e,t)=>{let{editor:r}=n,{query:i,nodeKey:a,offset:o}=t,s=o-i.length-1;r?.update(()=>{let t=iD(a);if(!uE(t)||t.getTextContent().slice(s,o)!==`:${i}`)return;let n=NS(e.emoji,t.getTextContent().slice(o));t.spliceText(s,i.length+1,n,!0)})},s=()=>{let{editor:e}=n;if(!e)return[];let t=e=>t=>z(r)?.isOpen()?(t?.preventDefault(),e(),!0):!1;return[e.registerCommand(aw,t(()=>z(r)?.moveSelection(1)),4),e.registerCommand(iw,t(()=>z(r)?.moveSelection(-1)),4),e.registerCommand(ow,t(()=>z(r)?.selectHighlighted()),4),e.registerCommand(uw,t(()=>z(r)?.selectHighlighted()),4),e.registerCommand(cw,t(()=>z(r)?.close(!0)),4),e.registerUpdateListener(({editorState:e})=>{let t;e.read(()=>{t=i()}),z(r)?.update(t)})]};L(()=>{if(!n.editor||!z(r))return;let e=s();return()=>{e.forEach(e=>e()),z(r)?.close()}}),L(()=>{n.useRichText||z(r)?.close()});{let t=A(()=>n.editor?.getRootElement()??void 0);bs(IS(e,{getAnchorRect:a,onSelect:o,get ariaOwner(){return z(t)}}),e=>M(r,e,!0),()=>z(r))}k()}var KEe=B(` `,1),qEe=B(` `,1),JEe=B(``),YEe={hash:`svelte-1xuqusz`,code:`.floating-link-editor.svelte-1xuqusz {position:fixed;inset:auto;z-index:1000;display:flex;align-items:center;gap:4px;margin:0;padding:4px;width:min(400px, 100vw - 16px);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);}.floating-link-editor.svelte-1xuqusz .sui.text-input {flex:auto;margin:0 !important;min-width:0;}.floating-link-editor.svelte-1xuqusz .sui.button {flex:none;margin:0 !important;}.url.svelte-1xuqusz {flex:auto;overflow:hidden;padding:0 8px;min-width:0;white-space:nowrap;text-overflow:ellipsis;}`};function XEe(e,t){let n=yo();O(t,!0),K(e,YEe);let r=ii(`editorStore`),i=j(void 0),a=j(!1),o=j(void 0),s=j(void 0),c=j(``),l=j(!1),u=!1,d=A(()=>r.config.format===`html`),f=j(void 0),p=j(0),m=j(void 0),h=j(void 0),g=A(()=>!!z(s)),_=A(()=>!!z(c).trim()&&TV(z(c))),v=A(()=>z(g)||!!z(i)&&z(a)&&z(o)!==z(i).key),y=A(()=>z(f)?FS({anchorRect:z(f),listMaxHeight:z(p)||48,viewport:{width:window.innerWidth,height:window.innerHeight},rtl:kc(),listWidth:Math.min(400,window.innerWidth-16)}):void 0),b=e=>aEe(e,z(s)&&`selection`in z(s)?z(s):{linkKey:z(s)&&`linkKey`in z(s)?z(s).linkKey:z(i)?.key}),x=()=>{let{editor:e}=r;M(f,e&&z(v)?b(e):void 0)},S=async(e,t,n=!1)=>{M(s,e),M(c,t,!0),M(l,n,!0),u=n,M(o,void 0),await no(),x(),await no(),z(h)?.focus(),z(h)?.select()},C=()=>{M(s,void 0),M(c,``),M(l,!1)},w=async()=>{r.editor&&await yR(r.editor)},T=()=>{let e,t=``,n=!1;return r.editor?.getEditorState().read(()=>{let r=EV();if(r){e={linkKey:r.getKey()},t=r.getURL(),n=r.getTarget()===`_blank`;return}let i=$()??sj();if(Q(i)&&!i.isCollapsed()){let n=i.getTextContent().trim();n&&(e={selection:i.clone()},t=Uc(n)&&TV(n)?n:``)}}),e?(S(e,t,n),!0):!1},ee=async()=>{let{editor:e}=r,t=z(s),n=z(c).trim(),i=z(d)&&z(l)!==u?z(l)?`_blank`:null:void 0;e&&t&&z(_)&&(C(),`linkKey`in t?e.update(()=>{let e=iD(t.linkKey);SF(e)&&(e.setURL(n),i!==void 0&&e.setTarget(i))}):(e.update(()=>{pD(t.selection.clone())}),e.dispatchCommand(wF,i?{url:n,target:i}:n)),await w())},E=async()=>{C(),await w()},te=async()=>{let e=z(i)?.key;e&&(r.editor?.update(()=>{let t=iD(e);SF(t)&&(t.getChildren().forEach(e=>{t.insertBefore(e)}),t.remove())}),await w())},ne=e=>{e.isComposing||(jx(e,`Enter`)?(e.preventDefault(),z(_)&&ee()):jx(e,`Escape`)&&(e.preventDefault(),e.stopPropagation(),E()))};L(()=>{let{editor:e}=r;if(!e)return;let t=e.registerCommand(mR,T,2),n=e.registerCommand(cw,e=>!z(v)||z(g)||!z(i)?!1:(e?.preventDefault(),M(o,z(i).key,!0),!0),3),a=e.registerUpdateListener(({editorState:e})=>{e.read(()=>{let e=EV();M(i,e?{key:e.getKey(),url:e.getURL(),target:e.getTarget()}:void 0,!0),z(s)&&(`linkKey`in z(s)?!SF(iD(z(s).linkKey)):[z(s).selection.anchor,z(s).selection.focus].some(({key:e})=>!iD(e)?.isAttached()))&&C()}),z(o)&&z(i)?.key!==z(o)&&M(o,void 0),x()}),c=e.registerEditableListener(e=>{e||C()});return()=>{t(),n(),a(),c()}}),L(()=>{r.useRichText||(C(),M(i,void 0))}),L(()=>{z(v),x()}),L(()=>{z(g),z(m)&&(z(m).matches(`:popover-open`)||z(m).showPopover?.(),M(p,z(m).getBoundingClientRect().height,!0))}),Do(()=>{let e=e=>{let t=e,n=r.editor?.getRootElement();return!!t&&(!!n?.contains(t)||!!z(m)?.contains(t))},t=({target:t})=>{ao(()=>{M(a,e(t),!0),z(g)&&!z(m)?.contains(t)&&C()})},n=({relatedTarget:e})=>{e||ao(()=>{M(a,!1)})};return window.addEventListener(`scroll`,x,{capture:!0,passive:!0}),window.addEventListener(`resize`,x,{passive:!0}),document.addEventListener(`focusin`,t),document.addEventListener(`focusout`,n),()=>{window.removeEventListener(`scroll`,x,{capture:!0}),window.removeEventListener(`resize`,x),document.removeEventListener(`focusin`,t),document.removeEventListener(`focusout`,n)}});var re=H(),ie=P(re),ae=e=>{var t=JEe();let r;var a=N(t),o=e=>{var t=KEe(),r=P(t);{let e=A(()=>!!z(c).trim()&&!TV(z(c))),t=A(()=>Y(`_sui.text_editor.url`));RS(r,{dir:`ltr`,get id(){return`${n}-url`},flex:!0,get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{ne(e)},get element(){return z(h)},set element(e){M(h,e,!0)},get value(){return z(c)},set value(e){M(c,e,!0)}})}var i=I(r,2),a=e=>{{let t=e=>{bx(e,{name:`open_in_new`})},n=A(()=>Y(`_sui.text_editor.open_in_new_tab`));eS(e,{iconic:!0,variant:`ghost`,get pressed(){return z(l)},get"aria-label"(){return z(n)},onclick:()=>{M(l,!z(l))},startIcon:t,$$slots:{startIcon:!0}})}};G(i,e=>{z(d)&&e(a)});var o=I(i,2);{let e=e=>{bx(e,{name:`check`})},t=A(()=>!z(_)),n=A(()=>z(s)&&`linkKey`in z(s)?Y(`_sui.update`):Y(`_sui.insert`));eS(o,{iconic:!0,variant:`ghost`,get disabled(){return z(t)},get"aria-label"(){return z(n)},onclick:()=>{ee()},startIcon:e,$$slots:{startIcon:!0}})}var u=I(o,2);{let e=e=>{bx(e,{name:`close`})},t=A(()=>Y(`_sui.cancel`));eS(u,{iconic:!0,variant:`ghost`,get"aria-label"(){return z(t)},onclick:()=>{E()},startIcon:e,$$slots:{startIcon:!0}})}U(e,t)},u=e=>{var t=qEe(),n=P(t),r=F(n,!0),a=I(n,2);{let e=e=>{bx(e,{name:`edit`})},t=A(()=>Y(`_sui.text_editor.edit_link`));eS(a,{iconic:!0,variant:`ghost`,get"aria-label"(){return z(t)},onclick:()=>{z(i)&&S({linkKey:z(i).key},z(i).url,z(i).target===`_blank`)},startIcon:e,$$slots:{startIcon:!0}})}var o=I(a,2);{let e=e=>{bx(e,{name:`link_off`})},t=A(()=>Y(`_sui.text_editor.remove_link`));eS(o,{iconic:!0,variant:`ghost`,get"aria-label"(){return z(t)},onclick:()=>{te()},startIcon:e,$$slots:{startIcon:!0}})}R(e=>{q(n,`href`,e),W(r,z(i).url),n.dir=n.dir},[()=>TV(z(i).url)?z(i).url:void 0]),U(e,t)};G(a,e=>{z(g)?e(o):z(i)&&e(u,1)}),D(t),bs(t,e=>M(m,e),()=>z(m)),R(e=>{q(t,`aria-label`,e),r=os(t,``,r,{top:z(y).top,bottom:z(y).bottom,left:z(y).left})},[()=>Y(`_sui.text_editor.link`)]),po(`mousedown`,t,e=>{e.target.closest(`input`)||e.preventDefault()}),U(e,t)};G(ie,e=>{z(v)&&z(y)&&e(ae)}),U(e,re),k()}mo([`mousedown`]);var ZEe=60,WV=async(e,t=0)=>e.closest(`dialog`)?.open&&t{window.requestAnimationFrame(e)}),WV(e,t+1)):new Promise(e=>{window.setTimeout(e)}),QEe=B(` `,1);function GV(e,t){O(t,!0);let n=ii(`editorStore`),r=[[[`insert-row-above`,`insert_row_above`],[`insert-row-below`,`insert_row_below`]],[[`insert-column-left`,`insert_column_left`],[`insert-column-right`,`insert_column_right`]],[[`delete-row`,`delete_row`],[`delete-column`,`delete_column`],[`delete-table`,`delete_table`]]],i=async(e,r)=>{let{editor:i}=n;if(!i)return;let a=i.getElementByKey(t.cellKey),o=!!a&&GB(a);i.update(()=>{eTe(e,t.cellKey,{rtl:o})}),await WV(r),await yR(i)};{let t=A(()=>Y(`_sui.text_editor.table_options`));QS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();Ro(P(n),17,()=>r,Fo,(e,t,n)=>{var r=QEe(),a=P(r),o=e=>{BS(e,{})};G(a,e=>{n>0&&e(o)}),Ro(I(a,2),17,()=>z(t),([e,t])=>e,(e,t)=>{var n=A(()=>Ar(z(t),2));let r=()=>z(n)[0],a=()=>z(n)[1];{let t=A(()=>Y(`_sui.text_editor.${a()}`));$S(e,{get label(){return z(t)},onclick:e=>{i(r(),e.currentTarget)}})}}),U(e,r)}),U(e,n)},$$slots:{default:!0}})}k()}var $Ee=B(`
    `),eDe={hash:`svelte-pdhbuw`,code:`.table-cell-menu-button.svelte-pdhbuw {position:absolute;z-index:1;translate:-100% 0;}.table-cell-menu-button.rtl.svelte-pdhbuw {translate:0 0;}.table-cell-menu-button[hidden].svelte-pdhbuw {display:none;}.table-cell-menu-button.svelte-pdhbuw .sui.button {margin:0;border-radius:50%;background-color:var(--sui-secondary-background-color);}`};function tDe(e,t){O(t,!0),K(e,eDe);let n=ii(`editorStore`),r=j(null),i=j(!1),a=j(void 0),o=j(void 0),s=A(()=>!!z(r)&&z(i)&&!!z(a)&&n.useRichText),c=A(()=>z(a)?`top: ${z(a).top}px; left: ${z(a).left}px`:void 0),l=()=>z(o)?.parentElement,u=()=>{let e=l(),t=z(r)?n.editor?.getElementByKey(z(r)):void 0;if(!z(i)||!e||!t){M(a,void 0);return}let o=t.getBoundingClientRect(),s=t.closest(`.table-wrapper`).getBoundingClientRect(),c=t.closest(`.lexical-root`).getBoundingClientRect(),u=e.getBoundingClientRect(),d=GB(t),f=Math.max(o.left,s.left),p=Math.min(o.right,s.right),m=Math.max(o.top,c.top),h=Math.min(o.bottom,c.bottom);p<=f||h<=m?M(a,void 0):M(a,{top:m-u.top+4,left:(d?f+4:p-4)-u.left,rtl:d,popupPosition:d?`bottom-right`:`bottom-left`})},d,f=()=>{window.clearTimeout(d),d=window.setTimeout(()=>{let e=l();M(i,!!e?.contains(document.activeElement)||!!z(o)?.querySelector(`[aria-expanded="true"]`),!0),u()})};L(()=>{let{editor:e}=n;if(!e)return;let t=e.registerUpdateListener(({editorState:e})=>{M(r,e.read(qB),!0),u()}),i=e.registerRootListener(e=>{if(!e)return;let t=new ResizeObserver(u);return e.addEventListener(`scroll`,u,{capture:!0}),t.observe(e),()=>{e.removeEventListener(`scroll`,u,{capture:!0}),t.disconnect()}});return()=>{t(),i()}}),Do(()=>(window.addEventListener(`resize`,u),document.addEventListener(`focusin`,f),document.addEventListener(`focusout`,f),()=>{window.clearTimeout(d),window.removeEventListener(`resize`,u),document.removeEventListener(`focusin`,f),document.removeEventListener(`focusout`,f)}));var p=$Ee();let m;var h=N(p),g=e=>{let t=A(()=>z(r));{let r=e=>{bx(e,{name:`expand_more`})},i=e=>{GV(e,{get cellKey(){return z(t)}})},o=A(()=>z(a)?.popupPosition),s=A(()=>Y(`_sui.text_editor.show_table_options`));bS(e,{iconic:!0,size:`small`,variant:`tertiary`,get popupPosition(){return z(o)},get"aria-label"(){return z(s)},get"aria-controls"(){return n.controlId},endIcon:r,popup:i,$$slots:{endIcon:!0,popup:!0}})}};G(h,e=>{z(s)&&z(r)&&e(g)}),D(p),bs(p,e=>M(o,e),()=>z(o)),R(()=>{m=is(p,1,`table-cell-menu-button svelte-pdhbuw`,null,m,{rtl:z(a)?.rtl}),q(p,`hidden`,!z(s)),os(p,z(c))}),po(`mousedown`,p,e=>{e.preventDefault()}),U(e,p),k()}mo([`mousedown`]);var nDe={bold:`**`,italic:`_`,strikethrough:`~~`,code:"`"},rDe=/^(?:#{1,6}[ \t]+|>[ \t]?|[-*+][ \t]+|\d+[.)][ \t]+)/,iDe=/^[ \t]*(?:```|~~~)/,aDe=({value:e,start:t,end:n})=>{let r=e.lastIndexOf(` `,t-1)+1,i=n>t&&e[n-1]===` `?n-1:n,a=e.indexOf(` `,i);return{lineStart:r,lineEnd:a===-1?e.length:a}},KV=({value:e,start:t})=>e.slice(0,t).split(` `).length-1,qV=(e,t)=>{let n;for(let r=0;r=n&&t<=r)return{open:n,close:r};n=void 0}}if(n===void 0&&r>=t)return}return n!==void 0&&t>=n?{open:n,close:e.length}:void 0},oDe=e=>{let t=e.value.split(` `),n=KV(e),r=t[n];if(qV(t,n))return`code-block`;let[,i]=r.match(/^(#{1,6})[ \t]/)??[];return i?`heading-${i.length}`:/^[-*+][ \t]/.test(r)?`bulleted-list`:/^\d+[.)][ \t]/.test(r)?`numbered-list`:r.startsWith(`>`)?`blockquote`:`paragraph`},sDe=({value:e,start:t,end:n},r)=>{let i=nDe[r],{length:a}=i,o=e.slice(t,n);if(o.length>=a*2&&o.startsWith(i)&&o.endsWith(i)){let e=o.slice(a,-a);return{start:t,end:n,text:e,selectionStart:t,selectionEnd:t+e.length}}if(e.slice(t-a,t)===i&&e.slice(n,n+a)===i)return{start:t-a,end:n+a,text:o,selectionStart:t-a,selectionEnd:n-a};let[,s,c,l]=o.match(/^(\s*)([\s\S]*?)(\s*)$/),u=`${s}${c.split(` `).map(e=>e.trim()?`${i}${e}${i}`:e).join(` `)}${l}`;if(!c){let e=t+s.length+a;return{start:t,end:n,text:`${s}${i}${i}${l}`,selectionStart:e,selectionEnd:e}}return{start:t,end:n,text:u,selectionStart:t+s.length+a,selectionEnd:t+u.length-l.length-a}},JV=(e,t)=>{let{value:n,start:r,end:i}=e,a=n.split(` `),o=qV(a,KV(e));if(o){let{open:e,close:n}=o,s=a.slice(0,e).join(` `).length+ +!!e,c=s+a.slice(e,n+1).join(` `).length,l=a.slice(e+1,n).join(` `),u=s+a[e].length+1,d=e=>Math.min(Math.max(e-u,0),l.length),f=JV({value:l,start:d(r),end:d(i)},t);return{start:s,end:c,text:`${l.slice(0,f.start)}${f.text}${l.slice(f.end)}`,selectionStart:s+f.selectionStart,selectionEnd:s+f.selectionEnd}}let{lineStart:s,lineEnd:c}=aDe(e),l=n.slice(s,c).split(` `);if(t===`code-block`)return{start:s,end:c,text:`\`\`\`\n${l.join(` `)}\n\`\`\``,selectionStart:r+4,selectionEnd:i+4};let[,u]=t.match(/^heading-(\d)$/)??[],d=0,f=e=>u?e.trim()?`${`#`.repeat(Number(u))} `:``:t===`bulleted-list`?e.trim()?`- `:``:t===`numbered-list`?e.trim()?(d+=1,`${d}. `):``:t===`blockquote`?e.trim()?`> `:`>`:``,p=0,m=r,h=i,g=l.map((e,t)=>{let[n=``]=e.match(rDe)??[],a=e.slice(n.length),o=f(a),c=s+l.slice(0,t).join(` `).length+ +!!t,u=c+n.length,d=c+e.length,g=u+p+o.length-n.length,_=e=>g+Math.max(e-u,0);return r>=c&&r<=d&&(m=_(r)),i>=c&&i<=d&&(h=_(i)),p+=o.length-n.length,`${o}${a}`});return i>c&&(h=i+p),{start:s,end:c,text:g.join(` `),selectionStart:m,selectionEnd:Math.max(m,h)}},cDe=({value:e,start:t,end:n},{url:r,text:i})=>{let[,a,o,s]=e.slice(t,n).match(/^(\s*)([\s\S]*?)(\s*)$/),c=`[${((i??o).trim()||r).replace(/([[\]\\])/g,`\\$1`)}](${/[\s()<>]/.test(r)?`<${r.replace(/[<>]/g,encodeURIComponent)}>`:r})`,l=t+a.length+c.length;return{start:t,end:n,text:`${a}${c}${s}`,selectionStart:l,selectionEnd:l}},YV=({value:e,start:t,end:n},r,{block:i=!1}={})=>{if(!i){let e=t+r.length;return{start:t,end:n,text:r,selectionStart:e,selectionEnd:e}}let a=e.slice(0,t).replace(/[ \t]*$/,``),o=e.slice(n).replace(/^[ \t]*/,``),s=a.length,c=e.length-o.length,l=`${a?a.endsWith(` `)?``:a.endsWith(` `)?` `:` `:``}${r}${o.startsWith(` `)?``:o.startsWith(` `)?` `:` `}`,u=s+l.length;return{start:s,end:c,text:l,selectionStart:u,selectionEnd:u}},XV=({value:e,selectionStart:t,selectionEnd:n})=>({value:e,start:t,end:n}),lDe=async e=>{let t=Date.now()+1e3;for(;;){if(e.focus(),document.activeElement===e||Date.now()>t)return document.activeElement===e;await new Promise(e=>{window.setTimeout(e,20)})}},ZV=({readOnly:e,disabled:t})=>!e&&!t,QV=async(e,{start:t,end:n,text:r,selectionStart:i,selectionEnd:a})=>{if(!ZV(e))return;let o=await lDe(e);e.value.slice(t,n)!==r&&(e.setSelectionRange(t,n),o&&typeof document.execCommand==`function`&&(r?document.execCommand(`insertText`,!1,r):document.execCommand(`delete`,!1))&&e.value.slice(t,t+r.length)===r||(e.setRangeText(r,t,n),e.dispatchEvent(new Event(`input`,{bubbles:!0})))),e.setSelectionRange(i,a)},$V=async(e,t)=>{e&&await QV(e,t(XV(e)))},eH=(e,t,n)=>{let r=r=>{ZV(e)&&jx(r,Ex()?`Meta+${t}`:`Ctrl+${t}`)&&(r.preventDefault(),n())};return e.addEventListener(`keydown`,r),()=>{e.removeEventListener(`keydown`,r)}},uDe=async(e,t)=>{let n=GTe(t);if(!n){e.focus();return}let r=t.transformer?.type!==`text-match`;await QV(e,YV(XV(e),n,{block:r}))},tH=/[ \t]*(?:\r?\n[ \t]*)+/g,dDe=({value:e,caret:t})=>{let n=e.slice(0,t).replace(tH,` `);return{value:n+e.slice(t).replace(tH,` `),caret:n.length}},fDe=e=>{let t=e=>{let{inputType:t}=e;if(t===`insertLineBreak`||t===`insertParagraph`){e.preventDefault();return}let n=e.data||e.dataTransfer?.getData(`text/plain`)||``;(t===`insertFromPaste`||t===`insertReplacementText`)&&n.includes(` `)&&typeof document.execCommand==`function`&&(e.preventDefault(),document.execCommand(`insertText`,!1,n.replace(tH,` `)))},n=()=>{let{value:t,selectionStart:n}=e;if(!t.includes(` `))return;let r=dDe({value:t,caret:n});e.value=r.value,e.setSelectionRange(r.caret,r.caret)};return e.addEventListener(`beforeinput`,t),e.addEventListener(`input`,n,{capture:!0}),()=>{e.removeEventListener(`beforeinput`,t),e.removeEventListener(`input`,n,{capture:!0})}},pDe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`ariaLabel`,`children`]),mDe=B(`
    `),hDe={hash:`svelte-1lqxga9`,code:`.button-group.svelte-1lqxga9 {flex:none;display:inline-flex;align-items:center;}`};function gDe(e,t){K(e,hDe);let n=J(t,`ariaLabel`,3,void 0),r=Ss(t,pDe);var i=mDe();gs(i,()=>({...r,role:`group`,class:`sui button-group ${t.class??``}`,"aria-label":n()}),void 0,void 0,void 0,`svelte-1lqxga9`),Eo(N(i),()=>t.children??Er),D(i),U(e,i)}function _De(e,t){O(t,!0);let n=ii(`editorStore`),r=A(()=>n.selection.alignment??``),i=A(()=>hR.find(({type:e})=>e===z(r))?.icon??`format_align_left`),a=async(e,t)=>{let{editor:r}=n;r&&(r.dispatchCommand(mw,e),await WV(t),await yR(r))};{let t=e=>{bx(e,{get name(){return z(i)}})},o=e=>{{let t=A(()=>Y(`_sui.text_editor.alignment_options`));QS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var i=H();No(P(i),()=>n.selection,e=>{var t=H();Ro(P(t),17,()=>hR,e=>e.type,(e,t)=>{{let n=e=>{bx(e,{get name(){return z(t).icon}})},i=A(()=>Y(`_sui.text_editor.${z(t).labelKey}`)),o=A(()=>z(r)===z(t).type);tC(e,{get label(){return z(i)},get checked(){return z(o)},onclick:e=>{a(z(t).type,e.currentTarget)},startIcon:n,$$slots:{startIcon:!0}})}}),U(e,t)}),U(e,i)},$$slots:{default:!0}})}},s=A(()=>Y(`_sui.text_editor.show_alignment_options`));bS(e,{get"aria-label"(){return z(s)},get"aria-controls"(){return n.controlId},startIcon:t,popup:o,$$slots:{startIcon:!0,popup:!0}})}k()}function vDe(e,t){O(t,!0);let n=ii(`editorStore`),r=A(()=>n.selection.inlineTypes.includes(t.type)),i={bold:`B`,italic:`I`},a=async()=>{let{editor:e,textArea:r,useRichText:i}=n;i?e&&(await yR(e),e.dispatchCommand(XC,t.type)):$V(r,e=>sDe(e,t.type))};L(()=>{let{textArea:e}=n,r=i[t.type];if(e&&r)return eH(e,r,()=>{a()})});{let i=e=>{bx(e,{get name(){return uR[t.type].icon}})},o=A(()=>Y(`_sui.text_editor.${uR[t.type].labelKey}`));eS(e,{iconic:!0,get"aria-label"(){return z(o)},get"aria-controls"(){return n.controlId},get pressed(){return z(r)},onclick:()=>{a()},startIcon:i,$$slots:{startIcon:!0}})}k()}function yDe(e,t){O(t,!0);let n=ii(`editorStore`),{labelKey:r,icon:i}=uR[`horizontal-rule`],a=async()=>{let{editor:e,textArea:t,useRichText:r}=n;r?e&&(e.update(()=>{Kwe()}),await yR(e)):await $V(t,e=>YV(e,`***`,{block:!0}))};{let t=e=>{bx(e,{get name(){return i}})},o=A(()=>Y(`_sui.text_editor.${r}`));eS(e,{iconic:!0,get"aria-label"(){return z(o)},get"aria-controls"(){return n.controlId},onclick:()=>{a()},startIcon:t,$$slots:{startIcon:!0}})}k()}var nH=(e,t)=>{let{textArea:n,useRichText:r}=e;if(!r){n&&uDe(n,t);return}let{createNode:i}=t;e.editor?.update(()=>{let e=i();mj(e.isInline()?[e]:[e,jE()])})};function bDe(e,t){O(t,!0);let n=ii(`editorStore`),r=A(()=>t.component.label),i=A(()=>t.component.icon);{let a=e=>{var t=H(),n=P(t),r=e=>{bx(e,{get name(){return z(i)}})};G(n,e=>{z(i)&&e(r)}),U(e,t)},o=A(()=>!!z(i)),s=A(()=>z(i)?void 0:z(r));eS(e,{get iconic(){return z(o)},get label(){return z(s)},get title(){return z(r)},get"aria-label"(){return z(r)},get"aria-controls"(){return n.controlId},onclick:()=>{nH(n,t.component)},startIcon:a,$$slots:{startIcon:!0}})}k()}var xDe=B(`
    `),SDe=B(`
    `),CDe=B(`
    `,1),wDe=B(` `,1);function TDe(e,t){let n=yo();O(t,!0);let r=`link`,i=ii(`editorStore`),a=A(()=>i.selection.inlineTypes.includes(r)),o=j(!1),s=j(!1),c=j(``),l=j(``),u=j(!1),d=A(()=>i.config.format===`html`&&i.useRichText),f=A(()=>!!z(c).trim()&&TV(z(c))),p=e=>{M(c,Uc(e)&&TV(e)?e:``,!0),M(s,!!e),M(o,!0)},m=()=>{let{textArea:e,useRichText:t}=i;if(t)i.editor?.getEditorState().read(()=>{p(Sye().trim())});else if(e){let{value:t,start:n,end:r}=XV(e);p(t.slice(n,r).trim())}},h=()=>{i.useRichText&&i.editor?.dispatchCommand(mR,void 0)||m()},g=e=>{jx(e,`Enter`)&&z(f)&&M(o,!1)},_=async e=>{let{textArea:t,useRichText:n}=i;if(!n)t&&(e.detail.returnValue===`cancel`?t.focus():$V(t,e=>cDe(e,{url:z(c).trim(),text:z(s)?void 0:z(l)}))),M(c,``),M(l,``);else{if(e.detail.returnValue!==`cancel`){if(!i.editor)return;await new Promise(e=>{i.editor?.update(async()=>{let t=$()??sj()?.clone();Q(t)||(t=nj()),z(s)||(M(l,z(l).trim(),!0),M(l,z(l)||z(c),!0),mj([lE(z(l))])),pD(t),e(void 0)})}),await yR(i.editor),i.editor.dispatchCommand(wF,z(d)&&z(u)?{url:z(c),target:`_blank`}:z(c))}else i.editor&&await yR(i.editor);M(c,``),M(l,``),M(u,!1)}},v=()=>i.editor?.registerCommand($C,e=>(jx(e,Ex()?`Meta+K`:`Ctrl+K`)&&(e.preventDefault(),h()),!1),2);L(()=>{let{textArea:e}=i;if(e)return eH(e,`K`,()=>{h()})}),L(()=>{if(i.editor)return v()});var y=wDe(),b=P(y);{let e=e=>{bx(e,{get name(){return uR[r].icon}})},t=A(()=>Y(`_sui.text_editor.${uR[r].labelKey}`)),n=A(()=>z(a)&&i.useRichText);eS(b,{iconic:!0,get"aria-label"(){return z(t)},get"aria-controls"(){return i.controlId},get pressed(){return z(n)},onclick:()=>{h()},startIcon:e,$$slots:{startIcon:!0}})}var x=I(b,2);{let e=A(()=>Y(`_sui.text_editor.insert_link`)),t=A(()=>!z(f)),r=A(()=>Y(`_sui.insert`));DS(x,{get title(){return z(e)},get okDisabled(){return z(t)},get okLabel(){return z(r)},restoreFocus:!1,onClose:e=>{_(e)},get open(){return z(o)},set open(e){M(o,e,!0)},children:(e,t)=>{var r=CDe(),i=P(r),a=N(i),o=F(a,!0),f=I(a,2);{let e=A(()=>!!z(c).trim()&&!TV(z(c))),t=A(()=>Y(`_sui.text_editor.url`));RS(f,{dir:`ltr`,get id(){return`${n}-url`},flex:!0,get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{g(e)},get value(){return z(c)},set value(e){M(c,e,!0)}})}D(i);var p=I(i,2),m=e=>{var t=xDe(),r=N(t),i=F(r,!0),a=I(r,2);{let e=A(()=>Y(`_sui.text_editor.text`));RS(a,{dir:`auto`,get id(){return`${n}-text`},flex:!0,get"aria-label"(){return z(e)},onkeydown:e=>{g(e)},get value(){return z(l)},set value(e){M(l,e,!0)}})}D(t),R(e=>{q(r,`for`,`${n}-text`),W(i,e)},[()=>Y(`_sui.text_editor.text`)]),U(e,t)};G(p,e=>{z(s)||e(m)});var h=I(p,2),_=e=>{var t=SDe(),n=N(t);{let e=A(()=>Y(`_sui.text_editor.open_in_new_tab`));CS(n,{get label(){return z(e)},get checked(){return z(u)},set checked(e){M(u,e,!0)}})}D(t),U(e,t)};G(h,e=>{z(d)&&e(_)}),R(e=>{q(a,`for`,`${n}-url`),W(o,e)},[()=>Y(`_sui.text_editor.url`)]),U(e,r)},$$slots:{default:!0}})}U(e,y),k()}function EDe(e,t){O(t,!0);let n=ii(`editorStore`);{let r=e=>{bx(e,{name:`arrow_drop_down`,class:`small-arrow`})},i=e=>{QS(e,{children:(e,r)=>{var i=H();Ro(P(i),17,()=>t.components,e=>e.id,(e,t)=>{let r=A(()=>z(t));$S(e,{get label(){return z(r).label},onclick:()=>{nH(n,z(t))},startIcon:e=>{var t=H(),n=P(t),i=e=>{bx(e,{get name(){return z(r).icon}})};G(n,e=>{z(r).icon&&e(i)}),U(e,t)},$$slots:{startIcon:!0}})}),U(e,i)},$$slots:{default:!0}})},a=A(()=>Y(`_sui.insert`));bS(e,{get label(){return z(a)},endIcon:r,popup:i,$$slots:{endIcon:!0,popup:!0}})}k()}var DDe=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:1,rH=e=>{let[t,n=`0`]=String(e).toLowerCase().split(`e`),r=(t.split(`.`)[1]?.length??0)-Number(n);return Math.max(r,0)},ODe=({fractional:e,min:t})=>typeof t==`number`&&t>=0?e?`decimal`:`numeric`:`text`,iH=new Map,kDe=e=>{let t=e||``,n=iH.get(t);if(n===void 0){try{n=new Intl.NumberFormat(e||void 0).formatToParts(1.5).find(({type:e})=>e===`decimal`).value}catch{n=`.`}iH.set(t,n)}return n},ADe=(e,t)=>{let n=kDe(t);if(!e||n===`.`||e.includes(`.`))return e;let r=e.split(n);return r.length===2?r.join(`.`):e},aH=e=>{let t=e.trim()?Number(e):NaN;return Number.isNaN(t)?void 0:t},oH=e=>Number(e||0),sH=(e,t)=>typeof t==`number`&&oH(e)<=t,cH=(e,t)=>typeof t==`number`&&oH(e)>=t,jDe=(e,{step:t,direction:n,min:r,max:i})=>{if(Number.isNaN(Number(e))||(n>0?cH(e,i):sH(e,r)))return;let a=rH(t),o=Number((oH(e)+t*n).toFixed(a));return typeof i==`number`&&o>i?String(i):typeof r==`number`&&o{if(t&&(aH(e)===void 0||e===``))return!0;if(e===void 0||e===``)return!1;let i=Number(e);return Number.isNaN(i)||typeof n==`number`&&oH(e)r},NDe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`invalid`,`flex`,`min`,`max`,`step`,`fractional`,`inputmode`,`class`,`hidden`,`disabled`,`readonly`,`required`,`children`,`increaseIcon`,`decreaseIcon`,`onChange`,`onkeydown`,`oninput`]),PDe=B(`
    `),FDe=B(``),IDe=B(`
    `),LDe={hash:`svelte-11p915l`,code:`.number-input.svelte-11p915l {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.number-input.stepper.svelte-11p915l {--sui-number-input-end-padding: 24px;}.number-input.flex.svelte-11p915l:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.number-input.svelte-11p915l:not(.disabled) button[aria-disabled='true'] {filter:grayscale(0) opacity(1);}.number-input.svelte-11p915l:not(.disabled) button[aria-disabled='true'] * {filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}.number-input.svelte-11p915l input {padding-right:var(--sui-number-input-end-padding, 8px);}.number-input.svelte-11p915l .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.buttons.svelte-11p915l {display:flex;flex-direction:column;position:absolute;inset-block:2px;right:2px;z-index:3;width:18px;}.buttons.svelte-11p915l button {flex:none;margin:0 !important;border-width:0;border-radius:3px;padding:0;width:100%;height:50%;min-height:0;}.buttons.svelte-11p915l button .icon {font-size:16px;}.number-input.svelte-11p915l:dir(rtl) {--sui-textbox-text-align: right;}.number-input.svelte-11p915l:dir(rtl) .buttons:where(.svelte-11p915l) {right:auto;left:2px;}.number-input.svelte-11p915l:dir(rtl) input {padding-right:8px;padding-left:var(--sui-number-input-end-padding, 8px);}`};function lH(e,t){let n=yo();O(t,!0),K(e,LDe);let r=J(t,`value`,15),i=J(t,`invalid`,15,!1),a=J(t,`flex`,3,!1),o=J(t,`min`,3,void 0),s=J(t,`max`,3,void 0),c=J(t,`step`,3,1),l=J(t,`fractional`,3,void 0),u=J(t,`inputmode`,3,void 0),d=J(t,`hidden`,3,!1),f=J(t,`disabled`,3,!1),p=J(t,`readonly`,3,!1),m=J(t,`required`,3,!1),h=Ss(t,NDe),g=j(!1),_=j(``),v=A(()=>c()!==-1),y=A(()=>DDe(c())),b=A(()=>l()??(!z(v)||rH(z(y))>0)),x=A(()=>{let e=typeof o()==`number`,t=typeof s()==`number`;if(!(z(v)||!e&&!t))return e&&t?Y(`_sui.number_input.range`,{values:{min:o(),max:s()}}):e?Y(`_sui.number_input.min`,{values:{min:o()}}):Y(`_sui.number_input.max`,{values:{max:s()}})}),S=A(()=>[h[`aria-describedby`],z(x)?`${n}-range`:void 0].filter(Boolean).join(` `)||void 0),C=A(()=>ADe(z(_),t.lang??Ac.current)),w=A(()=>sH(z(C),o())),T=A(()=>cH(z(C),s()));L(()=>{let e=r();ao(()=>{aH(z(C))!==e&&M(_,String(e??``),!0)})}),L(()=>{r(aH(z(C)))}),L(()=>{z(g)&&i(MDe(z(C),{required:m(),min:o(),max:s()}))});let ee=e=>{let t=jDe(z(C),{step:z(y),direction:e,min:o(),max:s()});t!==void 0&&M(_,t,!0)},E=()=>{ee(-1)},te=()=>{ee(1)};var ne=IDe();let re;var ie=N(ne),ae=e=>{var r=PDe(),i=N(r);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Eo(P(n),()=>t.increaseIcon),U(e,n)},a=e=>{bx(e,{name:`expand_less`})};G(r,e=>{t.increaseIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>f()||p()||Number.isNaN(Number(z(C)))||z(T)),a=A(()=>Y(`_sui.number_input.increase`));eS(i,{iconic:!0,get disabled(){return z(r)},get"aria-label"(){return z(a)},get"aria-controls"(){return n},onclick:()=>{te()},startIcon:e,$$slots:{startIcon:!0}})}var a=I(i,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Eo(P(n),()=>t.decreaseIcon),U(e,n)},a=e=>{bx(e,{name:`expand_more`})};G(r,e=>{t.decreaseIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>f()||p()||Number.isNaN(Number(z(C)))||z(w)),i=A(()=>Y(`_sui.number_input.decrease`));eS(a,{iconic:!0,get disabled(){return z(r)},get"aria-label"(){return z(i)},get"aria-controls"(){return n},onclick:()=>{E()},startIcon:e,$$slots:{startIcon:!0}})}D(r),U(e,r)},oe=e=>{var t=FDe(),r=F(t,!0);R(()=>{q(t,`id`,`${n}-range`),W(r,z(x))}),U(e,t)};G(ie,e=>{z(v)?e(ae):z(x)&&e(oe,1)});var se=I(ie,2);{let e=A(()=>z(v)?`spinbutton`:`textbox`),c=A(()=>z(v)&&Number.isFinite(r())?r():void 0),l=A(()=>z(v)?o():void 0),y=A(()=>z(v)?s():void 0),x=A(()=>u()??ODe({fractional:z(b),min:o()}));RS(se,Cs({dir:`ltr`},()=>h,{get role(){return z(e)},get id(){return n},spellcheck:`false`,get flex(){return a()},get hidden(){return d()},get disabled(){return f()},get readonly(){return p()},get required(){return m()},get invalid(){return i()},get"aria-valuenow"(){return z(c)},get"aria-valuemin"(){return z(l)},get"aria-valuemax"(){return z(y)},get inputmode(){return z(x)},get"aria-describedby"(){return z(S)},onkeydown:e=>{let{key:n,ctrlKey:r,metaKey:i,altKey:a,shiftKey:o}=e,s=o||a||r||i,c=z(v)&&!f()&&!p()&&!s;n===`ArrowDown`&&c&&(e.preventDefault(),E()),n===`ArrowUp`&&c&&(e.preventDefault(),te()),z(g)||M(g,!0),t.onkeydown?.(e)},oninput:e=>{z(g)||M(g,!0),t.oninput?.(e)},get onChange(){return t.onChange},get value(){return z(_)},set value(e){M(_,e,!0)}}))}D(ne),R(()=>{re=is(ne,1,`sui number-input ${t.class??``}`,`svelte-11p915l`,re,{flex:a(),disabled:f(),readonly:p(),stepper:z(v)}),q(ne,`hidden`,d())}),U(e,ne),k()}var RDe=B(`
    `),zDe=B(` `,1),BDe={hash:`svelte-xxp5r9`,code:`.table-size.svelte-xxp5r9 {display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px 16px;}`};function VDe(e,t){let n=yo();O(t,!0),K(e,BDe);let r=J(t,`disabled`,3,!1),i=ii(`editorStore`),a=j(!1),o=j(ea(3)),s=j(ea(3)),c=A(()=>WB(z(o))),l=A(()=>WB(z(s))),u=A(()=>!!z(c)&&!!z(l)),d=()=>{z(c)||M(o,3,!0),z(l)||M(s,3,!0),M(a,!0)},f=e=>{jx(e,`Enter`)&&z(u)&&M(a,!1)},p=async({rows:e,columns:t})=>{let{editor:n}=i;n&&(n.update(()=>{Jwe(e,t)}),await yR(n))},m=async({rows:e,columns:t})=>{let n=qwe(e,t);await $V(i.textArea,e=>{let t=YV(e,n,{block:!0}),r=t.start+t.text.indexOf(n)+2;return{...t,selectionStart:r,selectionEnd:r}})},h=async e=>{if(e.detail.returnValue!==`cancel`&&z(c)&&z(l)){let e={rows:z(c),columns:z(l)};i.useRichText?await p(e):await m(e)}else i.useRichText?i.editor&&await yR(i.editor):i.textArea?.focus()};var g=zDe(),_=P(g);{let e=e=>{bx(e,{get name(){return uR.table.icon}})},t=A(()=>Y(`_sui.text_editor.${uR.table.labelKey}`));eS(_,{iconic:!0,get disabled(){return r()},get"aria-label"(){return z(t)},get"aria-controls"(){return i.controlId},onclick:()=>{d()},startIcon:e,$$slots:{startIcon:!0}})}var v=I(_,2);{let e=A(()=>Y(`_sui.text_editor.insert_table`)),t=A(()=>!z(u)),r=A(()=>Y(`_sui.insert`));DS(v,{size:`x-small`,get title(){return z(e)},get okDisabled(){return z(t)},get okLabel(){return z(r)},restoreFocus:!1,onClose:e=>{h(e)},get open(){return z(a)},set open(e){M(a,e,!0)},children:(e,t)=>{var r=RDe(),i=N(r),a=F(i,!0),u=I(i,2);{let e=A(()=>!z(c)),t=A(()=>Y(`_sui.text_editor.rows`));lH(u,{get id(){return`${n}-rows`},min:1,get max(){return 50},get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{f(e)},get value(){return z(o)},set value(e){M(o,e,!0)}})}var d=I(u,2),p=F(d,!0),m=I(d,2);{let e=A(()=>!z(l)),t=A(()=>Y(`_sui.text_editor.columns`));lH(m,{get id(){return`${n}-columns`},min:1,get max(){return 50},get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{f(e)},get value(){return z(s)},set value(e){M(s,e,!0)}})}D(r),R((e,t)=>{q(i,`for`,`${n}-rows`),W(a,e),q(d,`for`,`${n}-columns`),W(p,t)},[()=>Y(`_sui.text_editor.rows`),()=>Y(`_sui.text_editor.columns`)]),U(e,r)},$$slots:{default:!0}})}U(e,g),k()}function HDe(e,t){O(t,!0);let n={paragraph:jE,blockquote:CI,"code-block":qP},r={"bulleted-list":YF,"numbered-list":XF},i=ii(`editorStore`),a=A(()=>i.selection.blockType===t.type),o=async()=>{if(!i.useRichText){$V(i.textArea,e=>JV(e,t.type));return}if(!i.editor)return;await yR(i.editor);let[,e]=t.type.match(/^heading-(\d)$/)??[],a=e?()=>OI(`h${e}`):n[t.type];a&&i.editor.update(()=>{Vye($(),a)}),t.type in r&&i.editor.dispatchCommand(r[t.type],void 0)};var s=H();No(P(s),()=>z(a),e=>{{let n=e=>{bx(e,{get name(){return uR[t.type].icon}})},r=A(()=>Y(`_sui.text_editor.${uR[t.type].labelKey}`));eC(e,{get label(){return z(r)},get checked(){return z(a)},onclick:()=>{z(a)||o()},startIcon:n,$$slots:{startIcon:!0}})}}),U(e,s),k()}var uH=B(` `,1),UDe=B(` `,1),dH=B(` `,1);function WDe(e,t){O(t,!0);let n=J(t,`disabled`,3,!1),r=J(t,`readonly`,3,!1),i=ii(`editorStore`),a=A(()=>Pc([`paragraph`,...i.config.enabledButtons.filter(e=>pR.includes(e))])),o=A(()=>i.config.format===`html`),s=A(()=>i.useRichText||!z(o)),c=A(()=>i.config.enabledButtons.includes(`table`)),l=A(()=>z(o)&&i.useRichText&&i.config.enabledButtons.includes(`align`)),u=A(()=>i.config.enabledButtons.includes(`horizontal-rule`)),d=A(()=>i.useRichText?i.selection.tableCellKey??null:null),f=A(()=>!!z(d)&&!z(o)),p=A(()=>z(f)?i.config.components.filter(xV):i.config.components),m=A(()=>z(p).filter(({trigger:e=`menuitem`})=>e===`button`)),h=A(()=>z(p).filter(({trigger:e=`menuitem`})=>e===`menuitem`)),g=A(()=>z(c)||!z(f)&&z(u)||z(p).length>0),_=A(()=>z(s)&&!z(f)),v=A(()=>Pc(i.config.enabledButtons.filter(e=>fR.includes(e))));{let t=A(()=>n()||r()||i.componentHasFocus),p=A(()=>Y(`_sui.text_editor.text_editor`));HV(e,{get disabled(){return z(t)},get ariaLabel(){return z(p)},children:(e,t)=>{var n=dH(),r=P(n),p=e=>{{let t=e=>{{let t=A(()=>uR[i.selection.blockType]?.icon??`format_paragraph`);bx(e,{get name(){return z(t)}})}},n=e=>{{let t=A(()=>Y(`_sui.text_editor.text_style_options`));QS(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();Ro(P(n),16,()=>z(a),e=>e,(e,t)=>{HDe(e,{get type(){return t}})}),U(e,n)},$$slots:{default:!0}})}},r=A(()=>Y(`_sui.text_editor.show_text_style_options`));bS(e,{get"aria-label"(){return z(r)},get"aria-controls"(){return i.controlId},startIcon:t,popup:n,$$slots:{startIcon:!0,popup:!0}})}};G(r,e=>{z(_)&&z(a).length>1&&e(p)});var y=I(r,2),b=e=>{var t=uH(),n=P(t);BS(n,{orientation:`vertical`}),BV(I(n,2),{}),U(e,t)},x=e=>{var t=dH(),n=P(t),r=e=>{var t=uH(),n=P(t),r=e=>{BS(e,{orientation:`vertical`})};G(n,e=>{z(_)&&z(a).length>1&&e(r)});var o=I(n,2);{let e=e=>{bx(e,{name:`table_edit`})},t=e=>{GV(e,{get cellKey(){return z(d)}})},n=A(()=>Y(`_sui.text_editor.show_table_options`));bS(o,{get"aria-label"(){return z(n)},get"aria-controls"(){return i.controlId},startIcon:e,popup:t,$$slots:{startIcon:!0,popup:!0}})}U(e,t)};G(n,e=>{z(c)&&z(d)&&e(r)});var o=I(n,2),s=e=>{var t=uH(),n=P(t);BS(n,{orientation:`vertical`}),gDe(I(n,2),{children:(e,t)=>{var n=H();Ro(P(n),16,()=>z(v),e=>e,(e,t)=>{var n=H(),r=P(n),i=e=>{TDe(e,{})},a=e=>{vDe(e,{get type(){return t}})};G(r,e=>{t===`link`?e(i):e(a,-1)}),U(e,n)}),U(e,n)},$$slots:{default:!0}}),U(e,t)};G(o,e=>{z(v).length&&e(s)});var p=I(o,2),y=e=>{var t=uH(),n=P(t);BS(n,{orientation:`vertical`}),_De(I(n,2),{}),U(e,t)};G(p,e=>{z(l)&&e(y)});var b=I(p,2),x=e=>{var t=UDe(),n=P(t);BS(n,{orientation:`vertical`});var r=I(n,2),i=e=>{{let t=A(()=>!!z(d));VDe(e,{get disabled(){return z(t)}})}};G(r,e=>{z(c)&&e(i)});var a=I(r,2),o=e=>{yDe(e,{})};G(a,e=>{z(u)&&!z(f)&&e(o)});var s=I(a,2);Ro(s,17,()=>z(m),e=>e.id,(e,t)=>{bDe(e,{get component(){return z(t)}})});var l=I(s,2),p=e=>{EDe(e,{get components(){return z(h)}})};G(l,e=>{z(h).length&&e(p)}),U(e,t)};G(b,e=>{z(g)&&e(x)}),U(e,t)};G(y,e=>{i.useRichText&&i.selection.blockType===`code-block`?e(b):z(s)&&e(x,1)});var S=I(y,2);wS(S,{flex:!0});var C=I(S,2),w=e=>{{let t=e=>{{let t=A(()=>z(o)?`html`:`markdown`);bx(e,{get name(){return z(t)}})}},n=A(()=>!i.useRichText),r=A(()=>Y(`_sui.text_editor.${z(o)?`edit_in_html`:`edit_in_markdown`}`));eS(e,{iconic:!0,get disabled(){return i.hasConverterError},get pressed(){return z(n)},get"aria-label"(){return z(r)},onclick:()=>{i.useRichText=!i.useRichText,i.useRichText&&i.convertToLexical()},startIcon:t,$$slots:{startIcon:!0}})}};G(C,e=>{i.config.modes.length>1&&e(w)}),U(e,n)},$$slots:{default:!0}})}k()}var GDe=new Set(`$$slots.$$events.$$legacy.value.pending.format.flex.dir.modes.buttons.components.multiline.minimal.useMarkdownShortcuts.useEmojiAutocomplete.hidden.disabled.readonly.required.invalid.ariaLabel.ariaLabelledby.ariaDescribedby.aria-label.aria-labelledby.aria-describedby.children`.split(`.`)),KDe=B(`
    `,1),qDe={hash:`svelte-2xn2h5`,code:`.text-editor.svelte-2xn2h5 {position:relative;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.text-editor.flex.svelte-2xn2h5:not([hidden]) {display:block;}.text-editor.svelte-2xn2h5:is(.single-line:where(.svelte-2xn2h5), .minimal:where(.svelte-2xn2h5)) > .lexical-root, .text-editor.svelte-2xn2h5:is(.single-line:where(.svelte-2xn2h5), .minimal:where(.svelte-2xn2h5)) > .text-area > :is(textarea, .clone) {min-height:0;}.text-editor.minimal.svelte-2xn2h5 > .lexical-root, .text-editor.minimal.svelte-2xn2h5 > .text-area > :is(textarea, .clone) {max-height:240px;}.text-editor.minimal.svelte-2xn2h5 > .lexical-root, .text-editor.minimal.svelte-2xn2h5 > .text-area > textarea {overflow:auto;}.text-editor.minimal.svelte-2xn2h5 > .lexical-root {--sui-text-editor-inner-toolbar-top: 0px;}.text-editor.minimal.svelte-2xn2h5 > .text-area > :is(textarea, .clone) {scrollbar-gutter:stable;}.text-editor.svelte-2xn2h5 .sui.text-area {margin:0 !important;width:100% !important;min-width:auto;}.text-editor.svelte-2xn2h5 .sui.text-area textarea {border-start-start-radius:0 !important;border-start-end-radius:0 !important;border-end-start-radius:var(--sui-textbox-border-radius) !important;border-end-end-radius:var(--sui-textbox-border-radius) !important;outline-offset:calc(var(--sui-focus-ring-width) * -1);}.text-editor.svelte-2xn2h5 {--sui-text-editor-toolbar-top: var(--sui-text-editor-inner-toolbar-top, 0px);--sui-text-editor-toolbar-z-index: var(--sui-text-editor-inner-toolbar-z-index, 100);}.text-editor.svelte-2xn2h5 > * {--sui-text-editor-inner-toolbar-top: calc( var(--sui-text-editor-toolbar-top) + var(--sui-text-editor-toolbar-height) );--sui-text-editor-inner-toolbar-z-index: calc(var(--sui-text-editor-toolbar-z-index) - 1);}`};function JDe(e,t){O(t,!0),K(e,qDe);let n=J(t,`value`,15,``),r=J(t,`pending`,15,!1),i=J(t,`format`,3,`markdown`),a=J(t,`flex`,3,!1),o=J(t,`dir`,3,void 0),s=J(t,`modes`,19,()=>[`rich-text`,`plain-text`]),c=J(t,`buttons`,19,()=>[...fR,...pR]),l=J(t,`components`,19,()=>[]),u=J(t,`multiline`,3,!0),d=J(t,`minimal`,3,!1),f=J(t,`useMarkdownShortcuts`,3,!0),p=J(t,`useEmojiAutocomplete`,3,!0),m=J(t,`hidden`,3,!1),h=J(t,`disabled`,3,!1),g=J(t,`readonly`,3,!1),_=J(t,`required`,3,!1),v=J(t,`invalid`,3,!1),y=J(t,`ariaLabel`,3,void 0),b=J(t,`ariaLabelledby`,3,void 0),x=J(t,`ariaDescribedby`,3,void 0),S=J(t,`aria-label`,3,void 0),C=J(t,`aria-labelledby`,3,void 0),w=J(t,`aria-describedby`,3,void 0),T=Ss(t,GDe),ee=A(()=>({"aria-label":y()??S(),"aria-labelledby":b()??C(),"aria-describedby":x()??w()})),E=RV();E.config={...E.config,modes:s(),enabledButtons:c(),components:l(),multiline:u(),useMarkdownShortcuts:f(),useEmojiAutocomplete:p(),format:i()},ai(`editorStore`,E);let te=i()===`html`?`html`:`markdown`,ne=2e4,re=j(ea(Zz())),ie=j(0),ae=A(()=>!E.useRichText&&!m()),oe=A(()=>o()===`auto`&&E.useRichText?void 0:o()),se=A(()=>!z(ae)||te!==`markdown`||E.inputValue.length>ne?``:[...new Set([...E.inputValue.matchAll(/^[ \t]*(?:```|~~~)[ \t]*(?[\w+#-]+)/gm)].map(({groups:e})=>e?.lang))].join(`,`)),ce=e=>{if(z(ie),!(!z(ae)||e.length>ne))return mwe(e,te,{theme:z(re)})};L(()=>Qz(async()=>{let e=Zz();z(ae)&&await DV(te),e===Zz()&&M(re,e,!0)})),L(()=>{if(!z(ae))return;let e=z(se)?z(se).split(`,`):[];z(re),ao(()=>{DV(te).then(async()=>{M(ie,z(ie)+1),await Promise.all(e.map(e=>DV(e))),M(ie,z(ie)+1)})})}),L(()=>{let{textArea:e,useRichText:t}=E;if(!e||t)return;let n=()=>{E.selection={blockNodeKey:null,blockType:document.activeElement===e?oDe(XV(e)):`paragraph`,inlineTypes:[]}},r=[`selectionchange`,`select`,`input`,`keyup`,`mouseup`,`focus`];return ao(n),r.forEach(t=>e.addEventListener(t,n)),()=>{r.forEach(t=>e.removeEventListener(t,n))}}),L(()=>{let{textArea:e}=E;if(e&&!u())return fDe(e)}),zV(E,{getInputValue:()=>n(),setValue:e=>{n()!==e&&n(e)},setPending:e=>{r(e)}});var le=KDe(),ue=P(le);gs(ue,()=>({...T,role:`none`,class:`sui text-editor`,hidden:m(),[fs]:{flex:a(),"single-line":!u(),minimal:d()},[ps]:{"--sui-text-editor-toolbar-height":`${E.toolbarHeight??``}px`}}),void 0,void 0,void 0,`svelte-2xn2h5`);var de=N(ue);WDe(de,{get disabled(){return h()},get readonly(){return g()}});var fe=I(de,2);{let e=A(()=>!E.useRichText||m());LV(fe,Cs(()=>z(ee),{get dir(){return o()},get hidden(){return z(e)},get disabled(){return h()},get readonly(){return g()},get required(){return _()},get invalid(){return v()}}))}var pe=I(fe,2);{let e=A(()=>u()?void 0:1),t=A(()=>u()?void 0:!1),n=A(()=>E.useRichText||m());UV(pe,Cs(()=>z(ee),{get id(){return`${E.editorId??``}-plain-text`},autoResize:!0,get rows(){return z(e)},get"aria-multiline"(){return z(t)},get useEmojiAutocomplete(){return p()},highlight:ce,get flex(){return a()},get dir(){return z(oe)},get hidden(){return z(n)},get disabled(){return h()},get readonly(){return g()},get required(){return _()},get invalid(){return v()},get element(){return E.textArea},set element(e){E.textArea=e},get value(){return E.inputValue},set value(e){E.inputValue=e}}))}var me=I(pe,2),he=e=>{GEe(e,{})};G(me,e=>{E.config.useEmojiAutocomplete&&!h()&&!g()&&e(he)});var ge=I(me,2),_e=e=>{XEe(e,{})},ve=A(()=>E.config.enabledButtons.includes(`link`)&&!h()&&!g());G(ge,e=>{z(ve)&&e(_e)});var ye=I(ge,2),be=e=>{tDe(e,{})},xe=A(()=>E.config.enabledButtons.includes(`table`)&&!h()&&!g());G(ye,e=>{z(xe)&&e(be)}),D(ue);var Se=I(ue,2),Ce=e=>{_C(e,{get show(){return E.showConverterError},set show(e){E.showConverterError=e},children:(e,t)=>{wx(e,{status:`error`,children:(e,t)=>{qr();var n=V();R(e=>W(n,e),[()=>Y(`_sui.text_editor.converter_error`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(Se,e=>{E.showConverterError&&e(Ce)}),U(e,le),k()}var YDe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`class`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`onclick`,`oninput`]),XDe=B(``),ZDe={hash:`svelte-hzctkj`,code:`.color-input.svelte-hzctkj {display:inline-block;margin:var(--sui-focus-ring-width);border-width:var(--sui-color-input-border-width, 1px);border-color:var(--sui-color-input-border-color, var(--sui-control-border-color));border-radius:var(--sui-color-input-border-radius, var(--sui-button-medium-border-radius));padding:var(--sui-color-input-padding, 3px);width:var(--sui-color-input-width, calc(var(--sui-button-medium-height) * 1.5));height:var(--sui-color-input-height, var(--sui-button-medium-height));color:inherit;background-color:var(--sui-color-input-background-color, var(--sui-textbox-background-color));font-family:var(--sui-textbox-font-family);cursor:pointer;transition:all 200ms;}.color-input.svelte-hzctkj:is(:where(.svelte-hzctkj):hover, :where(.svelte-hzctkj):focus-visible) {background-color:var(--sui-color-input-background-color-focus, var(--sui-hover-background-color));}.color-input.svelte-hzctkj:active {background-color:var(--sui-color-input-background-color-active, var(--sui-active-background-color));}.color-input[aria-readonly=true].svelte-hzctkj {cursor:default;background-color:var(--sui-disabled-background-color);}.color-input[aria-invalid=true].svelte-hzctkj {border-color:var(--sui-error-border-color);}.color-input.svelte-hzctkj::-webkit-color-swatch-wrapper {padding:0;}.color-input.svelte-hzctkj::-webkit-color-swatch {border:1px solid var(--sui-secondary-border-color);border-radius:calc(var(--sui-button-medium-border-radius) / 2);}.color-input.svelte-hzctkj::-moz-color-swatch {border:1px solid var(--sui-secondary-border-color);border-radius:calc(var(--sui-button-medium-border-radius) / 2);}`};function QDe(e,t){O(t,!0),K(e,ZDe);let n=J(t,`value`,15),r=J(t,`element`,15),i=J(t,`disabled`,3,!1),a=J(t,`readonly`,3,!1),o=J(t,`required`,3,!1),s=J(t,`invalid`,3,!1),c=J(t,`ariaLabel`,3,void 0),l=Ss(t,YDe),u=e=>{a()&&e.preventDefault(),t.onclick?.(e)},d=e=>{n(e.currentTarget.value),t.oninput?.(e)};var f=XDe();gs(f,()=>({...l,value:n()??``,type:`color`,class:`sui color-input ${t.class??``}`,disabled:i()||void 0,"aria-label":c()??l[`aria-label`],"aria-disabled":i(),"aria-readonly":a(),"aria-required":o(),"aria-invalid":s(),onclick:u,oninput:d}),void 0,void 0,void 0,`svelte-hzctkj`,!0),bs(f,e=>r(e),()=>r()),U(e,f),k()}var $De=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`type`,`min`,`max`,`step`,`class`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`oninput`]),eOe=B(``),tOe={hash:`svelte-r4j4k8`,code:`.date-time-input.svelte-r4j4k8 {display:inline-block;margin:var(--sui-focus-ring-width);width:auto;min-width:0;height:var(--sui-textbox-height);text-transform:var(--sui-date-time-input-text-transform, uppercase);font-variant-numeric:tabular-nums;border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-singleline-padding);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-singleline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));letter-spacing:var(--sui-textbox-letter-spacing, normal);transition:all 200ms;}.date-time-input.svelte-r4j4k8:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.date-time-input[aria-invalid=true].svelte-r4j4k8 {border-color:var(--sui-error-border-color);}.date-time-input.svelte-r4j4k8:read-only {color:var(--sui-secondary-foreground-color);border-color:var(--sui-textbox-border-color) !important;}.date-time-input.svelte-r4j4k8:is(:where(.svelte-r4j4k8):disabled, :where(.svelte-r4j4k8):read-only) {background-color:var(--sui-disabled-background-color);}.date-time-input.svelte-r4j4k8::-webkit-calendar-picker-indicator {cursor:pointer;}.date-time-input.svelte-r4j4k8:is(:where(.svelte-r4j4k8):disabled, :where(.svelte-r4j4k8):read-only)::-webkit-calendar-picker-indicator {cursor:default;}`};function nOe(e,t){O(t,!0),K(e,tOe);let n=J(t,`value`,15),r=J(t,`element`,15),i=J(t,`type`,3,`date`),a=J(t,`min`,3,void 0),o=J(t,`max`,3,void 0),s=J(t,`step`,3,void 0),c=J(t,`disabled`,3,!1),l=J(t,`readonly`,3,!1),u=J(t,`required`,3,!1),d=J(t,`invalid`,3,!1),f=J(t,`ariaLabel`,3,void 0),p=Ss(t,$De),m=e=>{n(e.currentTarget.value),t.oninput?.(e)};var h=eOe();gs(h,()=>({...p,value:n()??``,type:i(),min:a(),max:o(),step:s(),class:`sui date-time-input ${t.class??``}`,disabled:c()||void 0,readonly:l()||void 0,"aria-label":f()??p[`aria-label`],"aria-disabled":c(),"aria-readonly":l(),"aria-required":u(),"aria-invalid":d(),oninput:m}),void 0,void 0,void 0,`svelte-r4j4k8`,!0),bs(h,e=>r(e),()=>r()),U(e,h),k()}var rOe=new Set([`$$slots`,`$$events`,`$$legacy`,`mask`,`value`,`flex`,`monospace`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`visibilityIcon`]),iOe=B(`
    `),aOe={hash:`svelte-4ez2rh`,code:`.password-input.svelte-4ez2rh, .secret-input.svelte-4ez2rh {display:inline-flex;align-items:center;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.password-input.flex.svelte-4ez2rh:not([hidden]), .secret-input.flex.svelte-4ez2rh:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.password-input.svelte-4ez2rh .text-input, .secret-input.svelte-4ez2rh .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.password-input.svelte-4ez2rh input, .secret-input.svelte-4ez2rh input {border-start-end-radius:0;border-end-end-radius:0;}.password-input.svelte-4ez2rh button, .secret-input.svelte-4ez2rh button {margin-block:0;margin-inline-end:0;flex:none;margin-inline-start:-1px;border-width:1px;border-color:var(--sui-textbox-border-color);width:var(--sui-textbox-height);aspect-ratio:1/1;}.password-input.svelte-4ez2rh button:last-child, .secret-input.svelte-4ez2rh button:last-child {border-start-start-radius:0;border-start-end-radius:4px;border-end-end-radius:4px;border-end-start-radius:0;}.password-input.svelte-4ez2rh button .icon, .secret-input.svelte-4ez2rh button .icon {font-size:var(--sui-font-size-xx-large);}.secret-input.show.svelte-4ez2rh input {-webkit-text-security:none;}.secret-input.svelte-4ez2rh input {-webkit-text-security:disc;}.password-input.svelte-4ez2rh:dir(rtl), .secret-input.svelte-4ez2rh:dir(rtl) {--sui-textbox-text-align: right;}`};function oOe(e,t){let n=yo();O(t,!0),K(e,aOe);let r=J(t,`value`,15),i=J(t,`flex`,3,!1),a=J(t,`monospace`,3,!0),o=J(t,`hidden`,3,!1),s=J(t,`disabled`,3,!1),c=J(t,`readonly`,3,!1),l=J(t,`required`,3,!1),u=J(t,`invalid`,3,!1),d=Ss(t,rOe),f=j(!1),p=A(()=>t.mask===`type`?{show:`_sui.password_input.show_password`,hide:`_sui.password_input.hide_password`}:{show:`_sui.secret_input.show_secret`,hide:`_sui.secret_input.hide_secret`});var m=iOe();let h;var g=N(m);RS(g,Cs({dir:`ltr`},()=>t.mask===`css`?{autocomplete:`off`,autocapitalize:`off`,autocorrect:`off`}:{},()=>d,{get id(){return n}},()=>t.mask===`type`?{type:z(f)?`text`:`password`}:{},{spellcheck:`false`,get flex(){return i()},get monospace(){return a()},get hidden(){return o()},get disabled(){return s()},get readonly(){return c()},get required(){return l()},get invalid(){return u()},get value(){return r()},set value(e){r(e)}}));var _=I(g,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Eo(P(n),()=>t.visibilityIcon),U(e,n)},a=e=>{{let t=A(()=>z(f)?`visibility_off`:`visibility`);bx(e,{get name(){return z(t)}})}};G(r,e=>{t.visibilityIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>s()||c()),i=A(()=>Y(z(f)?z(p).hide:z(p).show));eS(_,{iconic:!0,get disabled(){return z(r)},get pressed(){return z(f)},get"aria-label"(){return z(i)},get"aria-controls"(){return n},onclick:()=>{M(f,!z(f))},startIcon:e,$$slots:{startIcon:!0}})}D(m),R(()=>{h=is(m,1,`sui ${t.mask===`type`?`password-input`:`secret-input`} ${t.class??``}`,`svelte-4ez2rh`,h,{flex:i(),disabled:s(),readonly:c(),show:t.mask===`css`&&z(f)}),q(m,`hidden`,o())}),U(e,m),k()}var sOe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`]);function fH(e,t){O(t,!0);let n=J(t,`value`,15),r=Ss(t,sOe);oOe(e,Cs(()=>r,{mask:`css`,get value(){return n()},set value(e){n(e)}})),k()}var cOe=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`expanded`,`class`,`hidden`,`disabled`,`label`,`value`,`valueType`,`children`,`items`,`startIcon`,`endIcon`,`chevronIcon`,`onChange`,`onSelect`,`onExpand`]),lOe=B(``),uOe=B(``),dOe=B(``),fOe=B(`
    `),pOe=B(`
    `),mOe={hash:`svelte-1pcxmh7`,code:`.end-icon.svelte-1pcxmh7 {display:contents;}[role=treeitem].svelte-1pcxmh7 {display:block;}[role=treeitem][hidden].svelte-1pcxmh7 {display:none;}[role=treeitem].svelte-1pcxmh7:focus-visible {outline-color:transparent;}[role=treeitem].svelte-1pcxmh7:focus-visible > .row:where(.svelte-1pcxmh7) {outline-color:var(--sui-focus-ring-color);outline-offset:calc(var(--sui-focus-ring-width) * -1);}[role=treeitem][aria-selected=true].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}[role=treeitem].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7):hover {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}[role=treeitem].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7):active {background-color:var(--sui-active-background-color);}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7) {cursor:default;}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7):is(:where(.svelte-1pcxmh7):hover, :where(.svelte-1pcxmh7):active) {color:var(--sui-tree-foreground-color);background-color:transparent;}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7) > .chevron:where(.svelte-1pcxmh7):not(.placeholder) {cursor:pointer;}[role='tree'][aria-readonly='true'] [role=treeitem][aria-selected=true].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7):is(:where(.svelte-1pcxmh7):hover, :where(.svelte-1pcxmh7):active) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}[role=treeitem][aria-expanded=true].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7) > .chevron:where(.svelte-1pcxmh7):dir(ltr) {transform:rotate(90deg);}[role=treeitem][aria-expanded=true].svelte-1pcxmh7 > .row:where(.svelte-1pcxmh7) > .chevron:where(.svelte-1pcxmh7):dir(rtl) {transform:rotate(-90deg);}.row.svelte-1pcxmh7 {display:flex;align-items:center;gap:4px;border-radius:var(--sui-tree-item-border-radius, var(--sui-option-border-radius, 4px));padding:var(--sui-tree-item-padding, var(--sui-option-padding, 0 8px));min-height:var(--sui-tree-item-height, var(--sui-option-height));cursor:pointer;transition:background-color 200ms;}.chevron.svelte-1pcxmh7 {flex:none;display:flex;align-items:center;justify-content:center;margin-inline-start:calc((var(--sui-tree-item-level, 1) - 1) * var(--sui-tree-item-indent, 16px));width:var(--sui-tree-item-chevron-size, 24px);height:var(--sui-tree-item-chevron-size, 24px);transition:transform 200ms;}.label.svelte-1pcxmh7 {flex:auto;overflow:hidden;padding:0 4px;white-space:nowrap;text-overflow:ellipsis;}.group.svelte-1pcxmh7 {display:block;}.group[hidden].svelte-1pcxmh7 {display:none;}`};function pH(e,t){let n=yo();O(t,!0),K(e,mOe);let r=J(t,`selected`,15,!1),i=J(t,`expanded`,15,!1),a=J(t,`hidden`,3,!1),o=J(t,`disabled`,3,!1),s=J(t,`label`,3,``),c=J(t,`value`,3,void 0),l=J(t,`valueType`,3,void 0),u=Ss(t,cOe),d=A(()=>c()===void 0?s():c()),f=A(()=>l()===void 0?Ix(z(d)):l()),p=(ii(`sui:tree-item-level`)??0)+1;ai(`sui:tree-item-level`,p);let m=e=>{r(e.detail.selected),t.onChange?.(e)},h=e=>{i(e.detail.expanded),t.onExpand?.(e)},g=e=>{t.onSelect?.(e)},_=e=>{let t=[[`Change`,m],[`Expand`,h],[`Select`,g]];return t.forEach(([t,n])=>{e.addEventListener(t,n)}),()=>{t.forEach(([t,n])=>{e.removeEventListener(t,n)})}};var v=pOe();gs(v,()=>({...u,id:n,role:`treeitem`,class:`sui treeitem ${t.class??``}`,tabindex:`-1`,hidden:a(),"aria-hidden":a(),"aria-disabled":o(),"aria-selected":r(),"aria-expanded":t.items?i():void 0,"aria-level":p,"aria-labelledby":t.endIcon?`${n}-label ${n}-end`:`${n}-label`,"data-label":s(),"data-value":z(d),"data-type":z(f)}),void 0,void 0,void 0,`svelte-1pcxmh7`);var y=N(v);let b;var x=N(y),S=e=>{var n=lOe(),r=N(n),i=e=>{var n=H();Eo(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{{let t=A(()=>kc()?`chevron_left`:`chevron_right`);bx(e,{get name(){return z(t)}})}};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),D(n),U(e,n)},C=e=>{U(e,uOe())};G(x,e=>{t.items?e(S):e(C,-1)});var w=I(x,2);Eo(w,()=>t.startIcon??Er);var T=I(w,2),ee=N(T),E=e=>{var t=V();R(()=>W(t,s())),U(e,t)},te=e=>{var n=H();Eo(P(n),()=>t.children??Er),U(e,n)};G(ee,e=>{s()?e(E):e(te,-1)}),D(T);var ne=I(T,2),re=e=>{var r=dOe();Eo(N(r),()=>t.endIcon),D(r),R(()=>q(r,`id`,`${n}-end`)),U(e,r)};G(ne,e=>{t.endIcon&&e(re)}),D(y);var ie=I(y,2),ae=e=>{var n=fOe();Eo(N(n),()=>t.items),D(n),R(()=>q(n,`hidden`,!i())),U(e,n)};G(ie,e=>{t.items&&e(ae)}),D(v),Qo(v,()=>_),R(()=>{b=os(y,``,b,{"--sui-tree-item-level":p}),q(T,`id`,`${n}-label`)}),U(e,v),k()}var mH=`[role="treeitem"]`,hOe=class{#e=new lS;constructor(e,{clickToSelect:t=!0,selectionFollowsFocus:n,expandOnSelect:r=!0}={}){e.dispatchEvent(new CustomEvent(`Initializing`)),this.parent=e,this.id=Bx(`tree`),this.clickToSelect=t,this.expandOnSelect=r,this.selectionFollowsFocusOption=n,this.anchor=void 0,this.activated=!1,this.destroyed=!1,this._onClick=dS(this,e=>this.onClick(e)),this._onKeyDown=dS(this,e=>this.onKeyDown(e)),this._onFocusIn=dS(this,e=>this.onFocusIn(e)),this.observer=new globalThis.MutationObserver(()=>{this.update()}),this.parent.tabIndex=-1,e.addEventListener(`click`,this._onClick),e.addEventListener(`keydown`,this._onKeyDown),e.addEventListener(`focusin`,this._onFocusIn),fS(this,()=>this.destroyed)}activate(){if(this.activated)return;let{parent:e}=this;this.activated=!0,this.update(),this.observer.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`hidden`,`aria-hidden`,`aria-disabled`,`aria-expanded`]}),e.dispatchEvent(new CustomEvent(`Initialized`))}get multi(){return this.parent.getAttribute(`aria-multiselectable`)===`true`}get selectionFollowsFocus(){return this.selectionFollowsFocusOption??!this.multi}get isDisabled(){return this.parent.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.parent.matches(`[aria-readonly="true"]`)}get allItems(){return[...this.parent.querySelectorAll(mH)]}get visibleItems(){let e=[],t=n=>{[...n.children].forEach(n=>{if(n.getAttribute(`role`)!==`treeitem`){t(n);return}let r=n;if(r.matches(`[hidden], [aria-hidden="true"]`)||(e.push(r),this.isParent(r)&&!this.isExpanded(r)))return;let i=this.getGroup(r);i&&t(i)})};return t(this.parent),e}get activeItems(){return this.visibleItems.filter(e=>!e.matches(`[aria-disabled="true"]`))}get selectedItems(){return[...this.parent.querySelectorAll(`${mH}[aria-selected="true"]`)]}get currentItem(){return this.allItems.find(e=>e.tabIndex===0)}getGroup(e){return[...e.children].find(e=>e.getAttribute(`role`)===`group`)}getChildItems(e){let t=this.getGroup(e);return t?this.getItemsInGroup(t):[]}getItemsInGroup(e){let t=[],n=e=>{[...e.children].forEach(e=>{let r=e.getAttribute(`role`);r===`treeitem`?t.push(e):r!==`group`&&r!==`tree`&&n(e)})};return n(e),t}getParentItem(e){return e.parentElement?.closest(mH)??void 0}isParent(e){return e.hasAttribute(`aria-expanded`)}isExpanded(e){return e.getAttribute(`aria-expanded`)===`true`}getLabel(e){return e.dataset.label??e.querySelector(`.label`)?.textContent??``}update(){let{allItems:e,activeItems:t}=this;e.forEach((e,t)=>{e.id||=`${this.id}-item-${t+1}`,e.hasAttribute(`aria-selected`)||e.setAttribute(`aria-selected`,`false`)}),[this.parent,...this.parent.querySelectorAll(`[role="group"]`)].forEach(e=>{let t=this.getItemsInGroup(e);t.forEach((e,n)=>{e.setAttribute(`aria-posinset`,String(n+1)),e.setAttribute(`aria-setsize`,String(t.length))})});let n=t.find(e=>e===document.activeElement)??t.find(e=>e.tabIndex===0)??t.find(e=>e.getAttribute(`aria-selected`)===`true`)??t[0];this.setTabStop(n)}scrollIntoView(e){rS(e)}setTabStop(e){this.parent.querySelectorAll(`${mH}[tabindex]:not([tabindex="-1"])`).forEach(t=>{t!==e&&(t.tabIndex=-1)}),e&&(e.tabIndex=0)}focusItem(e,{select:t=this.selectionFollowsFocus}={}){this.setTabStop(e),e.focus(),e.dispatchEvent(new CustomEvent(`Focus`)),this.scrollIntoView(e),t&&this.selectItem(e)}setSelected(e,t){e.getAttribute(`aria-selected`)===`true`!==t&&(e.setAttribute(`aria-selected`,String(t)),e.dispatchEvent(new CustomEvent(`Change`,{detail:{selected:t}})),t&&e.dispatchEvent(new CustomEvent(`Select`)))}selectItem(e,{additive:t=!1,range:n=!1}={}){if(this.isDisabled||this.isReadOnly)return;let{multi:r,anchor:i}=this,a=r&&n&&i&&i!==e?this.visibleItems:[],o=a.indexOf(i);if(o!==-1){let t=[o,a.indexOf(e)].sort((e,t)=>e-t);a.forEach((e,n)=>{this.setSelected(e,n>=t[0]&&n<=t[1]&&!e.matches(`[aria-disabled="true"]`))})}else r&&t?(this.setSelected(e,e.getAttribute(`aria-selected`)!==`true`),this.anchor=e):(this.selectedItems.forEach(t=>{t!==e&&this.setSelected(t,!1)}),this.setSelected(e,!0),this.anchor=e);this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:aS(e)}))}selectAll(e){this.isDisabled||this.isReadOnly||!this.multi||(this.activeItems.forEach(e=>{this.setSelected(e,!0)}),this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:aS(e)})))}expandItem(e,t){if(this.isDisabled||!this.isParent(e)||this.isExpanded(e)===t)return;let n=this.getGroup(e);e.setAttribute(`aria-expanded`,String(t)),n&&(n.hidden=!t),e.dispatchEvent(new CustomEvent(`Expand`,{detail:{expanded:t}})),this.update()}expandSiblings(e){let t=this.getParentItem(e),n=t?this.getGroup(t):this.parent;n&&this.getItemsInGroup(n).forEach(e=>{this.expandItem(e,!0)})}typeAhead(e,t){let n=this.activeItems,r=uS(n.map(e=>sS(this.getLabel(e))),this.#e.push(e),n.indexOf(t));r!==-1&&n[r]!==t&&this.focusItem(n[r])}onFocusIn(e){let t=e.target.closest(mH);t&&!t.matches(`[aria-disabled="true"]`)&&this.setTabStop(t)}onClick(e){let t=e.target,n=t.closest(mH);if(!n||e.button!==0||this.isDisabled)return;if(n.matches(`[aria-disabled="true"]`)){e.preventDefault();return}let{ctrlKey:r,metaKey:i,shiftKey:a}=e;t.closest(`[data-action="toggle"]`)?(e.preventDefault(),this.focusItem(n,{select:!1}),this.expandItem(n,!this.isExpanded(n))):(this.focusItem(n,{select:!1}),this.clickToSelect&&this.selectItem(n,{additive:r||i,range:a}),this.expandOnSelect&&!r&&!i&&!a&&this.expandItem(n,!this.isExpanded(n)))}onKeyDown(e){let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e,{activeItems:o,multi:s}=this;if(this.isDisabled||a||!o.length)return;let c=e.target.closest(mH),l=(c&&o.includes(c)?c:void 0)??this.currentItem??o[0],u=o.indexOf(l),{prevKey:d,nextKey:f}=cS(`horizontal`,kc());if(t===`a`&&(n||r))s&&(e.preventDefault(),this.selectAll(l));else if(!(n||r)){if(t===`Enter`)e.preventDefault(),l.click();else if(t===` `)e.preventDefault(),s?this.selectItem(l,{additive:!i,range:i}):this.selectItem(l);else if(t===`ArrowDown`||t===`ArrowUp`){e.preventDefault();let n=o[t===`ArrowDown`?u+1:u-1];if(!n)return;s&&i?(this.focusItem(n,{select:!1}),this.selectItem(n,{additive:!0})):this.focusItem(n)}else if(t===f){if(e.preventDefault(),!this.isParent(l))return;if(!this.isExpanded(l)){this.expandItem(l,!0);return}let t=this.getChildItems(l).find(e=>o.includes(e));t&&this.focusItem(t)}else if(t===d){if(e.preventDefault(),this.isParent(l)&&this.isExpanded(l)){this.expandItem(l,!1);return}let t=this.getParentItem(l);t&&o.includes(t)&&this.focusItem(t)}else t===`Home`||t===`End`?(e.preventDefault(),this.focusItem(t===`Home`?o[0]:o[o.length-1])):t===`*`?(e.preventDefault(),this.expandSiblings(l)):t.length===1&&t.trim()&&this.typeAhead(t,l)}}destroy(){this.destroyed=!0,this.#e.reset(),this.observer.disconnect(),this.parent.removeEventListener(`click`,this._onClick),this.parent.removeEventListener(`keydown`,this._onKeyDown),this.parent.removeEventListener(`focusin`,this._onFocusIn)}},gOe=e=>t=>{let n=new hOe(t,e);return()=>{n.destroy()}},_Oe=new Set([`$$slots`,`$$events`,`$$legacy`,`element`,`class`,`hidden`,`disabled`,`readonly`,`multiple`,`clickToSelect`,`selectionFollowsFocus`,`expandOnSelect`,`ariaLabel`,`children`,`onChange`]),vOe=B(`
    `),yOe={hash:`svelte-pcj1df`,code:`[role=tree].svelte-pcj1df {display:flex;flex-direction:column;margin:var(--sui-focus-ring-width);border-width:var(--sui-tree-border-width, 1px);border-style:var(--sui-tree-border-style, solid);border-color:var(--sui-tree-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-tree-border-radius, 4px);padding:var(--sui-tree-padding, 4px);min-width:var(--sui-tree-min-width, calc(var(--sui-option-height) * 5));overflow:auto;color:var(--sui-tree-foreground-color, var(--sui-control-foreground-color));background-color:var(--sui-tree-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}.inner.svelte-pcj1df {display:contents;}`};function hH(e,t){O(t,!0),K(e,yOe);let n=J(t,`element`,15),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`readonly`,3,!1),o=J(t,`multiple`,3,!1),s=J(t,`clickToSelect`,3,!0),c=J(t,`selectionFollowsFocus`,3,void 0),l=J(t,`expandOnSelect`,3,!0),u=J(t,`ariaLabel`,3,void 0),d=Ss(t,_Oe);var f=vOe(),p=e=>{t.onChange?.(e)};gs(f,()=>({...d,role:`tree`,class:`sui tree ${t.class??``}`,hidden:r(),"aria-hidden":r(),"aria-disabled":i(),"aria-readonly":a()||void 0,"aria-multiselectable":o(),"aria-label":u(),onChange:p}),void 0,void 0,void 0,`svelte-pcj1df`);var m=N(f);Eo(N(m),()=>t.children??Er),D(m),D(f),bs(f,e=>n(e),()=>n()),Qo(f,()=>gOe({clickToSelect:s(),selectionFollowsFocus:c(),expandOnSelect:l()})),R(()=>m.inert=i()),U(e,f),k()}var bOe=[`text`,`search`,`url`,`tel`,`email`,`password`,`number`],xOe=e=>document.documentElement.matches(`[data-env="dev"]`)?!0:e instanceof Element?e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&bOe.includes(e.type)||e.closest(`[role="textbox"]`)?.contentEditable===`true`:!1,SOe={hash:`svelte-h4yylm`,code:` /* https://fontsource.org/fonts/source-sans-3/cdn */ @font-face {font-family:'Source Sans 3';font-style:normal;font-display:swap;font-weight:200 900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/source-sans-3:vf@5.3.1/latin-wght-normal.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;size-adjust:110%; } /* https://fontsource.org/fonts/noto-mono/cdn */ @font-face {font-family:'Noto Mono';font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/noto-mono@5.3.0/latin-400-normal.woff2) format('woff2'); } /* https://fontsource.org/fonts/material-symbols-outlined/cdn */ @font-face {font-family:'Material Symbols Outlined';font-style:normal;font-display:block;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/material-symbols-outlined:vf@5.3.9/latin-wght-normal.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; }.material-symbols-outlined { /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */font-family:'Material Symbols Outlined';font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;overflow-wrap:normal;direction:ltr;-moz-font-feature-settings:'liga';font-feature-settings:'liga';}`};function COe(e){K(e,SOe)}var wOe=new Set([`$$slots`,`$$events`,`$$legacy`,`orientation`,`children`]),TOe=B(` `,1),EOe=B(``),DOe=B(`
    `,1),OOe={hash:`svelte-455qcr`,code:`:root, :host {--sui-base-hue: 210;--sui-highlight-foreground-color: hsl(var(--sui-foreground-color-1-hsl));--sui-primary-foreground-color: hsl(var(--sui-foreground-color-2-hsl));--sui-secondary-foreground-color: hsl(var(--sui-foreground-color-3-hsl));--sui-tertiary-foreground-color: hsl(var(--sui-foreground-color-4-hsl));--sui-disabled-foreground-color: hsl(var(--sui-foreground-color-5-hsl));--sui-error-foreground-color: hsl( var(--sui-error-color-hue) var(--sui-alert-foreground-color-saturation) var(--sui-alert-foreground-color-lightness) );--sui-warning-foreground-color: hsl( var(--sui-warning-color-hue) var(--sui-alert-foreground-color-saturation) var(--sui-alert-foreground-color-lightness) );--sui-info-foreground-color: hsl( var(--sui-info-color-hue) var(--sui-alert-foreground-color-saturation) var(--sui-alert-foreground-color-lightness) );--sui-success-foreground-color: hsl( var(--sui-success-color-hue) var(--sui-alert-foreground-color-saturation) var(--sui-alert-foreground-color-lightness) );--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 35%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl) / 75%);--sui-active-background-color: hsl(var(--sui-background-color-5-hsl) / 100%);--sui-content-background-color: hsl(var(--sui-background-color-1-hsl));--sui-code-background-color: hsl(var(--sui-background-color-3-hsl));--sui-primary-background-color: hsl(var(--sui-background-color-2-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl) / 80%);--sui-secondary-background-color: hsl(var(--sui-background-color-3-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl) / 80%);--sui-tertiary-background-color: hsl(var(--sui-background-color-4-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl) / 80%);--sui-disabled-background-color: hsl(var(--sui-background-color-4-hsl));--sui-error-background-color: hsl( var(--sui-error-color-hue) var(--sui-alert-background-color-saturation) var(--sui-alert-background-color-lightness) );--sui-warning-background-color: hsl( var(--sui-warning-color-hue) var(--sui-alert-background-color-saturation) var(--sui-alert-background-color-lightness) );--sui-info-background-color: hsl( var(--sui-info-color-hue) var(--sui-alert-background-color-saturation) var(--sui-alert-background-color-lightness) );--sui-success-background-color: hsl( var(--sui-success-color-hue) var(--sui-alert-background-color-saturation) var(--sui-alert-background-color-lightness) );--sui-disabled-opacity: 0.35;--sui-modal-border-width: 0;--sui-focus-ring-width: 2px;--sui-focus-ring-color: var(--sui-primary-accent-color);--sui-focus-ring-offset: 1px;--sui-primary-border-color: hsl(var(--sui-border-color-2-hsl));--sui-secondary-border-color: hsl(var(--sui-border-color-3-hsl));--sui-error-border-color: hsl( var(--sui-error-color-hue) var(--sui-alert-border-color-saturation) var(--sui-error-border-color-lightness, var(--sui-alert-border-color-lightness)) );--sui-warning-border-color: hsl( var(--sui-warning-color-hue) var(--sui-alert-border-color-saturation) var(--sui-alert-border-color-lightness) );--sui-info-border-color: hsl( var(--sui-info-color-hue) var(--sui-alert-border-color-saturation) var(--sui-alert-border-color-lightness) );--sui-success-border-color: hsl( var(--sui-success-color-hue) var(--sui-alert-border-color-saturation) var(--sui-alert-border-color-lightness) );--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 40%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 40%);--sui-font-family-default: "Source Sans 3", system-ui, sans-serif;--sui-font-size-xxx-large: 25px;--sui-font-size-xx-large: 21px;--sui-font-size-x-large: 19px;--sui-font-size-large: 17px;--sui-font-size-default: 15px;--sui-font-size-small: 13px;--sui-font-size-x-small: 11px;--sui-font-weight-normal: 400;--sui-font-weight-bold: 700;--sui-font-family-monospace: "Noto Sans Mono", ui-monospace, monospace;--sui-font-size-monospace: 0.9em;--sui-line-height-default: 1.2;--sui-line-height-compact: 1.4;--sui-line-height-comfortable: 1.6;--sui-word-spacing-normal: 1px;--sui-heading-margin: 0;--sui-heading-font-family: var(--sui-font-family-default);--sui-heading-font-weight: var(--sui-font-weight-bold);--sui-heading-line-height: var(--sui-line-height-default);--sui-paragraph-margin: 1.75em;--sui-menuitem-font-size: 14px;--sui-control-small-border-width: 1px;--sui-control-small-border-radius: calc(var(--sui-control-small-height) / 8);--sui-control-small-padding: 0 calc((var(--sui-control-small-height) / 5));--sui-control-small-height: 24px;--sui-control-medium-border-width: 1px;--sui-control-medium-border-radius: calc(var(--sui-control-medium-height) / 8);--sui-control-medium-padding: 0 calc((var(--sui-control-medium-height) / 4));--sui-control-medium-height: 32px;--sui-control-large-border-width: 1px;--sui-control-large-border-radius: calc(var(--sui-control-large-height) / 8);--sui-control-large-padding: 0 calc((var(--sui-control-large-height) / 3));--sui-control-large-height: 40px;--sui-control-border-color: hsl(var(--sui-border-color-2-hsl));--sui-control-foreground-color: var(--sui-primary-foreground-color);--sui-control-background-color: hsl(var(--sui-background-color-4-hsl));--sui-control-font-family: var(--sui-font-family-default);--sui-control-font-size: var(--sui-font-size-default);--sui-control-line-height: var(--sui-line-height-compact);--sui-button-small-border-radius: var(--sui-control-small-border-radius);--sui-button-small-padding: var(--sui-control-small-padding);--sui-button-small-height: var(--sui-control-small-height);--sui-button-medium-border-radius: var(--sui-control-medium-border-radius);--sui-button-medium-padding: var(--sui-control-medium-padding);--sui-button-medium-height: var(--sui-control-medium-height);--sui-button-large-border-radius: var(--sui-control-large-border-radius);--sui-button-large-padding: var(--sui-control-large-padding);--sui-button-large-height: var(--sui-control-large-height);--sui-button-border-color: var(--sui-control-border-color);--sui-button-background-color: var(--sui-control-background-color);--sui-checkbox-border-radius: var(--sui-control-medium-border-radius);--sui-checkbox-height: 20px;--sui-checkbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-checkbox-background-color: var(--sui-control-background-color);--sui-readonly-accent-color: var(--sui-tertiary-foreground-color);--sui-readonly-accent-color-inverted: var(--sui-primary-background-color);--sui-option-border-radius: var(--sui-control-medium-border-radius);--sui-option-padding: calc((var(--sui-control-medium-height) / 6)) calc((var(--sui-control-medium-height) / 5));--sui-option-height: var(--sui-control-medium-height);--sui-listbox-border-radius: var(--sui-control-medium-border-radius);--sui-listbox-border-color: var(--sui-control-border-color);--sui-listbox-foreground-color: var(--sui-control-foreground-color);--sui-listbox-background-color: hsl(var(--sui-background-color-1-hsl));--sui-tree-border-radius: var(--sui-control-medium-border-radius);--sui-tree-border-color: var(--sui-control-border-color);--sui-tree-foreground-color: var(--sui-control-foreground-color);--sui-tree-background-color: hsl(var(--sui-background-color-1-hsl));--sui-tree-item-border-radius: var(--sui-control-medium-border-radius);--sui-tree-item-padding: var(--sui-option-padding);--sui-tree-item-height: var(--sui-control-medium-height);--sui-tree-item-indent: 16px;--sui-textbox-border-radius: var(--sui-control-medium-border-radius);--sui-textbox-height: var(--sui-control-medium-height);--sui-textbox-border-color: var(--sui-control-border-color);--sui-textbox-foreground-color: var(--sui-control-foreground-color);--sui-textbox-background-color: hsl(var(--sui-background-color-1-hsl));--sui-textbox-font-family: var(--sui-font-family-default);--sui-textbox-font-size: var(--sui-font-size-default);--sui-textbox-singleline-padding: 0 8px;--sui-textbox-singleline-min-width: 240px;--sui-textbox-singleline-line-height: var(--sui-line-height-compact);--sui-textbox-multiline-padding: 16px;--sui-textbox-multiline-min-width: 480px;--sui-textbox-multiline-line-height: var(--sui-line-height-comfortable);--sui-tab-height: var(--sui-control-medium-height);--sui-tab-small-height: var(--sui-control-small-height);--sui-tab-medium-height: var(--sui-control-medium-height);--sui-tab-large-height: var(--sui-control-large-height);--sui-primary-toolbar-size: 56px;--sui-secondary-toolbar-size: 48px;--sui-bottom-navigation-height: var(--sui-primary-toolbar-size);--sui-primary-row-height: 56px;--sui-secondary-row-height: 40px;} @media (pointer: coarse) {:root, :host {--sui-menuitem-height: 40px;--sui-control-small-height: 32px;--sui-control-medium-height: 40px;--sui-control-large-height: 48px;--sui-checkbox-height: 24px;--sui-secondary-row-height: 48px;} } @media (prefers-reduced-transparency) {:root, :host {--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));} }:root[data-theme=light], :host[data-theme=light] {color-scheme:light;--sui-foreground-color-1-hsl: var(--sui-base-hue) 5% 5%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 25%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 35%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 45%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 65%;--sui-background-color-1-hsl: var(--sui-base-hue) 5% 100%;--sui-background-color-2-hsl: var(--sui-base-hue) 5% 98%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 95%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 92%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 84%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 72%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 80%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 25%;--sui-alert-background-color-saturation: 65%;--sui-alert-background-color-lightness: 90%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 68%;--sui-error-border-color-lightness: 60%;}:root[data-theme=dark], :host[data-theme=dark] {color-scheme:dark;--sui-foreground-color-1-hsl: var(--sui-base-hue) 10% 95%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 65%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 55%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 35%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 8%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 10%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 13%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 16%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 26%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 24%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 20%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 60%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 100% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 100% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 100% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 75%;--sui-alert-background-color-saturation: 40%;--sui-alert-background-color-lightness: 10%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 38%;} @media (prefers-color-scheme: light) {:root:not([data-theme]), :host:not([data-theme]) {color-scheme:light;--sui-foreground-color-1-hsl: var(--sui-base-hue) 5% 5%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 25%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 35%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 45%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 65%;--sui-background-color-1-hsl: var(--sui-base-hue) 5% 100%;--sui-background-color-2-hsl: var(--sui-base-hue) 5% 98%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 95%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 92%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 84%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 72%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 80%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 25%;--sui-alert-background-color-saturation: 65%;--sui-alert-background-color-lightness: 90%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 68%;--sui-error-border-color-lightness: 60%;} } @media (prefers-color-scheme: dark) {:root:not([data-theme]), :host:not([data-theme]) {color-scheme:dark;--sui-foreground-color-1-hsl: var(--sui-base-hue) 10% 95%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 65%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 55%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 35%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 8%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 10%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 13%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 16%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 26%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 24%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 20%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 60%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 100% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 100% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 100% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 75%;--sui-alert-background-color-saturation: 40%;--sui-alert-background-color-lightness: 10%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 38%;} }:root[data-contrast=more][data-theme=light], :host[data-contrast=more][data-theme=light] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}:root[data-contrast=more][data-theme=dark], :host[data-contrast=more][data-theme=dark] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;} @media (prefers-color-scheme: light) {:root[data-contrast=more]:not([data-theme]), :host[data-contrast=more]:not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;} } @media (prefers-color-scheme: dark) {:root[data-contrast=more]:not([data-theme]), :host[data-contrast=more]:not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;} } @media (prefers-contrast: more) {:root:not([data-contrast])[data-theme=light], :host:not([data-contrast])[data-theme=light] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}:root:not([data-contrast])[data-theme=dark], :host:not([data-contrast])[data-theme=dark] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;} } @media (prefers-contrast: more) and (prefers-color-scheme: light) {:root:not([data-contrast]):not([data-theme]), :host:not([data-contrast]):not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;} } @media (prefers-contrast: more) and (prefers-color-scheme: dark) {:root:not([data-contrast]):not([data-theme]), :host:not([data-contrast]):not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;} }.material-symbols-outlined {font-variation-settings:"FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;}*, ::before, ::after {overflow-anchor:none;scroll-behavior:smooth;box-sizing:border-box;outline-offset:0px;outline-width:var(--sui-focus-ring-width) !important;outline-style:solid;outline-color:transparent;border-width:0;border-style:solid;vertical-align:top;font-size-adjust:inherit;} @media (prefers-reduced-motion) {*, ::before, ::after {scroll-behavior:auto;transition-duration:1ms !important;} }::selection {background-color:var(--sui-primary-accent-color-translucent-light);}* {-webkit-tap-highlight-color:transparent;}:focus {z-index:1;outline-width:0;}:focus-visible {outline-color:var(--sui-focus-ring-color);outline-offset:var(--sui-focus-ring-offset, 0);z-index:2;}h1 {margin:var(--sui-h1-margin, var(--sui-heading-margin));font-size:var(--sui-h1-font-size, 34px);font-family:var(--sui-h1-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h1-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h1-line-height, var(--sui-heading-line-height));}h2 {margin:var(--sui-h2-margin, var(--sui-heading-margin));font-size:var(--sui-h2-font-size, 30px);font-family:var(--sui-h2-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h2-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h2-line-height, var(--sui-heading-line-height));}h3 {margin:var(--sui-h3-margin, var(--sui-heading-margin));font-size:var(--sui-h3-font-size, 26px);font-family:var(--sui-h3-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h3-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h3-line-height, var(--sui-heading-line-height));}h4 {margin:var(--sui-h4-margin, var(--sui-heading-margin));font-size:var(--sui-h4-font-size, 22px);font-family:var(--sui-h4-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h4-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h4-line-height, var(--sui-heading-line-height));}h5 {margin:var(--sui-h5-margin, var(--sui-heading-margin));font-size:var(--sui-h5-font-size, 18px);font-family:var(--sui-h5-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h5-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h5-line-height, var(--sui-heading-line-height));}h6 {margin:var(--sui-h6-margin, var(--sui-heading-margin));font-size:var(--sui-h6-font-size, 14px);font-family:var(--sui-h6-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h6-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h6-line-height, var(--sui-heading-line-height));}strong {font-weight:var(--sui-font-weight-bold, bold);}a {color:var(--sui-primary-accent-color-text);text-decoration:none;text-underline-offset:2px;}a:is(:hover, :focus, :active) {text-decoration:underline;}:is(:root, :host)[data-underline-links="true"] a {text-decoration:underline;}:is(p, ul, ol, dl) {margin:var(--sui-paragraph-margin) 0;line-height:var(--sui-line-height-comfortable);}:is(ul, ol) {padding-inline:2em;}:is(code, pre) {border-radius:4px;background-color:var(--sui-code-background-color);font-family:var(--sui-font-family-monospace);font-size:var(--sui-font-size-monospace);vertical-align:-0.05em;}pre {padding:8px;line-height:var(--sui-line-height-compact);-webkit-user-select:text;user-select:text;}code {padding:2px 4px;}table {border-collapse:collapse;}:is(th, td) {border:1px solid var(--sui-textbox-border-color);padding:8px;}blockquote {margin-inline:16px 0;border-inline-start:4px solid var(--sui-textbox-border-color);padding-inline-start:12px;}:is(.disabled, [aria-disabled=true], [inert]):not(body) {cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none;filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}:is(.disabled, [aria-disabled=true], [inert]):not(body) * {filter:grayscale(0) opacity(1);}:is(.disabled, [aria-disabled=true], [inert]) * {cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none;}:is(.readonly, [aria-readonly=true]):not(body) {cursor:default;}:is(.readonly, [aria-readonly=true]):not(body) * {cursor:default;}.font-loader.svelte-455qcr {position:absolute;inset-inline-start:-99999px;font-family:var(--sui-font-family-default);}.app-shell.svelte-455qcr {position:fixed;inset:0;overflow:hidden;width:100%;height:100%;color:var(--sui-primary-foreground-color);background-color:var(--sui-primary-background-color);font-family:var(--sui-font-family-default);font-size:var(--sui-font-size-default);font-weight:var(--sui-font-weight-normal, normal);word-spacing:var(--sui-word-spacing-normal);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;user-select:none;touch-action:none;cursor:default;}.app-shell.horizontal.svelte-455qcr {display:flex;flex-direction:row;overflow:hidden;}.app-shell.vertical.svelte-455qcr {display:flex;flex-direction:column;overflow:hidden;}`};function kOe(e,t){O(t,!0),K(e,OOe);let n=J(t,`orientation`,3,`horizontal`),r=Ss(t,wOe),i=j(!1);Do(()=>{let e=globalThis.matchMedia(`(prefers-color-scheme: dark)`),{dataset:t}=document.documentElement,n=()=>{t.autoTheming!==`false`&&(t.theme=e.matches?`dark`:`light`)};n(),e.addEventListener(`change`,n);let r=globalThis.setTimeout(()=>{M(i,!0)},1e3);return()=>{e.removeEventListener(`change`,n),globalThis.clearTimeout(r)}});var a=DOe();Zo(`455qcr`,e=>{var t=TOe(),n=P(t);COe(I(n,4),{}),R(e=>q(n,`content`,e),[()=>`width=device-width, initial-scale=1, maximum-scale=1, interactive-widget=resizes-content`]),U(e,t)});var o=P(a),s=e=>{var t=EOe();os(t,``,{},{opacity:`0`}),U(e,t)};G(o,e=>{z(i)||e(s)});var c=I(o,2),l=e=>e.preventDefault(),u=e=>e.preventDefault(),d=e=>{xOe(e.target)||e.preventDefault()};gs(c,()=>({...r,role:`none`,class:[`sui`,`app-shell`,n()],ondragover:l,ondrop:u,oncontextmenu:d}),void 0,void 0,void 0,`svelte-455qcr`),Eo(N(c),()=>t.children??Er),D(c),U(e,a),k()}var AOe=B(`
    `),jOe={hash:`svelte-csncls`,code:`.empty-state.svelte-csncls {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:16px;width:100%;height:100%;text-align:center;}`};function gH(e,t){K(e,jOe);let n=J(t,`children`,3,void 0);var r=AOe();Eo(N(r),()=>n()??Er),D(r),U(e,r)}var MOe=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`ariaLabel`,`children`]),NOe=B(`
    `),POe={hash:`svelte-1kki94y`,code:`.inner.svelte-1kki94y {display:contents;}`};function _H(e,t){K(e,POe);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`ariaLabel`,3,void 0),a=Ss(t,MOe);var o=NOe();gs(o,()=>({...a,role:`group`,class:`sui group ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-label":i()}),void 0,void 0,void 0,`svelte-1kki94y`);var s=N(o);Eo(N(s),()=>t.children??Er),D(s),D(o),R(()=>s.inert=r()),U(e,o)}var FOe=B(`
    `),IOe={hash:`svelte-gsis8`,code:`.placeholder.svelte-gsis8 {height:64px;}`};function vH(e,t){O(t,!0),K(e,IOe);let n=J(t,`eager`,3,!1),r=j(null),i=j(ea(n()));L(()=>(z(r)&&(async()=>{await Gx(z(r)),M(i,!0)})(),()=>{z(r)&&Vx(z(r))}));var a=H(),o=P(a),s=e=>{var n=H();Eo(P(n),()=>t.children),U(e,n)},c=e=>{var t=FOe();bs(t,e=>M(r,e),()=>z(r)),U(e,t)};G(o,e=>{z(i)?e(s):e(c,-1)}),U(e,a),k()}var LOe={ok:`OK`,cancel:`Cancel`,close:`Close`,clear:`Clear`,insert:`Insert`,update:`Update`,remove:`Remove`,collapse:`Collapse`,expand:`Expand`,dismiss:`Dismiss`,alert:{error:`Error`,warning:`Warning`,info:`Information`,success:`Success`},role_descriptions:{disclosure:`disclosure`,option_group:`option group`,menu_item_group:`menu item group`,checkbox_group:`checkbox group`,table_head:`table head`,table_body:`table body`,table_foot:`table foot`,grid_head:`grid head`,grid_body:`grid body`,grid_foot:`grid foot`},emoji_suggestions:`Emoji Suggestions`,calendar:{year:`Year`,previous_decade:`Previous Decade`,next_decade:`Next Decade`,month:`Month`,previous_month:`Previous Month`,next_month:`Next Month`,today:`Today`},split_button:{x_options:`{$name} Options`,more_options:`More Options`},combobox:{select_an_option:`Select an option…`,filter_options:`Filter Options`,no_matching_options:`No matching options found`},number_input:{increase:`Increase`,decrease:`Decrease`,range:`From {$min} to {$max}`,min:`Minimum {$min}`,max:`Maximum {$max}`},password_input:{show_password:`Show Password`,hide_password:`Hide Password`},secret_input:{show_secret:`Show Secret`,hide_secret:`Hide Secret`},select_tags:{selected_options:`Selected Options`,remove_x:`Remove {$name}`},text_editor:{text_editor:`Text Editor`,code_editor:`Code Editor`,text_style_options:`Text Style Options`,show_text_style_options:`Show Text Style Options`,paragraph:`Paragraph`,heading_1:`Heading 1`,heading_2:`Heading 2`,heading_3:`Heading 3`,heading_4:`Heading 4`,heading_5:`Heading 5`,heading_6:`Heading 6`,bulleted_list:`Bulleted List`,numbered_list:`Numbered List`,blockquote:`Block Quote`,code_block:`Code Block`,bold:`Bold`,italic:`Italic`,strikethrough:`Strikethrough`,code:`Code`,link:`Link`,insert_link:`Insert Link`,edit_link:`Edit Link`,remove_link:`Remove Link`,text:`Text`,url:`URL`,open_in_new_tab:`Open in New Tab`,insert_table:`Insert Table`,rows:`Rows`,columns:`Columns`,table_options:`Table Options`,show_table_options:`Show Table Options`,insert_row_above:`Insert Row Above`,insert_row_below:`Insert Row Below`,insert_column_left:`Insert Column Left`,insert_column_right:`Insert Column Right`,delete_row:`Delete Row`,delete_column:`Delete Column`,delete_table:`Delete Table`,insert_horizontal_rule:`Insert Horizontal Rule`,alignment_options:`Alignment Options`,show_alignment_options:`Show Alignment Options`,align_left:`Left Align`,align_center:`Center Align`,align_right:`Right Align`,align_justify:`Justify Align`,edit_in_markdown:`Edit in Markdown`,edit_in_html:`Edit in HTML`,converter_error:`Unable to enable rich text mode. Please use the plain text editor instead.`,language:`Language`,plain_text:`Plain Text`}};function ROe(e,t){O(t,!0);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1);var o=()=>n()??!1,s=e=>{n(e)};uC(e,{get checked(){return o()},set checked(e){s(e)},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`}}),k()}var zOe=B(`

    `);function BOe(e,t){O(t,!0);let n=J(t,`currentValue`,3,!1);var r=H(),i=P(r),a=e=>{var t=zOe(),r=F(t,!0);R(e=>W(r,e),[()=>Y(`boolean.${n()}`)]),U(e,t)};G(i,e=>{typeof n()==`boolean`&&e(a)}),U(e,r),k()}var yH=(e,t)=>e?.widget===`relation`&&e.collection===t,bH=(e,t)=>e.pendingEntries.filter(e=>e.collectionName===t),xH=(e,t)=>bH(e,t).filter(({baseEntry:e})=>!e),VOe=({collectionName:e,fileName:t,isIndexFile:n,currentValues:r,extraValues:i})=>[...Object.values(r).map(r=>({valueMap:r,fieldArgs:{collectionName:e,fileName:t,isIndexFile:n}})),...Object.values(i).map(e=>({valueMap:e}))],HOe=({collectionName:e,entry:t})=>Object.values(t.locales).flatMap(({content:t})=>t?[{valueMap:t,fieldArgs:{collectionName:e}}]:[]),UOe=(e,{collectionName:t,values:n})=>e.some(({valueMap:e,fieldArgs:r})=>Object.entries(e).some(([i,a])=>{if(!n.includes(a))return!1;if(!r)return!0;let o=ph({...r,valueMap:e,keyPath:i});return!o||yH(o,t)})),SH=e=>{let t=VOe(e),n=new Set,r=()=>{let r=e.pendingEntries.filter(e=>!n.has(e)&&UOe(t,e));return r.forEach(e=>{n.add(e),t.push(...HOe(e))}),r.length>0};for(;r(););return n},CH=e=>e.pendingEntries?.some(({baseEntry:e})=>!!e)?[...SH(e)].filter(({baseEntry:e})=>!!e):[],WOe=e=>{let t=SH(e);return e.pendingEntries.filter(e=>t.has(e)).map(e=>il(e))},wH=e=>{let{output_code_only:t=!1,keys:n={code:`code`,lang:`lang`}}=e;return t?void 0:n},TH=(e,t)=>{let n=wH(e);return!!n&&[n.code,n.lang].includes(t)},EH=(e,t)=>nf(e,(e,n)=>String(t(n)??``)),DH=(e,t)=>e.map(e=>{let{defaultValue:n,truthyValue:r,falsyValue:i}=e.args,a={...e.args},o=!1;if(n!==void 0){let e=EH(n,t);e!==n&&(a.defaultValue=e,o=!0)}if(r!==void 0){let e=EH(r,t);e!==r&&(a.truthyValue=e,o=!0)}if(i!==void 0){let e=EH(i,t);e!==i&&(a.falsyValue=e,o=!0)}let{customArgs:s}=e,c;return s?.some(e=>typeof e==`string`&&e.includes(`{{`))&&(c=s.map(e=>typeof e==`string`?EH(e,t):e)),!o&&!c?e:{...e,args:a,...c?{customArgs:c}:{}}}),GOe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(n,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new ee(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var ee=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e){(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(n,(function(){"use strict";var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),qOe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localizedFormat=r()})(n,(function(){"use strict";var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`};return function(t,n,r){var i=n.prototype,a=i.format;r.en.formats=e,i.format=function(t){t===void 0&&(t=`YYYY-MM-DDTHH:mm:ssZ`);var n=this.$locale().formats,r=function(t,n){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,i){var a=i&&i.toUpperCase();return r||n[i]||e[i]||n[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))}(t,n===void 0?{}:n);return a.call(this,r)}}}))})),JOe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(n,(function(){"use strict";var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),OH=u(GOe(),1),kH=u(KOe(),1),AH=u(qOe(),1),jH=u(JOe(),1),MH=RegExp(`[\\p{Z}[\\p{C}--[\\u200C\\u200D]]!"#$%\\x26'\\(\\)*+,\\/:;<=>?@\\[\\\\\\]^\`\\{\\|\\}]`,`v`),NH=/[^\w-~]/,PH=({loader:e,notLoadedMessage:t})=>{let n,r,i=al(!1),a=async()=>(r??=(async()=>{let t;try{t=await e()}catch(e){throw r=void 0,e}return n=t,i.current=!0,t})(),r);return{loaded:i,load:a,preload:()=>{a().catch(()=>{})},get:()=>{if(!n)throw Error(t);return n},reset:()=>{n=void 0,r=void 0,i.current=!1}}},YOe=/\p{M}/gu,FH=PH({loader:async()=>(await Qc(`@sindresorhus/transliterate`,`index.js`)).default,notLoadedMessage:`The transliterate library is not loaded yet.`}),XOe=async()=>{try{await FH.load()}catch(e){console.error(`Failed to load the transliterate library`,e)}},ZOe=(e,t)=>{let n=e.normalize(`NFD`);return FH.loaded.current?FH.get()(n,{locale:t?.replaceAll(`_`,`-`)}):n.replaceAll(YOe,``)};FH.reset;var QOe=/^\.+/,$Oe=/\.+$/,eke={unicode:new RegExp(MH,`gv`),ascii:new RegExp(NH,`g`)},tke=new Map,IH=e=>{let t=zc(e);return Ll(tke,t,()=>({consecutivePattern:RegExp(`(?:${t})+`,`g`),trimPattern:RegExp(`^(?:${t})+|(?:${t})+$`,`g`),leadingDotsPattern:RegExp(`^(?:\\.|${t})+`),trailingDotsPattern:RegExp(`(?:\\.|${t})+$`)}))},LH=({sanitize_replacement:e=`-`,trim:t=!0}={})=>e&&t?IH(e).trailingDotsPattern:$Oe,RH=e=>e.replace(LH(jl.current?.slug),``),zH=()=>jl.current?.slug?.timezone===`local`?void 0:`UTC`,BH=(e,{fallback:t=!0,locale:n=void 0,maxLength:r=void 0}={})=>{let{slug:{encoding:i=`unicode`,clean_accents:a=!1,sanitize_replacement:o=`-`,maxlength:s=void 0,trim:c=!0,lowercase:l=!0}={}}=jl.current??{},u=r??s,d=e;a&&(d=ZOe(d,n)),d=d.replaceAll(eke[i===`ascii`?`ascii`:`unicode`],` `),d=d.trim().replaceAll(/\s+/g,o);let f=QOe;if(o){let e=IH(o);d=d.replace(e.consecutivePattern,o),c&&(d=d.replace(e.trimPattern,``),{leadingDotsPattern:f}=e)}let p=LH({sanitize_replacement:o,trim:c});return d=d.replace(f,``),d=d.replace(p,``),!d&&t&&(d=Fc(`short`)),typeof u==`number`&&d.length>u&&(d=Bc(d,u,{ellipsis:``}),d=d.replace(p,``)),l&&(d=d.toLowerCase()),d},VH=e=>BH(e.trim(),{fallback:!1}),HH=({takenNames:e,name:t,format:n=VH,isReserved:r=void 0})=>{let i=t.trim();if(!i)return`empty`;let a=n(i);if(!a||i.includes(`/`)||i.startsWith(`.`)||a.startsWith(`.`))return`invalid`;if(r?.(a))return`reserved`;let o=a.normalize().toLowerCase();return e.some(e=>e.normalize().toLowerCase()===o)?`duplicate`:void 0},nke=new Set([`local`,`utc`]),UH=new WeakMap,WH=e=>typeof e==`string`&&!nke.has(e),GH=e=>{let t=UH.get(e);if(t)return t;let{type:n=`datetime-local`,min:r=void 0,max:i=void 0,step:a=void 0,format:o,date_format:s=void 0,time_format:c=void 0,picker_utc:l=!1,input_timezone:u=`local`,output_utc:d=!1}=e,f=typeof u==`string`&&u!==`any`?u:`local`,p=typeof s==`string`?s:``,m=typeof c==`string`?c:``,h=n===`date`||c===!1,g=n===`time`||s===!1,_=h?`9999-12-31`:g?void 0:`9999-12-31T23:59`,v=e.input_timezone===void 0?l?`utc`:`local`:f,y={type:h?`date`:g?`time`:`datetime-local`,min:typeof r==`string`&&r?r:void 0,max:typeof i==`string`&&i?i:_,step:typeof a==`number`&&Number.isInteger(a)&&a>0||a===`any`?a:void 0,format:o||[p,m].join(` `).trim()||void 0,dateOnly:h,timeOnly:g,inputTimeZone:v,outputUTC:e.output_utc===void 0?l:d,utc:v===`utc`,singleCustomTimeZone:WH(v)?v:void 0};return UH.set(e,y),y},rke=async e=>(await Qc(`dayjs`,`esm/locale/${e}.js`)).default,ike=new Set(`af,am,ar-iq,ar-dz,ar-kw,ar-ly,ar-ma,ar-sa,ar-tn,ar,az,be,bg,bi,bm,bn-bd,bn,bo,br,bs,ca,cs,cv,cy,da,de-at,de-ch,de,dv,en-au,el,en-gb,en-ie,en-il,en-in,en-nz,en-sg,en-tt,en-ca,en,eo,es-mx,es-pr,es-us,es-do,et,eu,fa,fi,fr-ca,fr-ch,fr,fo,fy,ga,gd,gl,gom-latn,gu,he,hi,hr,ht,hu,hy-am,id,is,it-ch,it,jv,ka,kk,km,ko,ku,ky,kn,lb,ja,lt,lv,me,mi,mk,ml,mn,mr,ms-my,ms,mt,lo,my,nb,ne,nl,nl-be,nn,pa-in,pl,pt-br,pt,rn,ro,es,ru,rw,sd,se,si,sk,sl,oc-lnc,sq,sr-cyrl,sr,ss,sv-fi,sv,sw,ta,te,tet,tg,th,tl-ph,tlh,tr,tzl,tzm,ug-cn,uk,tk,ur,uz-latn,uz,vi,x-pseudo,tzm-latn,yo,zh-cn,zh-hk,zh-tw,zh`.split(`,`)),KH=new Set([`en`]),qH=new Map,ake=new Map,oke=e=>{let t;try{t=new Intl.Locale(e)}catch{return}let{language:n,script:r,region:i}=t,a=[e.toLowerCase()];return r&&i&&a.push(`${n}-${r}-${i}`),r&&a.push(`${n}-${r}`),i&&a.push(`${n}-${i}`),r&&!i&&a.push(`${n}-${t.maximize().region}`),a.push(n),a.map(e=>e.toLowerCase()).find(e=>ike.has(e))},JH=e=>Ll(ake,e,()=>oke(e)),ske=e=>{if(KH.has(e))return Promise.resolve();let t=qH.get(e);return t||(t=(async()=>{try{OH.default.locale(await rke(e),void 0,!0),KH.add(e)}catch(t){console.error(`Failed to load the Day.js locale “${e}”`,t)}finally{qH.delete(e)}})(),qH.set(e,t)),t},cke=async e=>{let t=new Set([...e].map(JH).filter(e=>e!==void 0));await Promise.all([...t].map(ske))},YH=(e,t)=>{let{localize_format:n}=e,r=typeof n==`string`?n:n===!0&&t&&t!==`_default`?t:void 0;if(!r)return;let i=JH(r);return i&&i!==`en`&&KH.has(i)?i:void 0},lke=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_advancedFormat=r()})(n,(function(){"use strict";return function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var i=this.$utils(),a=(e||`YYYY-MM-DDTHH:mm:ssZ`).replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case`Q`:return Math.ceil((t.$M+1)/3);case`Do`:return n.ordinal(t.$D);case`gggg`:return t.weekYear();case`GGGG`:return t.isoWeekYear();case`wo`:return n.ordinal(t.week(),`W`);case`w`:case`ww`:return i.s(t.week(),e===`w`?1:2,`0`);case`W`:case`WW`:return i.s(t.isoWeek(),e===`W`?1:2,`0`);case`k`:case`kk`:return i.s(String(t.$H===0?24:t.$H),e===`k`?1:2,`0`);case`X`:return Math.floor(t.$d.getTime()/1e3);case`x`:return t.$d.getTime();case`z`:return`[`+t.offsetName()+`]`;case`zzz`:return`[`+t.offsetName(`long`)+`]`;default:return e}}));return r.bind(this)(a)}}}))})),uke=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_timezone=r()})(n,(function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,i){var a,o=function(e,n,r){r===void 0&&(r={});var i=new Date(e);return function(e,n){n===void 0&&(n={});var r=n.timeZoneName||`short`,i=e+`|`+r,a=t[i];return a||(a=new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:r}),t[i]=a),a}(n,r).formatToParts(i)},s=function(t,n){for(var r=o(t,n),a=[],s=0;s=0&&(a[d]=parseInt(u,10))}var f=a[3],p=f===24?0:f,m=a[0]+`-`+a[1]+`-`+a[2]+` `+p+`:`+a[4]+`:`+a[5]+`:000`,h=+t;return(i.utc(m).valueOf()-(h-=h%1e3))/6e4},c=r.prototype;c.tz=function(e,t){if(e===void 0&&(e=a),!this.isValid())return this;var n,r=this.utcOffset(),o=this.toDate(),c=o.toLocaleString(`en-US`,{timeZone:e}),l=s(+o,e);if(!Number(l))n=this.utcOffset(0,t);else if(n=i(c,{locale:this.$L}).$set(`millisecond`,this.$ms).utcOffset(l,!0),t){var u=n.utcOffset();n=n.add(r-u,`minute`)}return n.$x.$timezone=e,n},c.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),n=o(this.valueOf(),t,{timeZoneName:e}).find((function(e){return e.type.toLowerCase()===`timezonename`}));return n&&n.value};var l=c.startOf;c.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return l.call(this,e,t);var n=i(this.format(`YYYY-MM-DD HH:mm:ss:SSS`),{locale:this.$L});return l.call(n,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,n){var r=n&&t,o=n||t||a,c=s(+i(),o);if(typeof e!=`string`)return i(e).tz(o);var l=i.utc(e,r).valueOf();if(Number.isNaN(l)){var u=i(NaN);return u.$x.$timezone=o,u}var d=function(e,t,n){var r=e-60*t*1e3,i=s(r,n);if(t===i)return[r,t];var a=s(r-=60*(i-t)*1e3,n);return i===a?[r,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}(l,c,o),f=d[0],p=d[1],m=i(f).utcOffset(p);return m.$x.$timezone=o,m},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){a=e}}}))})),XH=u(lke(),1),ZH=u(uke(),1);OH.default.extend(XH.default),OH.default.extend(kH.default),OH.default.extend(AH.default),OH.default.extend(jH.default),OH.default.extend(ZH.default);var QH=e=>e instanceof Date&&!Number.isNaN(e.getTime()),$H=e=>e?OH.default.utc:OH.default,eU=/\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)$/i,dke=/[XxZ]/,fke=/[AaHhkmSsXx]|LT|LLL|lll/,tU=e=>e.replaceAll(/\[.*?]/g,``),nU=e=>dke.test(tU(e)),rU=(e,t)=>eU.test(e)&&fke.test(tU(t))&&!nU(t),iU=(e,t,n,r)=>e(t,n,r,rU(t,n)),aU=({value:e,format:t,parseAsUTC:n,localeKey:r})=>{let i=$H(n),a=iU(i,e,t,r);return a.isValid()?a:i(e)},oU=(e,t,n)=>(n?e.locale(n):e).format(t),sU=(e,t)=>t===`UTC`?e.toDate():OH.default.tz(e.format(`YYYY-MM-DDTHH:mm:ss.SSS`),t).toDate(),cU=(e,t)=>{if(!t||eU.test(e))return new Date(e);let n=OH.default.utc(e);return n.isValid()?sU(n,t):void 0},lU=e=>{let{format:t,dateOnly:n,utc:r,outputUTC:i,singleCustomTimeZone:a}=GH(e);return r||t&&i?`UTC`:n?void 0:a},uU=(e,t,n)=>{let{format:r,timeOnly:i}=GH(t);if(!e)return;let a=lU(t),o;if(r){let i=YH(t,n);if(a===`UTC`||!a){let t=aU({value:e,format:r,parseAsUTC:a===`UTC`,localeKey:i});o=t.isValid()?t.toDate():void 0}else{let t=iU($H(!0),e,r,i);o=t.isValid()?nU(r)?t.toDate():sU(t,a):cU(e,a)}}else o=cU(i?`${new Date().toJSON().split(`T`)[0]}T${e}`:e,a);if(QH(o))return o;console.error(`Invalid Date`,e)},pke=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),dU={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function fU(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function mke(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function hke(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function pU(e){return hke(e)||fU(e)}var mU=document.createElement(`i`);function hU(e){let t=`&`+e+`;`;mU.innerHTML=t;let n=mU.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}var gke=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function gU(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?pU:u===`decimal`?fU:mke;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&pke.includes(y)&&(_=y,v=hU(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&hU(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):pU(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(_ke(e))h(7,S),C=`�`;else if(e in dU)h(6,S),C=dU[e];else{let t=``;vke(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,gke[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function _ke(e){return e>=55296&&e<=57343||e>1114111}function vke(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var yke=e=>{let t=e,n=!0;for(;n;){let e=t;t=t.replaceAll(/([_*`~])([^_*`~]+)\1/g,`$2`),t=t.replaceAll(/([_*`~]{2,3})(.+?)\1/g,`$2`),n=t!==e}return t},bke=new lr,xke=RegExp(`<(?:br|hr)\\b[^>]*>|`,`gi`),Ske=new Map,_U=e=>Vl(Ske,e,()=>gU(ft(bke.parse(e).replaceAll(xke,`$& `),{ALLOWED_TAGS:[]})).replaceAll(/\s+/g,` `).trim(),100);OH.default.extend(kH.default),OH.default.extend(AH.default),OH.default.extend(jH.default);var Cke=/^\d{4}-[01]\d-[0-3]\d$/,wke=/T\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?Z$/,vU=Object.freeze([`date`,`default`,`localize`,`lower`,`plainify`,`slugify`,`ternary`,`truncate`,`upper`]),yU=/^[A-Za-z_]\w*$/,Tke=RegExp(`^(?${yU.source.slice(1,-1)})(?:\\((?.*)\\))?$`,`s`),Eke=/\s*(?:'(?.*?)'|(?-?\d+(?:\.\d+)?))\s*(?,|$)/sy,Dke=Object.entries({date:/^date\('(?.+?)'(?:,\s*'(?.+?)')?\)$/,default:/^default\('(?.*?)'\)$/,ternary:/^ternary\('(?.*?)',\s*'(?.*?)'\)$/,truncate:/^truncate\((?\d+)(?:,\s*'(?.*?)')?\)$/}),Oke=e=>{let t=[];if(!e.trim())return t;let n=new RegExp(Eke),r;do{let i=n.exec(e)?.groups;if(!i)return;t.push(i.string??Number(i.number)),{separator:r}=i}while(r);return t},kke=e=>{for(let[t,n]of Dke){let r=Object.entries(e.match(n)?.groups??{});if(r.length)return{method:t,args:Object.fromEntries(r.filter(([,e])=>e!==void 0))}}let{method:t,args:n}=e.match(Tke)?.groups??{};if(t&&!vU.includes(t)){if(n===void 0)return{method:t,args:{}};let e=Oke(n);if(e)return{method:t,args:{},customArgs:e}}return{method:e,args:{}}},bU=e=>{let t=[],n=``,r=!1;for(let i=0;iVl(Ake,e,()=>{let[t,...n]=bU(e.trim());return Object.freeze({value:t,transformations:Object.freeze(n.map(e=>{let{method:t,args:n,customArgs:r}=kke(e);return Object.freeze({method:t,args:Object.freeze(n),...r?{customArgs:Object.freeze(r)}:{}})}))})},500),jke=e=>String(e??``).toUpperCase(),Mke=e=>String(e??``).toLowerCase(),Nke=(e,{format:t,timeZone:n},r,i)=>{let a=String(e),{format:o,dateOnly:s,utc:c}=GH(r),l=o?YH(r,i):void 0,u=n===`utc`||c||s&&!!a.match(Cke)||s&&!!a.match(wke),d=o&&!(e instanceof Date)?aU({value:a,format:o,parseAsUTC:u,localeKey:l}):$H(u)(a);return d.isValid()?oU(d,t,l):``},Pke=(e,{defaultValue:t})=>e?String(e):t,Fke=(e,{truthyValue:t,falsyValue:n})=>e?t:n,Ike=(e,{max:t,ellipsis:n=`…`})=>Bc(String(e??``),Number(t),{ellipsis:n}),Lke=e=>_U(String(e??``)),Rke=new WeakMap,zke=({method:e,transform:t,value:n,customArgs:r,locale:i})=>{try{let e=t(n,{args:[...r??[]],locale:i===`_default`?void 0:i});if(typeof e?.then==`function`)throw e.then(void 0,()=>void 0),TypeError(`The function must return a string, not a Promise`);return String(e??``)}catch(r){let i=Ll(Rke,t,()=>new Set);return i.has(e)||(i.add(e),console.error(`The custom “${e}” string transformation failed. Further errors are not logged:`,r)),String(n??``)}},Bke=({fieldConfig:e,value:t,transformation:n,locale:r})=>{let{method:i,args:a,customArgs:o}=n;switch(i){case`upper`:return jke(t);case`lower`:return Mke(t);case`plainify`:return Lke(t);case`slugify`:return BH(String(t??``),{fallback:!1,locale:r});case`date`:return Nke(t,a,e??{},r);case`default`:return Pke(t,a);case`ternary`:return Fke(t,a);case`truncate`:return Ike(t,a);default:{let e=Yd.get(i);return e?zke({method:i,transform:e,value:t,customArgs:o,locale:r}):String(t)}}},SU=({fieldConfig:e,value:t,transformations:n,locale:r})=>(n.forEach(n=>{t=Bke({fieldConfig:e,value:t,transformation:n,locale:r})}),t),Vke=/^\d{4}-[01]\d-[0-3]\d$/,Hke=/T00:00(?::00)?(?:\.000)?Z$/,CU={year:`numeric`,month:`short`,day:`numeric`},wU={hour:`numeric`,minute:`numeric`,hour12:!0},Uke={...CU,...wU},Wke=new Map,TU=(e,t)=>Number.isNaN(e.getTime())?`Invalid Date`:Ll(Wke,t??``,()=>new Intl.DateTimeFormat(t??void 0,Uke)).format(e),EU={year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:`longOffset`},DU=new Map,Gke=e=>{let t=e??``,n=DU.get(t);return n||(n=new Intl.DateTimeFormat(`en-US`,{...EU,hourCycle:`h23`,timeZone:e}),DU.set(t,n)),n},OU=({date:e=new Date,timeZone:t=void 0}={})=>Object.fromEntries(Gke(t).formatToParts(e).filter(({type:e})=>e in EU).map(({type:e,value:t})=>[e,t])),Kke=/(?[+-]\d{2})(?::?(?\d{2}))?(?::?(?\d{2}))?(?:\.\d+)?$|Z$/,kU=e=>String(Math.abs(Number(e))).padStart(2,`0`),qke=new Map,AU=(e,t)=>{if(typeof e!=`string`||!e.trim())return;let{inputTimeZone:n}=GH(t);if(n===`local`||n===`utc`)return;let r=new Date(e);if(Number.isNaN(r.getTime()))return;let i=e.match(Kke);if(!i?.groups)return;let{hours:a,minutes:o=`0`}=i.groups,s=i[0]===`Z`?`+00:00`:`${a.startsWith(`-`)?`-`:`+`}${kU(a)}:${kU(o)}`;return(Ll(qke,n,()=>new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`longOffset`})).formatToParts(r).find(e=>e.type===`timeZoneName`)?.value??``).replace(`GMT`,``)===s?n:void 0},Jke=(e,t)=>{let n=AU(e,t);if(n)return n;let{inputTimeZone:r,singleCustomTimeZone:i}=GH(t);if(i)return i;try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(r===`local`)return e}catch{return r===`local`?``:void 0}},jU=(e,t=new Date)=>{try{let n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value??``,r=e.split(`/`).pop()?.replaceAll(`_`,` `)??e;return`(${n.replace(`GMT`,``)}) ${r}`}catch{return e}};OH.default.extend(XH.default),OH.default.extend(kH.default),OH.default.extend(AH.default),OH.default.extend(jH.default),OH.default.extend(ZH.default);var Yke=/^(?\d{4}-[01]\d-[0-3]\d)(?:T00:00(?::00)?(?:\.000)?Z)?$/,Xke=/(?:^|T)(?