@worldresources/wri-design-systems 2.198.0 → 2.199.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Icon as i,Menu as s,Portal as a,Tooltip as l,Field as c,Input as d,Popover as u,Text as h,HStack as p,StackSeparator as f,Group as m,Checkbox as g,CheckboxGroup as v,CheckboxCard as b,RadioCard as y,RadioGroup as w,Slider as C,For as x,Switch as k,Select as $,Tag as S,createListCollection as E,Textarea as M,useFilter as T,useListCollection as O,Combobox as L,Accordion as A,chakra as N,Flex as R,Pagination as D,ButtonGroup as P,Table as I,Dialog as z,InputGroup as V,Breadcrumb as H,Tabs as _,VisuallyHidden as B,useMediaQuery as j,Collapsible as F,useDisclosure as q,Avatar as W,Alert as U,CloseButton as K,createToaster as Z,Toaster as G,Toast as J,Stack as X}from"@chakra-ui/react";import{jsx as Y,jsxs as Q,Fragment as ee}from"react/jsx-runtime";import*as te from"react";import ne,{createContext as re,useContext as oe,useMemo as ie,forwardRef as se,useRef as ae,useState as le,useDebugValue as ce,useEffect as de,useLayoutEffect as ue,useId as he,Children as pe,useCallback as fe,createElement as me,useImperativeHandle as ge,Fragment as ve}from"react";import{jsxs as be,jsx as ye,Fragment as we}from"@emotion/react/jsx-runtime";import*as Ce from"react-dom";import xe,{createPortal as ke}from"react-dom";import{css as $e}from"@emotion/react";import Se from"object-assign";const Ee=e=>parseFloat(e.toFixed(4)).toString(),Me=e=>"number"==typeof e?`${Ee(.25*e)}rem`:e,Te=(e,t=16)=>`${Ee(e/t)}rem`,Oe={neutral:{100:{value:"#FFFFFF"},200:{value:"#F6F6F6"},300:{value:"#E7E6E6"},400:{value:"#C9C9C9"},500:{value:"#B0B0B0"},600:{value:"#A1A1A1"},700:{value:"#5C5959"},800:{value:"#3D3B3B"},900:{value:"#1A1919"}},primary:{100:{value:"#FFFBF2"},200:{value:"#FCEFD3"},300:{value:"#FADFA7"},400:{value:"#F5BF4F"},500:{value:"#F0AB00"},600:{value:"#DE9E00"},700:{value:"#855B00"},800:{value:"#5F4205"},900:{value:"#332300"}},secondary:{100:{value:"#F2F6FF"},200:{value:"#D7E0F7"},300:{value:"#B2C3F0"},400:{value:"#4F6CBA"},500:{value:"#3855A3"},600:{value:"#0A4298"},700:{value:"#123369"},800:{value:"#162241"},900:{value:"#0B1121"}},success:{100:{value:"#EBF5F2"},200:{value:"#D3EED1"},300:{value:"#C2E5DC"},500:{value:"#009E77"},900:{value:"#00664D"}},warning:{100:{value:"#FBF7EA"},200:{value:"#E3CC8F"},300:{value:"#EEDDA5"},500:{value:"#A88100"},900:{value:"#715804"}},error:{100:{value:"#FFEFED"},200:{value:"#EDA1A9"},300:{value:"#F6C5C1"},500:{value:"#C11101"},900:{value:"#8D0D01"}},accessible:{"text-on-primary-mids":{value:"#332300"},"text-on-secondary-mids":{value:"#F2F6FF"},"controls-on-neutral-lights":{value:"#855B00"},"controls-on-neutral-darks":{value:"#F5BF4F"}}},Le={200:{value:Te(12)},300:{value:Te(14)},400:{value:Te(16)},500:{value:Te(18)},600:{value:Te(20)},700:{value:Te(24)},800:{value:Te(30)},900:{value:Te(36)},1e3:{value:Te(48)},1100:{value:Te(60)}},Ae={0:{value:Te(0)},50:{value:Te(2)},100:{value:Te(4)},200:{value:Te(8)},300:{value:Te(12)},400:{value:Te(16)},500:{value:Te(20)},600:{value:Te(24)},700:{value:Te(28)},800:{value:Te(32)},900:{value:Te(36)},1e3:{value:Te(40)},1100:{value:Te(44)},1200:{value:Te(48)},1400:{value:Te(56)},1600:{value:Te(64)},2e3:{value:Te(80)},2400:{value:Te(96)},2800:{value:Te(112)}},Ne={100:{value:Te(0)},200:{value:Te(2)},300:{value:Te(4)},400:{value:Te(6)},500:{value:Te(8)},600:{value:Te(12)},700:{value:Te(16)},800:{value:Te(24)},900:{value:"9999px"}},Re={100:{value:Te(1)},200:{value:Te(2)},300:{value:Te(4)},400:{value:Te(6)}},De={300:{value:Te(12)},400:{value:Te(16)},500:{value:Te(20)},600:{value:Te(24)},700:{value:Te(28)},800:{value:Te(32)},900:{value:Te(36)},1e3:{value:Te(44)},1100:{value:Te(60)},1200:{value:Te(72)}},Pe=(e=>{const t={};return Object.keys(e).forEach((n=>{Object.keys(e[n]).forEach((r=>{const o=e[n][r].value;t[`${n}-${r}`]=o}))})),t})(Oe),Ie=e(t,{theme:{tokens:{colors:Oe,fontSizes:Le,lineHeights:De,spacing:Ae,radii:Ne,borderWidths:Re}}}),ze=(e,t)=>Ie.tokens.getVar(`colors.${e}.${t}`)||Oe?.[e]?.[t]?.value,Ve=e=>Ie.tokens.getVar(`fontSizes.${e}`)||Le?.[e]?.value,He=e=>Ie.tokens.getVar(`spacing.${e}`)||Ae?.[e]?.value,_e=e=>Ie.tokens.getVar(`lineHeights.${e}`)||De?.[e]?.value,Be=e=>Ie.tokens.getVar(`radii.${e}`)||Ne?.[e]?.value,je=e=>Ie.tokens.getVar(`borderWidths.${e}`)||Re?.[e]?.value,Fe=re({labels:{}}),qe=({labels:e,children:t})=>{const n=ie((()=>({labels:e})),[e]);return Y(Fe.Provider,{value:n,children:t})},We={CheckboxList:{expandLabel:"Expand",hideLabel:"Hide",requiredLabel:"Required.",optionalLabel:"Optional",errorPrefix:"Error:",requiredSymbolLabel:"required"},Password:{showLabel:"Show",hideLabel:"Hide",showPasswordLabel:"Show password",hidePasswordLabel:"Hide password",strengthPrefix:"Password Strength:",strengthVeryWeak:"Very Weak",strengthWeak:"Weak",strengthMedium:"Medium",strengthStrong:"Strong",strengthVeryStrong:"Very Strong",requirementMet:"Requirement met.",requirementNotMet:"Requirement not met.",minLengthRule:e=>`Use a minimum of ${e} characters`,uppercaseRule:"Use an uppercase letter",lowercaseRule:"Use a lowercase letter",numberRule:"Use a number",specialCharRule:"Use a special character"},TextInput:{requiredSymbolLabel:"required",optionalSuffix:" (Optional)"},CloseButton:{closeLabel:"Close"},Toast:{dismissLabel:"Dismiss"},InlineMessage:{roleDescription:"Note"},MapPopUp:{closeLabel:"Close"},AnalysisWidget:{toggleSectionLabel:"Toggle section"},Table:{ascendingLabel:"Ascending",descendingLabel:"Descending"},Button:{loadingLabel:"Loading"},BaseMap:{activeLabel:"Active"},Search:{filterPlaceholder:"Filter",filterAriaLabel:"Search filter"},MobileSearch:{inputAriaLabel:"Search",cancelLabel:"Cancel",recentSearchesTitle:"Recent searches",matchingResultsTitle:e=>`Showing ${e} matching results`,infoLabel:"Label"},RadioList:{requiredLabel:"Required.",optionalLabel:"Optional.",errorPrefix:"Error:",requiredSymbolLabel:"required"},Select:{defaultAriaLabel:"Select input",requiredSuffix:" required.",disabledSuffix:" Disabled."},NavigationRail:{showLabel:"Show",hideLabel:"Hide",sidebarLabel:"Sidebar"},Navbar:{openMenuLabel:"Open menu",closeLabel:"Close",menuLabel:"Menu",goBackLabel:"Go back",closeMenuLabel:"Close menu",closeButtonText:"Close"},LegendItem:{dragAndDropLabel:"Drag and drop",upLabel:"Up",downLabel:"Down",removeLabel:"Remove",aboutDataLabel:"About data"},Toolbar:{collapseLabel:"Collapse",expandLabel:"Expand",collapseAriaLabel:"Collapse",expandAriaLabel:"Expand"},OpacityControl:{opacityButtonLabel:"Opacity",opacityHeading:"Opacity",opacityAriaLabel:"Opacity",percentSuffix:"%"},Textarea:{requiredSymbolLabel:"required",optionalSuffix:" (Optional)",errorPrefix:"Error:",enterAtLeastChars:e=>`Enter at least ${e} characters`,minChars:e=>`Min ${e} characters`,charsRemaining:e=>`You have ${e} characters remaining`,maxChars:e=>`Max ${e} characters`,needMoreChars:e=>`You need ${e} more characters`,tooManyChars:e=>`You have ${e} characters too many`},Pagination:{previousLabel:"Previous",nextLabel:"Next",previousPageLabel:"Previous page",nextPageLabel:"Next page",paginationLabel:"Pagination",pageLabel:e=>`Page ${e}`},ItemCount:{perPageLabel:"Per Page",showingLabel:(e,t,n)=>`Showing ${e}-${t} of ${n}`},LayerGroup:{activeTagLabel:e=>`${e} Active`,groupAriaLabel:(e,t,n)=>`${e}, ${t} Active layers on the map${n?`, ${n}`:""}`},QualitativeAttribute:{hideLabel:"Hide",showLabel:"Show",visibleText:"visible",hiddenText:"hidden",linePrefix:"line,",currentlyTemplate:(e,t,n,r)=>`${n} ${e}${t?`, ${t}`:""}. Currently ${r}.`},MapControlsToolbar:{zoomInLabel:"Zoom in",zoomOutLabel:"Zoom out",expandLabel:"Expand",shareLabel:"Share",printLabel:"Print",settingsLabel:"Settings",helpLabel:"Help",zoomInAriaLabel:"Zoom in",zoomOutAriaLabel:"Zoom out",expandAriaLabel:"Expand",shareAriaLabel:"Share",printAriaLabel:"Print",settingsAriaLabel:"Settings",helpAriaLabel:"Help",toolbarAriaLabel:"Map controls toolbar"},StepProgressIndicator:{currentStepLabel:(e,t,n)=>`Current Step ${e}${t?` ${t}`:""}${n?". Completed":""}`},RichTextEditor:{editorAriaLabel:"Rich text editor",placeholder:"Start typing...",undoTooltip:"Undo",redoTooltip:"Redo",textTypeTooltip:"Text Type",fontSizeTooltip:"Font Size",alignmentTooltip:"Alignment",alignLeftOptionLabel:"Align left",alignCenterOptionLabel:"Align center",alignRightOptionLabel:"Align right",alignJustifyOptionLabel:"Justify",boldTooltip:"Bold (B)",boldIconText:"B",italicTooltip:"Italic (I)",italicIconText:"I",underlineTooltip:"Underline (U)",underlineIconText:"U",strikethroughTooltip:"Strikethrough",strikethroughIconText:"S",bulletListTooltip:"Bullet List",orderedListTooltip:"Ordered List",linkTooltip:"Link",imageTooltip:"Image",linkUrlPlaceholder:"http://example.org",linkLabelPlaceholder:"Label (optional)",linkLabelAriaLabel:"Link label",linkApplyLabel:"Apply",linkRemoveLabel:"Remove",linkInvalidUrlMessage:"Please enter a valid URL"}};function Ue(e){this.content=e}function Ke(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let e=0;o.text[e]==i.text[e];e++)n++;return n}if(o.content.size||i.content.size){let e=Ke(o.content,i.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function Ze(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let e=Ze(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}Ue.prototype={constructor:Ue,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return-1==o?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new Ue(i)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new Ue(n)},addToStart:function(e,t){return new Ue([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Ue(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(-1==i?o.length:i,0,t,n),new Ue(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=Ue.from(e)).size?new Ue(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=Ue.from(e)).size?new Ue(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Ue.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},get size(){return this.content.length>>1}},Ue.from=function(e){if(e instanceof Ue)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ue(t)};class Ge{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,o){for(let i=0,s=0;s<t;i++){let a=this.content[i],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,e-o),Math.min(a.content.size,t-o),n,r+o)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,((s,a)=>{let l=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(i?i=!1:o+=n),o+=l}),0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new Ge(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let o=0,i=0;i<t;o++){let s=this.content[o],a=i+s.nodeSize;a>e&&((i<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),n.push(s),r+=s.nodeSize),i=a}return new Ge(n,r)}cutByIndex(e,t){return e==t?Ge.empty:0==e&&t==this.content.length?this:new Ge(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new Ge(r,o)}addToStart(e){return new Ge([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Ge(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Ke(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Ze(this,e,t,n)}findIndex(e){if(0==e)return Xe(0,e);if(e==this.size)return Xe(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e)return r==e?Xe(t+1,r):Xe(t,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return Ge.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return Ge.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Ge.empty;let t,n=0;for(let r=0;r<e.length;r++){let o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new Ge(t||e,n)}static from(e){if(!e)return Ge.empty;if(e instanceof Ge)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ge([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Ge.empty=new Ge([],0);const Je={index:0,offset:0};function Xe(e,t){return Je.index=e,Je.offset=t,Je}function Ye(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Ye(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Ye(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}let Qe=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ye(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort(((e,t)=>e.type.rank-t.type.rank)),n}};Qe.none=[];class et extends Error{}class tt{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=rt(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return n&&new tt(n,this.openStart,this.openEnd)}removeBetween(e,t){return new tt(nt(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return tt.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new tt(Ge.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new tt(e,n,r)}}function nt(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(o==t||i.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(nt(i.content,t-o-1,n-o-1)))}function rt(e,t,n,r,o,i){let{index:s,offset:a}=e.findIndex(t),l=e.maybeChild(s);if(a==t||l.isText)return i&&r<=0&&o<=0&&!i.canReplace(s,s,n)?null:e.cut(0,t).append(n).append(e.cut(t));let c=rt(l.content,t-a-1,n,0==s?r-1:0,s==e.childCount-1?o-1:0,l);return c&&e.replaceChild(s,l.copy(c))}function ot(e,t,n){if(n.openStart>e.depth)throw new et("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new et("Inconsistent open depths");return it(e,t,n,0)}function it(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let s=it(e,t,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:o,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Ge.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return dt(i,ut(e,o,s,t,r))}{let r=e.parent,o=r.content;return dt(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return dt(i,ht(e,t,r))}function st(e,t){if(!t.type.compatibleContent(e.type))throw new et("Cannot join "+t.type.name+" onto "+e.type.name)}function at(e,t,n){let r=e.node(n);return st(r,t.node(n)),r}function lt(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function ct(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(lt(e.nodeAfter,r),i++));for(let e=i;e<s;e++)lt(o.child(e),r);t&&t.depth==n&&t.textOffset&&lt(t.nodeBefore,r)}function dt(e,t){return e.type.checkContent(t),e.copy(t)}function ut(e,t,n,r,o){let i=e.depth>o&&at(e,t,o+1),s=r.depth>o&&at(n,r,o+1),a=[];return ct(null,e,o,a),i&&s&&t.index(o)==n.index(o)?(st(i,s),lt(dt(i,ut(e,t,n,r,o+1)),a)):(i&&lt(dt(i,ht(e,t,o+1)),a),ct(t,n,o,a),s&&lt(dt(s,ht(n,r,o+1)),a)),ct(r,null,o,a),new Ge(a)}function ht(e,t,n){let r=[];if(ct(null,e,n,r),e.depth>n){lt(dt(at(e,t,n+1),ht(e,t,n+1)),r)}return ct(t,null,n,r),new Ge(r)}tt.empty=new tt(Ge.empty,0,0);class pt{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return Qe.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new vt(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,o=t;for(let t=e;;){let{index:e,offset:i}=t.content.findIndex(o),s=o-i;if(n.push(t,e,r+i),!s)break;if(t=t.child(e),t.isText)break;o=s-1,r+=i+1}return new pt(t,n,o)}static resolveCached(e,t){let n=gt.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else gt.set(e,n=new ft);let r=n.elts[n.i]=pt.resolve(e,t);return n.i=(n.i+1)%mt,r}}class ft{constructor(){this.elts=[],this.i=0}}const mt=12,gt=new WeakMap;class vt{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const bt=Object.create(null);let yt=class e{constructor(e,t,n,r=Qe.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Ge.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Ye(this.attrs,t||e.defaultAttrs||bt)&&Qe.sameSet(this.marks,n||Qe.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return tt.empty;let r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new tt(a,r.depth-i,o.depth-i)}replace(e,t,n){return ot(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return pt.resolveCached(this,e)}resolveNoCache(e){return pt.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ct(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Ge.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<o;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Qe.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Qe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=Ge.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,r,n);return o.type.checkAttrs(o.attrs),o}};yt.prototype.text=void 0;class wt extends yt{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ct(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new wt(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new wt(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ct(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class xt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new kt(e,t);if(null==n.next)return xt.empty;let r=$t(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return n(Lt(e,0));function n(r){let o=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<o.length;e++)o[e][0]==t&&(r=o[e][1]);Lt(e,n).forEach((e=>{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let i=t[r.join(",")]=new xt(r.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let r=o[e][1].sort(Ot);i.next.push({type:o[e][0],next:t[r.join(",")]||n(r)})}return i}}(function(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach((e=>e.to=t))}function i(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(i(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),o(i(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return o(i(e.expr,t),s),o(i(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(i(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();o(i(e.expr,s),t),s=t}if(-1==e.max)o(i(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),o(i(e.expr,s),t),s=t}return[r(s)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=i(e.exprs[r],t);if(r==e.exprs.length-1)return s;o(s,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function o(i,s){let a=i.matchFragment(e,n);if(a&&(!t||a.validEnd))return Ge.from(s.map((e=>e.createAndFill())));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=o(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:i,next:s}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r})).join("\n")}}xt.empty=new xt(!0);class kt{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function $t(e){let t=[];do{t.push(St(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function St(e){let t=[];do{t.push(Et(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Et(e){let t=function(e){if(e.eat("(")){let t=$t(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let e in n){let r=n[e];r.isInGroup(t)&&o.push(r)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=Tt(e,t)}return t}function Mt(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Tt(e,t){let n=Mt(e),r=n;return e.eat(",")&&(r="}"!=e.next?Mt(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Ot(e,t){return t-e}function Lt(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(Ot)}function At(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Nt(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(void 0===o){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=t.default}n[r]=o}return n}function Rt(e,t,n,r){for(let r in t)if(!(r in e))throw new RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function Dt(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new It(e,r,t[r]);return n}let Pt=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Dt(e,n.attrs),this.defaultAttrs=At(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==xt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Nt(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new yt(this,this.computeAttrs(e),Ge.from(t),Qe.setFrom(n))}createChecked(e=null,t,n){return t=Ge.from(t),this.checkContent(t),new yt(this,this.computeAttrs(e),t,Qe.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=Ge.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(Ge.empty,!0);return o?new yt(this,e,t.append(o),Qe.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Rt(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Qe.none:e}static compile(t,n){let r=Object.create(null);t.forEach(((t,o)=>r[t]=new e(t,n,o)));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class It{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let o=null===n?"null":typeof n;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class zt{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Dt(e,r.attrs),this.excluded=null;let o=At(this.attrs);this.instance=o?new Qe(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Qe(this,Nt(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,o)=>n[e]=new zt(e,r++,t,o))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Rt(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Vt{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=Ue.from(e.nodes),t.marks=Ue.from(e.marks||{}),this.nodes=Pt.compile(this.spec.nodes,this),this.marks=zt.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",o=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=xt.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==o?null:o?Ht(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Ht(this,n.split(" "))}this.nodeFromJSON=e=>yt.fromJSON(this,e),this.markFromJSON=e=>Qe.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof Pt))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new wt(n,n.defaultAttrs,e,Qe.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Ht(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class _t{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach((e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new Ut(this,t,!1);return n.addAll(e,Qe.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Ut(this,t,!0);return n.addAll(e,Qe.none,t.from,t.to),tt.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Kt(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(e)||r.context&&!n.matchesContext(r.context)||i.length>e.length&&(61!=i.charCodeAt(e.length)||i.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach((e=>{n(e=Zt(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=Zt(e)),e.node||e.ignore||e.mark||(e.node=t)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new _t(e,_t.schemaRules(e)))}}const Bt={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},jt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ft={ol:!0,ul:!0};function qt(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class Wt{constructor(e,t,n,r,o,i){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=i,this.content=[],this.activeMarks=Qe.none,this.match=o||(4&i?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Ge.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=Ge.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Ge.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Bt.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ut{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r,o=t.topNode,i=qt(null,t.preserveWhitespace,0)|(n?4:0);r=o?new Wt(o.type,o.attrs,Qe.none,!0,t.topMatch||o.type.contentMatch,i):new Wt(n?null:e.schema.topNodeType,null,Qe.none,!0,null,i),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,o=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:i}=this.parser;if("full"===o||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(o)if("full"===o)n=n.replace(/\r\n?/g,"\n");else if(i.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(i.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(i.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(i.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],o=e.previousSibling;(!t||o&&"BR"==o.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(i.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,o=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i,s=e.nodeName.toLowerCase();Ft.hasOwnProperty(s)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&Ft.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,n));e:if(a?a.ignore:jt.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let n,r=this.needsBlock;if(Bt.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),n=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let i=a&&a.skip?t:this.readStyles(e,t);i&&this.addAll(e,i),n&&this.sync(o),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,a,n,!1===a.consuming?i:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],o=n.getPropertyValue(r);if(o)for(let e;;){let n=this.parser.matchStyle(r,o,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter((e=>!n.clearMark(e))):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1!==n.consuming)break;e=n}}return t}addElementByRule(e,t,n,r){let o,i;if(t.node)if(i=this.parser.schema.nodes[t.node],i.isLeaf)this.insertNode(i.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(i,t.attrs||null,n,t.preserveWhitespace);e&&(o=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e,n,!1)));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}o&&this.sync(s)&&this.open--}addAll(e,t,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,t);this.findAtPoint(e,o)}findPlace(e,t,n){let r,o;for(let t=this.open,i=0;t>=0;t--){let s=this.nodes[t],a=s.findWrapping(e);if(a&&(!r||r.length>a.length+i)&&(r=a,o=s,!a.length))break;if(s.solid){if(n)break;i+=2}}if(!r)return null;this.sync(o);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=Qe.none;for(let o of r.concat(e.marks))(t.type?t.type.allowsMarkType(o.type):Gt(o.type,e.type))&&(n=o.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let o=this.findPlace(e.create(t),n,!1);return o&&(o=this.enterInner(e,t,n,!0,r)),o}enterInner(e,t,n,r=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let s=qt(e,o,i.options);4&i.options&&0==i.content.length&&(s|=4);let a=Qe.none;return n=n.filter((t=>!(i.type?i.type.allowsMarkType(t.type):Gt(t.type,e))||(a=t.addToSet(a),!1))),this.nodes.push(new Wt(e,t,a,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)){t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=a&&!e.isInGroup(a))return!1;s--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function Kt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Zt(e){let t={};for(let n in e)t[n]=e[n];return t}function Gt(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class Jt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Yt(t).createDocumentFragment());let r=n,o=[];return e.forEach((e=>{if(o.length||e.marks.length){let n=0,i=0;for(;n<o.length&&i<e.marks.length;){let t=e.marks[i];if(this.marks[t.type.name]){if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],s=this.serializeMark(n,e.isInline,t);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){if(e.isText)return Yt(t).createTextNode(e.text);let{dom:n,contentDOM:r}=tn(Yt(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&tn(Yt(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return"string"==typeof t?{dom:e.createTextNode(t)}:tn(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Jt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Xt(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Xt(e.marks)}}function Xt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Yt(e){return e.document||window.document}const Qt=new WeakMap;function en(e){let t=Qt.get(e);return void 0===t&&Qt.set(e,t=function(e){let t=null;function n(e){if(e&&"object"==typeof e)if(Array.isArray(e))if("string"==typeof e[0])t||(t=[]),t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}(e)),t}function tn(e,t,n,r){if(1==t.nodeType)return{dom:t};if(t.dom&&1==t.dom.nodeType)return t;let o,i=t[0];if("string"!=typeof i)throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=en(r))&&o.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s,a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let l=n?e.createElementNS(n,i):e.createElement(i),c=t[1],d=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){d=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?l.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):"style"==e&&l.style?l.style.cssText=c[e]:l.setAttribute(e,c[e])}}for(let o=d;o<t.length;o++){let i=t[o];if(0===i){if(o<t.length-1||o>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}if("string"==typeof i)l.appendChild(e.createTextNode(i));else{let{dom:t,contentDOM:o}=tn(e,i,n,r);if(l.appendChild(t),o){if(s)throw new RangeError("Multiple content holes");s=o}}}return{dom:l,contentDOM:s}}const nn=Math.pow(2,16);function rn(e,t){return e+t*nn}function on(e){return 65535&e}class sn{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class an{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&an.empty)return an.empty}recover(e){let t=0,n=on(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/nn}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+o],c=this.ranges[s+i],d=a+l;if(e<=d){let o=a+r+((l?e==a?-1:e==d?1:t:t)<0?0:c);if(n)return o;let i=e==(t<0?a:d)?null:rn(s/3,e-a),u=e==a?2:e==d?1:4;return(t<0?e!=a:e!=d)&&(u|=8),new sn(o,u,i)}r+=c-l}return n?e+r:new sn(e+r,0,null)}touches(e,t){let n=0,r=on(t),o=this.inverted?2:1,i=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+o];if(e<=s+a&&t==3*r)return!0;n+=this.ranges[t+i]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),o+=c-l}}invert(){return new an(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?an.empty:new an(e<0?[0,-e,0]:[0,0,e])}}an.empty=new an([]);class ln{constructor(e,t,n=0,r=(e?e.length:0)){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new ln(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new ln;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this._maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return n?e:new sn(e,r,null)}}const cn=Object.create(null);class dn{getMap(){return an.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=cn[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in cn)throw new RangeError("Duplicate use of step JSON ID "+e);return cn[e]=t,t.prototype.jsonID=e,t}}class un{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new un(e,null)}static fail(e){return new un(null,e)}static fromReplace(e,t,n,r){try{return un.ok(e.replace(t,n,r))}catch(e){if(e instanceof et)return un.fail(e.message);throw e}}}function hn(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(hn(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return Ge.fromArray(r)}class pn extends dn{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new tt(hn(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return un.fromReplace(e,this.from,this.to,o)}invert(){return new fn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new pn(t.pos,n.pos,this.mark)}merge(e){return e instanceof pn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new pn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new pn(t.from,t.to,e.markFromJSON(t.mark))}}dn.jsonID("addMark",pn);class fn extends dn{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new tt(hn(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return un.fromReplace(e,this.from,this.to,n)}invert(){return new pn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new fn(t.pos,n.pos,this.mark)}merge(e){return e instanceof fn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new fn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new fn(t.from,t.to,e.markFromJSON(t.mark))}}dn.jsonID("removeMark",fn);class mn extends dn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return un.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return un.fromReplace(e,this.pos,this.pos+1,new tt(Ge.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new mn(this.pos,t.marks[n]);return new mn(this.pos,this.mark)}}return new gn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new mn(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new mn(t.pos,e.markFromJSON(t.mark))}}dn.jsonID("addNodeMark",mn);class gn extends dn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return un.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return un.fromReplace(e,this.pos,this.pos+1,new tt(Ge.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new mn(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new gn(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new gn(t.pos,e.markFromJSON(t.mark))}}dn.jsonID("removeNodeMark",gn);class vn extends dn{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&yn(e,this.from,this.to)?un.fail("Structure replace would overwrite content"):un.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new an([this.from,this.to-this.from,this.slice.size])}invert(e){return new vn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&vn.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new vn(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof vn)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?tt.empty:new tt(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new vn(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?tt.empty:new tt(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new vn(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new vn(t.from,t.to,tt.fromJSON(e,t.slice),!!t.structure)}}vn.MAP_BIAS=1,dn.jsonID("replace",vn);class bn extends dn{constructor(e,t,n,r,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(yn(e,this.from,this.gapFrom)||yn(e,this.gapTo,this.to)))return un.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return un.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?un.fromReplace(e,this.from,this.to,n):un.fail("Content does not fit in gap")}getMap(){return new an([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new bn(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||o>n.pos?null:new bn(t.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bn(t.from,t.to,t.gapFrom,t.gapTo,tt.fromJSON(e,t.slice),t.insert,!!t.structure)}}function yn(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function wn(e,t,n,r=n.contentMatch,o=!0){let i=e.doc.nodeAt(t),s=[],a=t+1;for(let t=0;t<i.childCount;t++){let l=i.child(t),c=a+l.nodeSize,d=r.matchType(l.type);if(d){r=d;for(let t=0;t<l.marks.length;t++)n.allowsMarkType(l.marks[t].type)||e.step(new fn(a,c,l.marks[t]));if(o&&l.isText&&"pre"!=n.whitespace){let e,t,r=/\r?\n|\r/g;for(;e=r.exec(l.text);)t||(t=new tt(Ge.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),s.push(new vn(a+e.index,a+e.index+e[0].length,t))}}else s.push(new vn(a,c,tt.empty));a=c}if(!r.validEnd){let t=r.fillBefore(Ge.empty,!0);e.replace(a,a,new tt(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function Cn(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function xn(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,o=0;;--n){let i=e.$from.node(n),s=e.$from.index(n)+r,a=e.$to.indexAfter(n)-o;if(n<e.depth&&i.canReplace(s,a,t))return n;if(0==n||i.type.spec.isolating||!Cn(i,s,a))break;s&&(r=1),a<i.childCount&&(o=1)}return null}function kn(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<o;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return i?o.map($n).concat({type:t,attrs:n}).concat(i.map($n)):null}function $n(e){return{type:e,attrs:null}}function Sn(e,t,n,r){t.forEach(((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let o=e.mapping.slice(r).map(n+1+i+s.index);e.replaceWith(o,o+1,t.type.schema.linebreakReplacement.create())}}}))}function En(e,t,n,r){t.forEach(((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let o=e.mapping.slice(r).map(n+1+i);e.replaceWith(o,o+1,t.type.schema.text("\n"))}}))}function Mn(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>i;e--,t--){let n=o.node(e),i=o.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[t+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=r&&r[t]||n;if(!n.canReplace(i+1,n.childCount)||!l.type.validContent(s))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function Tn(e,t){let n=e.resolve(t),r=n.index();return On(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function On(e,t){return!(!e||!t||e.isLeaf||!function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let o=0;o<t.childCount;o++){let i=t.child(o),s=i.type==r?e.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n)return!1;if(!e.type.allowsMarks(i.marks))return!1}return n.validEnd}(e,t))}function Ln(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let o,i,s=r.index(e);if(e==r.depth?(o=r.nodeBefore,i=r.nodeAfter):n>0?(o=r.node(e+1),s++,i=r.node(e).maybeChild(s)):(o=r.node(e).maybeChild(s-1),i=r.node(e+1)),o&&!o.isTextblock&&On(o,i)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function An(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,i=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(i,i,o);else{let e=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=e&&s.canReplaceWith(i,i,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Nn(e,t,n=t,r=tt.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return Rn(o,i,r)?new vn(t,n,r):new Dn(o,i,r).fit()}function Rn(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}dn.jsonID("replaceAround",bn);class Dn{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=Ge.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=Ge.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new tt(o,i,s);return e>-1?new bn(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new vn(n.pos,r.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=t.firstChild;if(t.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=zn(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let o=e.firstChild;for(let e=this.depth;e>=0;e--){let i,{type:s,match:a}=this.frontier[e],l=null;if(1==t&&(o?a.matchType(o.type)||(l=a.fillBefore(Ge.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:l};if(2==t&&o&&(i=a.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:i};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=zn(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new tt(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=zn(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new tt(Pn(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new tt(Pn(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let i=this.unplaced,s=n?n.content:i.content,a=i.openStart-e,l=0,c=[],{match:d,type:u}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));d=d.matchFragment(r)}let h=s.size+e-(i.content.size-i.openEnd);for(;l<s.childCount;){let e=s.child(l),t=d.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(d=t,c.push(Vn(e.mark(u.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?h:-1)))}let p=l==s.childCount;p||(h=-1),this.placed=In(this.placed,t,Ge.from(c)),this.frontier[t].match=d,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<h;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?0==e?tt.empty:new tt(Pn(i.content,e-1,1),e-1,h<0?i.openEnd:e-1):new tt(Pn(i.content,e,l),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Hn(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=Hn(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=Hn(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:i,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=In(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=In(this.placed,this.depth,Ge.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Ge.empty,!0);e.childCount&&(this.placed=In(this.placed,this.frontier.length,e))}}function Pn(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Pn(e.firstChild.content,t-1,n)))}function In(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(In(e.lastChild.content,t-1,n)))}function zn(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Vn(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Vn(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Ge.empty,!0)))),e.copy(r)}function Hn(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function _n(e,t,n,r,o){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(_n(o.content,t+1,n,r,o)))}if(t>r){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(Ge.empty,!0))}return e}function Bn(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}class jn extends dn{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return un.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return un.fromReplace(e,this.pos,this.pos+1,new tt(Ge.from(r),0,t.isLeaf?0:1))}getMap(){return an.empty}invert(e){return new jn(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new jn(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new jn(t.pos,t.attr,t.value)}}dn.jsonID("attr",jn);class Fn extends dn{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return un.ok(n)}getMap(){return an.empty}invert(e){return new Fn(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Fn(t.attr,t.value)}}dn.jsonID("docAttr",Fn);let qn=class extends Error{};qn=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(qn.prototype=Object.create(Error.prototype)).constructor=qn,qn.prototype.name="TransformError";class Wn{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ln}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new qn(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach(((n,r,o,i)=>{e=Math.min(e,o),t=Math.max(t,i)}))}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=tt.empty){let r=Nn(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new tt(Ge.from(n),0,0))}delete(e,t){return this.replace(e,t,tt.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),i=e.doc.resolve(n);if(Rn(o,i,r))return e.step(new vn(t,n,r));let s=Bn(o,i);0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:o.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),c=[],d=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=d-1;e>=0;e--){let t=c[e],n=(u=t.type).spec.defining||u.spec.definingForContent;if(n&&!t.sameMarkup(o.node(Math.abs(a)-1)))d=e;else if(n||!t.type.isTextblock)break}var u;for(let t=r.openStart;t>=0;t--){let a=(t+d+1)%(r.openStart+1),u=c[a];if(u)for(let t=0;t<s.length;t++){let c=s[(t+l)%s.length],d=!0;c<0&&(d=!1,c=-c);let h=o.node(c-1),p=o.index(c-1);if(h.canReplaceWith(p,p,u.type,u.marks))return e.replace(o.before(c),d?i.after(c):n,new tt(_n(r.content,0,r.openStart,a),a,r.openEnd))}}let h=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,r),!(e.steps.length>h));a--){let e=s[a];e<0||(t=o.before(e),n=i.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}(e.doc,t,r.type);null!=o&&(t=n=o)}e.replaceRange(t,n,new tt(Ge.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&0==r.parentOffset&&0==o.parentOffset){let i=r.sharedDepth(n),s=!1;for(let e=r.depth;e>i;e--)r.node(e).type.spec.isolating&&(s=!0);for(let e=o.depth;e>i;e--)o.node(e).type.spec.isolating&&(s=!0);if(!s){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=o.depth;e>0&&n==o.start(e);e--)n=o.before(e);r=e.doc.resolve(t),o=e.doc.resolve(n)}}let i=Bn(r,o);for(let t=0;t<i.length;t++){let n=i[t],s=t==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return e.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:o,depth:i}=t,s=r.before(i+1),a=o.after(i+1),l=s,c=a,d=Ge.empty,u=0;for(let e=i,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,d=Ge.from(r.node(e).copy(d)),u++):l--;let h=Ge.empty,p=0;for(let e=i,t=!1;e>n;e--)t||o.after(e+1)<o.end(e)?(t=!0,h=Ge.from(o.node(e).copy(h)),p++):c++;e.step(new bn(l,c,s,a,new tt(d.append(h),u,p),d.size-u,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=null,{linebreakReplacement:o}=e.doc.type.schema,i=e.doc.resolve(t-n),s=i.node().type;if(o&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(o);e&&!t?r=!1:!e&&t&&(r=!0)}let a=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);En(e,r.node(),r.before(),a)}s.inlineContent&&wn(e,t+n-1,s,i.node().contentMatchAt(i.index()),null==r);let l=e.mapping.slice(a),c=l.map(t-n);if(e.step(new vn(c,l.map(t+n,-1),tt.empty,!0)),!0===r){let t=e.doc.resolve(c);Sn(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=Ge.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Ge.from(n[e].type.create(n[e].attrs,r))}let o=t.start,i=t.end;e.step(new bn(o,i,o,i,new tt(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{let s="function"==typeof o?o(t):o;if(t.isTextblock&&!t.hasMarkup(r,s)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(i).map(n),r)){let o=null;if(r.schema.linebreakReplacement){let e="pre"==r.whitespace,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?o=!1:!e&&t&&(o=!0)}!1===o&&En(e,t,n,i),wn(e,e.mapping.slice(i).map(n,1),r,void 0,null===o);let a=e.mapping.slice(i),l=a.map(n,1),c=a.map(n+t.nodeSize,1);return e.step(new bn(l,c,l+1,c-1,new tt(Ge.from(r.create(s,null,t.marks)),0,0),1,!0)),!0===o&&Sn(e,t,n,i),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return function(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new bn(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new tt(Ge.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new jn(e,t,n)),this}setDocAttribute(e,t){return this.step(new Fn(e,t)),this}addNodeMark(e,t){return this.step(new mn(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof Qe)t.isInSet(n.marks)&&this.step(new gn(e,t));else{let r,o=n.marks,i=[];for(;r=t.isInSet(o);)i.push(new gn(e,r)),o=r.removeFromSet(o);for(let e=i.length-1;e>=0;e--)this.step(i[e])}return this}split(e,t=1,n){return function(e,t,n=1,r){let o=e.doc.resolve(t),i=Ge.empty,s=Ge.empty;for(let e=o.depth,t=o.depth-n,a=n-1;e>t;e--,a--){i=Ge.from(o.node(e).copy(i));let t=r&&r[a];s=Ge.from(t?t.type.create(t.attrs,s):o.node(e).copy(s))}e.step(new vn(t,t,new tt(i.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let o,i,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let d=e.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),u=Math.min(l+e.nodeSize,n),h=r.addToSet(d);for(let e=0;e<d.length;e++)d[e].isInSet(h)||(o&&o.to==c&&o.mark.eq(d[e])?o.to=u:s.push(o=new fn(c,u,d[e])));i&&i.to==c?i.to=u:a.push(i=new pn(c,u,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;i++;let a=null;if(r instanceof zt){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<o.length;e++){let t=o[e];t.step==i-1&&l.eq(o[e].style)&&(n=t)}n?(n.to=r,n.step=i):o.push({style:l,from:Math.max(s,t),to:r,step:i})}}})),o.forEach((t=>e.step(new fn(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return wn(this,e,t,n),this}}const Un=Object.create(null);class Kn{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Zn(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=tt.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=e.mapping.slice(o);e.replaceRange(c.map(a.pos),c.map(l.pos),s?tt.empty:t),0==s&&or(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=e.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),or(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Xn(e):rr(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let o=t<0?rr(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):rr(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new tr(e.node(0))}static atStart(e){return rr(e,e,0,0,1)||new tr(e)}static atEnd(e){return rr(e,e,e.content.size,e.childCount,-1)||new tr(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Un[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Un)throw new RangeError("Duplicate use of selection JSON ID "+e);return Un[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Xn.between(this.$anchor,this.$head).getBookmark()}}Kn.prototype.visible=!0;class Zn{constructor(e,t){this.$from=e,this.$to=t}}let Gn=!1;function Jn(e){Gn||e.parent.inlineContent||(Gn=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Xn extends Kn{constructor(e,t=e){Jn(e),Jn(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return Kn.near(n);let r=e.resolve(t.map(this.anchor));return new Xn(r.parent.inlineContent?r:n,n)}replace(e,t=tt.empty){if(super.replace(e,t),t==tt.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof Xn&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Yn(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Xn(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=Kn.findFrom(t,n,!0)||Kn.findFrom(t,-n,!0);if(!e)return Kn.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(Kn.findFrom(e,-n,!0)||Kn.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new Xn(e,t)}}Kn.jsonID("text",Xn);class Yn{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Yn(e.map(this.anchor),e.map(this.head))}resolve(e){return Xn.between(e.resolve(this.anchor),e.resolve(this.head))}}class Qn extends Kn{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),o=e.resolve(r);return n?Kn.near(o):new Qn(o)}content(){return new tt(Ge.from(this.node),0,0)}eq(e){return e instanceof Qn&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new er(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Qn(e.resolve(t.anchor))}static create(e,t){return new Qn(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}Qn.prototype.visible=!1,Kn.jsonID("node",Qn);class er{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new Yn(n,n):new er(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Qn.isSelectable(n)?new Qn(t):Kn.near(t)}}class tr extends Kn{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=tt.empty){if(t==tt.empty){e.delete(0,e.doc.content.size);let t=Kn.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new tr(e)}map(e){return new tr(e)}eq(e){return e instanceof tr}getBookmark(){return nr}}Kn.jsonID("all",tr);const nr={map(){return this},resolve:e=>new tr(e)};function rr(e,t,n,r,o,i=!1){if(t.inlineContent)return Xn.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&Qn.isSelectable(r))return Qn.create(e,n-(o<0?r.nodeSize:0))}else{let t=rr(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function or(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,i=e.steps[r];(i instanceof vn||i instanceof bn)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==o&&(o=r)})),e.setSelection(Kn.near(e.doc.resolve(o),n)))}class ir extends Wn{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return Qe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Qe.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(Kn.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function sr(e,t){return t&&e?e.bind(t):e}class ar{constructor(e,t,n){this.name=e,this.init=sr(t.init,n),this.apply=sr(t.apply,n)}}const lr=[new ar("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new ar("selection",{init:(e,t)=>e.selection||Kn.atStart(t.doc),apply:e=>e.selection}),new ar("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new ar("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class cr{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=lr.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new ar(e.key,e.spec.state,e))}))}}class dr{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let a=r?r[i].n:0,l=r?r[i].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new dr(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new ir(this)}static create(e){let t=new cr(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new dr(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new cr(this.schema,e.plugins),n=t.fields,r=new dr(t);for(let t=0;t<n.length;t++){let o=n[t].name;r[o]=this.hasOwnProperty(o)?this[o]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new cr(e.schema,e.plugins),o=new dr(r);return r.fields.forEach((r=>{if("doc"==r.name)o.doc=yt.fromJSON(e.schema,t.doc);else if("selection"==r.name)o.selection=Kn.fromJSON(o.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,i))return void(o[r.name]=a.fromJSON.call(s,e,t[i],o))}o[r.name]=r.init(e,o)}})),o}}function ur(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=ur(o,t,{})),n[r]=o}return n}class hr{constructor(e){this.spec=e,this.props={},e.props&&ur(e.props,this,this.props),this.key=e.key?e.key.key:fr("plugin")}getState(e){return e[this.key]}}const pr=Object.create(null);function fr(e){return e in pr?e+"$"+ ++pr[e]:(pr[e]=0,e+"$")}class mr{constructor(e="key"){this.key=fr(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const gr=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function vr(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const br=(e,t,n)=>{let r=vr(e,n);if(!r)return!1;let o=xr(r);if(!o){let n=r.blockRange(),o=n&&xn(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(Nr(e,o,t,-1))return!0;if(0==r.parent.content.size&&(wr(i,"end")||Qn.isSelectable(i)))for(let n=r.depth;;n--){let s=Nn(e.doc,r.before(n),r.after(n),tt.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(wr(i,"end")?Kn.findFrom(n.doc.resolve(n.mapping.map(o.pos,-1)),-1):Qn.create(n.doc,o.pos-i.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||r.node(n-1).childCount>1)break}return!(!i.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0)};function yr(e,t,n){let r=t.nodeBefore,o=t.pos-1;for(;!r.isTextblock;o--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let i=t.nodeAfter,s=t.pos+1;for(;!i.isTextblock;s++){if(i.type.spec.isolating)return!1;let e=i.firstChild;if(!e)return!1;i=e}let a=Nn(e.doc,o,s,tt.empty);if(!a||a.from!=o||a instanceof vn&&a.slice.size>=s-o)return!1;if(n){let t=e.tr.step(a);t.setSelection(Xn.create(t.doc,o)),n(t.scrollIntoView())}return!0}function wr(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}const Cr=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=xr(r)}let s=i&&i.nodeBefore;return!(!s||!Qn.isSelectable(s))&&(t&&t(e.tr.setSelection(Qn.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function xr(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function kr(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const $r=(e,t,n)=>{let r=kr(e,n);if(!r)return!1;let o=Er(r);if(!o)return!1;let i=o.nodeAfter;if(Nr(e,o,t,1))return!0;if(0==r.parent.content.size&&(wr(i,"start")||Qn.isSelectable(i))){let n=Nn(e.doc,r.before(),r.after(),tt.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(wr(i,"start")?Kn.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Qn.create(r.doc,r.mapping.map(o.pos))),t(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0)},Sr=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=Er(r)}let s=i&&i.nodeAfter;return!(!s||!Qn.isSelectable(s))&&(t&&t(e.tr.setSelection(Qn.create(e.doc,i.pos)).scrollIntoView()),!0)};function Er(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const Mr=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function Tr(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Or=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof tr||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Tr(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(n,i.createAndFill());s.setSelection(Xn.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},Lr=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Mn(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&xn(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};const Ar=(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof Qn&&e.selection.node.isBlock)return!(!n.parentOffset||!Mn(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let o,i,s=[],a=!1,l=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){a=n.end(e)==n.pos+(n.depth-e),l=n.start(e)==n.pos-(n.depth-e),i=Tr(n.node(e-1).contentMatchAt(n.indexAfter(e-1))),s.unshift(a&&i?{type:i}:null),o=e;break}if(1==e)return!1;s.unshift(null)}let c=e.tr;(e.selection instanceof Xn||e.selection instanceof tr)&&c.deleteSelection();let d=c.mapping.map(n.pos),u=Mn(c.doc,d,s.length,s);if(u||(s[0]=i?{type:i}:null,u=Mn(c.doc,d,s.length,s)),!u)return!1;if(c.split(d,s.length,s),!a&&l&&n.node(o).type!=i){let e=c.mapping.map(n.before(o)),t=c.doc.resolve(e);i&&n.node(o-1).canReplaceWith(t.index(),t.index()+1,i)&&c.setNodeMarkup(c.mapping.map(n.before(o)),i)}return t&&t(c.scrollIntoView()),!0};function Nr(e,t,n,r){let o,i,s=t.nodeBefore,a=t.nodeAfter,l=s.type.spec.isolating||a.type.spec.isolating;if(!l&&function(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(i,i+1)||!o.isTextblock&&!Tn(e.doc,t.pos)||(n&&n(e.tr.join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let c=!l&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(o=(i=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&i.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,i=Ge.empty;for(let e=o.length-1;e>=0;e--)i=Ge.from(o[e].create(null,i));i=Ge.from(s.copy(i));let l=e.tr.step(new bn(t.pos-1,r,t.pos,r,new tt(i,1,0),o.length,!0)),c=l.doc.resolve(r+2*o.length);c.nodeAfter&&c.nodeAfter.type==s.type&&Tn(l.doc,c.pos)&&l.join(c.pos),n(l.scrollIntoView())}return!0}let d=a.type.spec.isolating||r>0&&l?null:Kn.findFrom(t,1),u=d&&d.$from.blockRange(d.$to),h=u&&xn(u);if(null!=h&&h>=t.depth)return n&&n(e.tr.lift(u,h).scrollIntoView()),!0;if(c&&wr(a,"start",!0)&&wr(s,"end")){let r=s,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let i=a,l=1;for(;!i.isTextblock;i=i.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,i.content)){if(n){let r=Ge.empty;for(let e=o.length-1;e>=0;e--)r=Ge.from(o[e].copy(r));n(e.tr.step(new bn(t.pos-o.length,t.pos+a.nodeSize,t.pos+l,t.pos+a.nodeSize-l,new tt(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Rr(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(Xn.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}const Dr=Rr(-1),Pr=Rr(1);function Ir(e,t=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(i,s,((r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}}))}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,e,t)}r(o.scrollIntoView())}return!0}}function zr(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}function Vr(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i);if(!s)return!1;let a=r?n.tr:null;return!!function(e,t,n,r=null){let o=!1,i=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=s.resolve(t.start-2);i=new vt(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new vt(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let a=kn(i,n,r,t);if(!a)return!1;e&&function(e,t,n,r,o){let i=Ge.empty;for(let e=n.length-1;e>=0;e--)i=Ge.from(n[e].type.create(n[e].attrs,i));e.step(new bn(t.start-(r?2:0),t.end,t.start,t.end,new tt(i,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==o&&(s=e+1);let a=n.length-s,l=t.start+n.length-(r?2:0),c=t.parent;for(let n=t.startIndex,r=t.endIndex,o=!0;n<r;n++,o=!1)!o&&Mn(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(n).nodeSize}(e,t,a,o,n);return!0}(a,s,e,t)&&(r&&r(a.scrollIntoView()),!0)}}function Hr(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));return!!i&&(!n||(r.node(i.depth-1).type==e?function(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new bn(i-1,s,i,s,new tt(Ge.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new vt(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=xn(r);if(null==a)return!1;o.lift(r,a);let l=o.doc.resolve(o.mapping.map(i,-1)-1);Tn(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos);return t(o.scrollIntoView()),!0}(t,n,e,i):function(e,t,n){let r=e.tr,o=n.parent;for(let e=n.end,t=n.endIndex-1,i=n.startIndex;t>i;t--)e-=o.child(t).nodeSize,r.delete(e-1,e+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,c=i.node(-1),d=i.index(-1);if(!c.canReplace(d+(a?0:1),d+1,s.content.append(l?Ge.empty:Ge.from(o))))return!1;let u=i.pos,h=u+s.nodeSize;return r.step(new bn(u-(a?1:0),h+(l?1:0),u+1,h-1,new tt((a?Ge.empty:Ge.from(o.copy(Ge.empty))).append(l?Ge.empty:Ge.from(o.copy(Ge.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,i)))}}zr(gr,br,Cr),zr(gr,$r,Sr),zr(Mr,Or,Lr,Ar),"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();const _r=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Br=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let jr=null;const Fr=function(e,t,n){let r=jr||(jr=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},qr=function(e,t,n,r){return n&&(Ur(e,t,n,r,-1)||Ur(e,t,n,r,1))},Wr=/^(img|br|input|textarea|hr)$/i;function Ur(e,t,n,r,o){for(var i;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Kr(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Zr(e)||Wr.test(e.nodeName)||"false"==e.contentEditable)return!1;t=_r(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;{let n=e.childNodes[t+(o<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(!(null===(i=n.pmViewDesc)||void 0===i?void 0:i.ignoreForSelection))return!1;t+=o}else e=n,t=o<0?Kr(e):0}}}}function Kr(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Zr(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Gr=function(e){return e.focusNode&&qr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Jr(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const Xr="undefined"!=typeof navigator?navigator:null,Yr="undefined"!=typeof document?document:null,Qr=Xr&&Xr.userAgent||"",eo=/Edge\/(\d+)/.exec(Qr),to=/MSIE \d/.exec(Qr),no=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Qr),ro=!!(to||no||eo),oo=to?document.documentMode:no?+no[1]:eo?+eo[1]:0,io=!ro&&/gecko\/(\d+)/i.test(Qr);io&&(/Firefox\/(\d+)/.exec(Qr)||[0,0])[1];const so=!ro&&/Chrome\/(\d+)/.exec(Qr),ao=!!so,lo=so?+so[1]:0,co=!ro&&!!Xr&&/Apple Computer/.test(Xr.vendor),uo=co&&(/Mobile\/\w+/.test(Qr)||!!Xr&&Xr.maxTouchPoints>2),ho=uo||!!Xr&&/Mac/.test(Xr.platform),po=!!Xr&&/Win/.test(Xr.platform),fo=/Android \d/.test(Qr),mo=!!Yr&&"webkitFontSmoothing"in Yr.documentElement.style,go=mo?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function vo(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function bo(e,t){return"number"==typeof e?e:e[t]}function yo(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function wo(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=Br(s);continue}let e=s,n=e==i.body,a=n?vo(i):yo(e),l=0,c=0;if(t.top<a.top+bo(r,"top")?c=-(a.top-t.top+bo(o,"top")):t.bottom>a.bottom-bo(r,"bottom")&&(c=t.bottom-t.top>a.bottom-a.top?t.top+bo(o,"top")-a.top:t.bottom-a.bottom+bo(o,"bottom")),t.left<a.left+bo(r,"left")?l=-(a.left-t.left+bo(o,"left")):t.right>a.right-bo(r,"right")&&(l=t.right-a.right+bo(o,"right")),l||c)if(n)i.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let o=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}let d=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s="absolute"==d?s.offsetParent:Br(s)}}function Co(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Br(r));return t}function xo(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let ko=null;function $o(e,t){let n,r,o,i,s=2e8,a=0,l=t.top,c=t.top;for(let d=e.firstChild,u=0;d;d=d.nextSibling,u++){let e;if(1==d.nodeType)e=d.getClientRects();else{if(3!=d.nodeType)continue;e=Fr(d).getClientRects()}for(let h=0;h<e.length;h++){let p=e[h];if(p.top<=l&&p.bottom>=c){l=Math.max(p.bottom,l),c=Math.min(p.top,c);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<s){n=d,s=e,r=e&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==d.nodeType&&e&&(a=u+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!o&&p.left<=t.left&&p.right>=t.left&&(o=d,i={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=u+1)}}return!n&&o&&(n=o,r=i,s=0),n&&3==n.nodeType?function(e,t){let n,r=e.nodeValue.length,o=document.createRange();for(let i=0;i<r;i++){o.setEnd(e,i+1),o.setStart(e,i);let r=Oo(o,1);if(r.top!=r.bottom&&So(t,r)){n={node:e,offset:i+(t.left>=(r.left+r.right)/2?1:0)};break}}return o.detach(),n||{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:a}:$o(n,r)}function So(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Eo(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=e.childNodes[i];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let o=e[r];if(So(t,o))return Eo(n,t,o)}}if((i=(i+1)%r)==o)break}return e}function Mo(e,t){let n,r=e.dom.ownerDocument,o=0,i=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Kr(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Kr(r.startContainer),r.startOffset)}}}(r,t.left,t.top);i&&({node:n,offset:o}=i);let s,a=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!a||!e.dom.contains(1!=a.nodeType?a.parentNode:a)){let n=e.dom.getBoundingClientRect();if(!So(t,n))return null;if(a=Eo(e.dom,t,n),!a)return null}if(co)for(let e=a;n&&e;e=Br(e))e.draggable&&(n=void 0);if(a=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(a,t),n){if(io&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let e,r=n.childNodes[o];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&o++}let r;mo&&o&&1==n.nodeType&&1==(r=n.childNodes[o-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(e,t,n,r){let o=-1;for(let n=t,i=!1;n!=e.dom;){let t,s=e.docView.nearestDesc(n,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((t=s.dom.getBoundingClientRect()).width||t.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!i&&t.left>r.left||t.top>r.top?o=s.posBefore:(!i&&t.right<r.left||t.bottom<r.top)&&(o=s.posAfter),i=!0),!s.contentDOM&&o<0&&!s.node.isText))return(s.node.isBlock?r.top<(t.top+t.bottom)/2:r.left<(t.left+t.right)/2)?s.posBefore:s.posAfter;n=s.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}(e,n,o,t))}null==s&&(s=function(e,t,n){let{node:r,offset:o}=$o(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,a,t));let l=e.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function To(e){return e.top<e.bottom||e.left<e.right}function Oo(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(To(e))return e}return Array.prototype.find.call(n,To)||e.getBoundingClientRect()}const Lo=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ao(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=mo||io;if(3==r.nodeType){if(!s||!Lo.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let e=o,t=o,i=n<0?1:-1;return n<0&&!o?(t++,i=-1):n>=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,No(Oo(Fr(r,e,t),i),i<0)}{let e=Oo(Fr(r,o,o),n);if(io&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=Oo(Fr(r,o-1,o-1),-1);if(t.top==e.top){let n=Oo(Fr(r,o,o+1),-1);if(n.top!=e.top)return No(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(null==i&&o&&(n<0||o==Kr(r))){let e=r.childNodes[o-1];if(1==e.nodeType)return Ro(e.getBoundingClientRect(),!1)}if(null==i&&o<Kr(r)){let e=r.childNodes[o];if(1==e.nodeType)return Ro(e.getBoundingClientRect(),!0)}return Ro(r.getBoundingClientRect(),n>=0)}if(null==i&&o&&(n<0||o==Kr(r))){let e=r.childNodes[o-1],t=3==e.nodeType?Fr(e,Kr(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return No(Oo(t,1),!1)}if(null==i&&o<Kr(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Fr(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return No(Oo(t,-1),!0)}return No(Oo(3==r.nodeType?Fr(r):r,-n),n>=0)}function No(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Ro(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Do(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}const Po=/[\u0590-\u08ac]/;let Io=null,zo=null,Vo=!1;function Ho(e,t,n){return Io==t&&zo==n?Vo:(Io=t,zo=n,Vo="up"==n||"down"==n?function(e,t,n){let r=t.selection,o="up"==n?r.$from:r.$to;return Do(e,t,(()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=Ao(e,o.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=Fr(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=e.domSelection();return a?Po.test(r.parent.textContent)&&a.modify?Do(e,t,(()=>{let{focusNode:t,focusOffset:o,anchorNode:i,anchorOffset:s}=e.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:d,focusOffset:u}=e.domSelectionRange(),h=d&&!c.contains(1==d.nodeType?d:d.parentNode)||t==d&&o==u;try{a.collapse(i,s),t&&(t!=i||o!=s)&&a.extend&&a.extend(t,o)}catch(e){}return null!=l&&(a.caretBidiLevel=l),h})):"left"==n||"backward"==n?i:s:r.pos==r.start()||r.pos==r.end()}(e,t,n))}class _o{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>_r(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!t||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let o=this.children[n],i=t+o.size;if(i>e||o instanceof Ko){r=e-t;break}t=i}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof Bo&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?_r(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?_r(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,s=0;;s++){let n=this.children[s],a=i+n.size;if(-1==r&&e<=a){let o=i+n.border;if(e>=o&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=i;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=_r(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=_r(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let o=Math.min(e,t),i=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(o>a&&i<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if((io||co)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(d=!(!t||"\n"!=e.nodeValue[t-1]),d&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(s=a={node:t.parentNode,offset:_r(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];d=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(io&&c.focusNode&&c.focusNode!=a.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||d&&co)&&qr(s.node,s.offset,c.anchorNode,c.anchorOffset)&&qr(a.node,a.offset,c.focusNode,c.focusOffset))return;let u=!1;if((l.extend||e==t)&&(!d||!io)){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),u=!0}catch(e){}}if(!u){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let r=n+o.border,s=i-o.border;if(e>=r&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=r||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-r,t-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Bo extends _o{constructor(e,t,n,r){let o,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,(()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r))),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class jo extends _o{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class Fo extends _o{constructor(e,t,n,r,o){super(e,[],n,r),this.mark=t,this.spec=o}static create(e,t,n,r){let o=r.nodeViews[t.type.name],i=o&&o(t,r,n);return i&&i.dom||(i=Jt.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new Fo(e,t,i.dom,i.contentDOM||i.dom,i)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=Fo.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;t<i&&(o=si(o,t,i,n)),e>0&&(o=si(o,0,e,n));for(let e=0;e<o.length;e++)o[e].parent=r;return r.children=o,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class qo extends _o{constructor(e,t,n,r,o,i,s,a,l){super(e,[],o,i),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,o,i){let s,a=o.nodeViews[t.type.name],l=a&&a(t,o,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:i),n,r),c=l&&l.dom,d=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=Jt.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:d}=e)}d||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let u=c;return c=ti(c,n,t),l?s=new Zo(e,t,n,r,c,d||null,u,l,o,i+1):t.isText?new Uo(e,t,n,r,c,u,o):new qo(e,t,n,r,c,d||null,u,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Ge.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&ni(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,o=e.composing?this.localCompositionInfo(e,t):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new oi(this,i&&i.node,e);!function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,o,t.forChild(i,s),n),i+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let d,u,h,p;for(;s<o.length&&o[s].to==i;){let e=o[s++];e.widget&&(d?(u||(u=[d])).push(e):d=e)}if(d)if(u){u.sort(ii);for(let e=0;e<u.length;e++)n(u[e],c,!!l)}else n(d,c,!!l);if(l)p=-1,h=l,l=null;else{if(!(c<e.childCount))break;p=c,h=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=i&&a.splice(e--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let f=i+h.nodeSize;if(h.isText){let e=f;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(l=h.cut(e-i),h=h.cut(0,e-i),f=e,p=-1)}else for(;s<o.length&&o[s].to<f;)s++;r(h,h.isInline&&!h.isLeaf?a.filter((e=>!e.inline)):a.slice(),t.forChild(i,h),p),i=f}}(this.node,this.innerDeco,((t,o,i)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e,o):t.type.side>=0&&!i&&a.syncToMarks(o==this.node.childCount?Qe.none:this.node.child(o).marks,n,e,o),a.placeWidget(t,e,r)}),((t,i,l,c)=>{let d;a.syncToMarks(t.marks,n,e,c),a.findNodeMatch(t,i,l,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(d=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(t,i,l,d,e)||a.updateNextNode(t,i,l,e,c,r)||a.addNode(t,i,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(i&&this.protectLocalComposition(e,i),Go(this.contentDOM,this.children,e),uo&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Xn)||n<t||r>t+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<e.childCount;){let t=e.child(o++);if(i+=t.nodeSize,!t.isText)break;l+=t.text}if(i>=n){if(i>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new jo(this,o,t,r);e.input.compositionNodes.push(i),this.children=si(this.children,n,n+r.length,e,i)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(ni(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Qo(this.dom,this.nodeDOM,Yo(this.outerDeco,this.node,t),Yo(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Wo(e,t,n,r,o){ti(r,t,e);let i=new qo(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Uo extends qo{constructor(e,t,n,r,o,i,s){super(e,t,n,r,o,null,i,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),o=document.createTextNode(r.text);return new Uo(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Ko extends _o{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Zo extends qo{constructor(e,t,n,r,o,i,s,a,l,c){super(e,t,n,r,o,i,s,l,c),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Go(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let s=t[i],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=ri(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(a,r);if(s instanceof Fo){let t=r?r.previousSibling:e.lastChild;Go(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=ri(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const Jo=function(e){e&&(this.nodeName=e)};Jo.prototype=Object.create(null);const Xo=[new Jo];function Yo(e,t,n){if(0==e.length)return Xo;let r=n?Xo[0]:new Jo,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s){s.nodeName&&o.push(r=new Jo(s.nodeName));for(let e in s){let i=s[e];null!=i&&(n&&1==o.length&&o.push(r=new Jo(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+i:"style"==e?r.style=(r.style?r.style+";":"")+i:"nodeName"!=e&&(r[e]=i))}}}return o}function Qo(e,t,n,r){if(n==Xo&&r==Xo)return t;let o=t;for(let t=0;t<r.length;t++){let i=r[t],s=n[t];if(t){let t;s&&s.nodeName==i.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==i.nodeName||(t=document.createElement(i.nodeName),t.pmIsDeco=!0,t.appendChild(o),s=Xo[0]),o=t}ei(o,s||Xo[0],i)}return o}function ei(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==o.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<o.length;t++)-1==r.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function ti(e,t,n){return Qo(e,e,Xo,Yo(t,n,1!=e.nodeType))}function ni(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function ri(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class oi{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Fo)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&!1!==e[o].type.spec.spanning;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let o=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){o=t;break}}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let r=Fo.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,o,i){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof qo){let l=this.preMatch.matched.get(a);if(null!=l&&l!=o)return!1;let c,d=a.dom,u=this.isLocked(d)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&ni(t,a.outerDeco));if(!u&&a.update(e,t,n,r))return this.destroyBetween(this.index,s),a.dom!=d&&(this.changed=!0),this.index++,!0;if(!u&&(c=this.recreateWrapper(a,e,t,n,r,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,i+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,o,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!ni(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=qo.create(this.top,t,n,r,o,i);if(s.contentDOM){s.children=e.children,e.children=[];for(let e of s.children)e.parent=s}return e.destroy(),s}addNode(e,t,n,r,o){let i=qo.create(this.top,e,t,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new Bo(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Fo;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Uo)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((co||ao)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new Ko(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function ii(e,t){return e.type.side-t.type.side}function si(e,t,n,r,o){let i=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,d=a+=l.size;c>=n||d<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,r)),o&&(i.push(o),o=void 0),d>n&&i.push(l.slice(n-c,l.size,r)))}return i}function ai(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(Gr(n)){for(a=s;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&Qn.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==Kr(e);r||o;){if(e==n)return!0;let t=_r(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==Kr(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;l=new Qn(s==e?c:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,o=s;for(let r=0;r<n.rangeCount;r++){let i=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(i.startContainer,i.startOffset,1)),o=Math.max(o,e.docView.posFromDOM(i.endContainer,i.endOffset,-1))}if(t<0)return null;[a,s]=o==e.state.selection.anchor?[o,t]:[t,o],c=r.resolve(s)}else a=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let d=r.resolve(a);if(!l){l=gi(e,d,c,"pointer"==t||e.state.selection.head<c.pos&&!i?1:-1)}return l}function li(e){return e.editable?e.hasFocus():bi(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ci(e,t=!1){let n=e.state.selection;if(fi(e,n),li(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&ao){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&qr(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,_r(n)+1):t.collapse(n,0);!r&&!e.state.selection.visible&&ro&&oo<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let r,o,{anchor:i,head:s}=n;!di||n instanceof Xn||(n.$from.parent.inlineContent||(r=ui(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=ui(e,n.to))),e.docView.setSelection(i,s,e,t),di&&(r&&pi(r),o&&pi(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{li(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const di=co||ao&&lo<63;function ui(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(co&&o&&"false"==o.contentEditable)return hi(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return hi(o);if(i)return hi(i)}}function hi(e){return e.contentEditable="true",co&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function pi(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function fi(e,t){if(t instanceof Qn){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(mi(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else mi(e)}function mi(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function gi(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||Xn.between(t,n,r)}function vi(e){return!(e.editable&&!e.hasFocus())&&bi(e)}function bi(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function yi(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&Kn.findFrom(i,t)}function wi(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ci(e,t,n){let r=e.state.selection;if(!(r instanceof Xn)){if(r instanceof Qn&&r.node.isInline)return wi(e,new Xn(t>0?r.$to:r.$from));{let n=yi(e.state,t);return!!n&&wi(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=e.state.doc.resolve(n.pos+o.nodeSize*(t<0?-1:1));return wi(e,new Xn(r.$anchor,i))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=yi(e.state,t);return!!(n&&n instanceof Qn)&&wi(e,n)}if(!(ho&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=t<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(Qn.isSelectable(i)?wi(e,new Qn(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):!!mo&&wi(e,new Xn(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}function xi(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function ki(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function $i(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;io&&1==n.nodeType&&r<xi(n)&&ki(n.childNodes[r],-1)&&(s=!0);for(;;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(ki(e,-1))o=n,i=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Si(n))break;{let t=n.previousSibling;for(;t&&ki(t,-1);)o=n.parentNode,i=_r(t),t=t.previousSibling;if(t)n=t,r=xi(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Ei(e,n,r):o&&Ei(e,o,i)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=xi(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!ki(n.childNodes[r],1))break;o=n,i=++r}else{if(Si(n))break;{let t=n.nextSibling;for(;t&&ki(t,1);)o=t.parentNode,i=_r(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=xi(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}o&&Ei(e,o,i)}(e)}function Si(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Ei(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!Zr(e);)t=_r(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!Zr(e);)t=_r(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Gr(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout((()=>{e.state==o&&ci(e)}),50)}function Mi(e,t){let n=e.state.doc.resolve(t);if(!ao&&!po&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function Ti(e,t,n){let r=e.state.selection;if(r instanceof Xn&&!r.empty||n.indexOf("s")>-1)return!1;if(ho&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=yi(e.state,t);if(n&&n instanceof Qn)return wi(e,n)}if(!o.parent.inlineContent){let n=t<0?o:i,s=r instanceof tr?Kn.near(n,t):Kn.findFrom(n,t);return!!s&&wi(e,s)}return!1}function Oi(e,t){if(!(e.state.selection instanceof Xn))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=e.state.tr;return t<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),e.dispatch(r),!0}return!1}function Li(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ai(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||ho&&72==n&&"c"==r)return Oi(e,-1)||$i(e,-1);if(46==n&&!t.shiftKey||ho&&68==n&&"c"==r)return Oi(e,1)||$i(e,1);if(13==n||27==n)return!0;if(37==n||ho&&66==n&&"c"==r){let t=37==n?"ltr"==Mi(e,e.state.selection.from)?-1:1:-1;return Ci(e,t,r)||$i(e,t)}if(39==n||ho&&70==n&&"c"==r){let t=39==n?"ltr"==Mi(e,e.state.selection.from)?1:-1:1;return Ci(e,t,r)||$i(e,t)}return 38==n||ho&&80==n&&"c"==r?Ti(e,-1,r)||$i(e,-1):40==n||ho&&78==n&&"c"==r?function(e){if(!co||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Li(e,n,"true"),setTimeout((()=>Li(e,n,"false")),20)}return!1}(e)||Ti(e,1,r)||$i(e,1):r==(ho?"m":"c")&&(66==n||73==n||89==n||90==n)}function Ni(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||Jt.fromSchema(e.state.schema),a=ji(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,d=l.firstChild,u=0;for(;d&&1==d.nodeType&&(c=_i[d.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),u++}d=l.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${o} ${i}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function Ri(e,t,n,r,o){let i,s,a=o.parent.type.spec.code;if(!n&&!t)return null;let l=!!t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(n=>{t=n(t,a||r,e)})),a)return s=new tt(Ge.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",(t=>{s=t(s,e,!0)})),s;let n=e.someProp("clipboardTextParser",(n=>n(t,o,r,e)));if(n)s=n;else{let n=o.marks(),{schema:r}=e.state,s=Jt.fromSchema(r);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),i=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=ji().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&_i[o[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;Fi||(Fi=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e}));return Fi.createHTML(e)}(e),n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),mo&&function(e){let t=e.querySelectorAll(ao?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let e=+d[3];e>0;e--){let e=i.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;i=e}if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||_t.fromSchema(e.state.schema);s=t.parseSlice(i,{preserveWhitespace:!(!l&&!d),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Di.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(d)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:o,openStart:i,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;o=Ge.from(t.create(n[e+1],o)),i++,s++}return new tt(o,i,s)}(Hi(s,+d[1],+d[2]),d[4]);else if(s=tt.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),i=[];if(e.forEach((e=>{if(!i)return;let t,n=o.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&r.length&&Ii(n,r,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=zi(i[i.length-1],r.length));let t=Pi(e,n);i.push(t),o=o.matchType(t.type),r=n}})),i)return Ge.from(i)}return e}(s.content,o),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Hi(s,e,t)}return e.someProp("transformPasted",(t=>{s=t(s,e,l)})),s}const Di=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Pi(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Ge.from(e));return e}function Ii(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let i=Ii(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(Ge.from(Pi(n,e,o+1))))}}function zi(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,zi(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Ge.empty,!0);return e.copy(n.append(r))}function Vi(e,t,n,r,o,i){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(i=0),o<r-1&&(a=Vi(a,t,n,r,o+1,i)),o>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Ge.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Hi(e,t,n){return t<e.openStart&&(e=new tt(Vi(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new tt(Vi(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const _i={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Bi=null;function ji(){return Bi||(Bi=document.implementation.createHTMLDocument("title"))}let Fi=null;const qi={},Wi={},Ui={touchstart:!0,touchmove:!0};class Ki{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Zi(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Gi(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Ji(e,t))}))}function Ji(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Xi(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Yi(e){return{left:e.clientX,top:e.clientY}}function Qi(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(e.someProp(t,(t=>r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1))))return!0;return!1}function es(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function ts(e,t,n,r,o){return Qi(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(o?function(e,t){if(-1==t)return!1;let n,r,o=e.state.selection;o instanceof Qn&&(n=o.node);let i=e.state.doc.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e);if(Qn.isSelectable(t)){r=n&&o.$from.depth>0&&e>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(e);break}}return null!=r&&(es(e,Qn.create(e.state.doc,r)),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&Qn.isSelectable(r))&&(es(e,new Qn(n)),!0)}(e,n))}function ns(e,t,n,r){return Qi(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function rs(e,t,n,r){return Qi(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(es(e,Xn.create(r,0,r.content.size)),!0);let o=r.resolve(t);for(let t=o.depth+1;t>0;t--){let n=t>o.depth?o.nodeAfter:o.node(t),i=o.before(t);if(n.inlineContent)es(e,Xn.create(r,i+1,i+1+n.content.size));else{if(!Qn.isSelectable(n))continue;es(e,Qn.create(r,i))}return!0}}(e,n,r)}function is(e){return ps(e)}Wi.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!ls(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!fo||!ao||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!uo||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||Ai(e,n)?n.preventDefault():Zi(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,Jr(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},Wi.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Wi.keypress=(e,t)=>{let n=t;if(ls(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||ho&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof Xn&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(t).scrollIntoView();/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t,o)))||e.dispatch(o()),n.preventDefault()}};const ss=ho?"metaKey":"ctrlKey";qi.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=is(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[ss]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i,button:n.button};let s=e.posAtCoords(Yi(n));s&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new as(e,s,n,!!r)):("doubleClick"==i?ns:rs)(e,s.pos,s.inside,n)?n.preventDefault():Zi(e,"pointer"))};class as{constructor(e,t,n,r){let o,i;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[ss],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a&&1==a.nodeDOM.nodeType?a.nodeDOM:null;let{selection:l}=e.state;0==n.button&&(o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Qn&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!io||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Zi(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>ci(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Yi(e))),this.updateAllowDefault(e),this.allowDefault||!t?Zi(this.view,"pointer"):ts(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||co&&this.mightDrag&&!this.mightDrag.node.isAtom||ao&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(es(this.view,Kn.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Zi(this.view,"pointer")}move(e){this.updateAllowDefault(e),Zi(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function ls(e,t){return!!e.composing||!!(co&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}qi.touchstart=e=>{e.input.lastTouch=Date.now(),is(e),Zi(e,"pointer")},qi.touchmove=e=>{e.input.lastTouch=Date.now(),Zi(e,"pointer")},qi.contextmenu=e=>is(e);const cs=fo?5e3:-1;function ds(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>ps(e)),t))}function us(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function hs(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=Kr(e=e.childNodes[t-1])}else{if(!e.parentNode||Zr(e))return null;t=_r(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||Zr(e))return null;t=_r(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}function ps(e,t=!1){if(!(fo&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),us(e),t||e.docView&&e.docView.dirty){let n=ai(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}Wi.compositionstart=Wi.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Xn&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))||ao&&po&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),ps(e,!0),e.markCursor=null;else if(ps(e,!t.selection.empty),io&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}ds(e,cs)},Wi.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then((()=>e.domObserver.flush())),e.input.compositionID++,ds(e,20))};const fs=ro&&oo<15||uo&&go<604;function ms(e,t,n,r,o){let i=Ri(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,o,i||tt.empty))))return!0;if(!i)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function gs(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}qi.copy=Wi.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let i=fs?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Ni(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Wi.paste=(e,t)=>{let n=t;if(e.composing&&!fo)return;let r=fs?null:n.clipboardData,o=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&ms(e,gs(r),r.getData("text/html"),o,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ms(e,r.value,null,o,t):ms(e,r.textContent,r.innerHTML,o,t)}),50)}(e,n)};class vs{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const bs=ho?"altKey":"ctrlKey";function ys(e,t){let n;return e.someProp("dragCopies",(e=>{n=n||e(t)})),null!=n?!n:!t[bs]}qi.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o,i=e.state.selection,s=i.empty?null:e.posAtCoords(Yi(n));if(s&&s.pos>=i.from&&s.pos<=(i instanceof Qn?i.to-1:i.to));else if(r&&r.mightDrag)o=Qn.create(e.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=Qn.create(e.state.doc,t.posBefore))}let a=(o||e.state.selection).content(),{dom:l,text:c,slice:d}=Ni(e,a);(!n.dataTransfer.files.length||!ao||lo>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(fs?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",fs||n.dataTransfer.setData("text/plain",c),e.dragging=new vs(d,ys(e,n),o)},qi.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},Wi.dragover=Wi.dragenter=(e,t)=>t.preventDefault(),Wi.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Yi(t));if(!r)return;let o=e.state.doc.resolve(r.pos),i=n&&n.slice;i?e.someProp("transformPasted",(t=>{i=t(i,e,!1)})):i=Ri(e,gs(t.dataTransfer),fs?null:t.dataTransfer.getData("text/html"),!1,o);let s=!(!n||!ys(e,t));if(e.someProp("handleDrop",(n=>n(e,t,i||tt.empty,s))))return void t.preventDefault();if(!i)return;t.preventDefault();let a=i?An(e.state.doc,o.pos,i):o.pos;null==a&&(a=o.pos);let l=e.state.tr;if(s){let{node:e}=n;e?e.replace(l):l.deleteSelection()}let c=l.mapping.map(a),d=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,u=l.doc;d?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i);if(l.doc.eq(u))return;let h=l.doc.resolve(c);if(d&&Qn.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new Qn(h));else{let t=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach(((e,n,r,o)=>t=o)),l.setSelection(gi(e,h,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},qi.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ci(e)}),20))},qi.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},qi.beforeinput=(e,t)=>{if(ao&&fo&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,Jr(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in Wi)qi[e]=Wi[e];function ws(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Cs{constructor(e,t){this.toDOM=e,this.spec=t||Es,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new $s(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Cs&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ws(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class xs{constructor(e,t){this.attrs=e,this.spec=t||Es}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new $s(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof xs&&ws(this.attrs,e.attrs)&&ws(this.spec,e.spec)}static is(e){return e.type instanceof xs}destroy(){}}class ks{constructor(e,t){this.attrs=e,this.spec=t||Es}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new $s(o.pos-n,i.pos-n,this)}valid(e,t){let n,{index:r,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(n=e.child(r)).isText&&o+n.nodeSize==t.to}eq(e){return this==e||e instanceof ks&&ws(this.attrs,e.attrs)&&ws(this.spec,e.spec)}destroy(){}}class $s{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new $s(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new $s(e,e,new Cs(t,n))}static inline(e,t,n,r){return new $s(e,t,new xs(n,r))}static node(e,t,n,r){return new $s(e,t,new ks(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof xs}get widget(){return this.type instanceof Cs}}const Ss=[],Es={};class Ms{constructor(e,t){this.local=e.length?e:Ss,this.children=t.length?t:Ss}static create(e,t){return t.length?Rs(t,e,0,Es):Ts}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==Ts||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Es)}mapInner(e,t,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,s){let a=e.slice();for(let e=0,t=i;e<n.maps.length;e++){let r=0;n.maps[e].forEach(((e,n,o,i)=>{let s=i-o-(n-e);for(let o=0;o<a.length;o+=3){let i=a[o+1];if(i<0||e>i+t-r)continue;let l=a[o]+t-r;n>=l?a[o+1]=e<=l?-2:-1:e>=t&&s&&(a[o]+=s,a[o+1]+=s)}r+=s})),t=n.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let c=n.map(e[t]+i),d=c-o;if(d<0||d>=r.content.size){l=!0;continue}let u=n.map(e[t+1]+i,-1)-o,{index:h,offset:p}=r.content.findIndex(d),f=r.maybeChild(h);if(f&&p==d&&p+f.nodeSize==u){let r=a[t+2].mapInner(n,f,c+1,e[t]+i+1,s);r!=Ts?(a[t]=d,a[t+1]=u,a[t+2]=r):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,r,o,i,s){function a(e,t){for(let i=0;i<e.local.length;i++){let a=e.local[i].map(r,o,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[i].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+i+1);return n}(a,e,t,n,o,i,s),c=Rs(l,r,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Ms(t.sort(Ds),a)}(this.children,i||[],e,t,n,r,o):i?new Ms(i.sort(Ds),Ss):Ts}add(e,t){return t.length?this==Ts?Ms.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,o=0;e.forEach(((e,i)=>{let s,a=i+n;if(s=As(t,e,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(e,s,a+1):r.splice(o,0,i,i+e.nodeSize,Rs(s,e,a+1,Es)),o+=3}}));let i=Ls(o?Ns(t):t,-n);for(let t=0;t<i.length;t++)i[t].type.valid(e,i[t])||i.splice(t--,1);return new Ms(i.length?this.local.concat(i).sort(Ds):this.local,r||this.children)}remove(e){return 0==e.length||this==Ts?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>i&&t.to<s&&(e[n]=null,(o||(o=[])).push(t));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=Ts?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<e.length;o++)if(n=e[o])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Ms(r,n):Ts}forChild(e,t){if(this==Ts)return this;if(t.isLeaf)return Ms.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let o=e+1,i=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>o&&t.type instanceof xs){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new Ms(r.sort(Ds),Ss);return n?new Os([e,n]):e}return n||Ts}eq(e){if(this==e)return!0;if(!(e instanceof Ms)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Ps(this.localsInner(e))}localsInner(e){if(this==Ts)return Ss;if(e.inlineContent||!this.local.some(xs.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof xs||t.push(this.local[e]);return t}forEachSet(e){e(this)}}Ms.empty=new Ms([],[]),Ms.removeOverlap=Ps;const Ts=Ms.empty;class Os{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,Es)));return Os.from(n)}forChild(e,t){if(t.isLeaf)return Ms.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,t);o!=Ts&&(o instanceof Os?n=n.concat(o.members):n.push(o))}return Os.from(n)}eq(e){if(!(e instanceof Os)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?Ps(n?t:t.sort(Ds)):Ss}static from(e){switch(e.length){case 0:return Ts;case 1:return e[0];default:return new Os(e.every((e=>e instanceof Ms))?e:e.reduce(((e,t)=>e.concat(t instanceof Ms?t:t.members)),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Ls(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new $s(o.from+t,o.to+t,o.type))}return n}function As(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let t,i=0;i<e.length;i++)(t=e[i])&&t.from>n&&t.to<r&&((o||(o=[])).push(t),e[i]=null);return o}function Ns(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Rs(e,t,n,r){let o=[],i=!1;t.forEach(((t,s)=>{let a=As(e,t,s+n);if(a){i=!0;let e=Rs(a,t,n+s+1,r);e!=Ts&&o.push(s,s+t.nodeSize,e)}}));let s=Ls(i?Ns(e):e,-n).sort(Ds);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||o.length?new Ms(s,o):Ts}function Ds(e,t){return e.from-t.from||e.to-t.to}function Ps(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),Is(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),Is(t,o+1,i.copy(r.to,i.to)))}}return t}function Is(e,t,n){for(;t<e.length&&Ds(n,e[t])>0;)t++;e.splice(t,0,n)}function zs(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=Ts&&t.push(r)})),e.cursorWrapper&&t.push(Ms.create(e.state.doc,[e.cursorWrapper.deco])),Os.from(t)}const Vs={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Hs=ro&&oo<=11;class _s{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Bs{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new _s,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver((t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);ro&&oo<=11&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():co&&e.composing&&t.some((e=>"childList"==e.type&&"TR"==e.target.nodeName))?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()})),Hs&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Vs)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(vi(this.view)){if(this.suppressingSelectionUpdates)return ci(this.view);if(ro&&oo<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&qr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let t=e.focusNode;t;t=Br(t))n.add(t);for(let r=e.anchorNode;r;r=Br(r))if(n.has(r)){t=r;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&vi(e)&&!this.ignoreSelectionChange(n),o=-1,i=-1,s=!1,a=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],a);n&&(o=o<0?n.from:Math.min(n.from,o),i=i<0?n.to:Math.max(n.to,i),n.typeOver&&(s=!0))}if(!a.some((e=>"BR"==e.nodeName))||8!=e.input.lastKeyCode&&46!=e.input.lastKeyCode){if(io&&a.length){let t=a.filter((e=>"BR"==e.nodeName));if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;!t||"LI"!=t.nodeName||n&&Ws(e,n)==t||r.remove()}}}}else for(let e of a)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;for(;t&&1==t.nodeType;){if("false"==t.contentEditable){e.parentNode.removeChild(e);break}t=t.firstChild}}let l=null;o<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Gr(n)&&(l=ai(e))&&l.eq(Kn.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,ci(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||r)&&(o>-1&&(e.docView.markDirty(o,i),function(e){if(js.has(e))return;if(js.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=io,Fs)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Fs=!0}}(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:o}=e.domSelectionRange();for(let i of t)if("TR"==(null===(n=i.parentNode)||void 0===n?void 0:n.nodeName)){let t=i.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(i,n.firstChild),r==i&&e.domSelection().collapse(i,o)}else i.parentNode.removeChild(i)}}(e,a)),this.handleDOMChange(o,i,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||ci(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,o=e.nextSibling;if(ro&&oo<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:i}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(e.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==e.target?_r(r)+1:0,s=n.localPosFromDOM(e.target,i,-1),a=o&&o.parentNode==e.target?_r(o):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let js=new WeakMap,Fs=!1;function qs(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return qr(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function Ws(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Us(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(co&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||co&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Ks=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Zs(e,t,n,r,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=ai(e,t);if(n&&!e.state.selection.eq(n)){if(ao&&fo&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",(t=>t(e,Jr(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),i&&r.setMeta("composition",i),e.dispatch(r)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l,c,d=e.state.selection,u=function(e,t,n){let r,{node:o,fromOffset:i,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelectionRange(),d=c.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:c.anchorOffset}],Gr(c)||r.push({node:c.focusNode,offset:c.focusOffset})),ao&&8===e.input.lastKeyCode)for(let e=s;e>i;e--){let t=o.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let u=e.state.doc,h=e.someProp("domParser")||_t.fromSchema(e.state.schema),p=u.resolve(a),f=null,m=h.parse(o,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Us,context:p});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n),h=e.state.doc,p=h.slice(u.from,u.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(l=e.state.selection.to,c="end"):(l=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let f=function(e,t,n,r,o){let i=e.findDiffStart(t,n);if(null==i)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==o){r-=s+Math.max(0,i-Math.min(s,a))-i}if(s<i&&e.size<t.size){let e=r<=i&&r>=s?i-r:0;i-=e,i&&i<t.size&&Xs(t.textBetween(i-1,i+1))&&(i+=e?1:-1),a=i+(a-s),s=i}else if(a<i){let t=r<=i&&r>=a?i-r:0;i-=t,i&&i<e.size&&Xs(e.textBetween(i-1,i+1))&&(i+=t?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}(p.content,u.doc.content,u.from,l,c);if(f&&e.input.domChangeCount++,(uo&&e.input.lastIOSEnter>Date.now()-225||fo)&&o.some((e=>1==e.nodeType&&!Ks.test(e.nodeName)))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",(t=>t(e,Jr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&d instanceof Xn&&!d.empty&&d.$head.sameParent(d.$anchor))||e.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let t=Gs(e,e.state.doc,u.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);i&&n.setMeta("composition",i),e.dispatch(n)}}return}f={start:d.from,endA:d.to,endB:d.to}}e.state.selection.from<e.state.selection.to&&f.start==f.endB&&e.state.selection instanceof Xn&&(f.start>e.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?f.start=e.state.selection.from:f.endA<e.state.selection.to&&f.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),ro&&oo<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>u.from&&"  "==u.doc.textBetween(f.start-u.from-1,f.start-u.from+1)&&(f.start--,f.endA--,f.endB--);let m=u.doc.resolveNoCache(f.start-u.from),g=u.doc.resolveNoCache(f.endB-u.from),v=h.resolve(f.start),b=m.sameParent(g)&&m.parent.inlineContent&&v.end()>=f.endA;if((uo&&e.input.lastIOSEnter>Date.now()-225&&(!b||o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!b&&m.pos<u.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(u.doc.textBetween(m.pos,g.pos,"","")))&&e.someProp("handleKeyDown",(t=>t(e,Jr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,r,o){if(n-t<=o.pos-r.pos||Js(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(!r.parent.isTextblock){let e=i.nodeAfter;return null!=e&&n==t+e.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(Js(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Js(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(h,f.start,f.endA,m,g)&&e.someProp("handleKeyDown",(t=>t(e,Jr(8,"Backspace")))))return void(fo&&ao&&e.domObserver.suppressSelectionUpdates());ao&&f.endB==f.start&&(e.input.lastChromeDelete=Date.now()),fo&&!b&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==f.endA&&(f.endB-=2,g=u.doc.resolveNoCache(f.endB-u.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,Jr(13,"Enter"))}))}),20));let y,w=f.start,C=f.endA,x=t=>{let n=t||e.state.tr.replace(w,C,u.doc.slice(f.start-u.from,f.endB-u.from));if(u.sel){let t=Gs(e,n.doc,u.sel);t&&!(ao&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==w||t.head==n.mapping.map(C)-1)||ro&&t.empty&&t.head==w)&&n.setSelection(t)}return i&&n.setMeta("composition",i),n.scrollIntoView()};if(b)if(m.pos==g.pos){ro&&oo<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>ci(e)),20));let t=x(e.state.tr.delete(w,C)),n=h.resolve(f.start).marksAcross(h.resolve(f.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(f.endA==f.endB&&(y=function(e,t){let n,r,o,i=e.firstChild.marks,s=t.firstChild.marks,a=i,l=s;for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);for(let e=0;e<i.length;e++)l=i[e].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",o=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",o=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(o(t.child(e)));if(Ge.from(c).eq(e))return{mark:r,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),v.parent.content.cut(v.parentOffset,f.endA-v.start())))){let t=x(e.state.tr);"add"==y.type?t.addMark(w,C,y.mark):t.removeMark(w,C,y.mark),e.dispatch(t)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,w,C));e.someProp("handleTextInput",(r=>r(e,w,C,t,n)))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function Gs(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:gi(e,t.resolve(n.anchor),t.resolve(n.head))}function Js(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}function Xs(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class Ys{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Ki,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(ra),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=ta(this),ea(this),this.nodeViews=na(this),this.docView=Wo(this.state.doc,Qs(this),zs(this),this.dom,this),this.domObserver=new Bs(this,((e,t,n,r)=>Zs(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in qi){let n=qi[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Xi(e,t)||Ji(e,t)||!e.editable&&t.type in Wi||n(e,t)},Ui[t]?{passive:!0}:void 0)}co&&e.dom.addEventListener("input",(()=>null)),Gi(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Gi(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(ra),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let r=this.state,o=!1,i=!1;e.storedMarks&&this.composing&&(us(this),i=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=na(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,o=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Gi(this),this.editable=ta(this),ea(this);let a=zs(this),l=Qs(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",d=o||!this.docView.matchesNode(e.doc,l,a);!d&&e.selection.eq(r.selection)||(i=!0);let u="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(i,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=o-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:Co(e.dom)}}(this);if(i){this.domObserver.stop();let t=d&&(ro||ao)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(d){let n=ao?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=hs(this)),!o&&this.docView.update(e.doc,l,a,this)||(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=Wo(e.doc,l,a,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return qr(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?ci(this,t):(fi(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;xo(n,0==r?0:r-t)}(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof Qn){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&wo(this,t.getBoundingClientRect(),e)}else wo(this,this.coordsAtPos(this.state.selection.head,1),e);else;}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new vs(e.slice,e.move,r<0?void 0:Qn.create(this.state.doc,r))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let o=this.directPlugins[r].props[e];if(null!=o&&(n=t?t(o):o))return n}let o=this.state.plugins;if(o)for(let r=0;r<o.length;r++){let i=o[r].props[e];if(null!=i&&(n=t?t(i):i))return n}}hasFocus(){if(ro){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(ko)return e.focus(ko);let t=Co(e);e.focus(null==ko?{get preventScroll(){return ko={preventScroll:!0},!0}}:void 0),ko||(ko=!1,xo(t,0))}(this.dom),ci(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}updateRoot(){this._root=null}posAtCoords(e){return Mo(this,e)}coordsAtPos(e,t=1){return Ao(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return Ho(this,t||this.state,e)}pasteHTML(e,t){return ms(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ms(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Ni(this,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],zs(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,jr=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Ji(e,t)||!qi[t.type]||!e.editable&&t.type in Wi||qi[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?co&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return qs(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?qs(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Qs(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),t.translate||(t.translate="no"),[$s.node(0,e.state.doc.content.size,t)]}function ea(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:$s.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function ta(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function na(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function ra(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}Ys.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var oa={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ia={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},sa="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),aa="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),la=0;la<10;la++)oa[48+la]=oa[96+la]=String(la);for(la=1;la<=24;la++)oa[la+111]="F"+la;for(la=65;la<=90;la++)oa[la]=String.fromCharCode(la+32),ia[la]=String.fromCharCode(la);for(var ca in oa)ia.hasOwnProperty(ca)||(ia[ca]=oa[ca]);const da="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ua="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function ha(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let e=0;e<i.length-1;e++){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);da?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function pa(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function fa(e){let t=function(e){let t=Object.create(null);for(let n in e)t[ha(n)]=e[n];return t}(e);return function(e,n){let r,o=function(e){var t=!(sa&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||aa&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?ia:oa)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),i=t[pa(o,n)];if(i&&i(e.state,e.dispatch,e))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let r=t[pa(o,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(ua&&n.ctrlKey&&n.altKey)&&(r=oa[n.keyCode])&&r!=o){let o=t[pa(r,n)];if(o&&o(e.state,e.dispatch,e))return!0}}return!1}}var ma=Object.defineProperty,ga=(e,t)=>{for(var n in t)ma(e,n,{get:t[n],enumerable:!0})};function va(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}var ba=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!e,l=e||o.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),o=n(...e)(r);return s.push(o),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),s.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,o=e||n.tr,i=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})]))),chain:()=>this.createChain(o,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s={tr:e,editor:r,view:i,state:va({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(s)])))}};return s}},ya={};ga(ya,{blur:()=>wa,clearContent:()=>Ca,clearNodes:()=>xa,command:()=>ka,createParagraphNear:()=>$a,cut:()=>Sa,deleteCurrentNode:()=>Ea,deleteNode:()=>Ta,deleteRange:()=>Oa,deleteSelection:()=>Aa,enter:()=>Na,exitCode:()=>Ra,extendMarkRange:()=>_a,first:()=>Ba,focus:()=>Ka,forEach:()=>Za,insertContent:()=>Ga,insertContentAt:()=>Qa,joinBackward:()=>nl,joinDown:()=>tl,joinForward:()=>rl,joinItemBackward:()=>ol,joinItemForward:()=>il,joinTextblockBackward:()=>sl,joinTextblockForward:()=>al,joinUp:()=>el,keyboardShortcut:()=>cl,lift:()=>ul,liftEmptyBlock:()=>hl,liftListItem:()=>pl,newlineInCode:()=>fl,resetAttributes:()=>vl,scrollIntoView:()=>bl,selectAll:()=>yl,selectNodeBackward:()=>wl,selectNodeForward:()=>Cl,selectParentNode:()=>xl,selectTextblockEnd:()=>kl,selectTextblockStart:()=>$l,setContent:()=>El,setMark:()=>ac,setMeta:()=>lc,setNode:()=>cc,setNodeSelection:()=>dc,setTextDirection:()=>uc,setTextSelection:()=>hc,sinkListItem:()=>pc,splitBlock:()=>mc,splitListItem:()=>gc,toggleList:()=>yc,toggleMark:()=>wc,toggleNode:()=>Cc,toggleWrap:()=>xc,undoInputRule:()=>kc,unsetAllMarks:()=>$c,unsetMark:()=>Sc,unsetTextDirection:()=>Ec,updateAttributes:()=>Mc,wrapIn:()=>Tc,wrapInList:()=>Oc});var wa=()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())})),!0),Ca=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),xa=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:o}=r;return!n||(o.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:o}=t,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+e.nodeSize)),a=i.blockRange(s);if(!a)return;const l=xn(a);if(e.type.isTextblock){const{defaultType:e}=i.parent.contentMatchAt(i.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},ka=e=>t=>e(t),$a=()=>({state:e,dispatch:t})=>Or(e,t),Sa=(e,t)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,i.content),r.setSelection(new Xn(r.doc.resolve(Math.max(s-1,0)))),!0},Ea=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const o=e.selection.$anchor;for(let n=o.depth;n>0;n-=1){if(o.node(n).type===r.type){if(t){const t=o.before(n),r=o.after(n);e.delete(t,r).scrollIntoView()}return!0}}return!1};function Ma(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var Ta=e=>({tr:t,state:n,dispatch:r})=>{const o=Ma(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1){if(i.node(e).type===o){if(r){const n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},Oa=e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},La=(e,t,n)=>{if(!e.parent.isInline)return e.pos;if("left"===n&&e.pos>e.start()||"right"===n&&e.pos<e.end())return e.pos;const r=t.nodes[e.parent.type.name].spec;return(o=r).content&&/^text(\*|\+)/.test(o.content)?"left"===n?e.start()-1:e.end()+1:e.pos;var o},Aa=()=>({state:e,dispatch:t})=>{const{$from:n,$to:r}=e.selection;if(e.selection.empty)return!1;const{from:o,to:i}=((e,t,n)=>({from:La(e,n,"left"),to:La(t,n,"right")}))(n,r,e.schema);return t&&(e.tr.deleteRange(o,i).scrollIntoView(),t(e.tr)),!0},Na=()=>({commands:e})=>e.keyboardShortcut("Enter"),Ra=()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=Tr(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,s.createAndFill());o.setSelection(Kn.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0})(e,t);function Da(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function Pa(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:Da(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Ia(e,t,n={}){return e.find((e=>e.type===t&&Pa(Object.fromEntries(Object.keys(n).map((t=>[t,e.attrs[t]]))),n)))}function za(e,t,n={}){return!!Ia(e,t,n)}function Va(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(r.node&&r.node.marks.some((e=>e.type===t))||(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some((e=>e.type===t)))return;if(!n){const e=r.node.marks.find((e=>e.type===t));e&&(n=e.attrs)}if(!Ia([...r.node.marks],t,n))return;let o=r.index,i=e.start()+r.offset,s=o+1,a=i+r.node.nodeSize;for(;o>0&&za([...e.parent.child(o-1).marks],t,n);)o-=1,i-=e.parent.child(o).nodeSize;for(;s<e.parent.childCount&&za([...e.parent.child(s).marks],t,n);)a+=e.parent.child(s).nodeSize,s+=1;return{from:i,to:a}}function Ha(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var _a=(e,t)=>({tr:n,state:r,dispatch:o})=>{const i=Ha(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:d}=a;if(o){const e=Va(l,i,t);if(e&&e.from<=c&&e.to>=d){const t=Xn.create(s,e.from,e.to);n.setSelection(t)}}return!0},Ba=e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function ja(e){return e instanceof Xn}function Fa(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function qa(e,t=null){if(!t)return null;const n=Kn.atStart(e),r=Kn.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const o=n.from,i=r.to;return"all"===t?Xn.create(e,Fa(0,o,i),Fa(e.content.size,o,i)):Xn.create(e,Fa(t,o,i),Fa(t,o,i))}function Wa(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function Ua(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ka=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};const s=()=>{(Ua()||Wa())&&r.dom.focus(),"undefined"==typeof navigator||!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||Ua()||Wa()||r.dom.focus({preventScroll:!0}),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};try{if(r.hasFocus()&&null===e||!1===e)return!0}catch{return!1}if(i&&null===e&&!ja(n.state.selection))return s(),!0;const a=qa(o.doc,e)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},Za=(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),Ga=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Ja=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&Ja(r)}return e};function Xa(e){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return Ja(n)}function Ya(e,t,n){if(e instanceof yt||e instanceof Ge)return e;n={slice:!0,parseOptions:{},...n};const r="string"==typeof e;if("object"==typeof e&&null!==e)try{if(Array.isArray(e)&&e.length>0)return Ge.fromArray(e.map((e=>t.nodeFromJSON(e))));const r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Ya("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,o="";const i=new Vt({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(r=!0,o="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?_t.fromSchema(i).parseSlice(Xa(e),n.parseOptions):_t.fromSchema(i).parse(Xa(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const r=_t.fromSchema(t);return n.slice?r.parseSlice(Xa(e),n.parseOptions).content:r.parse(Xa(e),n.parseOptions)}return Ya("",t,n)}var Qa=(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){let o;const a=e=>{i.emit("contentError",{editor:i,error:e,disableCollaboration:()=>{"collaboration"in i.storage&&"object"==typeof i.storage.collaboration&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},l={preserveWhitespace:"full",...(n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{Ya(t,i.schema,{parseOptions:l,errorOnInvalidContent:!0})}catch(e){a(e)}try{o=Ya(t,i.schema,{parseOptions:l,errorOnInvalidContent:null!=(s=n.errorOnInvalidContent)?s:i.options.enableContentCheck})}catch(e){return a(e),!1}let{from:c,to:d}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},u=!0,h=!0;if(("type"in o?[o]:o).forEach((e=>{e.check(),u=!!u&&(e.isText&&0===e.marks.length),h=!!h&&e.isBlock})),c===d&&h){const{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(c-=1,d+=1)}let p;if(u){if(Array.isArray(t))p=t.map((e=>e.text||"")).join("");else if(t instanceof Ge){let e="";t.forEach((t=>{t.text&&(e+=t.text)})),p=e}else p="object"==typeof t&&t&&t.text?t.text:t;r.insertText(p,c,d)}else{p=o;const e=r.doc.resolve(c),t=e.node(),n=0===e.parentOffset,i=t.isText||t.isTextblock,s=t.content.size>0;n&&i&&s&&h&&(c=Math.max(0,c-1)),r.replaceWith(c,d,p)}n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const o=e.steps[r];if(!(o instanceof vn||o instanceof bn))return;const i=e.mapping.maps[r];let s=0;i.forEach(((e,t,n,r)=>{0===s&&(s=r)})),e.setSelection(Kn.near(e.doc.resolve(s),n))}(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},el=()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection,o=r instanceof Qn;if(o){if(r.node.isTextblock||!Tn(e.doc,r.from))return!1;n=r.from}else if(n=Ln(e.doc,r.from,-1),null==n)return!1;if(t){let r=e.tr.join(n);o&&r.setSelection(Qn.create(r.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(r.scrollIntoView())}return!0})(e,t),tl=()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection;if(r instanceof Qn){if(r.node.isTextblock||!Tn(e.doc,r.to))return!1;n=r.to}else if(n=Ln(e.doc,r.to,1),null==n)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0})(e,t),nl=()=>({state:e,dispatch:t})=>br(e,t),rl=()=>({state:e,dispatch:t})=>$r(e,t),ol=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Ln(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},il=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Ln(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},sl=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=vr(e,n);if(!r)return!1;let o=xr(r);return!!o&&yr(e,o,t)})(e,t),al=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=kr(e,n);if(!r)return!1;let o=Er(r);return!!o&&yr(e,o,t)})(e,t);function ll(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var cl=e=>({editor:t,view:n,tr:r,dispatch:o})=>{const i=function(e){const t=e.split(/-(?!$)/);let n,r,o,i,s=t[t.length-1];"Space"===s&&(s=" ");for(let e=0;e<t.length-1;e+=1){const s=t[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);Ua()||ll()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=i.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&o&&r.maybeStep(t)})),!0};function dl(e,t,n={}){const{from:r,to:o,empty:i}=e.selection,s=t?Ma(t,e.schema):null,a=[];e.doc.nodesBetween(r,o,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);a.push({node:e,from:n,to:i})}));const l=o-r,c=a.filter((e=>!s||s.name===e.node.type.name)).filter((e=>Pa(e.node.attrs,n,{strict:!1})));if(i)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}var ul=(e,t={})=>({state:n,dispatch:r})=>!!dl(n,Ma(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&xn(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)})(n,r),hl=()=>({state:e,dispatch:t})=>Lr(e,t),pl=e=>({state:t,dispatch:n})=>Hr(Ma(e,t.schema))(t,n),fl=()=>({state:e,dispatch:t})=>Mr(e,t);function ml(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function gl(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}var vl=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=ml("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(i=Ma(e,r.schema)),"mark"===a&&(s=Ha(e,r.schema));let l=!1;return n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{i&&i===e.type&&(l=!0,o&&n.setNodeMarkup(r,void 0,gl(e.attrs,t))),s&&e.marks.length&&e.marks.forEach((i=>{s===i.type&&(l=!0,o&&n.addMark(r,r+e.nodeSize,s.create(gl(i.attrs,t))))}))}))})),l},bl=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),yl=()=>({tr:e,dispatch:t})=>{if(t){const t=new tr(e.doc);e.setSelection(t)}return!0},wl=()=>({state:e,dispatch:t})=>Cr(e,t),Cl=()=>({state:e,dispatch:t})=>Sr(e,t),xl=()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:o}=e.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),t&&t(e.tr.setSelection(Qn.create(e.doc,n))),!0)})(e,t),kl=()=>({state:e,dispatch:t})=>Pr(e,t),$l=()=>({state:e,dispatch:t})=>Dr(e,t);function Sl(e,t,n={},r={}){return Ya(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var El=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{const{doc:l}=i;if("full"!==r.preserveWhitespace){const a=Sl(e,o.schema,r,{errorOnInvalidContent:null!=t?t:o.options.enableContentCheck});return s&&i.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!n),!0}return s&&i.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:o.options.enableContentCheck})};function Ml(e,t){const n=Ha(t,e.schema),{from:r,to:o,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function Tl(e,t){const n=new Wn(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}function Ol(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function Ll(e,t,n){if(void 0===e.config[t]&&e.parent)return Ll(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?Ll(e.parent,t,n):null})}return e.config[t]}function Al(e){return e.map((e=>{const t=Ll(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...Al(t())]:e})).flat(10)}function Nl(e,t){const n=Jt.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Rl(e){return"function"==typeof e}function Dl(e,t=void 0,...n){return Rl(e)?t?e.bind(t)(...n):e(...n):e}function Pl(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function Il(e){const t=[],{nodeExtensions:n,markExtensions:r}=Pl(e),o=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter((e=>"text"!==e.name)).map((e=>e.name)),a=r.map((e=>e.name)),l=[...s,...a];return e.forEach((e=>{const n=Ll(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:o});if(!n)return;n().forEach((e=>{let n;n=Array.isArray(e.types)?e.types:"*"===e.types?l:"nodes"===e.types?s:"marks"===e.types?a:[],n.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...i,...r}})}))}))}))})),o.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=Ll(e,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{const o={...i,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&void 0===(null==o?void 0:o.default)&&delete o.default,t.push({type:e.name,name:n,attribute:o})}))})),t}function zl(e){const t=[],n=function(e){const t=[];let n="",r=!1,o=!1,i=0;const s=e.length;for(let a=0;a<s;a+=1){const s=e[a];if("'"!==s||o)if('"'!==s||r){if(!r&&!o){if("("===s){i+=1,n+=s;continue}if(")"===s&&i>0){i-=1,n+=s;continue}if(";"===s&&0===i){t.push(n),n="";continue}}n+=s}else o=!o,n+=s;else r=!r,n+=s}return n&&t.push(n),t}(e||""),r=n.length;for(let e=0;e<r;e+=1){const r=n[e],o=r.indexOf(":");if(-1===o)continue;const i=r.slice(0,o).trim(),s=r.slice(o+1).trim();i&&s&&t.push([i,s])}return t}function Vl(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{if(n[e])if("class"===e){const r=t?String(t).split(" "):[],o=n[e]?n[e].split(" "):[],i=r.filter((e=>!o.includes(e)));n[e]=[...o,...i].join(" ")}else if("style"===e){const r=new Map([...zl(n[e]),...zl(t)]);n[e]=Array.from(r.entries()).map((([e,t])=>`${e}: ${t}`)).join("; ")}else n[e]=t;else n[e]=t})),n}),{})}function Hl(e,t){return t.filter((t=>t.type===e.type.name)).filter((e=>e.attribute.rendered)).map((t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]})).reduce(((e,t)=>Vl(e,t)),{})}function _l(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const o=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...o}}}}function Bl(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function jl(e){var t,n;const r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),void 0!==(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)&&(r.validate=e.attribute.validate),[e.name,r]}function Fl(e){return e.sort(((e,t)=>{const n=Ll(e,"priority")||100,r=Ll(t,"priority")||100;return n>r?-1:n<r?1:0}))}function ql(e){const t=Fl(Al(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return Array.from(new Set(t))}(t.map((e=>e.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e=>`'${e}'`)).join(", ")}]. This can lead to issues.`),t}function Wl(e,t,n){const{from:r,to:o}=t,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let a="";return e.nodesBetween(r,o,((e,n,l,c)=>{var d;e.isBlock&&n>r&&(a+=i);const u=null==s?void 0:s[e.type.name];if(u)return l&&(a+=u({node:e,pos:n,parent:l,index:c,range:t})),!1;e.isText&&(a+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,o-n))})),a}function Ul(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}function Kl(e,t){const n=ml("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=Ma(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,(e=>{i.push(e)}));const s=i.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?Ml(e,t):{}}function Zl(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.some((t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}))}function Gl(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,o)=>{const i=[];if(e.ranges.length)e.forEach(((e,t)=>{i.push({from:e,to:t})}));else{const{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;i.push({from:e,to:t})}i.forEach((({from:e,to:n})=>{const i=t.slice(o).map(e,-1),s=t.slice(o).map(n),a=t.invert().map(i,-1),l=t.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:i,to:s}})}))})),Zl(r)}function Jl(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const o=Va(n.resolve(e),t.type);o&&r.push({mark:t,...o})})):n.nodesBetween(e,t,((e,t)=>{e&&void 0!==(null==e?void 0:e.nodeSize)&&r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function Xl(e,t){return t.nodes[e]||t.marks[e]||null}function Yl(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}function Ql(e,t,n={}){const{empty:r,ranges:o}=e.selection,i=t?Ha(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!i||i.name===e.type.name)).find((e=>Pa(e.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((({$from:t,$to:n})=>{const r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,((e,t)=>{if(i&&e.inlineContent&&!e.type.allowsMarkType(i))return!1;if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),l=Math.min(o,t+e.nodeSize);s+=l-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:l}))))}))})),0===s)return!1;const l=a.filter((e=>!i||i.name===e.mark.type.name)).filter((e=>Pa(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!i||e.mark.type!==i&&e.mark.type.excludes(i))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=s}function ec(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function tc(e,t){const{nodeExtensions:n}=Pl(t),r=n.find((t=>t.name===e));if(!r)return!1;const o=Dl(Ll(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function nc(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return!/\S/.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach((e=>{!1!==r&&(nc(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))})),r}return!1}function rc(e){return e instanceof Qn}var oc=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function ic(e,t){const n=t.mapping.mapResult(e.position);return{position:new oc(n.pos),mapResult:n}}function sc(e){return new oc(e)}var ac=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Ha(e,r.schema);if(o)if(s){const e=Ml(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const o=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(o,i,((e,r)=>{const s=Math.max(r,o),a=Math.min(r+e.nodeSize,i);e.marks.find((e=>e.type===l))?e.marks.forEach((e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))})):n.addMark(s,a,l.create(t))}))}));return function(e,t,n){var r;const{selection:o}=t;let i=null;if(ja(o)&&(i=o.$cursor),i){const t=null!=(r=e.storedMarks)?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some((e=>e.type.excludes(n))))}const{ranges:s}=o;return s.some((({$from:t,$to:r})=>{let o=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,((e,t,r)=>{if(o)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),i=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));o=t&&i}return!o})),o}))}(r,n,l)},lc=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),cc=(e,t={})=>({state:n,dispatch:r,chain:o})=>{const i=Ma(e,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),i.isTextblock?o().command((({commands:e})=>!!Ir(i,{...s,...t})(n)||e.clearNodes())).command((({state:e})=>Ir(i,{...s,...t})(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},dc=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=Fa(e,0,n.content.size),o=Qn.create(n,r);t.setSelection(o)}return!0},uc=(e,t)=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=r;let s,a;return"number"==typeof t?(s=t,a=t):t&&"from"in t&&"to"in t?(s=t.from,a=t.to):(s=i.from,a=i.to),o&&n.doc.nodesBetween(s,a,((t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})})),!0},hc=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,i=Xn.atStart(n).from,s=Xn.atEnd(n).to,a=Fa(r,i,s),l=Fa(o,i,s),c=Xn.create(n,a,l);t.setSelection(c)}return!0},pc=e=>({state:t,dispatch:n})=>{const r=Ma(e,t.schema);return(o=r,function(e,t){let{$from:n,$to:r}=e.selection,i=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==o));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=o)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,r=Ge.from(n?o.create():null),s=new tt(Ge.from(o.create(null,Ge.from(a.type.create(null,r)))),n?3:1,0),c=i.start,d=i.end;t(e.tr.step(new bn(c-(n?3:1),d,c,d,s,1,!0)).scrollIntoView())}return!0})(t,n);var o};function fc(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}var mc=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=t,{$from:a,$to:l}=i,c=Yl(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof Qn&&i.node.isBlock)return!(!a.parentOffset||!Mn(s,a.pos))&&(r&&(e&&fc(n,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,u=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=d&&u?[{type:u,attrs:c}]:void 0,p=Mn(t.doc,t.mapping.map(a.pos),1,h);if(h||p||!Mn(t.doc,t.mapping.map(a.pos),1,u?[{type:u}]:void 0)||(p=!0,h=u?[{type:u,attrs:c}]:void 0),r){if(p&&(i instanceof Xn&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,h),u&&!d&&!a.parentOffset&&a.parent.type!==u)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,u)&&t.setNodeMarkup(t.mapping.map(a.before()),u)}e&&fc(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return p},gc=(e,t={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var s;const a=Ma(e,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;const h=i.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let e=Ge.empty;const r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=Ge.from(l.node(t).copy(e));const o=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,i={...Yl(h,l.node().type.name,l.node().attrs),...t},c=(null==(s=a.contentMatch.defaultType)?void 0:s.createAndFill(i))||void 0;e=e.append(Ge.from(a.createAndFill(null,c)||void 0));const d=l.before(l.depth-(r-1));n.replace(d,l.after(-o),new tt(e,4-r,0));let u=-1;n.doc.nodesBetween(d,n.doc.content.size,((e,t)=>{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)})),u>-1&&n.setSelection(Xn.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}const p=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,f={...Yl(h,u.type.name,u.attrs),...t},m={...Yl(h,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);const g=p?[{type:a,attrs:f},{type:p,attrs:m}]:[{type:a,attrs:f}];if(!Mn(n.doc,l.pos,2))return!1;if(o){const{selection:e,storedMarks:t}=r,{splittableMarks:s}=i.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!a||!o)return!0;const c=a.filter((e=>s.includes(e.type.name)));n.ensureMarks(c)}return!0},vc=(e,t)=>{const n=Ol((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Tn(e.doc,n.pos)||(e.join(n.pos),!0)},bc=(e,t)=>{const n=Ol((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Tn(e.doc,r)||(e.join(r),!0)};var yc=(e,t,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:u,splittableMarks:h}=o.extensionManager,p=Ma(e,s.schema),f=Ma(t,s.schema),{selection:m,storedMarks:g}=s,{$from:v,$to:b}=m,y=v.blockRange(b),w=g||m.$to.parentOffset&&m.$from.marks();if(!y)return!1;const C=Ol((e=>tc(e.type.name,u)))(m),x=0===m.from&&m.to===s.doc.content.size,k=s.doc.content.content,$=1===k.length?k[0]:null,S=x&&$&&tc($.type.name,u)?{node:$,pos:0}:null,E=null!=C?C:S,M=!!S;if((!!C&&y.depth>=1&&y.depth-C.depth<=1||M)&&E){if(E.node.type===p)return x&&M?l().command((({tr:e,dispatch:t})=>{const n=function(e){const t=e.doc,n=t.firstChild;if(!n)return null;const r=t.resolve(1),o=t.resolve(n.nodeSize-1);return Xn.between(r,o)}(e);return!!n&&(e.setSelection(n),t&&t(e),!0)})).liftListItem(f).run():c.liftListItem(f);if(tc(E.node.type.name,u)&&p.validContent(E.node.content))return l().command((()=>(i.setNodeMarkup(E.pos,p),!0))).command((()=>vc(i,p))).command((()=>bc(i,p))).run()}return n&&w&&a?l().command((()=>{const e=d().wrapInList(p,r),t=w.filter((e=>h.includes(e.type.name)));return i.ensureMarks(t),!!e||c.clearNodes()})).wrapInList(p,r).command((()=>vc(i,p))).command((()=>bc(i,p))).run():l().command((()=>!!d().wrapInList(p,r)||c.clearNodes())).wrapInList(p,r).command((()=>vc(i,p))).command((()=>bc(i,p))).run()},wc=(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Ha(e,r.schema);return Ql(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},Cc=(e,t,n={})=>({state:r,commands:o})=>{const i=Ma(e,r.schema),s=Ma(t,r.schema),a=dl(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?o.setNode(s,l):o.setNode(i,{...l,...n})},xc=(e,t={})=>({state:n,commands:r})=>{const o=Ma(e,n.schema);return dl(n,o,t)?r.lift(o):r.wrapIn(o,t)},kc=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){const t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){const n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},$c=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:o}=n;return r||t&&o.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},Sc=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=Ha(e,r.schema),{$from:c,empty:d,ranges:u}=a;if(!o)return!0;if(d&&s){let{from:e,to:t}=a;const r=null==(i=c.marks().find((e=>e.type===l)))?void 0:i.attrs,o=Va(c,l,r);o&&(e=o.from,t=o.to),n.removeMark(e,t,l)}else u.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},Ec=e=>({tr:t,state:n,dispatch:r})=>{const{selection:o}=n;let i,s;return"number"==typeof e?(i=e,s=e):e&&"from"in e&&"to"in e?(i=e.from,s=e.to):(i=o.from,s=o.to),r&&t.doc.nodesBetween(i,s,((e,n)=>{if(e.isText)return;const r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)})),!0},Mc=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=ml("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(i=Ma(e,r.schema)),"mark"===a&&(s=Ha(e,r.schema));let l=!1;return n.selection.ranges.forEach((e=>{const a=e.$from.pos,c=e.$to.pos;let d,u,h,p;n.selection.empty?r.doc.nodesBetween(a,c,((e,t)=>{i&&i===e.type&&(l=!0,h=Math.max(t,a),p=Math.min(t+e.nodeSize,c),d=t,u=e)})):r.doc.nodesBetween(a,c,((e,r)=>{r<a&&i&&i===e.type&&(l=!0,h=Math.max(r,a),p=Math.min(r+e.nodeSize,c),d=r,u=e),r>=a&&r<=c&&(i&&i===e.type&&(l=!0,o&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),s&&e.marks.length&&e.marks.forEach((i=>{if(s===i.type&&(l=!0,o)){const o=Math.max(r,a),l=Math.min(r+e.nodeSize,c);n.addMark(o,l,s.create({...i.attrs,...t}))}})))})),u&&(void 0!==d&&o&&n.setNodeMarkup(d,void 0,{...u.attrs,...t}),s&&u.marks.length&&u.marks.forEach((e=>{s===e.type&&o&&n.addMark(h,p,s.create({...e.attrs,...t}))})))})),l},Tc=(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&kn(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(Ma(e,n.schema),t)(n,r),Oc=(e,t={})=>({state:n,dispatch:r})=>Vr(Ma(e,n.schema),t)(n,r),Lc=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},Ac=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}};function Nc(e){var t;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let d=!1;const u=((e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,o,i)=>{var s,a;const l=(null==(a=(s=e.type.spec).toText)?void 0:a.call(s,{node:e,pos:t,parent:o,index:i}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))})),n})(c)+i;return s.forEach((e=>{if(d)return;const t=((e,t)=>{if(Da(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(u,e.find);if(!t)return;const s=l.state.tr,c=va({state:l.state,transaction:s}),h={from:r-(t[0].length-i.length),to:o},{commands:p,chain:f,can:m}=new ba({editor:n,state:c});null!==e.handler({state:c,range:h,match:t,commands:p,chain:f,can:m})&&s.steps.length&&(e.undoable&&s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),d=!0)})),d}function Rc(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function Dc(e,t){const n={...e};return Rc(e)&&Rc(t)&&Object.keys(t).forEach((r=>{Rc(t[r])&&Rc(e[r])?n[r]=Dc(e[r],t[r]):n[r]=t[r]})),n}var Pc=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Dl(Ll(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Dl(Ll(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Dc(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},Ic=class e extends Pc{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!!!o.find((e=>(null==e?void 0:e.type.name)===t.name)))return!1;const i=o.find((e=>(null==e?void 0:e.type.name)===t.name));return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};var zc=class{constructor(e){this.find=e.find,this.handler=e.handler}};function Vc(e){const{editor:t,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:c,can:d}=new ba({editor:t,state:n}),u=[];n.doc.nodesBetween(r,o,((e,t)=>{var h,p,f,m,g;if((null==(p=null==(h=e.type)?void 0:h.spec)?void 0:p.code)||!(e.isText||e.isTextblock||e.isInline))return;const v=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,b=Math.max(r,t),y=Math.min(o,t+v);if(b>=y)return;const w=((e,t,n)=>{if(Da(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map((t=>{const n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]})(e.isText?e.text||"":e.textBetween(b-t,y-t,void 0,""),i.find,s);w.forEach((e=>{if(void 0===e.index)return;const t=b+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},h=i.handler({state:n,range:o,match:e,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:a});u.push(h)}))}));return u.every((e=>null!==e))}var Hc=null;function _c(e){const{editor:t,rules:n}=e;let r,o=null,i=!1,s=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const l=({state:e,from:n,to:o,rule:i,pasteEvt:s})=>{const l=e.tr,c=va({state:e,transaction:l});if(Vc({editor:t,state:c,from:Math.max(n-1,0),to:o.b-1,rule:i,pasteEvent:s,dropEvent:r})&&l.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}},c=n.map((e=>new hr({view(e){const n=n=>{var r;o=(null==(r=e.dom.parentElement)?void 0:r.contains(n.target))?e.dom.parentElement:null,o&&(Hc=t)},r=()=>{Hc&&(Hc=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(s=o===e.dom.parentElement,r=t,!s){const e=Hc;(null==e?void 0:e.isEditable)&&setTimeout((()=>{const t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})}),10)}return!1},paste:(e,t)=>{var n;const r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const o=t[0],c="paste"===o.getMeta("uiEvent")&&!i,d="drop"===o.getMeta("uiEvent")&&!s,u=o.getMeta("applyPasteRules"),h=!!u;if(!c&&!d&&!h)return;if(h){let{text:t}=u;"string"==typeof t||(t=Nl(Ge.from(t),r.schema));const{from:n}=u,o=n+t.length,i=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t);return l({rule:e,state:r,from:n,to:{b:o},pasteEvt:i})}const p=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof p&&f&&p!==f.b?l({rule:e,state:r,from:p,to:f,pasteEvt:a}):void 0}})));return c}var Bc=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=ql(e),this.schema=function(e,t){var n;const r=Il(e),{nodeExtensions:o,markExtensions:i}=Pl(e),s=null==(n=o.find((e=>Ll(e,"topNode"))))?void 0:n.name,a=Object.fromEntries(o.map((n=>{const o=r.filter((e=>e.type===n.name)),i={name:n.name,options:n.options,storage:n.storage,editor:t},s=Bl({...e.reduce(((e,t)=>{const r=Ll(t,"extendNodeSchema",i);return{...e,...r?r(n):{}}}),{}),content:Dl(Ll(n,"content",i)),marks:Dl(Ll(n,"marks",i)),group:Dl(Ll(n,"group",i)),inline:Dl(Ll(n,"inline",i)),atom:Dl(Ll(n,"atom",i)),selectable:Dl(Ll(n,"selectable",i)),draggable:Dl(Ll(n,"draggable",i)),code:Dl(Ll(n,"code",i)),whitespace:Dl(Ll(n,"whitespace",i)),linebreakReplacement:Dl(Ll(n,"linebreakReplacement",i)),defining:Dl(Ll(n,"defining",i)),isolating:Dl(Ll(n,"isolating",i)),attrs:Object.fromEntries(o.map(jl))}),a=Dl(Ll(n,"parseHTML",i));a&&(s.parseDOM=a.map((e=>_l(e,o))));const l=Ll(n,"renderHTML",i);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:Hl(e,o)}));const c=Ll(n,"renderText",i);return c&&(s.toText=c),[n.name,s]}))),l=Object.fromEntries(i.map((n=>{const o=r.filter((e=>e.type===n.name)),i={name:n.name,options:n.options,storage:n.storage,editor:t},s=Bl({...e.reduce(((e,t)=>{const r=Ll(t,"extendMarkSchema",i);return{...e,...r?r(n):{}}}),{}),inclusive:Dl(Ll(n,"inclusive",i)),excludes:Dl(Ll(n,"excludes",i)),group:Dl(Ll(n,"group",i)),spanning:Dl(Ll(n,"spanning",i)),code:Dl(Ll(n,"code",i)),attrs:Object.fromEntries(o.map(jl))}),a=Dl(Ll(n,"parseHTML",i));a&&(s.parseDOM=a.map((e=>_l(e,o))));const l=Ll(n,"renderHTML",i);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:Hl(e,o)})),[n.name,s]})));return new Vt({topNode:s,nodes:a,marks:l})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce(((e,t)=>{const n=Ll(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Xl(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=Fl([...this.extensions].reverse()).flatMap((t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Xl(t.name,this.schema)},r=[],o=Ll(t,"addKeyboardShortcuts",n);let i={};if("mark"===t.type&&Ll(t,"exitable",n)&&(i.ArrowRight=()=>Ic.handleExit({editor:e,mark:t})),o){const t=Object.fromEntries(Object.entries(o()).map((([t,n])=>[t,()=>n({editor:e})])));i={...i,...t}}const s=new hr({props:{handleKeyDown:fa(i)}});r.push(s);const a=Ll(t,"addInputRules",n);if(ec(t,e.options.enableInputRules)&&a){const t=a();if(t&&t.length){const n=function(e){const{editor:t,rules:n}=e,r=new hr({state:{init:()=>null,apply(e,o,i){const s=e.getMeta(r);if(s)return s;const a=e.getMeta("applyInputRules");return!!a&&setTimeout((()=>{let{text:e}=a;"string"==typeof e||(e=Nl(Ge.from(e),i.schema));const{from:o}=a,s=o+e.length;Nc({editor:t,from:o,to:s,text:e,rules:n,plugin:r})})),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput:(e,o,i,s)=>Nc({editor:t,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:o}=e.state.selection;o&&Nc({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;const{$cursor:i}=e.state.selection;return!!i&&Nc({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),o=Array.isArray(n)?n:[n];r.push(...o)}}const l=Ll(t,"addPasteRules",n);if(ec(t,e.options.enablePasteRules)&&l){const t=l();if(t&&t.length){const n=_c({editor:e,rules:t});r.push(...n)}}const c=Ll(t,"addProseMirrorPlugins",n);if(c){const e=c();r.push(...e)}return r}));return t}get attributes(){return Il(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Pl(this.extensions);return Object.fromEntries(t.filter((e=>!!Ll(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Ma(t.name,this.schema)},o=Ll(t,"addNodeView",r);if(!o)return[];const i=o();if(!i)return[];return[t.name,(r,o,s,a,l)=>{const c=Hl(r,n);return i({node:r,view:o,getPos:s,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:c})}]})))}dispatchTransaction(e){const{editor:t}=this;return Fl([...this.extensions].reverse()).reduceRight(((e,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Xl(n.name,this.schema)},o=Ll(n,"dispatchTransaction",r);return o?t=>{o.call(r,{transaction:t,next:e})}:e}),e)}transformPastedHTML(e){const{editor:t}=this;return Fl([...this.extensions]).reduce(((e,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Xl(n.name,this.schema)},o=Ll(n,"transformPastedHTML",r);return o?(t,n)=>{const i=e(t,n);return o.call(r,i)}:e}),e||(e=>e))}get markViews(){const{editor:e}=this,{markExtensions:t}=Pl(this.extensions);return Object.fromEntries(t.filter((e=>!!Ll(e,"addMarkView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Ha(t.name,this.schema)},o=Ll(t,"addMarkView",r);if(!o)return[];return[t.name,(r,i,s)=>{const a=Hl(r,n);return o()({mark:r,view:i,inline:s,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{!function(e,t,n={}){const{state:r}=t,{doc:o,tr:i}=r,s=e;o.descendants(((t,r)=>{const o=i.mapping.map(r),a=i.mapping.map(r)+t.nodeSize;let l=null;if(t.marks.forEach((e=>{if(e!==s)return!1;l=e})),!l)return;let c=!1;if(Object.keys(n).forEach((e=>{n[e]!==l.attrs[e]&&(c=!0)})),c){const t=e.type.create({...e.attrs,...n});i.removeMark(o,a,e.type),i.addMark(o,a,t)}})),i.docChanged&&t.view.dispatch(i)}(r,e,t)}})}]})))}destroy(){this.extensions.forEach((e=>{let t=e;for(;t.parent;){const e=t.parent;e.child===t&&(e.child=null),t=e}})),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map((e=>[e.name,e.storage]))),e.forEach((e=>{var t;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Xl(e.name,this.schema)};if("mark"===e.type){(null==(t=Dl(Ll(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name)}const r=Ll(e,"onBeforeCreate",n),o=Ll(e,"onCreate",n),i=Ll(e,"onUpdate",n),s=Ll(e,"onSelectionUpdate",n),a=Ll(e,"onTransaction",n),l=Ll(e,"onFocus",n),c=Ll(e,"onBlur",n),d=Ll(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),i&&this.editor.on("update",i),s&&this.editor.on("selectionUpdate",s),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)}))}};Bc.resolve=ql,Bc.sort=Fl,Bc.flatten=Al;ga({},{ClipboardTextSerializer:()=>Fc,Commands:()=>qc,Delete:()=>Wc,Drop:()=>Uc,Editable:()=>Kc,FocusEvents:()=>Gc,Keymap:()=>Jc,Paste:()=>Xc,Tabindex:()=>Yc,TextDirection:()=>Qc,focusEventsPluginKey:()=>Zc});var jc=class e extends Pc{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},Fc=jc.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new hr({key:new mr("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,s=Math.min(...i.map((e=>e.$from.pos))),a=Math.max(...i.map((e=>e.$to.pos))),l=Ul(n);return Wl(r,{from:s,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),qc=jc.create({name:"commands",addCommands:()=>({...ya})}),Wc=jc.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,o;const i=()=>{var n,r,o,i;if(null!=(i=null==(o=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:o.call(r,e))?i:e.getMeta("y-sync$"))return;const s=Tl(e.before,[e,...t]);Gl(s).forEach((t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,((n,r)=>{const o=r+n.nodeSize-2,i=t.oldRange.from<=r&&o<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:o,newFrom:s.mapping.map(r),newTo:s.mapping.map(o),deletedRange:t.oldRange,newRange:t.newRange,partial:!i,editor:this.editor,transaction:e,combinedTransform:s})}))}));const a=s.mapping;s.steps.forEach(((t,n)=>{var r,o;if(t instanceof fn){const i=a.slice(n).map(t.from,-1),l=a.slice(n).map(t.to),c=a.invert().map(i,-1),d=a.invert().map(l),u=i>0&&(null==(r=s.doc.nodeAt(i-1))?void 0:r.marks.some((e=>e.eq(t.mark)))),h=null==(o=s.doc.nodeAt(l))?void 0:o.marks.some((e=>e.eq(t.mark)));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:i,to:l},partial:Boolean(h||u),editor:this.editor,transaction:e,combinedTransform:s})}}))};null==(o=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||o?setTimeout(i,0):i()}}),Uc=jc.create({name:"drop",addProseMirrorPlugins(){return[new hr({key:new mr("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Kc=jc.create({name:"editable",addProseMirrorPlugins(){return[new hr({key:new mr("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Zc=new mr("focusEvents"),Gc=jc.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new hr({key:Zc,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),Jc=jc.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:o,$anchor:i}=n,{pos:s,parent:a}=i,l=i.parent.isTextblock&&s>0?t.doc.resolve(s-1):i,c=l.parent.type.spec.isolating,d=i.pos-i.parentOffset,u=c&&1===l.parent.childCount?d===i.pos:Kn.atStart(r).from===s;return!(!o||!a.type.isTextblock||a.textContent.length||!u||u&&"paragraph"===i.parent.type.name)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ua()||ll()?o:r},addProseMirrorPlugins(){return[new hr({key:new mr("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some((e=>e.getMeta("composition"))))return;const r=e.some((e=>e.docChanged))&&!t.doc.eq(n.doc),o=e.some((e=>e.getMeta("preventClearDocument")));if(!r||o)return;const{empty:i,from:s,to:a}=t.selection,l=Kn.atStart(t.doc).from,c=Kn.atEnd(t.doc).to;if(i||!(s===l&&a===c))return;if(!nc(n.doc))return;const d=n.tr,u=va({state:n,transaction:d}),{commands:h}=new ba({editor:this.editor,state:u});return h.clearNodes(),d.steps.length?d:void 0}})]}}),Xc=jc.create({name:"paste",addProseMirrorPlugins(){return[new hr({key:new mr("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),Yc=jc.create({name:"tabindex",addOptions:()=>({value:void 0}),addProseMirrorPlugins(){return[new hr({key:new mr("tabindex"),props:{attributes:()=>{var e;return this.editor.isEditable||void 0!==this.options.value?{tabindex:null!=(e=this.options.value)?e:"0"}:{}}}})]}}),Qc=jc.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=Pl(this.extensions);return[{types:e.filter((e=>"text"!==e.name)).map((e=>e.name)),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return!t||"ltr"!==t&&"rtl"!==t&&"auto"!==t?this.options.direction:t},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new hr({key:new mr("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),ed=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){const t=[];return this.node.content.forEach(((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=n.isInline,a=this.pos+r+(i?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!o&&!s&&l.depth<=this.depth)return;const c=new e(l,this.editor,o,o||s?n:null);o&&(c.actualDepth=this.depth+1),t.push(c)})),t}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){const e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];if(e[o]!==t[o])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;const o=Object.keys(t);return this.children.forEach((i=>{if(!(n&&r.length>0)){if(i.node.type.name===e){o.every((e=>t[e]===i.node.attrs[e]))&&r.push(i)}n&&r.length>0||(r=r.concat(i.querySelectorAll(e,t,n)))}})),r}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}};var td=class extends Lc{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"undefined"!=typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:ic,createMappablePosition:sc},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",(({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n))),this.on("paste",(({event:e,slice:t})=>this.options.onPaste(e,t))),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=qa(t,this.options.autofocus);this.editorState=dr.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if("undefined"==typeof document)throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout((()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)}),0)}unmount(){if(this.editorView){const e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"undefined"!=typeof document&&(this.css=function(e,t){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}',this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=Rl(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach((e=>{const t="string"==typeof e?`${e}$`:e.key;n=n.filter((e=>!e.key.startsWith(t)))})),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t,n,r;const o=[...this.options.enableCoreExtensions?[Kc,Fc.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),qc,Gc,Jc,Yc.configure({value:null==(r=null==(n=this.options.coreExtensionOptions)?void 0:n.tabindex)?void 0:r.value}),Uc,Xc,Wc,Qc.configure({direction:this.options.textDirection})].filter((e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name])):[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new Bc(o,this)}createCommandManager(){this.commandManager=new ba({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Sl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message)))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter((e=>"collaboration"!==e.name)),this.createExtensionManager()}}),e=Sl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,i=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(i);this.editorView=new Ys(e,{...t,attributes:{role:"textbox",...null==t?void 0:t.attributes},dispatchTransaction:o,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)})):void(this.capturedTransaction=e);const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),o=n.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!o)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const s=n.findLast((e=>e.getMeta("focus")||e.getMeta("blur"))),a=null==s?void 0:s.getMeta("focus"),l=null==s?void 0:s.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),e.getMeta("preventUpdate")||!n.some((e=>e.docChanged))||i.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return Kl(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return dl(e,null,n)||Ql(e,null,n);const r=ml(t,e.schema);return"node"===r?dl(e,t,n):"mark"===r&&Ql(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Nl(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return Wl(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...Ul(this.schema),...n}})}get isEmpty(){return nc(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText?t.nodeAfter:null;return new ed(t,this,!1,n)}get $doc(){return this.$pos(0)}};function nd(e){return new Ac({find:e.find,handler:({state:t,range:n,match:r})=>{const o=Dl(e.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=t,s=r[r.length-1],a=r[0];if(s){const r=a.search(/\S/),l=n.from+a.indexOf(s),c=l+s.length;if(Jl(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>l)).length)return null;c<n.to&&i.delete(c,n.to),l>n.from&&i.delete(n.from+r,l);const d=n.from+r+s.length;i.addMark(n.from+r,d,e.type.create(o||{})),i.removeStoredMark(e.type)}},undoable:e.undoable})}function rd(e){return new Ac({find:e.find,handler:({state:t,range:n,match:r})=>{const o=Dl(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from;let a=n.to;const l=e.type.create(o);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;const t=r[0][r[0].length-1];i.insertText(t,s+r[0].length-1),i.replaceWith(e,a,l)}else if(r[0]){const t=e.type.isInline?s:s-1;i.insert(t,e.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()},undoable:e.undoable})}function od(e){return new Ac({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=Dl(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)},undoable:e.undoable})}function id(e){return new Ac({find:e.find,handler:({state:t,range:n,match:r,chain:o})=>{const i=Dl(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&kn(a,e.type,i);if(!l)return null;if(s.wrap(a,l),e.keepMarks&&e.editor){const{selection:n,storedMarks:r}=t,{splittableMarks:o}=e.editor.extensionManager,i=r||n.$to.parentOffset&&n.$from.marks();if(i){const e=i.filter((e=>o.includes(e.type.name)));s.ensureMarks(e)}}if(e.keepAttributes){const t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";o().updateAttributes(t,i).run()}const c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&Tn(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&s.join(n.from-1)},undoable:e.undoable})}var sd=class{constructor(e){var t,n,r,o,i,s;this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;const t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;const t=e.touches[0];if(!t)return;const n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;const e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=e=>{"Shift"===e.key&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{"Shift"===e.key&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,(null==(t=e.options)?void 0:t.min)&&(this.minSize={...this.minSize,...e.options.min}),(null==(n=e.options)?void 0:n.max)&&(this.maxSize=e.options.max),(null==(r=null==e?void 0:e.options)?void 0:r.directions)&&(this.directions=e.options.directions),(null==(o=e.options)?void 0:o.preserveAspectRatio)&&(this.preserveAspectRatio=e.options.preserveAspectRatio),(null==(i=e.options)?void 0:i.className)&&(this.classNames={container:e.options.className.container||"",wrapper:e.options.className.wrapper||"",handle:e.options.className.handle||"",resizing:e.options.className.resizing||""}),(null==(s=e.options)?void 0:s.createCustomHandle)&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var e;return null!=(e=this.contentElement)?e:null}handleEditorUpdate(){const e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&0===this.handleMap.size&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type&&(this.node=e,!this.onUpdate||this.onUpdate(e,t,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const e=document.createElement("div");return e.dataset.resizeContainer="",e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){const e=document.createElement("div");return e.style.position="relative",e.style.display="block",e.dataset.resizeWrapper="",this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){const t=document.createElement("div");return t.dataset.resizeHandle=e,t.style.position="absolute",this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){const n=t.includes("top"),r=t.includes("bottom"),o=t.includes("left"),i=t.includes("right");n&&(e.style.top="0"),r&&(e.style.bottom="0"),o&&(e.style.left="0"),i&&(e.style.right="0"),"top"!==t&&"bottom"!==t||(e.style.left="0",e.style.right="0"),"left"!==t&&"right"!==t||(e.style.top="0",e.style.bottom="0")}attachHandles(){this.directions.forEach((e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener("mousedown",(t=>this.handleResizeStart(t,e))),t.addEventListener("touchstart",(t=>this.handleResizeStart(t,e))),this.handleMap.set(e,t),this.wrapper.appendChild(t)}))}removeHandles(){this.handleMap.forEach((e=>e.remove())),this.handleMap.clear()}applyInitialSize(){const e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,"touches"in e?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:o}=this.calculateNewDimensions(this.activeHandle,e,t),i=this.applyConstraints(r,o,n);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,o=this.startHeight;const i=e.includes("right"),s=e.includes("left"),a=e.includes("bottom"),l=e.includes("top");i?r=this.startWidth+t:s&&(r=this.startWidth-t),a?o=this.startHeight+n:l&&(o=this.startHeight-n),"right"!==e&&"left"!==e||(r=this.startWidth+(i?t:-t)),"top"!==e&&"bottom"!==e||(o=this.startHeight+(a?n:-n));return this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,o,e):{width:r,height:o}}applyConstraints(e,t,n){var r,o,i,s;if(!n){let n=Math.max(this.minSize.width,e),i=Math.max(this.minSize.height,t);return(null==(r=this.maxSize)?void 0:r.width)&&(n=Math.min(this.maxSize.width,n)),(null==(o=this.maxSize)?void 0:o.height)&&(i=Math.min(this.maxSize.height,i)),{width:n,height:i}}let a=e,l=t;return a<this.minSize.width&&(a=this.minSize.width,l=a/this.aspectRatio),l<this.minSize.height&&(l=this.minSize.height,a=l*this.aspectRatio),(null==(i=this.maxSize)?void 0:i.width)&&a>this.maxSize.width&&(a=this.maxSize.width,l=a/this.aspectRatio),(null==(s=this.maxSize)?void 0:s.height)&&l>this.maxSize.height&&(l=this.maxSize.height,a=l*this.aspectRatio),{width:a,height:l}}applyAspectRatio(e,t,n){const r="top"===n||"bottom"===n;return"left"===n||"right"===n?{width:e,height:e/this.aspectRatio}:r?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};function ad(e,t){const n=e.getAttribute("style");if(!n)return null;const r=n.split(";").map((e=>e.trim())).filter(Boolean),o=t.toLowerCase();for(let e=r.length-1;e>=0;e-=1){const t=r[e],n=t.indexOf(":");if(-1===n)continue;if(t.slice(0,n).trim().toLowerCase()===o)return t.slice(n+1).trim()}return null}function ld(e){if(!(null==e?void 0:e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,(e=>(n.push(e),`__QUOTED_${n.length-1}__`))),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){const e=o.map((e=>e.trim().slice(1)));t.class=e.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(t.id=i[1]);Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach((([,e,r])=>{var o;const i=parseInt((null==(o=r.match(/__QUOTED_(\d+)__/))?void 0:o[1])||"0",10),s=n[i];s&&(t[e]=s.slice(1,-1))}));const s=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();if(s){s.split(/\s+/).filter(Boolean).forEach((e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}))}return t}function cd(e){if(!e||0===Object.keys(e).length)return"";const t=[];if(e.class){String(e.class).split(/\s+/).filter(Boolean).forEach((e=>t.push(`.${e}`)))}return e.id&&t.push(`#${e.id}`),Object.entries(e).forEach((([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))})),t.join(" ")}function dd(e){const{nodeName:t,name:n,parseAttributes:r=ld,serializeAttributes:o=cd,defaultAttributes:i={},requiredAttributes:s=[],allowedAttributes:a}=e,l=n||t;return{parseMarkdown:(e,n)=>{const r={...i,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${l}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,o){const i=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),a=e.match(i);if(!a)return;const c=a[1]||"",d=r(c);return s.find((e=>!(e in d)))?void 0:{type:t,raw:a[0],attributes:d}}},renderMarkdown:e=>{const t=(e=>{if(!a)return e;const t={};return a.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),n=o(t);return`:::${l}${n?` {${n}}`:""} :::`}}}function ud(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=ld,serializeAttributes:i=cd,defaultAttributes:s={},content:a="block",allowedAttributes:l}=e,c=n||t;return{parseMarkdown:(e,n)=>{let o;if(r){const t=r(e);o="string"==typeof t?[{type:"text",text:t}]:t}else o="block"===a?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);const i={...s,...e.attributes};return n.createNode(t,i,o)},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var i;const s=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),l=e.match(s);if(!l)return;const[d,u=""]=l,h=o(u);let p=1;const f=d.length;let m="";const g=/^:::([\w-]*)(\s.*)?/gm,v=e.slice(f);for(g.lastIndex=0;;){const n=g.exec(v);if(null===n)break;const o=n.index,s=n[1];if(!(null==(i=n[2])?void 0:i.endsWith(":::")))if(s)p+=1;else if(p-=1,0===p){const i=v.slice(0,o);m=i.trim();const s=e.slice(0,f+o+n[0].length);let l=[];if(m)if("block"===a)for(l=r.blockTokens(i),l.forEach((e=>{!e.text||e.tokens&&0!==e.tokens.length||(e.tokens=r.inlineTokens(e.text))}));l.length>0;){const e=l[l.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;l.pop()}else l=r.inlineTokens(m);return{type:t,raw:s,attributes:h,content:m,tokens:l}}}}},renderMarkdown:(e,t)=>{const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),r=i(n),o=r?` {${r}}`:"",s=t.renderChildren(e.content||[],"\n\n");return`:::${c}${o}\n\n${s}\n\n:::`}}}function hd(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;null!==r;){const[,o,i,s]=r;t[o]=i||s,r=n.exec(e)}return t}function pd(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}="${t}"`)).join(" ")}function fd(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=hd,serializeAttributes:i=pd,defaultAttributes:s={},selfClosing:a=!1,allowedAttributes:l}=e,c=n||t,d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{const o={...s,...e.attributes};if(a)return n.createNode(t,o);const i=r?r(e):e.content||"";return i?n.createNode(t,o,[n.createTextNode(i)]):n.createNode(t,o,[])},markdownTokenizer:{name:t,level:"inline",start(e){const t=a?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){const i=a?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),s=e.match(i);if(!s)return;let l="",c="";if(a){const[,e]=s;c=e}else{const[,e,t]=s;c=e,l=t||""}const u=o(c.trim());return{type:t,raw:s[0],content:l.trim(),attributes:u}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter((e=>"text"===e.type)).map((e=>e.text)).join(""));const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{const r="string"==typeof n?n:n.name,o="string"==typeof n?void 0:n.skipIfDefault;if(r in e){const n=e[r];if(void 0!==o&&n===o)return;t[r]=n}})),t})(e.attrs||{}),o=i(n),s=o?` ${o}`:"";return a?`[${c}${s}]`:`[${c}${s}]${t}[/${c}]`}}}function md(e,t,n){var r,o,i,s;const a=e.split("\n"),l=[];let c="",d=0;const u=t.baseIndentSize||2;for(;d<a.length;){const e=a[d],h=e.match(t.itemPattern);if(!h){if(l.length>0)break;if(""===e.trim()){d+=1,c=`${c}${e}\n`;continue}return}const p=t.extractItemData(h),{indentLevel:f,mainContent:m}=p;c=`${c}${e}\n`;const g=[m];for(d+=1;d<a.length;){const e=a[d];if(""===e.trim()){const t=a.slice(d+1).findIndex((e=>""!==e.trim()));if(-1===t)break;if(((null==(o=null==(r=a[d+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:o.length)||0)>f){g.push(e),c=`${c}${e}\n`,d+=1;continue}break}if(!(((null==(s=null==(i=e.match(/^(\s*)/))?void 0:i[1])?void 0:s.length)||0)>f))break;g.push(e),c=`${c}${e}\n`,d+=1}let v;const b=g.slice(1);if(b.length>0){const e=b.map((e=>e.slice(f+u))).join("\n");e.trim()&&(v=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}const y=t.createToken(p,v);l.push(y)}if(0!==l.length)return{items:l,raw:c}}function gd(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const o="function"==typeof n?n(r):n,[i,...s]=e.content;let a=`${o}${t.renderChildren([i])}`;return s&&s.length>0&&s.forEach(((e,n)=>{var r,o;const i=null!=(o=null==(r=t.renderChild)?void 0:r.call(t,e,n+1))?o:t.renderChildren([e]);if(null!=i){const n=i.split("\n").map((e=>e?t.indent(e):t.indent(""))).join("\n");a+="paragraph"===e.type?`\n\n${n}`:`\n${n}`}})),a}ga({},{createAtomBlockMarkdownSpec:()=>dd,createBlockMarkdownSpec:()=>ud,createInlineMarkdownSpec:()=>fd,parseAttributes:()=>ld,parseIndentedBlocks:()=>md,renderNestedMarkdownContent:()=>gd,serializeAttributes:()=>cd});var vd=class e extends Pc{constructor(){super(...arguments),this.type="node"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};function bd(e){return new zc({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{const i=Dl(e.getAttributes,void 0,r,o);if(!1===i||null===i)return null;const{tr:s}=t,a=r[r.length-1],l=r[0];let c=n.to;if(a){const o=l.search(/\S/),d=n.from+l.indexOf(a),u=d+a.length;if(Jl(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>d)).length)return null;u<n.to&&s.delete(u,n.to),d>n.from&&s.delete(n.from+o,d),c=n.from+o+a.length,s.addMark(n.from+o,c,e.type.create(i||{}));void 0!==r.index&&void 0!==r.input&&r.index+r[0].length>=r.input.length||s.removeStoredMark(e.type)}}})}var yd=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,wd=vd.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",Vl(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,r,o,i,s;const a=null!=(n=null==(t=e.attrs)?void 0:t.src)?n:"",l=null!=(o=null==(r=e.attrs)?void 0:r.alt)?o:"",c=null!=(s=null==(i=e.attrs)?void 0:i.title)?s:"";return c?`![${l}](${a} "${c}")`:`![${l}](${a})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||"undefined"==typeof document)return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:o,getPos:i,HTMLAttributes:s,editor:a})=>{const l=document.createElement("img");Object.entries(s).forEach((([e,t])=>{if(null!=t)switch(e){case"width":case"height":break;default:l.setAttribute(e,t)}})),l.src=s.src;const c=new sd({element:l,editor:a,node:o,getPos:i,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{const n=i();void 0!==n&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===o.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:!0===r}}),d=c.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",l.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},c}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[rd({find:yd,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),Cd=wd;const xd="numeric",kd="ascii",$d="alpha",Sd="asciinumeric",Ed="alphanumeric",Md="domain",Td="emoji",Od="scheme",Ld="slashscheme",Ad="whitespace";function Nd(e,t){return e in t||(t[e]=[]),t[e]}function Rd(e,t,n){t[xd]&&(t[Sd]=!0,t[Ed]=!0),t[kd]&&(t[Sd]=!0,t[$d]=!0),t[Sd]&&(t[Ed]=!0),t[$d]&&(t[Ed]=!0),t[Ed]&&(t[Md]=!0),t[Td]&&(t[Md]=!0);for(const r in t){const t=Nd(r,n);t.indexOf(e)<0&&t.push(e)}}function Dd(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Dd.groups={},Dd.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){const r=t.jr[n][0],o=t.jr[n][1];if(o&&r.test(e))return o}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){let o;return r=r||Dd.groups,t&&t.j?o=t:(o=new Dd(t),n&&r&&Rd(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const i=e.length;if(!i)return o;for(let t=0;t<i-1;t++)o=o.tt(e[t]);return o.tt(e[i-1],t,n,r)},tt(e,t,n,r){r=r||Dd.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const i=t;let s,a=o.go(e);if(a?(s=new Dd,Object.assign(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Dd,i){if(r)if(s.t&&"string"==typeof s.t){const e=Object.assign(function(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(s.t,r),n);Rd(i,e,r)}else n&&Rd(i,n,r);s.t=i}return o.j[e]=s,s}};const Pd=(e,t,n,r,o)=>e.ta(t,n,r,o),Id=(e,t,n,r,o)=>e.tr(t,n,r,o),zd=(e,t,n,r,o)=>e.ts(t,n,r,o),Vd=(e,t,n,r,o)=>e.tt(t,n,r,o),Hd="WORD",_d="UWORD",Bd="ASCIINUMERICAL",jd="ALPHANUMERICAL",Fd="LOCALHOST",qd="TLD",Wd="UTLD",Ud="SCHEME",Kd="SLASH_SCHEME",Zd="NUM",Gd="WS",Jd="NL",Xd="OPENBRACE",Yd="CLOSEBRACE",Qd="OPENBRACKET",eu="CLOSEBRACKET",tu="OPENPAREN",nu="CLOSEPAREN",ru="OPENANGLEBRACKET",ou="CLOSEANGLEBRACKET",iu="FULLWIDTHLEFTPAREN",su="FULLWIDTHRIGHTPAREN",au="LEFTCORNERBRACKET",lu="RIGHTCORNERBRACKET",cu="LEFTWHITECORNERBRACKET",du="RIGHTWHITECORNERBRACKET",uu="FULLWIDTHLESSTHAN",hu="FULLWIDTHGREATERTHAN",pu="AMPERSAND",fu="APOSTROPHE",mu="ASTERISK",gu="AT",vu="BACKSLASH",bu="BACKTICK",yu="CARET",wu="COLON",Cu="COMMA",xu="DOLLAR",ku="DOT",$u="EQUALS",Su="EXCLAMATION",Eu="HYPHEN",Mu="PERCENT",Tu="PIPE",Ou="PLUS",Lu="POUND",Au="QUERY",Nu="QUOTE",Ru="FULLWIDTHMIDDLEDOT",Du="SEMI",Pu="SLASH",Iu="TILDE",zu="UNDERSCORE",Vu="EMOJI",Hu="SYM";var _u=Object.freeze({__proto__:null,ALPHANUMERICAL:jd,AMPERSAND:pu,APOSTROPHE:fu,ASCIINUMERICAL:Bd,ASTERISK:mu,AT:gu,BACKSLASH:vu,BACKTICK:bu,CARET:yu,CLOSEANGLEBRACKET:ou,CLOSEBRACE:Yd,CLOSEBRACKET:eu,CLOSEPAREN:nu,COLON:wu,COMMA:Cu,DOLLAR:xu,DOT:ku,EMOJI:Vu,EQUALS:$u,EXCLAMATION:Su,FULLWIDTHGREATERTHAN:hu,FULLWIDTHLEFTPAREN:iu,FULLWIDTHLESSTHAN:uu,FULLWIDTHMIDDLEDOT:Ru,FULLWIDTHRIGHTPAREN:su,HYPHEN:Eu,LEFTCORNERBRACKET:au,LEFTWHITECORNERBRACKET:cu,LOCALHOST:Fd,NL:Jd,NUM:Zd,OPENANGLEBRACKET:ru,OPENBRACE:Xd,OPENBRACKET:Qd,OPENPAREN:tu,PERCENT:Mu,PIPE:Tu,PLUS:Ou,POUND:Lu,QUERY:Au,QUOTE:Nu,RIGHTCORNERBRACKET:lu,RIGHTWHITECORNERBRACKET:du,SCHEME:Ud,SEMI:Du,SLASH:Pu,SLASH_SCHEME:Kd,SYM:Hu,TILDE:Iu,TLD:qd,UNDERSCORE:zu,UTLD:Wd,UWORD:_d,WORD:Hd,WS:Gd});const Bu=/[a-z]/,ju=/\p{L}/u,Fu=/\p{Emoji}/u,qu=/\d/,Wu=/\s/;let Uu=null,Ku=null;function Zu(e,t){const n=function(e){const t=[],n=e.length;let r=0;for(;r<n;){let o,i=e.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,(e=>e.toLowerCase()))),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=e,l=null,c=0,d=null,u=-1,h=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(u=0,h=0,d=a):u>=0&&(u+=n[s].length,h++),c+=n[s].length,i+=n[s].length,s++;i-=u,s-=h,c-=u,o.push({t:d.t,v:t.slice(i-c,i),s:i-c,e:i})}return o}function Gu(e,t,n,r,o){let i;const s=t.length;for(let n=0;n<s-1;n++){const s=t[n];e.j[s]?i=e.j[s]:(i=new Dd(r),i.jr=o.slice(),e.j[s]=i),e=i}return i=new Dd(n),i.jr=o.slice(),e.j[t[s-1]]=i,i}function Ju(e){const t=[],n=[];let r=0;for(;r<e.length;){let o=0;for(;"0123456789".indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+o),10);t>0;t--)n.pop();r+=o}else n.push(e[r]),r++}return t}const Xu={defaultProtocol:"http",events:null,format:Qu,formatHref:Qu,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Yu(e,t=null){let n=Object.assign({},Xu);e&&(n=Object.assign(n,e instanceof Yu?e.o:e));const r=n.ignoreTags,o=[];for(let e=0;e<r.length;e++)o.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}function Qu(e){return e}function eh(e,t){this.t="token",this.v=e,this.tk=t}function th(e,t){class n extends eh{constructor(t,n){super(t,n),this.t=e}}for(const e in t)n.prototype[e]=t[e];return n.t=e,n}Yu.prototype={o:Xu,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=null!=t;let o=this.o[e];return o?("object"==typeof o?(o=n.t in o?o[n.t]:Xu[e],"function"==typeof o&&r&&(o=o(t,n))):"function"==typeof o&&r&&(o=o(t,n.t,n)),o):o},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},eh.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Xu.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),s={},a=e.get("className",n,t),l=e.get("target",n,t),c=e.get("rel",n,t),d=e.getObj("attributes",n,t),u=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:o,attributes:s,content:i,eventListeners:u}}};const nh=th("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),rh=th("text"),oh=th("nl"),ih=th("url",{isLink:!0,toHref(e=Xu.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Fd&&e[1].t===wu}}),sh=e=>new Dd(e);function ah(e,t,n){const r=n[0].s,o=n[n.length-1].e;return new e(t.slice(r,o),n)}const lh="undefined"!=typeof console&&console&&console.warn||(()=>{}),ch={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function dh(e,t=!1){if(ch.initialized&&lh(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');ch.customSchemes.push([e,t])}function uh(){ch.scanner=function(e=[]){const t={};Dd.groups=t;const n=new Dd;null==Uu&&(Uu=Ju("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==Ku&&(Ku=Ju("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),Vd(n,"'",fu),Vd(n,"{",Xd),Vd(n,"}",Yd),Vd(n,"[",Qd),Vd(n,"]",eu),Vd(n,"(",tu),Vd(n,")",nu),Vd(n,"<",ru),Vd(n,">",ou),Vd(n,"(",iu),Vd(n,")",su),Vd(n,"「",au),Vd(n,"」",lu),Vd(n,"『",cu),Vd(n,"』",du),Vd(n,"<",uu),Vd(n,">",hu),Vd(n,"&",pu),Vd(n,"*",mu),Vd(n,"@",gu),Vd(n,"`",bu),Vd(n,"^",yu),Vd(n,":",wu),Vd(n,",",Cu),Vd(n,"$",xu),Vd(n,".",ku),Vd(n,"=",$u),Vd(n,"!",Su),Vd(n,"-",Eu),Vd(n,"%",Mu),Vd(n,"|",Tu),Vd(n,"+",Ou),Vd(n,"#",Lu),Vd(n,"?",Au),Vd(n,'"',Nu),Vd(n,"/",Pu),Vd(n,";",Du),Vd(n,"~",Iu),Vd(n,"_",zu),Vd(n,"\\",vu),Vd(n,"・",Ru);const r=Id(n,qu,Zd,{[xd]:!0});Id(r,qu,r);const o=Id(r,Bu,Bd,{[Sd]:!0}),i=Id(r,ju,jd,{[Ed]:!0}),s=Id(n,Bu,Hd,{[kd]:!0});Id(s,qu,o),Id(s,Bu,s),Id(o,qu,o),Id(o,Bu,o);const a=Id(n,ju,_d,{[$d]:!0});Id(a,Bu),Id(a,qu,i),Id(a,ju,a),Id(i,qu,i),Id(i,Bu),Id(i,ju,i);const l=Vd(n,"\n",Jd,{[Ad]:!0}),c=Vd(n,"\r",Gd,{[Ad]:!0}),d=Id(n,Wu,Gd,{[Ad]:!0});Vd(n,"",d),Vd(c,"\n",l),Vd(c,"",d),Id(c,Wu,d),Vd(d,"\r"),Vd(d,"\n"),Id(d,Wu,d),Vd(d,"",d);const u=Id(n,Fu,Vu,{[Td]:!0});Vd(u,"#"),Id(u,Fu,u),Vd(u,"️",u);const h=Vd(u,"‍");Vd(h,"#"),Id(h,Fu,u);const p=[[Bu,s],[qu,o]],f=[[Bu,null],[ju,a],[qu,i]];for(let e=0;e<Uu.length;e++)Gu(n,Uu[e],qd,Hd,p);for(let e=0;e<Ku.length;e++)Gu(n,Ku[e],Wd,_d,f);Rd(qd,{tld:!0,ascii:!0},t),Rd(Wd,{utld:!0,alpha:!0},t),Gu(n,"file",Ud,Hd,p),Gu(n,"mailto",Ud,Hd,p),Gu(n,"http",Kd,Hd,p),Gu(n,"https",Kd,Hd,p),Gu(n,"ftp",Kd,Hd,p),Gu(n,"ftps",Kd,Hd,p),Rd(Ud,{scheme:!0,ascii:!0},t),Rd(Kd,{slashscheme:!0,ascii:!0},t),e=e.sort(((e,t)=>e[0]>t[0]?1:-1));for(let t=0;t<e.length;t++){const r=e[t][0],o=e[t][1]?{[Od]:!0}:{[Ld]:!0};r.indexOf("-")>=0?o[Md]=!0:Bu.test(r)?qu.test(r)?o[Sd]=!0:o[kd]=!0:o[xd]=!0,zd(n,r,r,o)}return zd(n,"localhost",Fd,{ascii:!0}),n.jd=new Dd(Hu),{start:n,tokens:Object.assign({groups:t},_u)}}(ch.customSchemes);for(let e=0;e<ch.tokenQueue.length;e++)ch.tokenQueue[e][1]({scanner:ch.scanner});ch.parser=function({groups:e}){const t=e.domain.concat([pu,mu,gu,vu,bu,yu,xu,$u,Eu,Zd,Mu,Tu,Ou,Lu,Pu,Hu,Iu,zu]),n=[fu,wu,Cu,ku,Su,Mu,Au,Nu,Du,ru,ou,Xd,Yd,eu,Qd,tu,nu,iu,su,au,lu,cu,du,uu,hu],r=[pu,fu,mu,vu,bu,yu,xu,$u,Eu,Xd,Yd,Mu,Tu,Ou,Lu,Au,Pu,Hu,Iu,zu],o=sh(),i=Vd(o,Iu);Pd(i,r,i),Pd(i,e.domain,i);const s=sh(),a=sh(),l=sh();Pd(o,e.domain,s),Pd(o,e.scheme,a),Pd(o,e.slashscheme,l),Pd(s,r,i),Pd(s,e.domain,s);const c=Vd(s,gu);Vd(i,gu,c),Vd(a,gu,c),Vd(l,gu,c);const d=Vd(i,ku);Pd(d,r,i),Pd(d,e.domain,i);const u=sh();Pd(c,e.domain,u),Pd(u,e.domain,u);const h=Vd(u,ku);Pd(h,e.domain,u);const p=sh(nh);Pd(h,e.tld,p),Pd(h,e.utld,p),Vd(c,Fd,p);const f=Vd(u,Eu);Vd(f,Eu,f),Pd(f,e.domain,u),Pd(p,e.domain,u),Vd(p,ku,h),Vd(p,Eu,f);const m=Vd(s,Eu),g=Vd(s,ku);Vd(m,Eu,m),Pd(m,e.domain,s),Pd(g,r,i),Pd(g,e.domain,s);const v=sh(ih);Pd(g,e.tld,v),Pd(g,e.utld,v),Pd(v,e.domain,s),Pd(v,r,i),Vd(v,ku,g),Vd(v,Eu,m),Vd(v,gu,c);const b=Vd(v,wu),y=sh(ih);Pd(b,e.numeric,y);const w=sh(ih),C=sh();Pd(w,t,w),Pd(w,n,C),Pd(C,t,w),Pd(C,n,C),Vd(v,Pu,w),Vd(y,Pu,w);const x=Vd(a,wu),k=Vd(l,wu),$=Vd(k,Pu),S=Vd($,Pu);Pd(a,e.domain,s),Vd(a,ku,g),Vd(a,Eu,m),Pd(l,e.domain,s),Vd(l,ku,g),Vd(l,Eu,m),Pd(x,e.domain,w),Vd(x,Pu,w),Vd(x,Au,w),Pd(S,e.domain,w),Pd(S,t,w),Vd(S,Pu,w);const E=[[Xd,Yd],[Qd,eu],[tu,nu],[ru,ou],[iu,su],[au,lu],[cu,du],[uu,hu]];for(let e=0;e<E.length;e++){const[r,o]=E[e],i=Vd(w,r);Vd(C,r,i);const s=sh(ih);Pd(i,t,s);const a=sh();Pd(i,n,a),Vd(i,o,w),Pd(s,t,s),Pd(s,n,a),Pd(a,t,s),Pd(a,n,a),Vd(s,o,w),Vd(a,o,w)}return Vd(o,Fd,v),Vd(o,Jd,oh),{start:o,tokens:_u}}(ch.scanner.tokens);for(let e=0;e<ch.pluginQueue.length;e++)ch.pluginQueue[e][1]({scanner:ch.scanner,parser:ch.parser});return ch.initialized=!0,ch}function hh(e){return ch.initialized||uh(),function(e,t,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=e,l=null,c=null,d=0,u=null,h=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(h=0,u=a):h>=0&&h++,o++,d++;if(h<0)o-=d,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(ah(rh,t,s)),s=[]),o-=h,d-=h;const e=u.t,r=n.slice(o-d,o);i.push(ah(e,t,r))}}return s.length>0&&i.push(ah(rh,t,s)),i}(ch.parser.start,e,Zu(ch.scanner.start,e))}function ph(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new Yu(n),o=hh(e),i=[];for(let e=0;e<o.length;e++){const n=o[e];!n.isLink||t&&n.t!==t||!r.check(n)||i.push(n.toFormattedObject(r))}return i}hh.scan=Zu;var fh="[\0-   ᠎ -\u2029  ]",mh=new RegExp(fh),gh=new RegExp(`${fh}$`),vh=new RegExp(fh,"g");function bh(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach((e=>{const t="string"==typeof e?e:e.scheme;t&&n.push(t)})),!e||e.replace(vh,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var yh=Ic.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach((e=>{"string"!=typeof e?dh(e.scheme,e.optionalSlashes):dh(e)}))},onDestroy(){Dd.groups={},ch.scanner=null,ch.parser=null,ch.tokenQueue=[],ch.pluginQueue=[],ch.customSchemes=[],ch.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!bh(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(r)&&!!/\./.test(r)}}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!(!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!bh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!bh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Vl(this.options.HTMLAttributes,e),0]:["a",Vl(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,o,i;const s=null!=(r=null==(n=e.attrs)?void 0:n.href)?r:"",a=null!=(i=null==(o=e.attrs)?void 0:o.title)?i:"",l=t.renderChildren(e);return a?`[${l}](${s} "${a}")`:`[${l}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!bh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return!(n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!bh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[bd({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,o=ph(e).filter((e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!bh(e,n),protocols:n,defaultProtocol:r})));o.length&&o.forEach((e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})}))}return t},type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;var r;return this.options.autolink&&e.push((r={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!bh(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink},new hr({key:new mr("autolink"),appendTransaction:(e,t,n)=>{const o=e.some((e=>e.docChanged))&&!t.doc.eq(n.doc),i=e.some((e=>e.getMeta("preventAutolink")));if(!o||i)return;const{tr:s}=n;return Gl(Tl(t.doc,[...e])).forEach((({newRange:e})=>{const t=function(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,((e,t)=>{n(e)&&r.push({node:e,pos:t})})),r}(n.doc,e,(e=>e.isTextblock));let o,i;if(t.length>1)o=t[0],i=n.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ");else if(t.length){const r=n.doc.textBetween(e.from,e.to," "," ");if(!gh.test(r))return;o=t[0],i=n.doc.textBetween(o.pos,e.to,void 0," ")}if(o&&i){const e=i.split(mh).filter(Boolean);if(e.length<=0)return!1;const t=e[e.length-1],l=o.pos+i.lastIndexOf(t);if(!t)return!1;const c=hh(t).map((e=>e.toObject(r.defaultProtocol)));if(!(1===(a=c).length?a[0].isLink:3===a.length&&a[1].isLink&&["()","[]"].includes(a[0].value+a[2].value)))return!1;c.filter((e=>e.isLink)).map((e=>({...e,from:l+e.start+1,to:l+e.end+1}))).filter((e=>!n.schema.marks.code||!n.doc.rangeHasMark(e.from,e.to,n.schema.marks.code))).filter((e=>r.validate(e.value))).filter((e=>r.shouldAutoLink(e.value))).forEach((e=>{Jl(e.from,e.to,n.doc).some((e=>e.mark.type===r.type))||s.addMark(e.from,e.to,r.type.create({href:e.href}))}))}var a})),s.steps.length?s:void 0}}))),e.push(function(e){return new hr({key:new mr("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i;if(0!==r.button)return!1;if(!t.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{const t=r.target;if(!t)return!1;const n=e.editor.view.dom;s=t.closest("a"),s&&!n.contains(s)&&(s=null)}if(!s)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const n=Kl(t.state,e.type.name),r=null!=(o=s.href)?o:n.href,l=null!=(i=s.target)?i:n.target;r&&(window.open(r,l),a=!0)}return a}}})}({type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(function(e){return new hr({key:new mr("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:o}=e,{state:i}=t,{selection:s}=i,{empty:a}=s;if(a)return!1;let l="";r.content.forEach((e=>{l+=e.textContent}));const c=ph(l,{defaultProtocol:e.defaultProtocol}).find((e=>e.isLink&&e.value===l));return!(!l||!c||void 0!==o&&!o(c.value))&&e.editor.commands.setMark(e.type,{href:c.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),wh=yh;function Ch(e={}){return new hr({view:t=>new xh(t,e)})}class xh{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,s=o.height/r.offsetHeight;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let o=t.getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let a=this.width/2*s;e={left:o.left,right:o.right,top:i-a,bottom:i+a}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*i;e={left:t.left-n,right:t.left+n,top:t.top,bottom:t.bottom}}let a,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!c||c==document.body&&"static"==getComputedStyle(c).position)a=-pageXOffset,l=-pageYOffset;else{let e=c.getBoundingClientRect(),t=e.width/c.offsetWidth,n=e.height/c.offsetHeight;a=e.left-c.scrollLeft*t,l=e.top-c.scrollTop*n}this.element.style.left=(e.left-a)/i+"px",this.element.style.top=(e.top-l)/s+"px",this.element.style.width=(e.right-e.left)/i+"px",this.element.style.height=(e.bottom-e.top)/s+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(t&&!o){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=An(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class kh extends Kn{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return kh.valid(n)?new kh(n):Kn.near(n)}content(){return tt.empty}eq(e){return e instanceof kh&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new kh(e.resolve(t.pos))}getBookmark(){return new $h(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||Sh(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||Sh(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&kh.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(kh.valid(s))return s}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!Qn.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=i,r+=t;let s=e.doc.resolve(r);if(kh.valid(s))return s}return null}}}kh.prototype.visible=!1,kh.findFrom=kh.findGapCursorFrom,Kn.jsonID("gapcursor",kh);class $h{constructor(e){this.pos=e}map(e){return new $h(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return kh.valid(t)?new kh(t):Kn.near(t)}}function Sh(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}const Eh=fa({ArrowLeft:Mh("horiz",-1),ArrowRight:Mh("horiz",1),ArrowUp:Mh("vert",-1),ArrowDown:Mh("vert",1)});function Mh(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,s=t>0?i.$to:i.$from,a=i.empty;if(i instanceof Xn){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=kh.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new kh(l))),!0)}}function Th(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!kh.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&Qn.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new kh(r))),!0)}function Oh(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof kh))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=Ge.empty;for(let e=r.length-1;e>=0;e--)o=Ge.from(r[e].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new tt(o,0,0));return i.setSelection(Xn.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function Lh(e){if(!(e.selection instanceof kh))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ms.create(e.doc,[$s.widget(e.selection.head,t,{key:"gapcursor"})])}var Ah=200,Nh=function(){};Nh.prototype.append=function(e){return e.length?(e=Nh.from(e),!this.length&&e||e.length<Ah&&this.leafAppend(e)||this.length<Ah&&e.leafPrepend(this)||this.appendInner(e)):this},Nh.prototype.prepend=function(e){return e.length?Nh.from(e).append(this):this},Nh.prototype.appendInner=function(e){return new Dh(this,e)},Nh.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Nh.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Nh.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Nh.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Nh.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},Nh.from=function(e){return e instanceof Nh?e:e&&e.length?new Rh(e):Nh.empty};var Rh=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Ah)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Ah)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Nh);Nh.empty=new Rh([]);var Dh=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Nh);class Ph{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(o,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new Ih(e.map));let t,o=e.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new Ih(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(r)):e.selection,s=new Ph(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(e,t,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),d=new Ih(e.mapping.maps[n],c,t);(l=a&&a.merge(d))&&(d=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(d),t&&(i++,t=void 0),r||(a=d)}let l=i-n.depth;return l>Vh&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),i-=l),new Ph(s.append(o),i)}remapping(e,t){let n=new ln;return this.items.forEach(((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new Ph(this.items.append(e.map((e=>new Ih(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(a+1,r));c&&s++,n.push(new Ih(l,i,c))}else n.push(new Ih(l))}),r);let l=[];for(let e=t;e<i;e++)l.push(new Ih(o.maps[e]));let c=this.items.slice(0,r).append(l).append(n),d=new Ph(c,s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=i.selection&&i.selection.map(t.slice(n));a&&o++;let l,c=new Ih(s.invert(),e,a),d=r.length-1;(l=r.length&&r[d].merge(c))?r[d]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new Ph(Nh.from(r.reverse()),o)}}Ph.empty=new Ph(Nh.empty,0);class Ih{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Ih(t.getMap().invert(),t,this.selection)}}}class zh{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const Vh=20;function Hh(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(((e,n,r,o)=>t.push(r,o)));return t}function _h(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}let Bh=!1,jh=null;function Fh(e){let t=e.plugins;if(jh!=t){Bh=!1,jh=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Bh=!0;break}}return Bh}const qh=new mr("history"),Wh=new mr("closeHistory");function Uh(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new hr({key:qh,state:{init:()=>new zh(Ph.empty,Ph.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(qh);if(i)return i.historyState;n.getMeta(Wh)&&(e=new zh(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(qh))return s.getMeta(qh).redo?new zh(e.done.addTransform(n,void 0,r,Fh(t)),e.undone,Hh(n.mapping.maps),e.prevTime,e.prevComposition):new zh(e.done,e.undone.addTransform(n,void 0,r,Fh(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new zh(e.done.rebased(n,o),e.undone.rebased(n,o),_h(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new zh(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),_h(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!s&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),a=s?_h(e.prevRanges,n.mapping):Hh(n.mapping.maps);return new zh(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,Fh(t)),Ph.empty,a,n.time,null==o?e.prevComposition:o)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?Zh:"historyRedo"==n?Gh:null;return!(!r||!e.editable)&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Kh(e,t){return(n,r)=>{let o=qh.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=Fh(t),o=qh.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),l=new zh(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(qh,{redo:n,historyState:l})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const Zh=Kh(!1,!0),Gh=Kh(!0,!0);jc.create({name:"characterCount",addOptions:()=>({limit:null,autoTrim:!0,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter((e=>""!==e)).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){const e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new hr({key:new mr("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const o=this.options.limit,i=this.options.autoTrim;if(null==o||0===o||!1===i)return void(e=!0);const s=this.storage.characters({node:r.doc});if(s>o){const t=0,n=s-o;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const i=r.tr.deleteRange(t,n);return e=!0,i}e=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=n)return!0;if(r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r)return!1;if(!e.getMeta("paste"))return!1;const i=e.selection.$head.pos,s=i-(o-n),a=i;e.deleteRange(s,a);return!(this.storage.characters({node:e.doc})>n)}})]}});var Jh=jc.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[Ch(this.options)]}});jc.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new hr({key:new mr("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=t,i=[];if(!n||!r)return Ms.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants(((e,t)=>{if(e.isText)return;if(!(o>=t&&o<=t+e.nodeSize-1))return!1;s+=1}));let a=0;return e.descendants(((e,t)=>{if(e.isText)return!1;if(!(o>=t&&o<=t+e.nodeSize-1))return!1;a+=1;if("deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1)return"deepest"===this.options.mode;i.push($s.node(t,t+e.nodeSize,{class:this.options.className}))})),Ms.create(e,i)}}})]}});var Xh=jc.create({name:"gapCursor",addProseMirrorPlugins:()=>[new hr({props:{decorations:Lh,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&kh.valid(n)?new kh(n):null,handleClick:Th,handleKeyDown:Eh,handleDOMEvents:{beforeinput:Oh}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!=(t=Dl(Ll(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))?t:null}}});function Yh(e){const{editor:t,placeholder:n,dataAttribute:r,pos:o,node:i,isEmptyDoc:s,hasAnchor:a,classes:{emptyNode:l,emptyEditor:c}}=e,d=[l];return s&&d.push(c),$s.node(o,o+i.nodeSize,{class:d.join(" "),[r]:"function"==typeof n?n({editor:t,node:i,pos:o,hasAnchor:a}):n})}function Qh(e){const t=getComputedStyle(e),n=`${t.overflow} ${t.overflowY} ${t.overflowX}`;return/auto|scroll|overlay/.test(n)}function ep({doc:e,view:t,scrollContainer:n}){const r=t.dom.getBoundingClientRect(),o=n?(i=n)===window?{top:0,bottom:window.innerHeight}:i.getBoundingClientRect():{top:0,bottom:window.innerHeight};var i;const s=Math.max(r.top,o.top),a=Math.min(r.bottom,o.bottom);if(s>=a)return{top:0,bottom:e.content.size};const l="rtl"===getComputedStyle(t.dom).direction?Math.max(r.right-2,r.left+2):r.left+2,c=t.posAtCoords({left:l,top:s+2}),d=t.posAtCoords({left:l,top:a-2});return{top:c?c.pos:0,bottom:d?d.pos:e.content.size}}var tp="placeholder";var np=new mr("tiptap__placeholder"),rp=jc.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:tp,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${t=this.options.dataAttribute,t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${tp}`;var t;return[new hr({state:{init:()=>({topPos:null,bottomPos:null}),apply(e,t){const n=e.getMeta(np);return(null==n?void 0:n.positions)?{topPos:n.positions.top,bottomPos:n.positions.bottom}:e.docChanged?{topPos:null!==t.topPos?e.mapping.map(t.topPos):null,bottomPos:null!==t.bottomPos?e.mapping.map(t.bottomPos):null}:t}},key:np,view(e){const t=function(e){let t=e;for(;t;){if(Qh(t))return t;const e=t.parentElement;if(!e){const e=t.getRootNode();if(e instanceof ShadowRoot){t=e.host;continue}return window}t=e}return window}(e.dom),n=()=>{const n=ep({view:e,doc:e.state.doc,scrollContainer:t}),r=np.getState(e.state);if(r.topPos===n.top&&r.bottomPos===n.bottom)return;const o=e.state.tr.setMeta(np,{positions:n}).setMeta("tiptap__viewportUpdate",!0);e.dispatch(o)},{call:r,cancel:o}=function(e,t){let n=null;return{call:(...r)=>{n||(e(...r),n=setTimeout((()=>{n=null}),t))},cancel:()=>{n&&(clearTimeout(n),n=null)}}}(n,250),i=t;return i.addEventListener("scroll",r,{passive:!0}),n(),{update(t,r){e.state.doc.content.size!==r.doc.content.size&&n()},destroy:()=>{o(),i.removeEventListener("scroll",r)}}},props:{decorations:({doc:t,selection:n})=>{var r,o;if(!(this.editor.isEditable||!this.options.showOnlyWhenEditable))return null;const{anchor:i}=n,s=[],a=this.editor.isEmpty;if(this.options.showOnlyCurrent&&!this.options.includeChildren){const n=t.resolve(i);if(n.depth>0){const t=n.node(1),r=n.before(1);if(t.type.isTextblock&&nc(t)){const o=i>=r&&i<=r+t.nodeSize,l=Yh({node:t,dataAttribute:e,hasAnchor:o,placeholder:this.options.placeholder,classes:{emptyEditor:this.options.emptyEditorClass,emptyNode:this.options.emptyNodeClass},editor:this.editor,isEmptyDoc:a,pos:n.before(1)});s.push(l)}}}else{const n=np.getState(this.editor.state),l=null!=(r=n.topPos)?r:0,c=null!=(o=n.bottomPos)?o:t.content.size;t.nodesBetween(l,c,((t,n)=>{const r=i>=n&&i<=n+t.nodeSize,o=!t.isLeaf&&nc(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&o){const o=Yh({classes:{emptyEditor:this.options.emptyEditorClass,emptyNode:this.options.emptyNodeClass},editor:this.editor,isEmptyDoc:a,dataAttribute:e,hasAnchor:r,placeholder:this.options.placeholder,node:t,pos:n});s.push(o)}return this.options.includeChildren}))}return Ms.create(t,s)}}})]}});jc.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new hr({key:new mr("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||rc(n.selection)||e.view.dragging?null:Ms.create(n.doc,[$s.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});function op({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}var ip=jc.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;const t=new mr(this.name),n=this.options.node||(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map((([,e])=>e)).filter((e=>(this.options.notAfter||[]).concat(n).includes(e.name)));return[new hr({key:t,appendTransaction:(e,r,o)=>{const{doc:i,tr:s,schema:a}=o,l=t.getState(o),c=i.content.size,d=a.nodes[n];if(!e.some((e=>e.getMeta("skipTrailingNode")))&&l)return s.insert(c,d.create())},state:{init:(e,t)=>!op({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>{if(!e.docChanged)return t;if(e.getMeta("__uniqueIDTransaction"))return t;return!op({node:e.doc.lastChild,types:r})}}})]}}),sp=jc.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Zh(e,t),redo:()=>({state:e,dispatch:t})=>Gh(e,t)}),addProseMirrorPlugins(){return[Uh(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),ap=rp,lp=Ic.create({name:"subscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sub"},{style:"vertical-align",getAttrs:e=>"sub"===e&&null}],renderHTML({HTMLAttributes:e}){return["sub",Vl(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),cp=Ic.create({name:"superscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:e=>"super"===e&&null}],renderHTML({HTMLAttributes:e}){return["sup",Vl(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),dp=jc.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{const t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.map((n=>t.updateAttributes(n,{textAlign:e}))).some((e=>e)),unsetTextAlign:()=>({commands:e})=>this.options.types.map((t=>e.resetAttributes(t,"textAlign"))).some((e=>e)),toggleTextAlign:e=>({editor:t,commands:n})=>!!this.options.alignments.includes(e)&&(t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),up=(e,t=0)=>{const n=[];return!e.children.length||t>20||Array.from(e.children).forEach((e=>{"SPAN"===e.tagName?n.push(e):e.children.length&&n.push(...up(e,t+1))})),n},hp=Ic.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!0}),parseHTML(){return[{tag:"span",consuming:!1,getAttrs:e=>!!e.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(e=>{if(!e.children.length)return;const t=up(e);t&&t.forEach((e=>{var t,n;const r=e.getAttribute("style"),o=null==(n=null==(t=e.parentElement)?void 0:t.closest("span"))?void 0:n.getAttribute("style");e.setAttribute("style",`${o};${r}`)}))})(e),{})}]},renderHTML({HTMLAttributes:e}){return["span",Vl(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,((t,n)=>{if(t.isTextblock)return!0;t.marks.filter((e=>e.type===this.type)).some((e=>Object.values(e.attrs).some((e=>!!e))))||e.removeMark(n,n+t.nodeSize,this.type)})),!0}}}}),pp=jc.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>{var t;const n=null!=(t=ad(e,"background-color"))?t:e.style.backgroundColor;return null==n?void 0:n.replace(/['"]+/g,"")},renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands:()=>({setBackgroundColor:e=>({chain:t})=>t().setMark("textStyle",{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()})}),fp=jc.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;const n=null!=(t=ad(e,"color"))?t:e.style.color;return null==n?void 0:n.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),mp=jc.create({name:"fontFamily",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>{var t;return null!=(t=ad(e,"font-family"))?t:e.style.fontFamily},renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands:()=>({setFontFamily:e=>({chain:t})=>t().setMark("textStyle",{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()})}),gp=jc.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>{var t;return null!=(t=ad(e,"font-size"))?t:e.style.fontSize},renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands:()=>({setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()})}),vp=jc.create({name:"lineHeight",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>{var t;return null!=(t=ad(e,"line-height"))?t:e.style.lineHeight},renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands:()=>({setLineHeight:e=>({chain:t})=>t().setMark("textStyle",{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()})}),bp=jc.create({name:"textStyleKit",addExtensions(){const e=[];return!1!==this.options.backgroundColor&&e.push(pp.configure(this.options.backgroundColor)),!1!==this.options.color&&e.push(fp.configure(this.options.color)),!1!==this.options.fontFamily&&e.push(mp.configure(this.options.fontFamily)),!1!==this.options.fontSize&&e.push(gp.configure(this.options.fontSize)),!1!==this.options.lineHeight&&e.push(vp.configure(this.options.lineHeight)),!1!==this.options.textStyle&&e.push(hp.configure(this.options.textStyle)),e}}),yp=(e,t)=>{if("slot"===e)return 0;if(e instanceof Function)return e(t);const{children:n,...r}=null!=t?t:{};if("svg"===e)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},wp=/^\s*>\s$/,Cp=vd.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return yp("blockquote",{...Vl(this.options.HTMLAttributes,e),children:yp("slot",{})})},parseMarkdown:(e,t)=>{var n;const r=null!=(n=t.parseBlockChildren)?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";const n=[];return e.content.forEach(((e,r)=>{var o,i;const s=(null!=(i=null==(o=t.renderChild)?void 0:o.call(t,e,r))?i:t.renderChildren([e])).split("\n").map((e=>""===e.trim()?">":`> ${e}`));n.push(s.join("\n"))})),n.join("\n>\n")},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[id({find:wp,type:this.type})]}}),xp=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,kp=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,$p=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Sp=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Ep=Ic.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return yp("strong",{...Vl(this.options.HTMLAttributes,e),children:yp("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[nd({find:xp,type:this.type}),nd({find:$p,type:this.type})]},addPasteRules(){return[bd({find:kp,type:this.type}),bd({find:Sp,type:this.type})]}}),Mp=/(^|[^`])`([^`]+)`(?!`)$/,Tp=/(^|[^`])`([^`]+)`(?!`)/g,Op=Ic.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",Vl(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[nd({find:Mp,type:this.type})]},addPasteRules(){return[bd({find:Tp,type:this.type})]}}),Lp=/^```([a-z]+)?[\s\n]$/,Ap=/^~~~([a-z]+)?[\s\n]$/,Np=vd.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;if(!n)return null;const r=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter((e=>e.startsWith(n))).map((e=>e.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",Vl(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,r;return!1===(null==(n=e.raw)?void 0:n.startsWith("```"))&&!1===(null==(r=e.raw)?void 0:r.startsWith("~~~"))&&"indented"!==e.codeBlockStyle?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const o=(null==(n=e.attrs)?void 0:n.language)||"";if(e.content){r=[`\`\`\`${o}`,t.renderChildren(e.content),"```"].join("\n")}else r=`\`\`\`${o}\n\n\`\`\``;return r},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:o}=r,{$from:i,empty:s}=o;if(i.parent.type!==this.type)return!1;const a=" ".repeat(n);return s?e.commands.insertContent(a):e.commands.command((({tr:e})=>{const{from:t,to:n}=o,i=r.doc.textBetween(t,n,"\n","\n").split("\n").map((e=>a+e)).join("\n");return e.replaceWith(t,n,r.schema.text(i)),!0}))},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:o}=r,{$from:i,empty:s}=o;return i.parent.type===this.type&&(s?e.commands.command((({tr:e})=>{var t;const{pos:o}=i,s=i.start(),a=i.end(),l=r.doc.textBetween(s,a,"\n","\n").split("\n");let c=0,d=0;const u=o-s;for(let e=0;e<l.length;e+=1){if(d+l[e].length>=u){c=e;break}d+=l[e].length+1}const h=(null==(t=l[c].match(/^ */))?void 0:t[0])||"",p=Math.min(h.length,n);if(0===p)return!0;let f=s;for(let e=0;e<c;e+=1)f+=l[e].length+1;e.delete(f,f+p);return o-f<=p&&e.setSelection(Xn.create(e.doc,f)),!0})):e.commands.command((({tr:e})=>{const{from:t,to:i}=o,s=r.doc.textBetween(t,i,"\n","\n").split("\n").map((e=>{var t;const r=(null==(t=e.match(/^ */))?void 0:t[0])||"",o=Math.min(r.length,n);return e.slice(o)})).join("\n");return e.replaceWith(t,i,r.schema.text(s)),!0})))},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!i||!s)&&e.chain().command((({tr:e})=>(e.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type)return!1;if(!(o.parentOffset===o.parent.nodeSize-2))return!1;const s=o.after();if(void 0===s)return!1;return r.nodeAt(s)?e.commands.command((({tr:e})=>(e.setSelection(Kn.near(r.resolve(s))),!0))):e.commands.exitCode()}}},addInputRules(){return[od({find:Lp,type:this.type,getAttributes:e=>({language:e[1]})}),od({find:Ap,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new hr({key:new mr("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=null==o?void 0:o.mode;if(!n||!i)return!1;const{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(Xn.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),Rp=vd.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),Dp=vd.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",Vl(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>" \n",parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:s}=r.extensionManager,a=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&i){const t=a.filter((e=>s.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Pp=vd.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Vl(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=(null==(n=e.attrs)?void 0:n.level)?parseInt(e.attrs.level,10):1,o="#".repeat(r);return e.content?`${o} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>od({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}}),Ip=vd.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",Vl(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!function(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof Qn){const e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let o=r.depth;for(;o>=0;){const e=r.index(o);if(r.node(o).contentMatchAt(e).matchType(t))return!0;o-=1}return!1}(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,o=e();return rc(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command((({state:e,tr:t,dispatch:n})=>{if(n){const{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(Xn.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(Qn.create(t.doc,n.pos)):t.setSelection(Xn.create(t.doc,n.pos));else{const o=e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType,i=null==o?void 0:o.create();i&&(t.insert(r,i),t.setSelection(Xn.create(t.doc,r+1)))}t.scrollIntoView()}return!0})).run()}}},addInputRules(){return[rd({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),zp=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Vp=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Hp=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,_p=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Bp=Ic.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Vl(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[nd({find:zp,type:this.type}),nd({find:Hp,type:this.type})]},addPasteRules(){return[bd({find:Vp,type:this.type}),bd({find:_p,type:this.type})]}}),jp=Object.defineProperty,Fp="textStyle",qp=/^\s*([-+*])\s$/,Wp=vd.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Vl(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>"list"!==e.type||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(Fp)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=id({find:qp,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=id({find:qp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Fp),editor:this.editor})),[e]}});function Up(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:"text",raw:e,text:e}])}var Kp=vd.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Vl(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n;if("list_item"!==e.type)return[];const r=null!=(n=t.parseBlockChildren)?n:t.parseChildren;let o=[];if(e.tokens&&e.tokens.length>0){if(function(e){var t,n;const r=null==(t=e.tokens)?void 0:t[0];return Boolean(e.text&&1===(null==(n=e.tokens)?void 0:n.length)&&"list"===(null==r?void 0:r.type)&&r.ordered&&r.raw===e.text)}(e))return{type:"listItem",content:[{type:"paragraph",content:Up(e.text||"",t)}]};if(e.tokens.some((e=>"paragraph"===e.type)))o=r(e.tokens);else{const n=e.tokens[0];if(n&&"text"===n.type&&n.tokens&&n.tokens.length>0){if(o=[{type:"paragraph",content:t.parseInline(n.tokens)}],e.tokens.length>1){const t=r(e.tokens.slice(1));o.push(...t)}}else o=r(e.tokens)}}return 0===o.length&&(o=[{type:"paragraph",content:[]}]),{type:"listItem",content:o}},renderMarkdown:(e,t,n)=>gd(e,t,(e=>{var t,n;if("bulletList"===e.parentType)return"- ";if("orderedList"===e.parentType){return`${((null==(n=null==(t=e.meta)?void 0:t.parentAttrs)?void 0:n.start)||1)+e.index}. `}return"- "}),n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});((e,t)=>{for(var n in t)jp(e,n,{get:t[n],enumerable:!0})})({},{findListItemPos:()=>Zp,getNextListDepth:()=>Gp,handleBackspace:()=>Qp,handleDelete:()=>nf,hasListBefore:()=>Jp,hasListItemAfter:()=>rf,hasListItemBefore:()=>Xp,listItemHasSubList:()=>Yp,nextListIsDeeper:()=>ef,nextListIsHigher:()=>tf});var Zp=(e,t)=>{const{$from:n}=t.selection,r=Ma(e,t.schema);let o=null,i=n.depth,s=n.pos,a=null;for(;i>0&&null===a;)o=n.node(i),o.type===r?a=i:(i-=1,s-=1);return null===a?null:{$pos:t.doc.resolve(s),depth:a}},Gp=(e,t)=>{const n=Zp(e,t);if(!n)return!1;const[,r]=((e,t,n,r=20)=>{const o=e.doc.resolve(n);let i=r,s=null;for(;i>0&&null===s;){const e=o.node(i);(null==e?void 0:e.type.name)===t?s=e:i-=1}return[s,i]})(t,e,n.$pos.pos+4);return r},Jp=(e,t,n)=>{const{$anchor:r}=e.selection,o=Math.max(0,r.pos-2),i=e.doc.resolve(o).node();return!(!i||!n.includes(i.type.name))},Xp=(e,t)=>{var n;const{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-2);return 0!==o.index()&&(null==(n=o.nodeBefore)?void 0:n.type.name)===e},Yp=(e,t,n)=>{if(!n)return!1;const r=Ma(e,t.schema);let o=!1;return n.descendants((e=>{e.type===r&&(o=!0)})),o},Qp=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!dl(e.state,t)&&Jp(e.state,t,n)){const{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),o=[];r.node().descendants(((e,n)=>{e.type.name===t&&o.push({node:e,pos:n})}));const i=o.at(-1);if(!i)return!1;const s=e.state.doc.resolve(r.start()+i.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},s.end()).joinForward().run()}if(!dl(e.state,t))return!1;if(!(e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)})(e.state))return!1;const r=Zp(t,e.state);if(!r)return!1;const o=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),i=Yp(t,e.state,o);return Xp(t,e.state)&&!i?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},ef=(e,t)=>{const n=Gp(e,t),r=Zp(e,t);return!(!r||!n)&&n>r.depth},tf=(e,t)=>{const n=Gp(e,t),r=Zp(e,t);return!(!r||!n)&&n<r.depth},nf=(e,t)=>{if(!dl(e.state,t))return!1;if(!((e,t)=>{const{$from:n,$to:r,$anchor:o}=e.selection;if(t){const n=Ol((e=>e.type.name===t))(e.selection);if(!n)return!1;const r=e.doc.resolve(n.pos+1);return o.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)})(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:o}=n;return!(!n.empty&&r.sameParent(o))&&(ef(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():tf(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},rf=(e,t)=>{var n;const{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-r.parentOffset-2);return o.index()!==o.parent.childCount-1&&(null==(n=o.nodeAfter)?void 0:n.type.name)===e},of=jc.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach((({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&nf(e,n)&&(t=!0)})),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach((({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&nf(e,n)&&(t=!0)})),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach((({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&Qp(e,n,r)&&(t=!0)})),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach((({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&Qp(e,n,r)&&(t=!0)})),t}}}}),sf=/^(\s*)(\d+)\.\s+(.*)$/,af=/^\s/;function lf(e){const t=[],n=[];let r=!1;return e.forEach((e=>{if(!r)return""===e.trim()||t.length>0&&function(e){const t=e.trimStart();return/^[-+*]\s+/.test(t)||/^\d+\.\s+/.test(t)||/^>\s?/.test(t)||/^```/.test(t)||/^~~~/.test(t)}(e)?(r=!0,void n.push(e)):void t.push(e);n.push(e)})),{paragraphLines:t,blockLines:n}}function cf(e,t,n){const r=[];let o=0;for(;o<e.length;){const i=e[o];if(i.indent===t){const{paragraphLines:s,blockLines:a}=lf(i.contentLines),l=s.join("\n").trim(),c=[];l&&c.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const d=a.join("\n").trim();if(d){const e=n.blockTokens(d);c.push(...e)}let u=o+1;const h=[];for(;u<e.length&&e[u].indent>t;)h.push(e[u]),u+=1;if(h.length>0){const e=Math.min(...h.map((e=>e.indent))),t=cf(h,e,n);c.push({type:"list",ordered:!0,start:h[0].number,items:t,raw:h.map((e=>e.raw)).join("\n")})}r.push({type:"list_item",raw:i.raw,tokens:c}),o=u}else o+=1}return r}var df="textStyle",uf=/^(\d+)\.\s$/,hf=vd.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",Vl(this.options.HTMLAttributes,n),0]:["ol",Vl(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if("list"!==e.type||!e.ordered)return[];const n=e.start||1,r=e.items?function(e,t){return e.map((e=>{if("list_item"!==e.type)return t.parseChildren([e])[0];const n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach((e=>{if("paragraph"===e.type||"list"===e.type||"blockquote"===e.type||"code"===e.type)n.push(...t.parseChildren([e]));else if("text"===e.type&&e.tokens){const r=t.parseChildren([e]);n.push({type:"paragraph",content:r})}else{const r=t.parseChildren([e]);r.length>0&&n.push(...r)}})),{type:"listItem",content:n}}))}(e.items,t):[];return 1!==n?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),n=null==t?void 0:t.index;return void 0!==n?n:-1},tokenize:(e,t,n)=>{var r;const o=e.split("\n"),[i,s]=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const o=e[n],i=o.match(sf);if(!i)break;const[,s,a,l]=i,c=s.length,d=[l];let u=n+1;const h=[o];let p=!1;for(;u<e.length;){const t=e[u];if(t.match(sf))break;if(""===t.trim())h.push(t),d.push(""),p=!0,u+=1;else if(t.match(af))h.push(t),d.push(t.slice(c+2)),u+=1;else{if(p)break;h.push(t),d.push(t),u+=1}}t.push({indent:c,number:parseInt(a,10),content:d.join("\n").trim(),contentLines:d,raw:h.join("\n")}),r=u,n=u}return[t,r]}(o);if(0===i.length)return;const a=cf(i,0,n);if(0===a.length)return;return{type:"list",ordered:!0,start:(null==(r=i[0])?void 0:r.number)||1,items:a,raw:o.slice(0,s).join("\n")}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(df)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=id({find:uf,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=id({find:uf,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(df)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),pf=/^\s*(\[([( |x])?\])\s$/,ff=vd.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",Vl(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;return gd(e,t,`- [${(null==(n=e.attrs)?void 0:n.checked)?"x":" "}] `)},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=e=>{var t,n;a.ariaLabel=(null==(n=null==(t=this.options.a11y)?void 0:t.checkboxLabel)?void 0:n.call(t,e,a.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};c(e),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",(e=>e.preventDefault())),a.addEventListener("change",(t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked)return void(a.checked=!a.checked);const{checked:o}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus(void 0,{scrollIntoView:!1}).command((({tr:e})=>{const t=n();if("number"!=typeof t)return!1;const r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==r?void 0:r.attrs,checked:o}),!0})).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,o)||(a.checked=!a.checked))})),Object.entries(this.options.HTMLAttributes).forEach((([e,t])=>{o.setAttribute(e,t)})),o.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,i.append(a,s),o.append(i,l),Object.entries(t).forEach((([e,t])=>{o.setAttribute(e,t)}));let d=new Set(Object.keys(t));return{dom:o,contentDOM:l,update:e=>{if(e.type!==this.type)return!1;o.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,c(e);const t=Hl(e,r.extensionManager.attributes),n=new Set(Object.keys(t)),i=this.options.HTMLAttributes;return d.forEach((e=>{n.has(e)||(e in i?o.setAttribute(e,i[e]):o.removeAttribute(e))})),Object.entries(t).forEach((([e,t])=>{null==t?e in i?o.setAttribute(e,i[e]):o.removeAttribute(e):o.setAttribute(e,t)})),d=n,!0}}}},addInputRules(){return[id({find:pf,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),mf=vd.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",Vl(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=null==(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:t.index;return void 0!==n?n:-1},tokenize(e,t,n){const r=e=>{const t=md(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:"taskList",raw:t.raw,items:t.items}]:n.blockTokens(e)},o=md(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});jc.create({name:"listKit",addExtensions(){const e=[];return!1!==this.options.bulletList&&e.push(Wp.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(Kp.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(of.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(hf.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(ff.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(mf.configure(this.options.taskList)),e}});var gf="&nbsp;",vf=vd.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Vl(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(1===n.length&&"image"===n[0].type)return t.parseChildren([n[0]]);const r=t.parseInline(n);return!(1===n.length&&"text"===n[0].type&&(n[0].raw===gf||n[0].text===gf||" "===n[0].raw||" "===n[0].text))||1!==r.length||"text"!==r[0].type||r[0].text!==gf&&" "!==r[0].text?t.createNode("paragraph",void 0,r):t.createNode("paragraph",void 0,[])},renderMarkdown:(e,t,n)=>{var r,o;if(!e)return"";const i=Array.isArray(e.content)?e.content:[];if(0===i.length){const e=Array.isArray(null==(r=null==n?void 0:n.previousNode)?void 0:r.content)?n.previousNode.content:[];return"paragraph"===(null==(o=null==n?void 0:n.previousNode)?void 0:o.type)&&0===e.length?gf:""}return t.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),bf=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,yf=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,wf=Ic.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",Vl(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[nd({find:bf,type:this.type})]},addPasteRules(){return[bd({find:yf,type:this.type})]}}),Cf=vd.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),xf=Ic.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",Vl(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>`++${t.renderChildren(e)}++`,markdownTokenizer:{name:"underline",level:"inline",start:e=>e.indexOf("++"),tokenize(e,t,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;const o=r[2].trim();return{type:"underline",raw:r[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),kf=xf,$f=jc.create({name:"starterKit",addExtensions(){var e,t,n,r;const o=[];return!1!==this.options.bold&&o.push(Ep.configure(this.options.bold)),!1!==this.options.blockquote&&o.push(Cp.configure(this.options.blockquote)),!1!==this.options.bulletList&&o.push(Wp.configure(this.options.bulletList)),!1!==this.options.code&&o.push(Op.configure(this.options.code)),!1!==this.options.codeBlock&&o.push(Np.configure(this.options.codeBlock)),!1!==this.options.document&&o.push(Rp.configure(this.options.document)),!1!==this.options.dropcursor&&o.push(Jh.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&o.push(Xh.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&o.push(Dp.configure(this.options.hardBreak)),!1!==this.options.heading&&o.push(Pp.configure(this.options.heading)),!1!==this.options.undoRedo&&o.push(sp.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&o.push(Ip.configure(this.options.horizontalRule)),!1!==this.options.italic&&o.push(Bp.configure(this.options.italic)),!1!==this.options.listItem&&o.push(Kp.configure(this.options.listItem)),!1!==this.options.listKeymap&&o.push(of.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&o.push(yh.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&o.push(hf.configure(this.options.orderedList)),!1!==this.options.paragraph&&o.push(vf.configure(this.options.paragraph)),!1!==this.options.strike&&o.push(wf.configure(this.options.strike)),!1!==this.options.text&&o.push(Cf.configure(this.options.text)),!1!==this.options.underline&&o.push(xf.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&o.push(ip.configure(null==(r=this.options)?void 0:r.trailingNode)),o}}),Sf=$f;function Ef(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mf,Tf={exports:{}},Of={};var Lf,Af,Nf={};
1
+ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Icon as i,Menu as s,Portal as a,Tooltip as l,Field as c,Input as d,Popover as u,Text as h,HStack as p,StackSeparator as f,Group as m,Checkbox as g,CheckboxGroup as v,CheckboxCard as b,RadioCard as y,RadioGroup as w,Slider as C,For as x,Switch as k,Select as $,Tag as S,createListCollection as M,Textarea as E,useFilter as T,useListCollection as O,Combobox as L,Accordion as A,chakra as R,Flex as N,Pagination as D,ButtonGroup as P,Table as I,Dialog as z,InputGroup as V,Breadcrumb as H,Tabs as _,VisuallyHidden as B,useMediaQuery as j,Collapsible as F,useDisclosure as q,Avatar as W,Alert as U,CloseButton as K,createToaster as Z,Toaster as G,Toast as J,Stack as X}from"@chakra-ui/react";import{jsx as Y,jsxs as Q,Fragment as ee}from"react/jsx-runtime";import*as te from"react";import ne,{createContext as re,useContext as oe,useMemo as ie,forwardRef as se,useRef as ae,useState as le,useDebugValue as ce,useEffect as de,useLayoutEffect as ue,useId as he,Children as pe,useCallback as fe,createElement as me,useImperativeHandle as ge,Fragment as ve}from"react";import{jsxs as be,jsx as ye,Fragment as we}from"@emotion/react/jsx-runtime";import*as Ce from"react-dom";import xe,{createPortal as ke}from"react-dom";import{css as $e}from"@emotion/react";import Se from"object-assign";const Me=e=>parseFloat(e.toFixed(4)).toString(),Ee=e=>"number"==typeof e?`${Me(.25*e)}rem`:e,Te=(e,t=16)=>`${Me(e/t)}rem`,Oe={neutral:{100:{value:"#FFFFFF"},200:{value:"#F6F6F6"},300:{value:"#E7E6E6"},400:{value:"#C9C9C9"},500:{value:"#B0B0B0"},600:{value:"#A1A1A1"},700:{value:"#5C5959"},800:{value:"#3D3B3B"},900:{value:"#1A1919"}},primary:{100:{value:"#FFFBF2"},200:{value:"#FCEFD3"},300:{value:"#FADFA7"},400:{value:"#F5BF4F"},500:{value:"#F0AB00"},600:{value:"#DE9E00"},700:{value:"#855B00"},800:{value:"#5F4205"},900:{value:"#332300"}},secondary:{100:{value:"#F2F6FF"},200:{value:"#D7E0F7"},300:{value:"#B2C3F0"},400:{value:"#4F6CBA"},500:{value:"#3855A3"},600:{value:"#0A4298"},700:{value:"#123369"},800:{value:"#162241"},900:{value:"#0B1121"}},success:{100:{value:"#EBF5F2"},200:{value:"#D3EED1"},300:{value:"#C2E5DC"},500:{value:"#009E77"},900:{value:"#00664D"}},warning:{100:{value:"#FBF7EA"},200:{value:"#E3CC8F"},300:{value:"#EEDDA5"},500:{value:"#A88100"},900:{value:"#715804"}},error:{100:{value:"#FFEFED"},200:{value:"#EDA1A9"},300:{value:"#F6C5C1"},500:{value:"#C11101"},900:{value:"#8D0D01"}},accessible:{"text-on-primary-mids":{value:"#332300"},"text-on-secondary-mids":{value:"#F2F6FF"},"controls-on-neutral-lights":{value:"#855B00"},"controls-on-neutral-darks":{value:"#F5BF4F"}}},Le={200:{value:Te(12)},300:{value:Te(14)},400:{value:Te(16)},500:{value:Te(18)},600:{value:Te(20)},700:{value:Te(24)},800:{value:Te(30)},900:{value:Te(36)},1e3:{value:Te(48)},1100:{value:Te(60)}},Ae={0:{value:Te(0)},50:{value:Te(2)},100:{value:Te(4)},200:{value:Te(8)},300:{value:Te(12)},400:{value:Te(16)},500:{value:Te(20)},600:{value:Te(24)},700:{value:Te(28)},800:{value:Te(32)},900:{value:Te(36)},1e3:{value:Te(40)},1100:{value:Te(44)},1200:{value:Te(48)},1400:{value:Te(56)},1600:{value:Te(64)},2e3:{value:Te(80)},2400:{value:Te(96)},2800:{value:Te(112)}},Re={100:{value:Te(0)},200:{value:Te(2)},300:{value:Te(4)},400:{value:Te(6)},500:{value:Te(8)},600:{value:Te(12)},700:{value:Te(16)},800:{value:Te(24)},900:{value:"9999px"}},Ne={100:{value:Te(1)},200:{value:Te(2)},300:{value:Te(4)},400:{value:Te(6)}},De={300:{value:Te(12)},400:{value:Te(16)},500:{value:Te(20)},600:{value:Te(24)},700:{value:Te(28)},800:{value:Te(32)},900:{value:Te(36)},1e3:{value:Te(44)},1100:{value:Te(60)},1200:{value:Te(72)}},Pe=(e=>{const t={};return Object.keys(e).forEach((n=>{Object.keys(e[n]).forEach((r=>{const o=e[n][r].value;t[`${n}-${r}`]=o}))})),t})(Oe),Ie=e(t,{theme:{tokens:{colors:Oe,fontSizes:Le,lineHeights:De,spacing:Ae,radii:Re,borderWidths:Ne}}}),ze=(e,t)=>Ie.tokens.getVar(`colors.${e}.${t}`)||Oe?.[e]?.[t]?.value,Ve=e=>Ie.tokens.getVar(`fontSizes.${e}`)||Le?.[e]?.value,He=e=>Ie.tokens.getVar(`spacing.${e}`)||Ae?.[e]?.value,_e=e=>Ie.tokens.getVar(`lineHeights.${e}`)||De?.[e]?.value,Be=e=>Ie.tokens.getVar(`radii.${e}`)||Re?.[e]?.value,je=e=>Ie.tokens.getVar(`borderWidths.${e}`)||Ne?.[e]?.value,Fe=re({labels:{}}),qe=({labels:e,children:t})=>{const n=ie((()=>({labels:e})),[e]);return Y(Fe.Provider,{value:n,children:t})},We={CheckboxList:{expandLabel:"Expand",hideLabel:"Hide",requiredLabel:"Required.",optionalLabel:"Optional",errorPrefix:"Error:",requiredSymbolLabel:"required"},Password:{showLabel:"Show",hideLabel:"Hide",showPasswordLabel:"Show password",hidePasswordLabel:"Hide password",strengthPrefix:"Password Strength:",strengthVeryWeak:"Very Weak",strengthWeak:"Weak",strengthMedium:"Medium",strengthStrong:"Strong",strengthVeryStrong:"Very Strong",requirementMet:"Requirement met.",requirementNotMet:"Requirement not met.",minLengthRule:e=>`Use a minimum of ${e} characters`,uppercaseRule:"Use an uppercase letter",lowercaseRule:"Use a lowercase letter",numberRule:"Use a number",specialCharRule:"Use a special character"},TextInput:{requiredSymbolLabel:"required",optionalSuffix:" (Optional)"},Combobox:{requiredSymbolLabel:"required",optionalSuffix:" (Optional)",defaultInputAriaLabel:"Combobox input",clearSelectionLabel:"Clear selection",toggleOptionsLabel:"Toggle options",noItemsFoundLabel:"No items found"},CloseButton:{closeLabel:"Close"},Toast:{dismissLabel:"Dismiss"},AlertBanner:{closeAlertLabel:"Close alert"},Badge:{unreadMessagesLabel:e=>`${e} unread ${1===e?"message":"messages"}`},Avatar:{unreadMessagesLabel:e=>`${e} unread ${1===e?"message":"messages"}`},ProgressBar:{progressAriaLabel:e=>`Progress: ${e}%`},InlineMessage:{roleDescription:"Note"},MapPopUp:{dialogAriaLabel:"Map popup dialog",closeLabel:"Close"},MapMarker:{clusterAriaLabel:e=>`Cluster of ${e} locations`,pinAriaLabel:"Map pin location",pointAriaLabel:"Map point"},AnalysisWidget:{toggleSectionLabel:"Toggle section"},Table:{ascendingLabel:"Ascending",descendingLabel:"Descending",selectAllRowsLabel:"Select all rows",selectRowLabel:(e,t)=>{const n=e||t;return null!=n&&""!=`${n}`?`Select row ${n}`:"Select row"}},Button:{loadingLabel:"Loading"},BaseMap:{activeLabel:"Active"},Search:{filterPlaceholder:"Filter",filterAriaLabel:"Search filter"},MobileSearch:{inputAriaLabel:"Search",cancelLabel:"Cancel",recentSearchesTitle:"Recent searches",matchingResultsTitle:e=>`Showing ${e} matching results`,infoLabel:"Label"},MobileTabBar:{tabPositionStatus:(e,t)=>`tab ${e} of ${t}`,selectedStatus:"selected",notSelectedStatus:"not selected",disabledStatus:"disabled"},Switch:{defaultAriaLabel:e=>e},Tag:{closeButtonAriaLabel:e=>`${e} tag close button`},Menu:{menuAriaLabel:"Menu",submenuAriaLabel:e=>`${e} submenu`,shortcutPrefix:"Shortcut"},Modal:{dialogAriaLabel:"Modal dialog"},Sheet:{expandSheetLabel:"Expand sheet",makeFullScreenLabel:"Make full screen",expandedSheetLabel:"Expanded sheet"},RadioList:{requiredLabel:"Required.",optionalLabel:"Optional.",errorPrefix:"Error:",requiredSymbolLabel:"required"},Select:{defaultAriaLabel:"Select input",requiredSuffix:" required.",disabledSuffix:" Disabled."},NavigationRail:{showLabel:"Show",hideLabel:"Hide",sidebarLabel:"Sidebar"},Navbar:{openMenuLabel:"Open menu",closeLabel:"Close",menuLabel:"Menu",goBackLabel:"Go back",closeMenuLabel:"Close menu",closeButtonText:"Close"},LegendItem:{dragAndDropLabel:"Drag and drop",upLabel:"Up",downLabel:"Down",removeLabel:"Remove",aboutDataLabel:"About data"},Toolbar:{collapseLabel:"Collapse",expandLabel:"Expand",collapseAriaLabel:"Collapse",expandAriaLabel:"Expand"},OpacityControl:{opacityButtonLabel:"Opacity",opacityHeading:"Opacity",opacityAriaLabel:"Opacity",percentSuffix:"%"},Textarea:{requiredSymbolLabel:"required",optionalSuffix:" (Optional)",errorPrefix:"Error:",enterAtLeastChars:e=>`Enter at least ${e} characters`,minChars:e=>`Min ${e} characters`,charsRemaining:e=>`You have ${e} characters remaining`,maxChars:e=>`Max ${e} characters`,needMoreChars:e=>`You need ${e} more characters`,tooManyChars:e=>`You have ${e} characters too many`},Pagination:{previousLabel:"Previous",nextLabel:"Next",previousPageLabel:"Previous page",nextPageLabel:"Next page",paginationLabel:"Pagination",pageLabel:e=>`Page ${e}`},ItemCount:{perPageLabel:"Per Page",showingLabel:(e,t,n)=>`Showing ${e}-${t} of ${n}`},LayerGroup:{activeTagLabel:e=>`${e} Active`,groupAriaLabel:(e,t,n)=>`${e}, ${t} Active layers on the map${n?`, ${n}`:""}`},LayerItem:{aboutDataLabel:"About data"},QualitativeAttribute:{hideLabel:"Hide",showLabel:"Show",visibleText:"visible",hiddenText:"hidden",linePrefix:"line,",currentlyTemplate:(e,t,n,r)=>`${n} ${e}${t?`, ${t}`:""}. Currently ${r}.`},MapControlsToolbar:{zoomInLabel:"Zoom in",zoomOutLabel:"Zoom out",expandLabel:"Expand",shareLabel:"Share",printLabel:"Print",settingsLabel:"Settings",helpLabel:"Help",zoomInAriaLabel:"Zoom in",zoomOutAriaLabel:"Zoom out",expandAriaLabel:"Expand",shareAriaLabel:"Share",printAriaLabel:"Print",settingsAriaLabel:"Settings",helpAriaLabel:"Help",toolbarAriaLabel:"Map controls toolbar"},StepProgressIndicator:{currentStepLabel:(e,t,n)=>`Current Step ${e}${t?` ${t}`:""}${n?". Completed":""}`},RichTextEditor:{editorAriaLabel:"Rich text editor",placeholder:"Start typing...",undoTooltip:"Undo",redoTooltip:"Redo",textTypeTooltip:"Text Type",fontSizeTooltip:"Font Size",alignmentTooltip:"Alignment",alignLeftOptionLabel:"Align left",alignCenterOptionLabel:"Align center",alignRightOptionLabel:"Align right",alignJustifyOptionLabel:"Justify",boldTooltip:"Bold (B)",boldIconText:"B",italicTooltip:"Italic (I)",italicIconText:"I",underlineTooltip:"Underline (U)",underlineIconText:"U",strikethroughTooltip:"Strikethrough",strikethroughIconText:"S",bulletListTooltip:"Bullet List",orderedListTooltip:"Ordered List",linkTooltip:"Link",imageTooltip:"Image",linkUrlPlaceholder:"http://example.org",linkLabelPlaceholder:"Label (optional)",linkLabelAriaLabel:"Link label",linkApplyLabel:"Apply",linkRemoveLabel:"Remove",linkInvalidUrlMessage:"Please enter a valid URL"}};function Ue(e){this.content=e}function Ke(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let e=0;o.text[e]==i.text[e];e++)n++;return n}if(o.content.size||i.content.size){let e=Ke(o.content,i.content,n+1);if(null!=e)return e}n+=o.nodeSize}else n+=o.nodeSize}}function Ze(e,t,n,r){for(let o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};let s=e.child(--o),a=t.child(--i),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let e=Ze(s.content,a.content,n-1,r-1);if(e)return e}n-=l,r-=l}else n-=l,r-=l}}Ue.prototype={constructor:Ue,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return-1==o?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new Ue(i)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new Ue(n)},addToStart:function(e,t){return new Ue([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Ue(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(-1==i?o.length:i,0,t,n),new Ue(o)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=Ue.from(e)).size?new Ue(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=Ue.from(e)).size?new Ue(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Ue.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},get size(){return this.content.length>>1}},Ue.from=function(e){if(e instanceof Ue)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Ue(t)};class Ge{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,o){for(let i=0,s=0;s<t;i++){let a=this.content[i],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,e-o),Math.min(a.content.size,t-o),n,r+o)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,((s,a)=>{let l=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(i?i=!1:o+=n),o+=l}),0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new Ge(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let o=0,i=0;i<t;o++){let s=this.content[o],a=i+s.nodeSize;a>e&&((i<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),n.push(s),r+=s.nodeSize),i=a}return new Ge(n,r)}cutByIndex(e,t){return e==t?Ge.empty:0==e&&t==this.content.length?this:new Ge(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new Ge(r,o)}addToStart(e){return new Ge([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Ge(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Ke(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Ze(this,e,t,n)}findIndex(e){if(0==e)return Xe(0,e);if(e==this.size)return Xe(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e)return r==e?Xe(t+1,r):Xe(t,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return Ge.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return Ge.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Ge.empty;let t,n=0;for(let r=0;r<e.length;r++){let o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new Ge(t||e,n)}static from(e){if(!e)return Ge.empty;if(e instanceof Ge)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ge([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Ge.empty=new Ge([],0);const Je={index:0,offset:0};function Xe(e,t){return Je.index=e,Je.offset=t,Je}function Ye(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Ye(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Ye(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}let Qe=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ye(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort(((e,t)=>e.type.rank-t.type.rank)),n}};Qe.none=[];class et extends Error{}class tt{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=rt(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return n&&new tt(n,this.openStart,this.openEnd)}removeBetween(e,t){return new tt(nt(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return tt.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new tt(Ge.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new tt(e,n,r)}}function nt(e,t,n){let{index:r,offset:o}=e.findIndex(t),i=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(o==t||i.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,i.copy(nt(i.content,t-o-1,n-o-1)))}function rt(e,t,n,r,o,i){let{index:s,offset:a}=e.findIndex(t),l=e.maybeChild(s);if(a==t||l.isText)return i&&r<=0&&o<=0&&!i.canReplace(s,s,n)?null:e.cut(0,t).append(n).append(e.cut(t));let c=rt(l.content,t-a-1,n,0==s?r-1:0,s==e.childCount-1?o-1:0,l);return c&&e.replaceChild(s,l.copy(c))}function ot(e,t,n){if(n.openStart>e.depth)throw new et("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new et("Inconsistent open depths");return it(e,t,n,0)}function it(e,t,n,r){let o=e.index(r),i=e.node(r);if(o==t.index(r)&&r<e.depth-n.openStart){let s=it(e,t,n,r+1);return i.copy(i.content.replaceChild(o,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:o,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(Ge.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return dt(i,ut(e,o,s,t,r))}{let r=e.parent,o=r.content;return dt(r,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}}return dt(i,ht(e,t,r))}function st(e,t){if(!t.type.compatibleContent(e.type))throw new et("Cannot join "+t.type.name+" onto "+e.type.name)}function at(e,t,n){let r=e.node(n);return st(r,t.node(n)),r}function lt(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function ct(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(lt(e.nodeAfter,r),i++));for(let e=i;e<s;e++)lt(o.child(e),r);t&&t.depth==n&&t.textOffset&&lt(t.nodeBefore,r)}function dt(e,t){return e.type.checkContent(t),e.copy(t)}function ut(e,t,n,r,o){let i=e.depth>o&&at(e,t,o+1),s=r.depth>o&&at(n,r,o+1),a=[];return ct(null,e,o,a),i&&s&&t.index(o)==n.index(o)?(st(i,s),lt(dt(i,ut(e,t,n,r,o+1)),a)):(i&&lt(dt(i,ht(e,t,o+1)),a),ct(t,n,o,a),s&&lt(dt(s,ht(n,r,o+1)),a)),ct(r,null,o,a),new Ge(a)}function ht(e,t,n){let r=[];if(ct(null,e,n,r),e.depth>n){lt(dt(at(e,t,n+1),ht(e,t,n+1)),r)}return ct(t,null,n,r),new Ge(r)}tt.empty=new tt(Ge.empty,0,0);class pt{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return Qe.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new vt(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,o=t;for(let t=e;;){let{index:e,offset:i}=t.content.findIndex(o),s=o-i;if(n.push(t,e,r+i),!s)break;if(t=t.child(e),t.isText)break;o=s-1,r+=i+1}return new pt(t,n,o)}static resolveCached(e,t){let n=gt.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else gt.set(e,n=new ft);let r=n.elts[n.i]=pt.resolve(e,t);return n.i=(n.i+1)%mt,r}}class ft{constructor(){this.elts=[],this.i=0}}const mt=12,gt=new WeakMap;class vt{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const bt=Object.create(null);let yt=class e{constructor(e,t,n,r=Qe.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||Ge.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Ye(this.attrs,t||e.defaultAttrs||bt)&&Qe.sameSet(this.marks,n||Qe.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return tt.empty;let r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),s=r.start(i),a=r.node(i).content.cut(r.pos-s,o.pos-s);return new tt(a,r.depth-i,o.depth-i)}replace(e,t,n){return ot(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return pt.resolveCached(this,e)}resolveNoCache(e){return pt.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ct(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Ge.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<o;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Qe.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Qe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=Ge.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,r,n);return o.type.checkAttrs(o.attrs),o}};yt.prototype.text=void 0;class wt extends yt{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ct(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new wt(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new wt(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ct(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class xt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new kt(e,t);if(null==n.next)return xt.empty;let r=$t(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return n(Lt(e,0));function n(r){let o=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<o.length;e++)o[e][0]==t&&(r=o[e][1]);Lt(e,n).forEach((e=>{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let i=t[r.join(",")]=new xt(r.indexOf(e.length-1)>-1);for(let e=0;e<o.length;e++){let r=o[e][1].sort(Ot);i.next.push({type:o[e][0],next:t[r.join(",")]||n(r)})}return i}}(function(e){let t=[[]];return o(i(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach((e=>e.to=t))}function i(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(i(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),o(i(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return o(i(e.expr,t),s),o(i(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(i(e.expr,t));if("range"==e.type){let s=t;for(let t=0;t<e.min;t++){let t=n();o(i(e.expr,s),t),s=t}if(-1==e.max)o(i(e.expr,s),s);else for(let t=e.min;t<e.max;t++){let t=n();r(s,t),o(i(e.expr,s),t),s=t}return[r(s)]}if("name"==e.type)return[r(t,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=i(e.exprs[r],t);if(r==e.exprs.length-1)return s;o(s,t=n())}}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];i.push(n.name),!o||n.isText||n.hasRequiredAttrs()||(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function o(i,s){let a=i.matchFragment(e,n);if(a&&(!t||a.validEnd))return Ge.from(s.map((e=>e.createAndFill())));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=o(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),o=r.match;if(o.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<o.next.length;e++){let{type:i,next:s}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r})).join("\n")}}xt.empty=new xt(!0);class kt{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function $t(e){let t=[];do{t.push(St(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function St(e){let t=[];do{t.push(Mt(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Mt(e){let t=function(e){if(e.eat("(")){let t=$t(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let e in n){let r=n[e];r.isInGroup(t)&&o.push(r)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=Tt(e,t)}return t}function Et(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Tt(e,t){let n=Et(e),r=n;return e.eat(",")&&(r="}"!=e.next?Et(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Ot(e,t){return t-e}function Lt(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(Ot)}function At(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Rt(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(void 0===o){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);o=t.default}n[r]=o}return n}function Nt(e,t,n,r){for(let r in t)if(!(r in e))throw new RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function Dt(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new It(e,r,t[r]);return n}let Pt=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Dt(e,n.attrs),this.defaultAttrs=At(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==xt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Rt(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new yt(this,this.computeAttrs(e),Ge.from(t),Qe.setFrom(n))}createChecked(e=null,t,n){return t=Ge.from(t),this.checkContent(t),new yt(this,this.computeAttrs(e),t,Qe.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=Ge.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(Ge.empty,!0);return o?new yt(this,e,t.append(o),Qe.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Nt(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Qe.none:e}static compile(t,n){let r=Object.create(null);t.forEach(((t,o)=>r[t]=new e(t,n,o)));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class It{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let o=null===n?"null":typeof n;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class zt{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Dt(e,r.attrs),this.excluded=null;let o=At(this.attrs);this.instance=o?new Qe(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Qe(this,Rt(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,o)=>n[e]=new zt(e,r++,t,o))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Nt(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Vt{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=Ue.from(e.nodes),t.marks=Ue.from(e.marks||{}),this.nodes=Pt.compile(this.spec.nodes,this),this.marks=zt.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",o=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=xt.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==o?null:o?Ht(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:Ht(this,n.split(" "))}this.nodeFromJSON=e=>yt.fromJSON(this,e),this.markFromJSON=e=>Qe.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof Pt))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new wt(n,n.defaultAttrs,e,Qe.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Ht(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class _t{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach((e=>{if(function(e){return null!=e.tag}(e))this.tags.push(e);else if(function(e){return null!=e.style}(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new Ut(this,t,!1);return n.addAll(e,Qe.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Ut(this,t,!0);return n.addAll(e,Qe.none,t.from,t.to),tt.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Kt(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(!(0!=i.indexOf(e)||r.context&&!n.matchesContext(r.context)||i.length>e.length&&(61!=i.charCodeAt(e.length)||i.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach((e=>{n(e=Zt(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=Zt(e)),e.node||e.ignore||e.mark||(e.node=t)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new _t(e,_t.schemaRules(e)))}}const Bt={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},jt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ft={ol:!0,ul:!0};function qt(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class Wt{constructor(e,t,n,r,o,i){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=i,this.content=[],this.activeMarks=Qe.none,this.match=o||(4&i?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Ge.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=Ge.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Ge.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Bt.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ut{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r,o=t.topNode,i=qt(null,t.preserveWhitespace,0)|(n?4:0);r=o?new Wt(o.type,o.attrs,Qe.none,!0,t.topMatch||o.type.contentMatch,i):new Wt(n?null:e.schema.topNodeType,null,Qe.none,!0,null,i),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,o=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:i}=this.parser;if("full"===o||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(o)if("full"===o)n=n.replace(/\r\n?/g,"\n");else if(i.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(i.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(i.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(i.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],o=e.previousSibling;(!t||o&&"BR"==o.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(i.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,o=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i,s=e.nodeName.toLowerCase();Ft.hasOwnProperty(s)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&Ft.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,n));e:if(a?a.ignore:jt.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let n,r=this.needsBlock;if(Bt.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),n=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let i=a&&a.skip?t:this.readStyles(e,t);i&&this.addAll(e,i),n&&this.sync(o),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,a,n,!1===a.consuming?i:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],o=n.getPropertyValue(r);if(o)for(let e;;){let n=this.parser.matchStyle(r,o,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter((e=>!n.clearMark(e))):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1!==n.consuming)break;e=n}}return t}addElementByRule(e,t,n,r){let o,i;if(t.node)if(i=this.parser.schema.nodes[t.node],i.isLeaf)this.insertNode(i.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(i,t.attrs||null,n,t.preserveWhitespace);e&&(o=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e,n,!1)));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}o&&this.sync(s)&&this.open--}addAll(e,t,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,t);this.findAtPoint(e,o)}findPlace(e,t,n){let r,o;for(let t=this.open,i=0;t>=0;t--){let s=this.nodes[t],a=s.findWrapping(e);if(a&&(!r||r.length>a.length+i)&&(r=a,o=s,!a.length))break;if(s.solid){if(n)break;i+=2}}if(!r)return null;this.sync(o);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=Qe.none;for(let o of r.concat(e.marks))(t.type?t.type.allowsMarkType(o.type):Gt(o.type,e.type))&&(n=o.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let o=this.findPlace(e.create(t),n,!1);return o&&(o=this.enterInner(e,t,n,!0,r)),o}enterInner(e,t,n,r=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let s=qt(e,o,i.options);4&i.options&&0==i.content.length&&(s|=4);let a=Qe.none;return n=n.filter((t=>!(i.type?i.type.allowsMarkType(t.type):Gt(t.type,e))||(a=t.addToSet(a),!1))),this.nodes.push(new Wt(e,t,a,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!(!this.isOpen&&!this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)){t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),o=-(n?n.depth+1:0)+(r?0:1),i=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=a&&!e.isInGroup(a))return!1;s--}}return!0};return i(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function Kt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Zt(e){let t={};for(let n in e)t[n]=e[n];return t}function Gt(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t)return!0;if(i.indexOf(o)<0&&s(o))return!0}};if(s(o.contentMatch))return!0}}class Jt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Yt(t).createDocumentFragment());let r=n,o=[];return e.forEach((e=>{if(o.length||e.marks.length){let n=0,i=0;for(;n<o.length&&i<e.marks.length;){let t=e.marks[i];if(this.marks[t.type.name]){if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,i++}else i++}for(;n<o.length;)r=o.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],s=this.serializeMark(n,e.isInline,t);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){if(e.isText)return Yt(t).createTextNode(e.text);let{dom:n,contentDOM:r}=tn(Yt(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&tn(Yt(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return"string"==typeof t?{dom:e.createTextNode(t)}:tn(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Jt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Xt(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Xt(e.marks)}}function Xt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Yt(e){return e.document||window.document}const Qt=new WeakMap;function en(e){let t=Qt.get(e);return void 0===t&&Qt.set(e,t=function(e){let t=null;function n(e){if(e&&"object"==typeof e)if(Array.isArray(e))if("string"==typeof e[0])t||(t=[]),t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}(e)),t}function tn(e,t,n,r){if(1==t.nodeType)return{dom:t};if(t.dom&&1==t.dom.nodeType)return t;let o,i=t[0];if("string"!=typeof i)throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=en(r))&&o.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s,a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let l=n?e.createElementNS(n,i):e.createElement(i),c=t[1],d=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){d=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?l.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):"style"==e&&l.style?l.style.cssText=c[e]:l.setAttribute(e,c[e])}}for(let o=d;o<t.length;o++){let i=t[o];if(0===i){if(o<t.length-1||o>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}if("string"==typeof i)l.appendChild(e.createTextNode(i));else{let{dom:t,contentDOM:o}=tn(e,i,n,r);if(l.appendChild(t),o){if(s)throw new RangeError("Multiple content holes");s=o}}}return{dom:l,contentDOM:s}}const nn=Math.pow(2,16);function rn(e,t){return e+t*nn}function on(e){return 65535&e}class sn{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class an{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&an.empty)return an.empty}recover(e){let t=0,n=on(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/nn}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+o],c=this.ranges[s+i],d=a+l;if(e<=d){let o=a+r+((l?e==a?-1:e==d?1:t:t)<0?0:c);if(n)return o;let i=e==(t<0?a:d)?null:rn(s/3,e-a),u=e==a?2:e==d?1:4;return(t<0?e!=a:e!=d)&&(u|=8),new sn(o,u,i)}r+=c-l}return n?e+r:new sn(e+r,0,null)}touches(e,t){let n=0,r=on(t),o=this.inverted?2:1,i=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+o];if(e<=s+a&&t==3*r)return!0;n+=this.ranges[t+i]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),a=i+(this.inverted?0:o),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),o+=c-l}}invert(){return new an(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?an.empty:new an(e<0?[0,-e,0]:[0,0,e])}}an.empty=new an([]);class ln{constructor(e,t,n=0,r=(e?e.length:0)){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new ln(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new ln;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let o=this._maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return n?e:new sn(e,r,null)}}const cn=Object.create(null);class dn{getMap(){return an.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=cn[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in cn)throw new RangeError("Duplicate use of step JSON ID "+e);return cn[e]=t,t.prototype.jsonID=e,t}}class un{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new un(e,null)}static fail(e){return new un(null,e)}static fromReplace(e,t,n,r){try{return un.ok(e.replace(t,n,r))}catch(e){if(e instanceof et)return un.fail(e.message);throw e}}}function hn(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(hn(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return Ge.fromArray(r)}class pn extends dn{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),o=new tt(hn(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return un.fromReplace(e,this.from,this.to,o)}invert(){return new fn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new pn(t.pos,n.pos,this.mark)}merge(e){return e instanceof pn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new pn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new pn(t.from,t.to,e.markFromJSON(t.mark))}}dn.jsonID("addMark",pn);class fn extends dn{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new tt(hn(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return un.fromReplace(e,this.from,this.to,n)}invert(){return new pn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new fn(t.pos,n.pos,this.mark)}merge(e){return e instanceof fn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new fn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new fn(t.from,t.to,e.markFromJSON(t.mark))}}dn.jsonID("removeMark",fn);class mn extends dn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return un.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return un.fromReplace(e,this.pos,this.pos+1,new tt(Ge.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new mn(this.pos,t.marks[n]);return new mn(this.pos,this.mark)}}return new gn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new mn(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new mn(t.pos,e.markFromJSON(t.mark))}}dn.jsonID("addNodeMark",mn);class gn extends dn{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return un.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return un.fromReplace(e,this.pos,this.pos+1,new tt(Ge.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new mn(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new gn(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new gn(t.pos,e.markFromJSON(t.mark))}}dn.jsonID("removeNodeMark",gn);class vn extends dn{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&yn(e,this.from,this.to)?un.fail("Structure replace would overwrite content"):un.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new an([this.from,this.to-this.from,this.slice.size])}invert(e){return new vn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&vn.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new vn(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof vn)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?tt.empty:new tt(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new vn(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?tt.empty:new tt(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new vn(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new vn(t.from,t.to,tt.fromJSON(e,t.slice),!!t.structure)}}vn.MAP_BIAS=1,dn.jsonID("replace",vn);class bn extends dn{constructor(e,t,n,r,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(yn(e,this.from,this.gapFrom)||yn(e,this.gapTo,this.to)))return un.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return un.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?un.fromReplace(e,this.from,this.to,n):un.fail("Content does not fit in gap")}getMap(){return new an([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new bn(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||o>n.pos?null:new bn(t.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bn(t.from,t.to,t.gapFrom,t.gapTo,tt.fromJSON(e,t.slice),t.insert,!!t.structure)}}function yn(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function wn(e,t,n,r=n.contentMatch,o=!0){let i=e.doc.nodeAt(t),s=[],a=t+1;for(let t=0;t<i.childCount;t++){let l=i.child(t),c=a+l.nodeSize,d=r.matchType(l.type);if(d){r=d;for(let t=0;t<l.marks.length;t++)n.allowsMarkType(l.marks[t].type)||e.step(new fn(a,c,l.marks[t]));if(o&&l.isText&&"pre"!=n.whitespace){let e,t,r=/\r?\n|\r/g;for(;e=r.exec(l.text);)t||(t=new tt(Ge.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),s.push(new vn(a+e.index,a+e.index+e[0].length,t))}}else s.push(new vn(a,c,tt.empty));a=c}if(!r.validEnd){let t=r.fillBefore(Ge.empty,!0);e.replace(a,a,new tt(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function Cn(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function xn(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,o=0;;--n){let i=e.$from.node(n),s=e.$from.index(n)+r,a=e.$to.indexAfter(n)-o;if(n<e.depth&&i.canReplace(s,a,t))return n;if(0==n||i.type.spec.isolating||!Cn(i,s,a))break;s&&(r=1),a<i.childCount&&(o=1)}return null}function kn(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<o;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null}(r,t);return i?o.map($n).concat({type:t,attrs:n}).concat(i.map($n)):null}function $n(e){return{type:e,attrs:null}}function Sn(e,t,n,r){t.forEach(((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let o=e.mapping.slice(r).map(n+1+i+s.index);e.replaceWith(o,o+1,t.type.schema.linebreakReplacement.create())}}}))}function Mn(e,t,n,r){t.forEach(((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let o=e.mapping.slice(r).map(n+1+i);e.replaceWith(o,o+1,t.type.schema.text("\n"))}}))}function En(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>i;e--,t--){let n=o.node(e),i=o.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),a=r&&r[t+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=r&&r[t]||n;if(!n.canReplace(i+1,n.childCount)||!l.type.validContent(s))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function Tn(e,t){let n=e.resolve(t),r=n.index();return On(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function On(e,t){return!(!e||!t||e.isLeaf||!function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let o=0;o<t.childCount;o++){let i=t.child(o),s=i.type==r?e.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n)return!1;if(!e.type.allowsMarks(i.marks))return!1}return n.validEnd}(e,t))}function Ln(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let o,i,s=r.index(e);if(e==r.depth?(o=r.nodeBefore,i=r.nodeAfter):n>0?(o=r.node(e+1),s++,i=r.node(e).maybeChild(s)):(o=r.node(e).maybeChild(s-1),i=r.node(e+1)),o&&!o.isTextblock&&On(o,i)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function An(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,i=r.index(t)+(n>0?1:0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(i,i,o);else{let e=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=e&&s.canReplaceWith(i,i,e[0])}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Rn(e,t,n=t,r=tt.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return Nn(o,i,r)?new vn(t,n,r):new Dn(o,i,r).fit()}function Nn(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}dn.jsonID("replaceAround",bn);class Dn{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=Ge.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=Ge.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new tt(o,i,s);return e>-1?new bn(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new vn(n.pos,r.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=t.firstChild;if(t.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=zn(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let o=e.firstChild;for(let e=this.depth;e>=0;e--){let i,{type:s,match:a}=this.frontier[e],l=null;if(1==t&&(o?a.matchType(o.type)||(l=a.fillBefore(Ge.from(o),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:l};if(2==t&&o&&(i=a.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:i};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=zn(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new tt(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=zn(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new tt(Pn(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new tt(Pn(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let i=this.unplaced,s=n?n.content:i.content,a=i.openStart-e,l=0,c=[],{match:d,type:u}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));d=d.matchFragment(r)}let h=s.size+e-(i.content.size-i.openEnd);for(;l<s.childCount;){let e=s.child(l),t=d.matchType(e.type);if(!t)break;l++,(l>1||0==a||e.content.size)&&(d=t,c.push(Vn(e.mark(u.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?h:-1)))}let p=l==s.childCount;p||(h=-1),this.placed=In(this.placed,t,Ge.from(c)),this.frontier[t].match=d,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<h;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?0==e?tt.empty:new tt(Pn(i.content,e-1,1),e-1,h<0?i.openEnd:e-1):new tt(Pn(i.content,e,l),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Hn(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=Hn(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=Hn(e,n,r,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:i,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=In(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=In(this.placed,this.depth,Ge.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Ge.empty,!0);e.childCount&&(this.placed=In(this.placed,this.frontier.length,e))}}function Pn(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Pn(e.firstChild.content,t-1,n)))}function In(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(In(e.lastChild.content,t-1,n)))}function zn(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Vn(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Vn(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Ge.empty,!0)))),e.copy(r)}function Hn(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,s)?a:null}function _n(e,t,n,r,o){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(_n(o.content,t+1,n,r,o)))}if(t>r){let t=o.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(Ge.empty,!0))}return e}function Bn(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(o<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}class jn extends dn{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return un.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return un.fromReplace(e,this.pos,this.pos+1,new tt(Ge.from(r),0,t.isLeaf?0:1))}getMap(){return an.empty}invert(e){return new jn(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new jn(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new jn(t.pos,t.attr,t.value)}}dn.jsonID("attr",jn);class Fn extends dn{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return un.ok(n)}getMap(){return an.empty}invert(e){return new Fn(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Fn(t.attr,t.value)}}dn.jsonID("docAttr",Fn);let qn=class extends Error{};qn=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(qn.prototype=Object.create(Error.prototype)).constructor=qn,qn.prototype.name="TransformError";class Wn{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ln}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new qn(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach(((n,r,o,i)=>{e=Math.min(e,o),t=Math.max(t,i)}))}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=tt.empty){let r=Rn(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new tt(Ge.from(n),0,0))}delete(e,t){return this.replace(e,t,tt.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),i=e.doc.resolve(n);if(Nn(o,i,r))return e.step(new vn(t,n,r));let s=Bn(o,i);0==s[s.length-1]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?a=e:o.before(e)==t&&s.splice(1,0,-e)}let l=s.indexOf(a),c=[],d=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=d-1;e>=0;e--){let t=c[e],n=(u=t.type).spec.defining||u.spec.definingForContent;if(n&&!t.sameMarkup(o.node(Math.abs(a)-1)))d=e;else if(n||!t.type.isTextblock)break}var u;for(let t=r.openStart;t>=0;t--){let a=(t+d+1)%(r.openStart+1),u=c[a];if(u)for(let t=0;t<s.length;t++){let c=s[(t+l)%s.length],d=!0;c<0&&(d=!1,c=-c);let h=o.node(c-1),p=o.index(c-1);if(h.canReplaceWith(p,p,u.type,u.marks))return e.replace(o.before(c),d?i.after(c):n,new tt(_n(r.content,0,r.openStart,a),a,r.openEnd))}}let h=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,r),!(e.steps.length>h));a--){let e=s[a];e<0||(t=o.before(e),n=i.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}(e.doc,t,r.type);null!=o&&(t=n=o)}e.replaceRange(t,n,new tt(Ge.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&0==r.parentOffset&&0==o.parentOffset){let i=r.sharedDepth(n),s=!1;for(let e=r.depth;e>i;e--)r.node(e).type.spec.isolating&&(s=!0);for(let e=o.depth;e>i;e--)o.node(e).type.spec.isolating&&(s=!0);if(!s){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=o.depth;e>0&&n==o.start(e);e--)n=o.before(e);r=e.doc.resolve(t),o=e.doc.resolve(n)}}let i=Bn(r,o);for(let t=0;t<i.length;t++){let n=i[t],s=t==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return e.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:o,depth:i}=t,s=r.before(i+1),a=o.after(i+1),l=s,c=a,d=Ge.empty,u=0;for(let e=i,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,d=Ge.from(r.node(e).copy(d)),u++):l--;let h=Ge.empty,p=0;for(let e=i,t=!1;e>n;e--)t||o.after(e+1)<o.end(e)?(t=!0,h=Ge.from(o.node(e).copy(h)),p++):c++;e.step(new bn(l,c,s,a,new tt(d.append(h),u,p),d.size-u,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=null,{linebreakReplacement:o}=e.doc.type.schema,i=e.doc.resolve(t-n),s=i.node().type;if(o&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(o);e&&!t?r=!1:!e&&t&&(r=!0)}let a=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);Mn(e,r.node(),r.before(),a)}s.inlineContent&&wn(e,t+n-1,s,i.node().contentMatchAt(i.index()),null==r);let l=e.mapping.slice(a),c=l.map(t-n);if(e.step(new vn(c,l.map(t+n,-1),tt.empty,!0)),!0===r){let t=e.doc.resolve(c);Sn(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=Ge.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Ge.from(n[e].type.create(n[e].attrs,r))}let o=t.start,i=t.end;e.step(new bn(o,i,o,i,new tt(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{let s="function"==typeof o?o(t):o;if(t.isTextblock&&!t.hasMarkup(r,s)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(i).map(n),r)){let o=null;if(r.schema.linebreakReplacement){let e="pre"==r.whitespace,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?o=!1:!e&&t&&(o=!0)}!1===o&&Mn(e,t,n,i),wn(e,e.mapping.slice(i).map(n,1),r,void 0,null===o);let a=e.mapping.slice(i),l=a.map(n,1),c=a.map(n+t.nodeSize,1);return e.step(new bn(l,c,l+1,c-1,new tt(Ge.from(r.create(s,null,t.marks)),0,0),1,!0)),!0===o&&Sn(e,t,n,i),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return function(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new bn(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new tt(Ge.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new jn(e,t,n)),this}setDocAttribute(e,t){return this.step(new Fn(e,t)),this}addNodeMark(e,t){return this.step(new mn(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof Qe)t.isInSet(n.marks)&&this.step(new gn(e,t));else{let r,o=n.marks,i=[];for(;r=t.isInSet(o);)i.push(new gn(e,r)),o=r.removeFromSet(o);for(let e=i.length-1;e>=0;e--)this.step(i[e])}return this}split(e,t=1,n){return function(e,t,n=1,r){let o=e.doc.resolve(t),i=Ge.empty,s=Ge.empty;for(let e=o.depth,t=o.depth-n,a=n-1;e>t;e--,a--){i=Ge.from(o.node(e).copy(i));let t=r&&r[a];s=Ge.from(t?t.type.create(t.attrs,s):o.node(e).copy(s))}e.step(new vn(t,t,new tt(i.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let o,i,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let d=e.marks;if(!r.isInSet(d)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),u=Math.min(l+e.nodeSize,n),h=r.addToSet(d);for(let e=0;e<d.length;e++)d[e].isInSet(h)||(o&&o.to==c&&o.mark.eq(d[e])?o.to=u:s.push(o=new fn(c,u,d[e])));i&&i.to==c?i.to=u:a.push(i=new pn(c,u,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let o=[],i=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;i++;let a=null;if(r instanceof zt){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,l=a[e];for(let e=0;e<o.length;e++){let t=o[e];t.step==i-1&&l.eq(o[e].style)&&(n=t)}n?(n.to=r,n.step=i):o.push({style:l,from:Math.max(s,t),to:r,step:i})}}})),o.forEach((t=>e.step(new fn(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return wn(this,e,t,n),this}}const Un=Object.create(null);class Kn{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Zn(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=tt.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=e.mapping.slice(o);e.replaceRange(c.map(a.pos),c.map(l.pos),s?tt.empty:t),0==s&&or(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=e.mapping.slice(n),l=a.map(i.pos),c=a.map(s.pos);o?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),or(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Xn(e):rr(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let o=t<0?rr(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):rr(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new tr(e.node(0))}static atStart(e){return rr(e,e,0,0,1)||new tr(e)}static atEnd(e){return rr(e,e,e.content.size,e.childCount,-1)||new tr(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Un[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Un)throw new RangeError("Duplicate use of selection JSON ID "+e);return Un[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Xn.between(this.$anchor,this.$head).getBookmark()}}Kn.prototype.visible=!0;class Zn{constructor(e,t){this.$from=e,this.$to=t}}let Gn=!1;function Jn(e){Gn||e.parent.inlineContent||(Gn=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Xn extends Kn{constructor(e,t=e){Jn(e),Jn(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return Kn.near(n);let r=e.resolve(t.map(this.anchor));return new Xn(r.parent.inlineContent?r:n,n)}replace(e,t=tt.empty){if(super.replace(e,t),t==tt.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof Xn&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Yn(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Xn(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=Kn.findFrom(t,n,!0)||Kn.findFrom(t,-n,!0);if(!e)return Kn.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(Kn.findFrom(e,-n,!0)||Kn.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new Xn(e,t)}}Kn.jsonID("text",Xn);class Yn{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Yn(e.map(this.anchor),e.map(this.head))}resolve(e){return Xn.between(e.resolve(this.anchor),e.resolve(this.head))}}class Qn extends Kn{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),o=e.resolve(r);return n?Kn.near(o):new Qn(o)}content(){return new tt(Ge.from(this.node),0,0)}eq(e){return e instanceof Qn&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new er(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Qn(e.resolve(t.anchor))}static create(e,t){return new Qn(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}Qn.prototype.visible=!1,Kn.jsonID("node",Qn);class er{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new Yn(n,n):new er(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Qn.isSelectable(n)?new Qn(t):Kn.near(t)}}class tr extends Kn{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=tt.empty){if(t==tt.empty){e.delete(0,e.doc.content.size);let t=Kn.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new tr(e)}map(e){return new tr(e)}eq(e){return e instanceof tr}getBookmark(){return nr}}Kn.jsonID("all",tr);const nr={map(){return this},resolve:e=>new tr(e)};function rr(e,t,n,r,o,i=!1){if(t.inlineContent)return Xn.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&Qn.isSelectable(r))return Qn.create(e,n-(o<0?r.nodeSize:0))}else{let t=rr(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function or(e,t,n){let r=e.steps.length-1;if(r<t)return;let o,i=e.steps[r];(i instanceof vn||i instanceof bn)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==o&&(o=r)})),e.setSelection(Kn.near(e.doc.resolve(o),n)))}class ir extends Wn{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return Qe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Qe.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(Kn.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function sr(e,t){return t&&e?e.bind(t):e}class ar{constructor(e,t,n){this.name=e,this.init=sr(t.init,n),this.apply=sr(t.apply,n)}}const lr=[new ar("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new ar("selection",{init:(e,t)=>e.selection||Kn.atStart(t.doc),apply:e=>e.selection}),new ar("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new ar("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class cr{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=lr.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new ar(e.key,e.spec.state,e))}))}}class dr{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let a=r?r[i].n:0,l=r?r[i].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new dr(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new ir(this)}static create(e){let t=new cr(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new dr(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new cr(this.schema,e.plugins),n=t.fields,r=new dr(t);for(let t=0;t<n.length;t++){let o=n[t].name;r[o]=this.hasOwnProperty(o)?this[o]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new cr(e.schema,e.plugins),o=new dr(r);return r.fields.forEach((r=>{if("doc"==r.name)o.doc=yt.fromJSON(e.schema,t.doc);else if("selection"==r.name)o.selection=Kn.fromJSON(o.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,i))return void(o[r.name]=a.fromJSON.call(s,e,t[i],o))}o[r.name]=r.init(e,o)}})),o}}function ur(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=ur(o,t,{})),n[r]=o}return n}class hr{constructor(e){this.spec=e,this.props={},e.props&&ur(e.props,this,this.props),this.key=e.key?e.key.key:fr("plugin")}getState(e){return e[this.key]}}const pr=Object.create(null);function fr(e){return e in pr?e+"$"+ ++pr[e]:(pr[e]=0,e+"$")}class mr{constructor(e="key"){this.key=fr(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const gr=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function vr(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const br=(e,t,n)=>{let r=vr(e,n);if(!r)return!1;let o=xr(r);if(!o){let n=r.blockRange(),o=n&&xn(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(Rr(e,o,t,-1))return!0;if(0==r.parent.content.size&&(wr(i,"end")||Qn.isSelectable(i)))for(let n=r.depth;;n--){let s=Rn(e.doc,r.before(n),r.after(n),tt.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(wr(i,"end")?Kn.findFrom(n.doc.resolve(n.mapping.map(o.pos,-1)),-1):Qn.create(n.doc,o.pos-i.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||r.node(n-1).childCount>1)break}return!(!i.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0)};function yr(e,t,n){let r=t.nodeBefore,o=t.pos-1;for(;!r.isTextblock;o--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let i=t.nodeAfter,s=t.pos+1;for(;!i.isTextblock;s++){if(i.type.spec.isolating)return!1;let e=i.firstChild;if(!e)return!1;i=e}let a=Rn(e.doc,o,s,tt.empty);if(!a||a.from!=o||a instanceof vn&&a.slice.size>=s-o)return!1;if(n){let t=e.tr.step(a);t.setSelection(Xn.create(t.doc,o)),n(t.scrollIntoView())}return!0}function wr(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}const Cr=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=xr(r)}let s=i&&i.nodeBefore;return!(!s||!Qn.isSelectable(s))&&(t&&t(e.tr.setSelection(Qn.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function xr(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function kr(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const $r=(e,t,n)=>{let r=kr(e,n);if(!r)return!1;let o=Mr(r);if(!o)return!1;let i=o.nodeAfter;if(Rr(e,o,t,1))return!0;if(0==r.parent.content.size&&(wr(i,"start")||Qn.isSelectable(i))){let n=Rn(e.doc,r.before(),r.after(),tt.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(wr(i,"start")?Kn.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):Qn.create(r.doc,r.mapping.map(o.pos))),t(r.scrollIntoView())}return!0}}return!(!i.isAtom||o.depth!=r.depth-1)&&(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0)},Sr=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=Mr(r)}let s=i&&i.nodeAfter;return!(!s||!Qn.isSelectable(s))&&(t&&t(e.tr.setSelection(Qn.create(e.doc,i.pos)).scrollIntoView()),!0)};function Mr(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const Er=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function Tr(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Or=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof tr||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=Tr(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(n,i.createAndFill());s.setSelection(Xn.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},Lr=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(En(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&xn(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};const Ar=(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof Qn&&e.selection.node.isBlock)return!(!n.parentOffset||!En(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let o,i,s=[],a=!1,l=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){a=n.end(e)==n.pos+(n.depth-e),l=n.start(e)==n.pos-(n.depth-e),i=Tr(n.node(e-1).contentMatchAt(n.indexAfter(e-1))),s.unshift(a&&i?{type:i}:null),o=e;break}if(1==e)return!1;s.unshift(null)}let c=e.tr;(e.selection instanceof Xn||e.selection instanceof tr)&&c.deleteSelection();let d=c.mapping.map(n.pos),u=En(c.doc,d,s.length,s);if(u||(s[0]=i?{type:i}:null,u=En(c.doc,d,s.length,s)),!u)return!1;if(c.split(d,s.length,s),!a&&l&&n.node(o).type!=i){let e=c.mapping.map(n.before(o)),t=c.doc.resolve(e);i&&n.node(o-1).canReplaceWith(t.index(),t.index()+1,i)&&c.setNodeMarkup(c.mapping.map(n.before(o)),i)}return t&&t(c.scrollIntoView()),!0};function Rr(e,t,n,r){let o,i,s=t.nodeBefore,a=t.nodeAfter,l=s.type.spec.isolating||a.type.spec.isolating;if(!l&&function(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(i,i+1)||!o.isTextblock&&!Tn(e.doc,t.pos)||(n&&n(e.tr.join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let c=!l&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(o=(i=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&i.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,i=Ge.empty;for(let e=o.length-1;e>=0;e--)i=Ge.from(o[e].create(null,i));i=Ge.from(s.copy(i));let l=e.tr.step(new bn(t.pos-1,r,t.pos,r,new tt(i,1,0),o.length,!0)),c=l.doc.resolve(r+2*o.length);c.nodeAfter&&c.nodeAfter.type==s.type&&Tn(l.doc,c.pos)&&l.join(c.pos),n(l.scrollIntoView())}return!0}let d=a.type.spec.isolating||r>0&&l?null:Kn.findFrom(t,1),u=d&&d.$from.blockRange(d.$to),h=u&&xn(u);if(null!=h&&h>=t.depth)return n&&n(e.tr.lift(u,h).scrollIntoView()),!0;if(c&&wr(a,"start",!0)&&wr(s,"end")){let r=s,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let i=a,l=1;for(;!i.isTextblock;i=i.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,i.content)){if(n){let r=Ge.empty;for(let e=o.length-1;e>=0;e--)r=Ge.from(o[e].copy(r));n(e.tr.step(new bn(t.pos-o.length,t.pos+a.nodeSize,t.pos+l,t.pos+a.nodeSize-l,new tt(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Nr(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(Xn.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}const Dr=Nr(-1),Pr=Nr(1);function Ir(e,t=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(i,s,((r,i)=>{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}}))}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,e,t)}r(o.scrollIntoView())}return!0}}function zr(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}function Vr(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i);if(!s)return!1;let a=r?n.tr:null;return!!function(e,t,n,r=null){let o=!1,i=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=s.resolve(t.start-2);i=new vt(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new vt(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let a=kn(i,n,r,t);if(!a)return!1;e&&function(e,t,n,r,o){let i=Ge.empty;for(let e=n.length-1;e>=0;e--)i=Ge.from(n[e].type.create(n[e].attrs,i));e.step(new bn(t.start-(r?2:0),t.end,t.start,t.end,new tt(i,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==o&&(s=e+1);let a=n.length-s,l=t.start+n.length-(r?2:0),c=t.parent;for(let n=t.startIndex,r=t.endIndex,o=!0;n<r;n++,o=!1)!o&&En(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=c.child(n).nodeSize}(e,t,a,o,n);return!0}(a,s,e,t)&&(r&&r(a.scrollIntoView()),!0)}}function Hr(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,(t=>t.childCount>0&&t.firstChild.type==e));return!!i&&(!n||(r.node(i.depth-1).type==e?function(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new bn(i-1,s,i,s,new tt(Ge.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new vt(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=xn(r);if(null==a)return!1;o.lift(r,a);let l=o.doc.resolve(o.mapping.map(i,-1)-1);Tn(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos);return t(o.scrollIntoView()),!0}(t,n,e,i):function(e,t,n){let r=e.tr,o=n.parent;for(let e=n.end,t=n.endIndex-1,i=n.startIndex;t>i;t--)e-=o.child(t).nodeSize,r.delete(e-1,e+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==o.childCount,c=i.node(-1),d=i.index(-1);if(!c.canReplace(d+(a?0:1),d+1,s.content.append(l?Ge.empty:Ge.from(o))))return!1;let u=i.pos,h=u+s.nodeSize;return r.step(new bn(u-(a?1:0),h+(l?1:0),u+1,h-1,new tt((a?Ge.empty:Ge.from(o.copy(Ge.empty))).append(l?Ge.empty:Ge.from(o.copy(Ge.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,i)))}}zr(gr,br,Cr),zr(gr,$r,Sr),zr(Er,Or,Lr,Ar),"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();const _r=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},Br=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let jr=null;const Fr=function(e,t,n){let r=jr||(jr=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},qr=function(e,t,n,r){return n&&(Ur(e,t,n,r,-1)||Ur(e,t,n,r,1))},Wr=/^(img|br|input|textarea|hr)$/i;function Ur(e,t,n,r,o){for(var i;;){if(e==n&&t==r)return!0;if(t==(o<0?0:Kr(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Zr(e)||Wr.test(e.nodeName)||"false"==e.contentEditable)return!1;t=_r(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;{let n=e.childNodes[t+(o<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable){if(!(null===(i=n.pmViewDesc)||void 0===i?void 0:i.ignoreForSelection))return!1;t+=o}else e=n,t=o<0?Kr(e):0}}}}function Kr(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Zr(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Gr=function(e){return e.focusNode&&qr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Jr(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const Xr="undefined"!=typeof navigator?navigator:null,Yr="undefined"!=typeof document?document:null,Qr=Xr&&Xr.userAgent||"",eo=/Edge\/(\d+)/.exec(Qr),to=/MSIE \d/.exec(Qr),no=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Qr),ro=!!(to||no||eo),oo=to?document.documentMode:no?+no[1]:eo?+eo[1]:0,io=!ro&&/gecko\/(\d+)/i.test(Qr);io&&(/Firefox\/(\d+)/.exec(Qr)||[0,0])[1];const so=!ro&&/Chrome\/(\d+)/.exec(Qr),ao=!!so,lo=so?+so[1]:0,co=!ro&&!!Xr&&/Apple Computer/.test(Xr.vendor),uo=co&&(/Mobile\/\w+/.test(Qr)||!!Xr&&Xr.maxTouchPoints>2),ho=uo||!!Xr&&/Mac/.test(Xr.platform),po=!!Xr&&/Win/.test(Xr.platform),fo=/Android \d/.test(Qr),mo=!!Yr&&"webkitFontSmoothing"in Yr.documentElement.style,go=mo?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function vo(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function bo(e,t){return"number"==typeof e?e:e[t]}function yo(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function wo(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=Br(s);continue}let e=s,n=e==i.body,a=n?vo(i):yo(e),l=0,c=0;if(t.top<a.top+bo(r,"top")?c=-(a.top-t.top+bo(o,"top")):t.bottom>a.bottom-bo(r,"bottom")&&(c=t.bottom-t.top>a.bottom-a.top?t.top+bo(o,"top")-a.top:t.bottom-a.bottom+bo(o,"bottom")),t.left<a.left+bo(r,"left")?l=-(a.left-t.left+bo(o,"left")):t.right>a.right-bo(r,"right")&&(l=t.right-a.right+bo(o,"right")),l||c)if(n)i.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let o=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}let d=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s="absolute"==d?s.offsetParent:Br(s)}}function Co(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Br(r));return t}function xo(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let ko=null;function $o(e,t){let n,r,o,i,s=2e8,a=0,l=t.top,c=t.top;for(let d=e.firstChild,u=0;d;d=d.nextSibling,u++){let e;if(1==d.nodeType)e=d.getClientRects();else{if(3!=d.nodeType)continue;e=Fr(d).getClientRects()}for(let h=0;h<e.length;h++){let p=e[h];if(p.top<=l&&p.bottom>=c){l=Math.max(p.bottom,l),c=Math.min(p.top,c);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<s){n=d,s=e,r=e&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==d.nodeType&&e&&(a=u+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!o&&p.left<=t.left&&p.right>=t.left&&(o=d,i={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=u+1)}}return!n&&o&&(n=o,r=i,s=0),n&&3==n.nodeType?function(e,t){let n,r=e.nodeValue.length,o=document.createRange();for(let i=0;i<r;i++){o.setEnd(e,i+1),o.setStart(e,i);let r=Oo(o,1);if(r.top!=r.bottom&&So(t,r)){n={node:e,offset:i+(t.left>=(r.left+r.right)/2?1:0)};break}}return o.detach(),n||{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:a}:$o(n,r)}function So(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Mo(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let n=e.childNodes[i];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let o=e[r];if(So(t,o))return Mo(n,t,o)}}if((i=(i+1)%r)==o)break}return e}function Eo(e,t){let n,r=e.dom.ownerDocument,o=0,i=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Kr(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Kr(r.startContainer),r.startOffset)}}}(r,t.left,t.top);i&&({node:n,offset:o}=i);let s,a=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!a||!e.dom.contains(1!=a.nodeType?a.parentNode:a)){let n=e.dom.getBoundingClientRect();if(!So(t,n))return null;if(a=Mo(e.dom,t,n),!a)return null}if(co)for(let e=a;n&&e;e=Br(e))e.draggable&&(n=void 0);if(a=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(a,t),n){if(io&&1==n.nodeType&&(o=Math.min(o,n.childNodes.length),o<n.childNodes.length)){let e,r=n.childNodes[o];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&o++}let r;mo&&o&&1==n.nodeType&&1==(r=n.childNodes[o-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&o--,n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(e,t,n,r){let o=-1;for(let n=t,i=!1;n!=e.dom;){let t,s=e.docView.nearestDesc(n,!0);if(!s)return null;if(1==s.dom.nodeType&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((t=s.dom.getBoundingClientRect()).width||t.height)&&(s.node.isBlock&&s.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(s.dom.nodeName)&&(!i&&t.left>r.left||t.top>r.top?o=s.posBefore:(!i&&t.right<r.left||t.bottom<r.top)&&(o=s.posAfter),i=!0),!s.contentDOM&&o<0&&!s.node.isText))return(s.node.isBlock?r.top<(t.top+t.bottom)/2:r.left<(t.left+t.right)/2)?s.posBefore:s.posAfter;n=s.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}(e,n,o,t))}null==s&&(s=function(e,t,n){let{node:r,offset:o}=$o(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,a,t));let l=e.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function To(e){return e.top<e.bottom||e.left<e.right}function Oo(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(To(e))return e}return Array.prototype.find.call(n,To)||e.getBoundingClientRect()}const Lo=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ao(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=mo||io;if(3==r.nodeType){if(!s||!Lo.test(r.nodeValue)&&(n<0?o:o!=r.nodeValue.length)){let e=o,t=o,i=n<0?1:-1;return n<0&&!o?(t++,i=-1):n>=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,Ro(Oo(Fr(r,e,t),i),i<0)}{let e=Oo(Fr(r,o,o),n);if(io&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=Oo(Fr(r,o-1,o-1),-1);if(t.top==e.top){let n=Oo(Fr(r,o,o+1),-1);if(n.top!=e.top)return Ro(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(null==i&&o&&(n<0||o==Kr(r))){let e=r.childNodes[o-1];if(1==e.nodeType)return No(e.getBoundingClientRect(),!1)}if(null==i&&o<Kr(r)){let e=r.childNodes[o];if(1==e.nodeType)return No(e.getBoundingClientRect(),!0)}return No(r.getBoundingClientRect(),n>=0)}if(null==i&&o&&(n<0||o==Kr(r))){let e=r.childNodes[o-1],t=3==e.nodeType?Fr(e,Kr(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return Ro(Oo(t,1),!1)}if(null==i&&o<Kr(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?Fr(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return Ro(Oo(t,-1),!0)}return Ro(Oo(3==r.nodeType?Fr(r):r,-n),n>=0)}function Ro(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function No(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Do(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}const Po=/[\u0590-\u08ac]/;let Io=null,zo=null,Vo=!1;function Ho(e,t,n){return Io==t&&zo==n?Vo:(Io=t,zo=n,Vo="up"==n||"down"==n?function(e,t,n){let r=t.selection,o="up"==n?r.$from:r.$to;return Do(e,t,(()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=Ao(e,o.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=Fr(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>2*(o.bottom-r.top):o.bottom-r.bottom>2*(r.bottom-o.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=e.domSelection();return a?Po.test(r.parent.textContent)&&a.modify?Do(e,t,(()=>{let{focusNode:t,focusOffset:o,anchorNode:i,anchorOffset:s}=e.domSelectionRange(),l=a.caretBidiLevel;a.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:d,focusOffset:u}=e.domSelectionRange(),h=d&&!c.contains(1==d.nodeType?d:d.parentNode)||t==d&&o==u;try{a.collapse(i,s),t&&(t!=i||o!=s)&&a.extend&&a.extend(t,o)}catch(e){}return null!=l&&(a.caretBidiLevel=l),h})):"left"==n||"backward"==n?i:s:r.pos==r.start()||r.pos==r.end()}(e,t,n))}class _o{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>_r(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let o,i=this.getDesc(r);if(i&&(!t||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],o=n+r.size;if(n==e&&o!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<o)return r.descAt(e-n-r.border);n=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let o=this.children[n],i=t+o.size;if(i>e||o instanceof Ko){r=e-t;break}t=i}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof Bo&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?_r(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?_r(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,s=0;;s++){let n=this.children[s],a=i+n.size;if(-1==r&&e<=a){let o=i+n.border;if(e>=o&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=i;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=_r(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=_r(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let o=Math.min(e,t),i=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(o>a&&i<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if((io||co)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(d=!(!t||"\n"!=e.nodeValue[t-1]),d&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(s=a={node:t.parentNode,offset:_r(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];d=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(io&&c.focusNode&&c.focusNode!=a.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||d&&co)&&qr(s.node,s.offset,c.anchorNode,c.anchorOffset)&&qr(a.node,a.offset,c.focusNode,c.focusOffset))return;let u=!1;if((l.extend||e==t)&&(!d||!io)){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),u=!0}catch(e){}}if(!u){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let r=n+o.border,s=i-o.border;if(e>=r&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=r||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-r,t-r):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Bo extends _o{constructor(e,t,n,r){let o,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,(()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r))),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class jo extends _o{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class Fo extends _o{constructor(e,t,n,r,o){super(e,[],n,r),this.mark=t,this.spec=o}static create(e,t,n,r){let o=r.nodeViews[t.type.name],i=o&&o(t,r,n);return i&&i.dom||(i=Jt.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new Fo(e,t,i.dom,i.contentDOM||i.dom,i)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=Fo.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;t<i&&(o=si(o,t,i,n)),e>0&&(o=si(o,0,e,n));for(let e=0;e<o.length;e++)o[e].parent=r;return r.children=o,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class qo extends _o{constructor(e,t,n,r,o,i,s,a,l){super(e,[],o,i),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,o,i){let s,a=o.nodeViews[t.type.name],l=a&&a(t,o,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:i),n,r),c=l&&l.dom,d=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=Jt.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:d}=e)}d||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let u=c;return c=ti(c,n,t),l?s=new Zo(e,t,n,r,c,d||null,u,l,o,i+1):t.isText?new Uo(e,t,n,r,c,u,o):new qo(e,t,n,r,c,d||null,u,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Ge.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&ni(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,o=e.composing?this.localCompositionInfo(e,t):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new oi(this,i&&i.node,e);!function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,o,t.forChild(i,s),n),i+=s.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let d,u,h,p;for(;s<o.length&&o[s].to==i;){let e=o[s++];e.widget&&(d?(u||(u=[d])).push(e):d=e)}if(d)if(u){u.sort(ii);for(let e=0;e<u.length;e++)n(u[e],c,!!l)}else n(d,c,!!l);if(l)p=-1,h=l,l=null;else{if(!(c<e.childCount))break;p=c,h=e.child(c++)}for(let e=0;e<a.length;e++)a[e].to<=i&&a.splice(e--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let f=i+h.nodeSize;if(h.isText){let e=f;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(l=h.cut(e-i),h=h.cut(0,e-i),f=e,p=-1)}else for(;s<o.length&&o[s].to<f;)s++;r(h,h.isInline&&!h.isLeaf?a.filter((e=>!e.inline)):a.slice(),t.forChild(i,h),p),i=f}}(this.node,this.innerDeco,((t,o,i)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e,o):t.type.side>=0&&!i&&a.syncToMarks(o==this.node.childCount?Qe.none:this.node.child(o).marks,n,e,o),a.placeWidget(t,e,r)}),((t,i,l,c)=>{let d;a.syncToMarks(t.marks,n,e,c),a.findNodeMatch(t,i,l,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(d=a.findIndexWithChild(o.node))>-1&&a.updateNodeAt(t,i,l,d,e)||a.updateNextNode(t,i,l,e,c,r)||a.addNode(t,i,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(i&&this.protectLocalComposition(e,i),Go(this.contentDOM,this.children,e),uo&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Xn)||n<t||r>t+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<e.childCount;){let t=e.child(o++);if(i+=t.nodeSize,!t.isText)break;l+=t.text}if(i>=n){if(i>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new jo(this,o,t,r);e.input.compositionNodes.push(i),this.children=si(this.children,n,n+r.length,e,i)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(ni(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Qo(this.dom,this.nodeDOM,Yo(this.outerDeco,this.node,t),Yo(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Wo(e,t,n,r,o){ti(r,t,e);let i=new qo(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Uo extends qo{constructor(e,t,n,r,o,i,s){super(e,t,n,r,o,null,i,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),o=document.createTextNode(r.text);return new Uo(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Ko extends _o{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Zo extends qo{constructor(e,t,n,r,o,i,s,a,l,c){super(e,t,n,r,o,i,s,l,c),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Go(e,t,n){let r=e.firstChild,o=!1;for(let i=0;i<t.length;i++){let s=t[i],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=ri(r),o=!0;r=r.nextSibling}else o=!0,e.insertBefore(a,r);if(s instanceof Fo){let t=r?r.previousSibling:e.lastChild;Go(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=ri(r),o=!0;o&&n.trackWrites==e&&(n.trackWrites=null)}const Jo=function(e){e&&(this.nodeName=e)};Jo.prototype=Object.create(null);const Xo=[new Jo];function Yo(e,t,n){if(0==e.length)return Xo;let r=n?Xo[0]:new Jo,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s){s.nodeName&&o.push(r=new Jo(s.nodeName));for(let e in s){let i=s[e];null!=i&&(n&&1==o.length&&o.push(r=new Jo(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+i:"style"==e?r.style=(r.style?r.style+";":"")+i:"nodeName"!=e&&(r[e]=i))}}}return o}function Qo(e,t,n,r){if(n==Xo&&r==Xo)return t;let o=t;for(let t=0;t<r.length;t++){let i=r[t],s=n[t];if(t){let t;s&&s.nodeName==i.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==i.nodeName||(t=document.createElement(i.nodeName),t.pmIsDeco=!0,t.appendChild(o),s=Xo[0]),o=t}ei(o,s||Xo[0],i)}return o}function ei(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==o.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<o.length;t++)-1==r.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function ti(e,t,n){return Qo(e,e,Xo,Yo(t,n,1!=e.nodeType))}function ni(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function ri(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class oi{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Fo)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&!1!==e[o].type.spec.spanning;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let o=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){o=t;break}}if(o>-1)o>this.index&&(this.changed=!0,this.destroyBetween(this.index,o)),this.top=this.top.children[this.index];else{let r=Fo.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,o,i){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof qo){let l=this.preMatch.matched.get(a);if(null!=l&&l!=o)return!1;let c,d=a.dom,u=this.isLocked(d)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&ni(t,a.outerDeco));if(!u&&a.update(e,t,n,r))return this.destroyBetween(this.index,s),a.dom!=d&&(this.changed=!0),this.index++,!0;if(!u&&(c=this.recreateWrapper(a,e,t,n,r,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,i+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,o,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!ni(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=qo.create(this.top,t,n,r,o,i);if(s.contentDOM){s.children=e.children,e.children=[];for(let e of s.children)e.parent=s}return e.destroy(),s}addNode(e,t,n,r,o){let i=qo.create(this.top,e,t,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new Bo(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Fo;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Uo)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((co||ao)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new Ko(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function ii(e,t){return e.type.side-t.type.side}function si(e,t,n,r,o){let i=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,d=a+=l.size;c>=n||d<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,r)),o&&(i.push(o),o=void 0),d>n&&i.push(l.slice(n-c,l.size,r)))}return i}function ai(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(Gr(n)){for(a=s;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&Qn.isSelectable(e)&&o.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==Kr(e);r||o;){if(e==n)return!0;let t=_r(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==Kr(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;l=new Qn(s==e?c:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,o=s;for(let r=0;r<n.rangeCount;r++){let i=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(i.startContainer,i.startOffset,1)),o=Math.max(o,e.docView.posFromDOM(i.endContainer,i.endOffset,-1))}if(t<0)return null;[a,s]=o==e.state.selection.anchor?[o,t]:[t,o],c=r.resolve(s)}else a=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let d=r.resolve(a);if(!l){l=gi(e,d,c,"pointer"==t||e.state.selection.head<c.pos&&!i?1:-1)}return l}function li(e){return e.editable?e.hasFocus():bi(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ci(e,t=!1){let n=e.state.selection;if(fi(e,n),li(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&ao){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&qr(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,_r(n)+1):t.collapse(n,0);!r&&!e.state.selection.visible&&ro&&oo<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{let r,o,{anchor:i,head:s}=n;!di||n instanceof Xn||(n.$from.parent.inlineContent||(r=ui(e,n.from)),n.empty||n.$from.parent.inlineContent||(o=ui(e,n.to))),e.docView.setSelection(i,s,e,t),di&&(r&&pi(r),o&&pi(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{li(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const di=co||ao&&lo<63;function ui(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(co&&o&&"false"==o.contentEditable)return hi(o);if(!(o&&"false"!=o.contentEditable||i&&"false"!=i.contentEditable)){if(o)return hi(o);if(i)return hi(i)}}function hi(e){return e.contentEditable="true",co&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function pi(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function fi(e,t){if(t instanceof Qn){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(mi(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else mi(e)}function mi(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function gi(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||Xn.between(t,n,r)}function vi(e){return!(e.editable&&!e.hasFocus())&&bi(e)}function bi(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function yi(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&Kn.findFrom(i,t)}function wi(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ci(e,t,n){let r=e.state.selection;if(!(r instanceof Xn)){if(r instanceof Qn&&r.node.isInline)return wi(e,new Xn(t>0?r.$to:r.$from));{let n=yi(e.state,t);return!!n&&wi(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=e.state.doc.resolve(n.pos+o.nodeSize*(t<0?-1:1));return wi(e,new Xn(r.$anchor,i))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=yi(e.state,t);return!!(n&&n instanceof Qn)&&wi(e,n)}if(!(ho&&n.indexOf("m")>-1)){let n,o=r.$head,i=o.textOffset?null:t<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=t<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(Qn.isSelectable(i)?wi(e,new Qn(t<0?e.state.doc.resolve(o.pos-i.nodeSize):o)):!!mo&&wi(e,new Xn(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}function xi(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function ki(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function $i(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;io&&1==n.nodeType&&r<xi(n)&&ki(n.childNodes[r],-1)&&(s=!0);for(;;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(ki(e,-1))o=n,i=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Si(n))break;{let t=n.previousSibling;for(;t&&ki(t,-1);)o=n.parentNode,i=_r(t),t=t.previousSibling;if(t)n=t,r=xi(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Mi(e,n,r):o&&Mi(e,o,i)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=xi(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!ki(n.childNodes[r],1))break;o=n,i=++r}else{if(Si(n))break;{let t=n.nextSibling;for(;t&&ki(t,1);)o=t.parentNode,i=_r(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=xi(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}o&&Mi(e,o,i)}(e)}function Si(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Mi(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!Zr(e);)t=_r(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!Zr(e);)t=_r(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Gr(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout((()=>{e.state==o&&ci(e)}),50)}function Ei(e,t){let n=e.state.doc.resolve(t);if(!ao&&!po&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function Ti(e,t,n){let r=e.state.selection;if(r instanceof Xn&&!r.empty||n.indexOf("s")>-1)return!1;if(ho&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=yi(e.state,t);if(n&&n instanceof Qn)return wi(e,n)}if(!o.parent.inlineContent){let n=t<0?o:i,s=r instanceof tr?Kn.near(n,t):Kn.findFrom(n,t);return!!s&&wi(e,s)}return!1}function Oi(e,t){if(!(e.state.selection instanceof Xn))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=e.state.tr;return t<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),e.dispatch(r),!0}return!1}function Li(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Ai(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||ho&&72==n&&"c"==r)return Oi(e,-1)||$i(e,-1);if(46==n&&!t.shiftKey||ho&&68==n&&"c"==r)return Oi(e,1)||$i(e,1);if(13==n||27==n)return!0;if(37==n||ho&&66==n&&"c"==r){let t=37==n?"ltr"==Ei(e,e.state.selection.from)?-1:1:-1;return Ci(e,t,r)||$i(e,t)}if(39==n||ho&&70==n&&"c"==r){let t=39==n?"ltr"==Ei(e,e.state.selection.from)?1:-1:1;return Ci(e,t,r)||$i(e,t)}return 38==n||ho&&80==n&&"c"==r?Ti(e,-1,r)||$i(e,-1):40==n||ho&&78==n&&"c"==r?function(e){if(!co||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Li(e,n,"true"),setTimeout((()=>Li(e,n,"false")),20)}return!1}(e)||Ti(e,1,r)||$i(e,1):r==(ho?"m":"c")&&(66==n||73==n||89==n||90==n)}function Ri(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||Jt.fromSchema(e.state.schema),a=ji(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,d=l.firstChild,u=0;for(;d&&1==d.nodeType&&(c=_i[d.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),u++}d=l.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${o} ${i}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function Ni(e,t,n,r,o){let i,s,a=o.parent.type.spec.code;if(!n&&!t)return null;let l=!!t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(n=>{t=n(t,a||r,e)})),a)return s=new tt(Ge.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",(t=>{s=t(s,e,!0)})),s;let n=e.someProp("clipboardTextParser",(n=>n(t,o,r,e)));if(n)s=n;else{let n=o.marks(),{schema:r}=e.state,s=Jt.fromSchema(r);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),i=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=ji().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&_i[o[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join(""));if(r.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;Fi||(Fi=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e}));return Fi.createHTML(e)}(e),n)for(let e=0;e<n.length;e++)r=r.querySelector(n[e])||r;return r}(n),mo&&function(e){let t=e.querySelectorAll(ao?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let e=+d[3];e>0;e--){let e=i.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;i=e}if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||_t.fromSchema(e.state.schema);s=t.parseSlice(i,{preserveWhitespace:!(!l&&!d),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Di.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(d)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:o,openStart:i,openEnd:s}=e;for(let e=n.length-2;e>=0;e-=2){let t=r.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;o=Ge.from(t.create(n[e+1],o)),i++,s++}return new tt(o,i,s)}(Hi(s,+d[1],+d[2]),d[4]);else if(s=tt.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),i=[];if(e.forEach((e=>{if(!i)return;let t,n=o.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&r.length&&Ii(n,r,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=zi(i[i.length-1],r.length));let t=Pi(e,n);i.push(t),o=o.matchType(t.type),r=n}})),i)return Ge.from(i)}return e}(s.content,o),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Hi(s,e,t)}return e.someProp("transformPasted",(t=>{s=t(s,e,l)})),s}const Di=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Pi(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Ge.from(e));return e}function Ii(e,t,n,r,o){if(o<e.length&&o<t.length&&e[o]==t[o]){let i=Ii(e,t,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?n.type:e[o+1]))return r.copy(r.content.append(Ge.from(Pi(n,e,o+1))))}}function zi(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,zi(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Ge.empty,!0);return e.copy(n.append(r))}function Vi(e,t,n,r,o,i){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(i=0),o<r-1&&(a=Vi(a,t,n,r,o+1,i)),o>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Ge.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function Hi(e,t,n){return t<e.openStart&&(e=new tt(Vi(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new tt(Vi(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const _i={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Bi=null;function ji(){return Bi||(Bi=document.implementation.createHTMLDocument("title"))}let Fi=null;const qi={},Wi={},Ui={touchstart:!0,touchmove:!0};class Ki{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Zi(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Gi(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Ji(e,t))}))}function Ji(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Xi(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Yi(e){return{left:e.clientX,top:e.clientY}}function Qi(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(e.someProp(t,(t=>r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1))))return!0;return!1}function es(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function ts(e,t,n,r,o){return Qi(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(o?function(e,t){if(-1==t)return!1;let n,r,o=e.state.selection;o instanceof Qn&&(n=o.node);let i=e.state.doc.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e);if(Qn.isSelectable(t)){r=n&&o.$from.depth>0&&e>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(e);break}}return null!=r&&(es(e,Qn.create(e.state.doc,r)),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&Qn.isSelectable(r))&&(es(e,new Qn(n)),!0)}(e,n))}function ns(e,t,n,r){return Qi(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function rs(e,t,n,r){return Qi(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(es(e,Xn.create(r,0,r.content.size)),!0);let o=r.resolve(t);for(let t=o.depth+1;t>0;t--){let n=t>o.depth?o.nodeAfter:o.node(t),i=o.before(t);if(n.inlineContent)es(e,Xn.create(r,i+1,i+1+n.content.size));else{if(!Qn.isSelectable(n))continue;es(e,Qn.create(r,i))}return!0}}(e,n,r)}function is(e){return ps(e)}Wi.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!ls(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!fo||!ao||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!uo||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||Ai(e,n)?n.preventDefault():Zi(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,Jr(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},Wi.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Wi.keypress=(e,t)=>{let n=t;if(ls(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||ho&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof Xn&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(t).scrollIntoView();/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t,o)))||e.dispatch(o()),n.preventDefault()}};const ss=ho?"metaKey":"ctrlKey";qi.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=is(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[ss]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i,button:n.button};let s=e.posAtCoords(Yi(n));s&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new as(e,s,n,!!r)):("doubleClick"==i?ns:rs)(e,s.pos,s.inside,n)?n.preventDefault():Zi(e,"pointer"))};class as{constructor(e,t,n,r){let o,i;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[ss],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,i=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a&&1==a.nodeDOM.nodeType?a.nodeDOM:null;let{selection:l}=e.state;0==n.button&&(o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof Qn&&l.from<=i&&l.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!io||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Zi(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>ci(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Yi(e))),this.updateAllowDefault(e),this.allowDefault||!t?Zi(this.view,"pointer"):ts(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||co&&this.mightDrag&&!this.mightDrag.node.isAtom||ao&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(es(this.view,Kn.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Zi(this.view,"pointer")}move(e){this.updateAllowDefault(e),Zi(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function ls(e,t){return!!e.composing||!!(co&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}qi.touchstart=e=>{e.input.lastTouch=Date.now(),is(e),Zi(e,"pointer")},qi.touchmove=e=>{e.input.lastTouch=Date.now(),Zi(e,"pointer")},qi.contextmenu=e=>is(e);const cs=fo?5e3:-1;function ds(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>ps(e)),t))}function us(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function hs(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=Kr(e=e.childNodes[t-1])}else{if(!e.parentNode||Zr(e))return null;t=_r(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||Zr(e))return null;t=_r(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}function ps(e,t=!1){if(!(fo&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),us(e),t||e.docView&&e.docView.dirty){let n=ai(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}Wi.compositionstart=Wi.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Xn&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))||ao&&po&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),ps(e,!0),e.markCursor=null;else if(ps(e,!t.selection.empty),io&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}ds(e,cs)},Wi.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then((()=>e.domObserver.flush())),e.input.compositionID++,ds(e,20))};const fs=ro&&oo<15||uo&&go<604;function ms(e,t,n,r,o){let i=Ni(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,o,i||tt.empty))))return!0;if(!i)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function gs(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}qi.copy=Wi.cut=(e,t)=>{let n=t,r=e.state.selection,o="cut"==n.type;if(r.empty)return;let i=fs?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Ri(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Wi.paste=(e,t)=>{let n=t;if(e.composing&&!fo)return;let r=fs?null:n.clipboardData,o=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&ms(e,gs(r),r.getData("text/html"),o,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ms(e,r.value,null,o,t):ms(e,r.textContent,r.innerHTML,o,t)}),50)}(e,n)};class vs{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const bs=ho?"altKey":"ctrlKey";function ys(e,t){let n;return e.someProp("dragCopies",(e=>{n=n||e(t)})),null!=n?!n:!t[bs]}qi.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o,i=e.state.selection,s=i.empty?null:e.posAtCoords(Yi(n));if(s&&s.pos>=i.from&&s.pos<=(i instanceof Qn?i.to-1:i.to));else if(r&&r.mightDrag)o=Qn.create(e.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=Qn.create(e.state.doc,t.posBefore))}let a=(o||e.state.selection).content(),{dom:l,text:c,slice:d}=Ri(e,a);(!n.dataTransfer.files.length||!ao||lo>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(fs?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",fs||n.dataTransfer.setData("text/plain",c),e.dragging=new vs(d,ys(e,n),o)},qi.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},Wi.dragover=Wi.dragenter=(e,t)=>t.preventDefault(),Wi.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Yi(t));if(!r)return;let o=e.state.doc.resolve(r.pos),i=n&&n.slice;i?e.someProp("transformPasted",(t=>{i=t(i,e,!1)})):i=Ni(e,gs(t.dataTransfer),fs?null:t.dataTransfer.getData("text/html"),!1,o);let s=!(!n||!ys(e,t));if(e.someProp("handleDrop",(n=>n(e,t,i||tt.empty,s))))return void t.preventDefault();if(!i)return;t.preventDefault();let a=i?An(e.state.doc,o.pos,i):o.pos;null==a&&(a=o.pos);let l=e.state.tr;if(s){let{node:e}=n;e?e.replace(l):l.deleteSelection()}let c=l.mapping.map(a),d=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,u=l.doc;d?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i);if(l.doc.eq(u))return;let h=l.doc.resolve(c);if(d&&Qn.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new Qn(h));else{let t=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach(((e,n,r,o)=>t=o)),l.setSelection(gi(e,h,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},qi.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ci(e)}),20))},qi.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},qi.beforeinput=(e,t)=>{if(ao&&fo&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,Jr(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let e in Wi)qi[e]=Wi[e];function ws(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Cs{constructor(e,t){this.toDOM=e,this.spec=t||Ms,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new $s(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Cs&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ws(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class xs{constructor(e,t){this.attrs=e,this.spec=t||Ms}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new $s(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof xs&&ws(this.attrs,e.attrs)&&ws(this.spec,e.spec)}static is(e){return e.type instanceof xs}destroy(){}}class ks{constructor(e,t){this.attrs=e,this.spec=t||Ms}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new $s(o.pos-n,i.pos-n,this)}valid(e,t){let n,{index:r,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(n=e.child(r)).isText&&o+n.nodeSize==t.to}eq(e){return this==e||e instanceof ks&&ws(this.attrs,e.attrs)&&ws(this.spec,e.spec)}destroy(){}}class $s{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new $s(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new $s(e,e,new Cs(t,n))}static inline(e,t,n,r){return new $s(e,t,new xs(n,r))}static node(e,t,n,r){return new $s(e,t,new ks(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof xs}get widget(){return this.type instanceof Cs}}const Ss=[],Ms={};class Es{constructor(e,t){this.local=e.length?e:Ss,this.children=t.length?t:Ss}static create(e,t){return t.length?Ns(t,e,0,Ms):Ts}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==Ts||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Ms)}mapInner(e,t,n,r,o){let i;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(i||(i=[])).push(a):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,s){let a=e.slice();for(let e=0,t=i;e<n.maps.length;e++){let r=0;n.maps[e].forEach(((e,n,o,i)=>{let s=i-o-(n-e);for(let o=0;o<a.length;o+=3){let i=a[o+1];if(i<0||e>i+t-r)continue;let l=a[o]+t-r;n>=l?a[o+1]=e<=l?-2:-1:e>=t&&s&&(a[o]+=s,a[o+1]+=s)}r+=s})),t=n.maps[e].map(t,-1)}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue}let c=n.map(e[t]+i),d=c-o;if(d<0||d>=r.content.size){l=!0;continue}let u=n.map(e[t+1]+i,-1)-o,{index:h,offset:p}=r.content.findIndex(d),f=r.maybeChild(h);if(f&&p==d&&p+f.nodeSize==u){let r=a[t+2].mapInner(n,f,c+1,e[t]+i+1,s);r!=Ts?(a[t]=d,a[t+1]=u,a[t+2]=r):(a[t+1]=-2,l=!0)}else l=!0}if(l){let l=function(e,t,n,r,o,i,s){function a(e,t){for(let i=0;i<e.local.length;i++){let a=e.local[i].map(r,o,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[i].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&a(e[n+2],t[n]+i+1);return n}(a,e,t,n,o,i,s),c=Ns(l,r,0,s);t=c.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Es(t.sort(Ds),a)}(this.children,i||[],e,t,n,r,o):i?new Es(i.sort(Ds),Ss):Ts}add(e,t){return t.length?this==Ts?Es.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,o=0;e.forEach(((e,i)=>{let s,a=i+n;if(s=As(t,e,a)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(e,s,a+1):r.splice(o,0,i,i+e.nodeSize,Ns(s,e,a+1,Ms)),o+=3}}));let i=Ls(o?Rs(t):t,-n);for(let t=0;t<i.length;t++)i[t].type.valid(e,i[t])||i.splice(t--,1);return new Es(i.length?this.local.concat(i).sort(Ds):this.local,r||this.children)}remove(e){return 0==e.length||this==Ts?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+t,s=n[r+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>i&&t.to<s&&(e[n]=null,(o||(o=[])).push(t));if(!o)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(o,i+1);a!=Ts?n[r+2]=a:(n.splice(r,3),r-=3)}if(r.length)for(let n,o=0;o<e.length;o++)if(n=e[o])for(let e=0;e<r.length;e++)r[e].eq(n,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Es(r,n):Ts}forChild(e,t){if(this==Ts)return this;if(t.isLeaf)return Es.empty;let n,r;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let o=e+1,i=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>o&&t.type instanceof xs){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new Es(r.sort(Ds),Ss);return n?new Os([e,n]):e}return n||Ts}eq(e){if(this==e)return!0;if(!(e instanceof Es)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Ps(this.localsInner(e))}localsInner(e){if(this==Ts)return Ss;if(e.inlineContent||!this.local.some(xs.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof xs||t.push(this.local[e]);return t}forEachSet(e){e(this)}}Es.empty=new Es([],[]),Es.removeOverlap=Ps;const Ts=Es.empty;class Os{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,Ms)));return Os.from(n)}forChild(e,t){if(t.isLeaf)return Es.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,t);o!=Ts&&(o instanceof Os?n=n.concat(o.members):n.push(o))}return Os.from(n)}eq(e){if(!(e instanceof Os)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?Ps(n?t:t.sort(Ds)):Ss}static from(e){switch(e.length){case 0:return Ts;case 1:return e[0];default:return new Os(e.every((e=>e instanceof Es))?e:e.reduce(((e,t)=>e.concat(t instanceof Es?t:t.members)),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Ls(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new $s(o.from+t,o.to+t,o.type))}return n}function As(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let t,i=0;i<e.length;i++)(t=e[i])&&t.from>n&&t.to<r&&((o||(o=[])).push(t),e[i]=null);return o}function Rs(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Ns(e,t,n,r){let o=[],i=!1;t.forEach(((t,s)=>{let a=As(e,t,s+n);if(a){i=!0;let e=Ns(a,t,n+s+1,r);e!=Ts&&o.push(s,s+t.nodeSize,e)}}));let s=Ls(i?Rs(e):e,-n).sort(Ds);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||o.length?new Es(s,o):Ts}function Ds(e,t){return e.from-t.from||e.to-t.to}function Ps(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from!=r.from){i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),Is(t,o,r.copy(i.from,r.to)));break}i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),Is(t,o+1,i.copy(r.to,i.to)))}}return t}function Is(e,t,n){for(;t<e.length&&Ds(n,e[t])>0;)t++;e.splice(t,0,n)}function zs(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=Ts&&t.push(r)})),e.cursorWrapper&&t.push(Es.create(e.state.doc,[e.cursorWrapper.deco])),Os.from(t)}const Vs={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Hs=ro&&oo<=11;class _s{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Bs{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new _s,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver((t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);ro&&oo<=11&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():co&&e.composing&&t.some((e=>"childList"==e.type&&"TR"==e.target.nodeName))?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()})),Hs&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Vs)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(vi(this.view)){if(this.suppressingSelectionUpdates)return ci(this.view);if(ro&&oo<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&qr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let t=e.focusNode;t;t=Br(t))n.add(t);for(let r=e.anchorNode;r;r=Br(r))if(n.has(r)){t=r;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&vi(e)&&!this.ignoreSelectionChange(n),o=-1,i=-1,s=!1,a=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],a);n&&(o=o<0?n.from:Math.min(n.from,o),i=i<0?n.to:Math.max(n.to,i),n.typeOver&&(s=!0))}if(!a.some((e=>"BR"==e.nodeName))||8!=e.input.lastKeyCode&&46!=e.input.lastKeyCode){if(io&&a.length){let t=a.filter((e=>"BR"==e.nodeName));if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;!t||"LI"!=t.nodeName||n&&Ws(e,n)==t||r.remove()}}}}else for(let e of a)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;for(;t&&1==t.nodeType;){if("false"==t.contentEditable){e.parentNode.removeChild(e);break}t=t.firstChild}}let l=null;o<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Gr(n)&&(l=ai(e))&&l.eq(Kn.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,ci(e),this.currentSelection.set(n),e.scrollToSelection()):(o>-1||r)&&(o>-1&&(e.docView.markDirty(o,i),function(e){if(js.has(e))return;if(js.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)){if(e.requiresGeckoHackNode=io,Fs)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Fs=!0}}(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:o}=e.domSelectionRange();for(let i of t)if("TR"==(null===(n=i.parentNode)||void 0===n?void 0:n.nodeName)){let t=i.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(i,n.firstChild),r==i&&e.domSelection().collapse(i,o)}else i.parentNode.removeChild(i)}}(e,a)),this.handleDOMChange(o,i,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||ci(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,o=e.nextSibling;if(ro&&oo<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:i}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!i||Array.prototype.indexOf.call(e.addedNodes,i)<0)&&(o=i)}let i=r&&r.parentNode==e.target?_r(r)+1:0,s=n.localPosFromDOM(e.target,i,-1),a=o&&o.parentNode==e.target?_r(o):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let js=new WeakMap,Fs=!1;function qs(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return qr(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function Ws(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Us(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(co&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||co&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Ks=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Zs(e,t,n,r,o){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=ai(e,t);if(n&&!e.state.selection.eq(n)){if(ao&&fo&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",(t=>t(e,Jr(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),i&&r.setMeta("composition",i),e.dispatch(r)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l,c,d=e.state.selection,u=function(e,t,n){let r,{node:o,fromOffset:i,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelectionRange(),d=c.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:c.anchorOffset}],Gr(c)||r.push({node:c.focusNode,offset:c.focusOffset})),ao&&8===e.input.lastKeyCode)for(let e=s;e>i;e--){let t=o.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let u=e.state.doc,h=e.someProp("domParser")||_t.fromSchema(e.state.schema),p=u.resolve(a),f=null,m=h.parse(o,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Us,context:p});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:l}}(e,t,n),h=e.state.doc,p=h.slice(u.from,u.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(l=e.state.selection.to,c="end"):(l=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let f=function(e,t,n,r,o){let i=e.findDiffStart(t,n);if(null==i)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==o){r-=s+Math.max(0,i-Math.min(s,a))-i}if(s<i&&e.size<t.size){let e=r<=i&&r>=s?i-r:0;i-=e,i&&i<t.size&&Xs(t.textBetween(i-1,i+1))&&(i+=e?1:-1),a=i+(a-s),s=i}else if(a<i){let t=r<=i&&r>=a?i-r:0;i-=t,i&&i<e.size&&Xs(e.textBetween(i-1,i+1))&&(i+=t?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}(p.content,u.doc.content,u.from,l,c);if(f&&e.input.domChangeCount++,(uo&&e.input.lastIOSEnter>Date.now()-225||fo)&&o.some((e=>1==e.nodeType&&!Ks.test(e.nodeName)))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",(t=>t(e,Jr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&d instanceof Xn&&!d.empty&&d.$head.sameParent(d.$anchor))||e.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let t=Gs(e,e.state.doc,u.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);i&&n.setMeta("composition",i),e.dispatch(n)}}return}f={start:d.from,endA:d.to,endB:d.to}}e.state.selection.from<e.state.selection.to&&f.start==f.endB&&e.state.selection instanceof Xn&&(f.start>e.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?f.start=e.state.selection.from:f.endA<e.state.selection.to&&f.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),ro&&oo<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>u.from&&"  "==u.doc.textBetween(f.start-u.from-1,f.start-u.from+1)&&(f.start--,f.endA--,f.endB--);let m=u.doc.resolveNoCache(f.start-u.from),g=u.doc.resolveNoCache(f.endB-u.from),v=h.resolve(f.start),b=m.sameParent(g)&&m.parent.inlineContent&&v.end()>=f.endA;if((uo&&e.input.lastIOSEnter>Date.now()-225&&(!b||o.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!b&&m.pos<u.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(u.doc.textBetween(m.pos,g.pos,"","")))&&e.someProp("handleKeyDown",(t=>t(e,Jr(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,r,o){if(n-t<=o.pos-r.pos||Js(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(!r.parent.isTextblock){let e=i.nodeAfter;return null!=e&&n==t+e.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(Js(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||Js(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(h,f.start,f.endA,m,g)&&e.someProp("handleKeyDown",(t=>t(e,Jr(8,"Backspace")))))return void(fo&&ao&&e.domObserver.suppressSelectionUpdates());ao&&f.endB==f.start&&(e.input.lastChromeDelete=Date.now()),fo&&!b&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==f.endA&&(f.endB-=2,g=u.doc.resolveNoCache(f.endB-u.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,Jr(13,"Enter"))}))}),20));let y,w=f.start,C=f.endA,x=t=>{let n=t||e.state.tr.replace(w,C,u.doc.slice(f.start-u.from,f.endB-u.from));if(u.sel){let t=Gs(e,n.doc,u.sel);t&&!(ao&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==w||t.head==n.mapping.map(C)-1)||ro&&t.empty&&t.head==w)&&n.setSelection(t)}return i&&n.setMeta("composition",i),n.scrollIntoView()};if(b)if(m.pos==g.pos){ro&&oo<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>ci(e)),20));let t=x(e.state.tr.delete(w,C)),n=h.resolve(f.start).marksAcross(h.resolve(f.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(f.endA==f.endB&&(y=function(e,t){let n,r,o,i=e.firstChild.marks,s=t.firstChild.marks,a=i,l=s;for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);for(let e=0;e<i.length;e++)l=i[e].removeFromSet(l);if(1==a.length&&0==l.length)r=a[0],n="add",o=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",o=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(o(t.child(e)));if(Ge.from(c).eq(e))return{mark:r,type:n}}(m.parent.content.cut(m.parentOffset,g.parentOffset),v.parent.content.cut(v.parentOffset,f.endA-v.start())))){let t=x(e.state.tr);"add"==y.type?t.addMark(w,C,y.mark):t.removeMark(w,C,y.mark),e.dispatch(t)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let t=m.parent.textBetween(m.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,w,C));e.someProp("handleTextInput",(r=>r(e,w,C,t,n)))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function Gs(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:gi(e,t.resolve(n.anchor),t.resolve(n.head))}function Js(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}function Xs(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class Ys{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Ki,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(ra),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=ta(this),ea(this),this.nodeViews=na(this),this.docView=Wo(this.state.doc,Qs(this),zs(this),this.dom,this),this.domObserver=new Bs(this,((e,t,n,r)=>Zs(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in qi){let n=qi[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Xi(e,t)||Ji(e,t)||!e.editable&&t.type in Wi||n(e,t)},Ui[t]?{passive:!0}:void 0)}co&&e.dom.addEventListener("input",(()=>null)),Gi(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Gi(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(ra),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let r=this.state,o=!1,i=!1;e.storedMarks&&this.composing&&(us(this),i=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=na(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,o=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Gi(this),this.editable=ta(this),ea(this);let a=zs(this),l=Qs(this),c=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",d=o||!this.docView.matchesNode(e.doc,l,a);!d&&e.selection.eq(r.selection)||(i=!0);let u="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(i,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=o-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:Co(e.dom)}}(this);if(i){this.domObserver.stop();let t=d&&(ro||ao)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(d){let n=ao?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=hs(this)),!o&&this.docView.update(e.doc,l,a,this)||(this.docView.updateOuterDeco(l),this.docView.destroy(),this.docView=Wo(e.doc,l,a,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return qr(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?ci(this,t):(fi(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;xo(n,0==r?0:r-t)}(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof Qn){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&wo(this,t.getBoundingClientRect(),e)}else wo(this,this.coordsAtPos(this.state.selection.head,1),e);else;}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new vs(e.slice,e.move,r<0?void 0:Qn.create(this.state.doc,r))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let r=0;r<this.directPlugins.length;r++){let o=this.directPlugins[r].props[e];if(null!=o&&(n=t?t(o):o))return n}let o=this.state.plugins;if(o)for(let r=0;r<o.length;r++){let i=o[r].props[e];if(null!=i&&(n=t?t(i):i))return n}}hasFocus(){if(ro){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(ko)return e.focus(ko);let t=Co(e);e.focus(null==ko?{get preventScroll(){return ko={preventScroll:!0},!0}}:void 0),ko||(ko=!1,xo(t,0))}(this.dom),ci(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;return e||document}updateRoot(){this._root=null}posAtCoords(e){return Eo(this,e)}coordsAtPos(e,t=1){return Ao(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return Ho(this,t||this.state,e)}pasteHTML(e,t){return ms(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ms(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Ri(this,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],zs(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,jr=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Ji(e,t)||!qi[t.type]||!e.editable&&t.type in Wi||qi[t.type](e,t)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?co&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return qs(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?qs(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Qs(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),t.translate||(t.translate="no"),[$s.node(0,e.state.doc.content.size,t)]}function ea(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:$s.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function ta(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function na(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function ra(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}Ys.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var oa={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ia={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},sa="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),aa="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),la=0;la<10;la++)oa[48+la]=oa[96+la]=String(la);for(la=1;la<=24;la++)oa[la+111]="F"+la;for(la=65;la<=90;la++)oa[la]=String.fromCharCode(la+32),ia[la]=String.fromCharCode(la);for(var ca in oa)ia.hasOwnProperty(ca)||(ia[ca]=oa[ca]);const da="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ua="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function ha(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let e=0;e<i.length-1;e++){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else{if(!/^mod$/i.test(s))throw new Error("Unrecognized modifier name: "+s);da?o=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function pa(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function fa(e){let t=function(e){let t=Object.create(null);for(let n in e)t[ha(n)]=e[n];return t}(e);return function(e,n){let r,o=function(e){var t=!(sa&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||aa&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?ia:oa)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),i=t[pa(o,n)];if(i&&i(e.state,e.dispatch,e))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let r=t[pa(o,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(ua&&n.ctrlKey&&n.altKey)&&(r=oa[n.keyCode])&&r!=o){let o=t[pa(r,n)];if(o&&o(e.state,e.dispatch,e))return!0}}return!1}}var ma=Object.defineProperty,ga=(e,t)=>{for(var n in t)ma(e,n,{get:t[n],enumerable:!0})};function va(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}var ba=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!e,l=e||o.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(l,t),o=n(...e)(r);return s.push(o),c}]))),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),s.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,r=!1,o=e||n.tr,i=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})]))),chain:()=>this.createChain(o,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s={tr:e,editor:r,view:i,state:va({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map((([e,t])=>[e,(...e)=>t(...e)(s)])))}};return s}},ya={};ga(ya,{blur:()=>wa,clearContent:()=>Ca,clearNodes:()=>xa,command:()=>ka,createParagraphNear:()=>$a,cut:()=>Sa,deleteCurrentNode:()=>Ma,deleteNode:()=>Ta,deleteRange:()=>Oa,deleteSelection:()=>Aa,enter:()=>Ra,exitCode:()=>Na,extendMarkRange:()=>_a,first:()=>Ba,focus:()=>Ka,forEach:()=>Za,insertContent:()=>Ga,insertContentAt:()=>Qa,joinBackward:()=>nl,joinDown:()=>tl,joinForward:()=>rl,joinItemBackward:()=>ol,joinItemForward:()=>il,joinTextblockBackward:()=>sl,joinTextblockForward:()=>al,joinUp:()=>el,keyboardShortcut:()=>cl,lift:()=>ul,liftEmptyBlock:()=>hl,liftListItem:()=>pl,newlineInCode:()=>fl,resetAttributes:()=>vl,scrollIntoView:()=>bl,selectAll:()=>yl,selectNodeBackward:()=>wl,selectNodeForward:()=>Cl,selectParentNode:()=>xl,selectTextblockEnd:()=>kl,selectTextblockStart:()=>$l,setContent:()=>Ml,setMark:()=>ac,setMeta:()=>lc,setNode:()=>cc,setNodeSelection:()=>dc,setTextDirection:()=>uc,setTextSelection:()=>hc,sinkListItem:()=>pc,splitBlock:()=>mc,splitListItem:()=>gc,toggleList:()=>yc,toggleMark:()=>wc,toggleNode:()=>Cc,toggleWrap:()=>xc,undoInputRule:()=>kc,unsetAllMarks:()=>$c,unsetMark:()=>Sc,unsetTextDirection:()=>Mc,updateAttributes:()=>Ec,wrapIn:()=>Tc,wrapInList:()=>Oc});var wa=()=>({editor:e,view:t})=>(requestAnimationFrame((()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())})),!0),Ca=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),xa=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:o}=r;return!n||(o.forEach((({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,((e,n)=>{if(e.type.isText)return;const{doc:r,mapping:o}=t,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+e.nodeSize)),a=i.blockRange(s);if(!a)return;const l=xn(a);if(e.type.isTextblock){const{defaultType:e}=i.parent.contentMatchAt(i.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)}))})),!0)},ka=e=>t=>e(t),$a=()=>({state:e,dispatch:t})=>Or(e,t),Sa=(e,t)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,i.content),r.setSelection(new Xn(r.doc.resolve(Math.max(s-1,0)))),!0},Ma=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const o=e.selection.$anchor;for(let n=o.depth;n>0;n-=1){if(o.node(n).type===r.type){if(t){const t=o.before(n),r=o.after(n);e.delete(t,r).scrollIntoView()}return!0}}return!1};function Ea(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var Ta=e=>({tr:t,state:n,dispatch:r})=>{const o=Ea(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1){if(i.node(e).type===o){if(r){const n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}}return!1},Oa=e=>({tr:t,dispatch:n})=>{const{from:r,to:o}=e;return n&&t.delete(r,o),!0},La=(e,t,n)=>{if(!e.parent.isInline)return e.pos;if("left"===n&&e.pos>e.start()||"right"===n&&e.pos<e.end())return e.pos;const r=t.nodes[e.parent.type.name].spec;return(o=r).content&&/^text(\*|\+)/.test(o.content)?"left"===n?e.start()-1:e.end()+1:e.pos;var o},Aa=()=>({state:e,dispatch:t})=>{const{$from:n,$to:r}=e.selection;if(e.selection.empty)return!1;const{from:o,to:i}=((e,t,n)=>({from:La(e,n,"left"),to:La(t,n,"right")}))(n,r,e.schema);return t&&(e.tr.deleteRange(o,i).scrollIntoView(),t(e.tr)),!0},Ra=()=>({commands:e})=>e.keyboardShortcut("Enter"),Na=()=>({state:e,dispatch:t})=>((e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=Tr(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,s.createAndFill());o.setSelection(Kn.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0})(e,t);function Da(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function Pa(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:Da(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Ia(e,t,n={}){return e.find((e=>e.type===t&&Pa(Object.fromEntries(Object.keys(n).map((t=>[t,e.attrs[t]]))),n)))}function za(e,t,n={}){return!!Ia(e,t,n)}function Va(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(r.node&&r.node.marks.some((e=>e.type===t))||(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some((e=>e.type===t)))return;if(!n){const e=r.node.marks.find((e=>e.type===t));e&&(n=e.attrs)}if(!Ia([...r.node.marks],t,n))return;let o=r.index,i=e.start()+r.offset,s=o+1,a=i+r.node.nodeSize;for(;o>0&&za([...e.parent.child(o-1).marks],t,n);)o-=1,i-=e.parent.child(o).nodeSize;for(;s<e.parent.childCount&&za([...e.parent.child(s).marks],t,n);)a+=e.parent.child(s).nodeSize,s+=1;return{from:i,to:a}}function Ha(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var _a=(e,t)=>({tr:n,state:r,dispatch:o})=>{const i=Ha(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:d}=a;if(o){const e=Va(l,i,t);if(e&&e.from<=c&&e.to>=d){const t=Xn.create(s,e.from,e.to);n.setSelection(t)}}return!0},Ba=e=>t=>{const n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function ja(e){return e instanceof Xn}function Fa(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function qa(e,t=null){if(!t)return null;const n=Kn.atStart(e),r=Kn.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;const o=n.from,i=r.to;return"all"===t?Xn.create(e,Fa(0,o,i),Fa(e.content.size,o,i)):Xn.create(e,Fa(t,o,i),Fa(t,o,i))}function Wa(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function Ua(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Ka=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};const s=()=>{(Ua()||Wa())&&r.dom.focus(),"undefined"==typeof navigator||!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||Ua()||Wa()||r.dom.focus({preventScroll:!0}),requestAnimationFrame((()=>{n.isDestroyed||(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};try{if(r.hasFocus()&&null===e||!1===e)return!0}catch{return!1}if(i&&null===e&&!ja(n.state.selection))return s(),!0;const a=qa(o.doc,e)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},Za=(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),Ga=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Ja=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&Ja(r)}return e};function Xa(e){if("undefined"==typeof window)throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=(new window.DOMParser).parseFromString(t,"text/html").body;return Ja(n)}function Ya(e,t,n){if(e instanceof yt||e instanceof Ge)return e;n={slice:!0,parseOptions:{},...n};const r="string"==typeof e;if("object"==typeof e&&null!==e)try{if(Array.isArray(e)&&e.length>0)return Ge.fromArray(e.map((e=>t.nodeFromJSON(e))));const r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),Ya("",t,n)}if(r){if(n.errorOnInvalidContent){let r=!1,o="";const i=new Vt({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(r=!0,o="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?_t.fromSchema(i).parseSlice(Xa(e),n.parseOptions):_t.fromSchema(i).parse(Xa(e),n.parseOptions),n.errorOnInvalidContent&&r)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const r=_t.fromSchema(t);return n.slice?r.parseSlice(Xa(e),n.parseOptions).content:r.parse(Xa(e),n.parseOptions)}return Ya("",t,n)}var Qa=(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){let o;const a=e=>{i.emit("contentError",{editor:i,error:e,disableCollaboration:()=>{"collaboration"in i.storage&&"object"==typeof i.storage.collaboration&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},l={preserveWhitespace:"full",...(n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{Ya(t,i.schema,{parseOptions:l,errorOnInvalidContent:!0})}catch(e){a(e)}try{o=Ya(t,i.schema,{parseOptions:l,errorOnInvalidContent:null!=(s=n.errorOnInvalidContent)?s:i.options.enableContentCheck})}catch(e){return a(e),!1}let{from:c,to:d}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},u=!0,h=!0;if(("type"in o?[o]:o).forEach((e=>{e.check(),u=!!u&&(e.isText&&0===e.marks.length),h=!!h&&e.isBlock})),c===d&&h){const{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(c-=1,d+=1)}let p;if(u){if(Array.isArray(t))p=t.map((e=>e.text||"")).join("");else if(t instanceof Ge){let e="";t.forEach((t=>{t.text&&(e+=t.text)})),p=e}else p="object"==typeof t&&t&&t.text?t.text:t;r.insertText(p,c,d)}else{p=o;const e=r.doc.resolve(c),t=e.node(),n=0===e.parentOffset,i=t.isText||t.isTextblock,s=t.content.size>0;n&&i&&s&&h&&(c=Math.max(0,c-1)),r.replaceWith(c,d,p)}n.updateSelection&&function(e,t,n){const r=e.steps.length-1;if(r<t)return;const o=e.steps[r];if(!(o instanceof vn||o instanceof bn))return;const i=e.mapping.maps[r];let s=0;i.forEach(((e,t,n,r)=>{0===s&&(s=r)})),e.setSelection(Kn.near(e.doc.resolve(s),n))}(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},el=()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection,o=r instanceof Qn;if(o){if(r.node.isTextblock||!Tn(e.doc,r.from))return!1;n=r.from}else if(n=Ln(e.doc,r.from,-1),null==n)return!1;if(t){let r=e.tr.join(n);o&&r.setSelection(Qn.create(r.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(r.scrollIntoView())}return!0})(e,t),tl=()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection;if(r instanceof Qn){if(r.node.isTextblock||!Tn(e.doc,r.to))return!1;n=r.to}else if(n=Ln(e.doc,r.to,1),null==n)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0})(e,t),nl=()=>({state:e,dispatch:t})=>br(e,t),rl=()=>({state:e,dispatch:t})=>$r(e,t),ol=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Ln(e.doc,e.selection.$from.pos,-1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},il=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Ln(e.doc,e.selection.$from.pos,1);return null!=r&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},sl=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=vr(e,n);if(!r)return!1;let o=xr(r);return!!o&&yr(e,o,t)})(e,t),al=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=kr(e,n);if(!r)return!1;let o=Mr(r);return!!o&&yr(e,o,t)})(e,t);function ll(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var cl=e=>({editor:t,view:n,tr:r,dispatch:o})=>{const i=function(e){const t=e.split(/-(?!$)/);let n,r,o,i,s=t[t.length-1];"Space"===s&&(s=" ");for(let e=0;e<t.length-1;e+=1){const s=t[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))o=!0;else{if(!/^mod$/i.test(s))throw new Error(`Unrecognized modifier name: ${s}`);Ua()||ll()?i=!0:r=!0}}return n&&(s=`Alt-${s}`),r&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),o&&(s=`Shift-${s}`),s}(e).split(/-(?!$)/),s=i.find((e=>!["Alt","Ctrl","Meta","Shift"].includes(e))),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction((()=>{n.someProp("handleKeyDown",(e=>e(n,a)))}));return null==l||l.steps.forEach((e=>{const t=e.map(r.mapping);t&&o&&r.maybeStep(t)})),!0};function dl(e,t,n={}){const{from:r,to:o,empty:i}=e.selection,s=t?Ea(t,e.schema):null,a=[];e.doc.nodesBetween(r,o,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);a.push({node:e,from:n,to:i})}));const l=o-r,c=a.filter((e=>!s||s.name===e.node.type.name)).filter((e=>Pa(e.node.attrs,n,{strict:!1})));if(i)return!!c.length;return c.reduce(((e,t)=>e+t.to-t.from),0)>=l}var ul=(e,t={})=>({state:n,dispatch:r})=>!!dl(n,Ea(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&xn(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)})(n,r),hl=()=>({state:e,dispatch:t})=>Lr(e,t),pl=e=>({state:t,dispatch:n})=>Hr(Ea(e,t.schema))(t,n),fl=()=>({state:e,dispatch:t})=>Er(e,t);function ml(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function gl(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}var vl=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=ml("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(i=Ea(e,r.schema)),"mark"===a&&(s=Ha(e,r.schema));let l=!1;return n.selection.ranges.forEach((e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,r)=>{i&&i===e.type&&(l=!0,o&&n.setNodeMarkup(r,void 0,gl(e.attrs,t))),s&&e.marks.length&&e.marks.forEach((i=>{s===i.type&&(l=!0,o&&n.addMark(r,r+e.nodeSize,s.create(gl(i.attrs,t))))}))}))})),l},bl=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),yl=()=>({tr:e,dispatch:t})=>{if(t){const t=new tr(e.doc);e.setSelection(t)}return!0},wl=()=>({state:e,dispatch:t})=>Cr(e,t),Cl=()=>({state:e,dispatch:t})=>Sr(e,t),xl=()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:o}=e.selection,i=r.sharedDepth(o);return 0!=i&&(n=r.before(i),t&&t(e.tr.setSelection(Qn.create(e.doc,n))),!0)})(e,t),kl=()=>({state:e,dispatch:t})=>Pr(e,t),$l=()=>({state:e,dispatch:t})=>Dr(e,t);function Sl(e,t,n={},r={}){return Ya(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Ml=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{const{doc:l}=i;if("full"!==r.preserveWhitespace){const a=Sl(e,o.schema,r,{errorOnInvalidContent:null!=t?t:o.options.enableContentCheck});return s&&i.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!n),!0}return s&&i.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:o.options.enableContentCheck})};function El(e,t){const n=Ha(t,e.schema),{from:r,to:o,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,(e=>{s.push(...e.marks)}));const a=s.find((e=>e.type.name===n.name));return a?{...a.attrs}:{}}function Tl(e,t){const n=new Wn(e);return t.forEach((e=>{e.steps.forEach((e=>{n.step(e)}))})),n}function Ol(e){return t=>function(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}(t.$from,e)}function Ll(e,t,n){if(void 0===e.config[t]&&e.parent)return Ll(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?Ll(e.parent,t,n):null})}return e.config[t]}function Al(e){return e.map((e=>{const t=Ll(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...Al(t())]:e})).flat(10)}function Rl(e,t){const n=Jt.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Nl(e){return"function"==typeof e}function Dl(e,t=void 0,...n){return Nl(e)?t?e.bind(t)(...n):e(...n):e}function Pl(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function Il(e){const t=[],{nodeExtensions:n,markExtensions:r}=Pl(e),o=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter((e=>"text"!==e.name)).map((e=>e.name)),a=r.map((e=>e.name)),l=[...s,...a];return e.forEach((e=>{const n=Ll(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:o});if(!n)return;n().forEach((e=>{let n;n=Array.isArray(e.types)?e.types:"*"===e.types?l:"nodes"===e.types?s:"marks"===e.types?a:[],n.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...i,...r}})}))}))}))})),o.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=Ll(e,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{const o={...i,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&void 0===(null==o?void 0:o.default)&&delete o.default,t.push({type:e.name,name:n,attribute:o})}))})),t}function zl(e){const t=[],n=function(e){const t=[];let n="",r=!1,o=!1,i=0;const s=e.length;for(let a=0;a<s;a+=1){const s=e[a];if("'"!==s||o)if('"'!==s||r){if(!r&&!o){if("("===s){i+=1,n+=s;continue}if(")"===s&&i>0){i-=1,n+=s;continue}if(";"===s&&0===i){t.push(n),n="";continue}}n+=s}else o=!o,n+=s;else r=!r,n+=s}return n&&t.push(n),t}(e||""),r=n.length;for(let e=0;e<r;e+=1){const r=n[e],o=r.indexOf(":");if(-1===o)continue;const i=r.slice(0,o).trim(),s=r.slice(o+1).trim();i&&s&&t.push([i,s])}return t}function Vl(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{if(n[e])if("class"===e){const r=t?String(t).split(" "):[],o=n[e]?n[e].split(" "):[],i=r.filter((e=>!o.includes(e)));n[e]=[...o,...i].join(" ")}else if("style"===e){const r=new Map([...zl(n[e]),...zl(t)]);n[e]=Array.from(r.entries()).map((([e,t])=>`${e}: ${t}`)).join("; ")}else n[e]=t;else n[e]=t})),n}),{})}function Hl(e,t){return t.filter((t=>t.type===e.type.name)).filter((e=>e.attribute.rendered)).map((t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]})).reduce(((e,t)=>Vl(e,t)),{})}function _l(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const o=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...o}}}}function Bl(e){return Object.fromEntries(Object.entries(e).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function jl(e){var t,n;const r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),void 0!==(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)&&(r.validate=e.attribute.validate),[e.name,r]}function Fl(e){return e.sort(((e,t)=>{const n=Ll(e,"priority")||100,r=Ll(t,"priority")||100;return n>r?-1:n<r?1:0}))}function ql(e){const t=Fl(Al(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return Array.from(new Set(t))}(t.map((e=>e.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e=>`'${e}'`)).join(", ")}]. This can lead to issues.`),t}function Wl(e,t,n){const{from:r,to:o}=t,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{};let a="";return e.nodesBetween(r,o,((e,n,l,c)=>{var d;e.isBlock&&n>r&&(a+=i);const u=null==s?void 0:s[e.type.name];if(u)return l&&(a+=u({node:e,pos:n,parent:l,index:c,range:t})),!1;e.isText&&(a+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,o-n))})),a}function Ul(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}function Kl(e,t){const n=ml("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=Ea(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,(e=>{i.push(e)}));const s=i.reverse().find((e=>e.type.name===n.name));return s?{...s.attrs}:{}}(e,t):"mark"===n?El(e,t):{}}function Zl(e){const t=function(e,t=JSON.stringify){const n={};return e.filter((e=>{const r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter(((e,n)=>{const r=t.filter(((e,t)=>t!==n));return!r.some((t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}))}function Gl(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach(((e,o)=>{const i=[];if(e.ranges.length)e.forEach(((e,t)=>{i.push({from:e,to:t})}));else{const{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;i.push({from:e,to:t})}i.forEach((({from:e,to:n})=>{const i=t.slice(o).map(e,-1),s=t.slice(o).map(n),a=t.invert().map(i,-1),l=t.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:i,to:s}})}))})),Zl(r)}function Jl(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((t=>{const o=Va(n.resolve(e),t.type);o&&r.push({mark:t,...o})})):n.nodesBetween(e,t,((e,t)=>{e&&void 0!==(null==e?void 0:e.nodeSize)&&r.push(...e.marks.map((n=>({from:t,to:t+e.nodeSize,mark:n}))))})),r}function Xl(e,t){return t.nodes[e]||t.marks[e]||null}function Yl(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}function Ql(e,t,n={}){const{empty:r,ranges:o}=e.selection,i=t?Ha(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((e=>!i||i.name===e.type.name)).find((e=>Pa(e.attrs,n,{strict:!1})));let s=0;const a=[];if(o.forEach((({$from:t,$to:n})=>{const r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,((e,t)=>{if(i&&e.inlineContent&&!e.type.allowsMarkType(i))return!1;if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),l=Math.min(o,t+e.nodeSize);s+=l-n,a.push(...e.marks.map((e=>({mark:e,from:n,to:l}))))}))})),0===s)return!1;const l=a.filter((e=>!i||i.name===e.mark.type.name)).filter((e=>Pa(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),c=a.filter((e=>!i||e.mark.type!==i&&e.mark.type.excludes(i))).reduce(((e,t)=>e+t.to-t.from),0);return(l>0?l+c:l)>=s}function ec(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function tc(e,t){const{nodeExtensions:n}=Pl(t),r=n.find((t=>t.name===e));if(!r)return!1;const o=Dl(Ll(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function nc(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return!/\S/.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach((e=>{!1!==r&&(nc(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))})),r}return!1}function rc(e){return e instanceof Qn}var oc=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function ic(e,t){const n=t.mapping.mapResult(e.position);return{position:new oc(n.pos),mapResult:n}}function sc(e){return new oc(e)}var ac=(e,t={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Ha(e,r.schema);if(o)if(s){const e=El(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach((e=>{const o=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(o,i,((e,r)=>{const s=Math.max(r,o),a=Math.min(r+e.nodeSize,i);e.marks.find((e=>e.type===l))?e.marks.forEach((e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))})):n.addMark(s,a,l.create(t))}))}));return function(e,t,n){var r;const{selection:o}=t;let i=null;if(ja(o)&&(i=o.$cursor),i){const t=null!=(r=e.storedMarks)?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some((e=>e.type.excludes(n))))}const{ranges:s}=o;return s.some((({$from:t,$to:r})=>{let o=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,((e,t,r)=>{if(o)return!1;if(e.isInline){const t=!r||r.type.allowsMarkType(n),i=!!n.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(n)));o=t&&i}return!o})),o}))}(r,n,l)},lc=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),cc=(e,t={})=>({state:n,dispatch:r,chain:o})=>{const i=Ea(e,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),i.isTextblock?o().command((({commands:e})=>!!Ir(i,{...s,...t})(n)||e.clearNodes())).command((({state:e})=>Ir(i,{...s,...t})(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},dc=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,r=Fa(e,0,n.content.size),o=Qn.create(n,r);t.setSelection(o)}return!0},uc=(e,t)=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=r;let s,a;return"number"==typeof t?(s=t,a=t):t&&"from"in t&&"to"in t?(s=t.from,a=t.to):(s=i.from,a=i.to),o&&n.doc.nodesBetween(s,a,((t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})})),!0},hc=e=>({tr:t,dispatch:n})=>{if(n){const{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,i=Xn.atStart(n).from,s=Xn.atEnd(n).to,a=Fa(r,i,s),l=Fa(o,i,s),c=Xn.create(n,a,l);t.setSelection(c)}return!0},pc=e=>({state:t,dispatch:n})=>{const r=Ea(e,t.schema);return(o=r,function(e,t){let{$from:n,$to:r}=e.selection,i=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==o));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=o)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,r=Ge.from(n?o.create():null),s=new tt(Ge.from(o.create(null,Ge.from(a.type.create(null,r)))),n?3:1,0),c=i.start,d=i.end;t(e.tr.step(new bn(c-(n?3:1),d,c,d,s,1,!0)).scrollIntoView())}return!0})(t,n);var o};function fc(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((e=>null==t?void 0:t.includes(e.type.name)));e.tr.ensureMarks(r)}}var mc=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=t,{$from:a,$to:l}=i,c=Yl(o.extensionManager.attributes,a.node().type.name,a.node().attrs);if(i instanceof Qn&&i.node.isBlock)return!(!a.parentOffset||!En(s,a.pos))&&(r&&(e&&fc(n,o.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,u=0===a.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=d&&u?[{type:u,attrs:c}]:void 0,p=En(t.doc,t.mapping.map(a.pos),1,h);if(h||p||!En(t.doc,t.mapping.map(a.pos),1,u?[{type:u}]:void 0)||(p=!0,h=u?[{type:u,attrs:c}]:void 0),r){if(p&&(i instanceof Xn&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,h),u&&!d&&!a.parentOffset&&a.parent.type!==u)){const e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,u)&&t.setNodeMarkup(t.mapping.map(a.before()),u)}e&&fc(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return p},gc=(e,t={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var s;const a=Ea(e,r.schema),{$from:l,$to:c}=r.selection,d=r.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;const h=i.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let e=Ge.empty;const r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=Ge.from(l.node(t).copy(e));const o=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,i={...Yl(h,l.node().type.name,l.node().attrs),...t},c=(null==(s=a.contentMatch.defaultType)?void 0:s.createAndFill(i))||void 0;e=e.append(Ge.from(a.createAndFill(null,c)||void 0));const d=l.before(l.depth-(r-1));n.replace(d,l.after(-o),new tt(e,4-r,0));let u=-1;n.doc.nodesBetween(d,n.doc.content.size,((e,t)=>{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)})),u>-1&&n.setSelection(Xn.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}const p=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,f={...Yl(h,u.type.name,u.attrs),...t},m={...Yl(h,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,c.pos);const g=p?[{type:a,attrs:f},{type:p,attrs:m}]:[{type:a,attrs:f}];if(!En(n.doc,l.pos,2))return!1;if(o){const{selection:e,storedMarks:t}=r,{splittableMarks:s}=i.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!a||!o)return!0;const c=a.filter((e=>s.includes(e.type.name)));n.ensureMarks(c)}return!0},vc=(e,t)=>{const n=Ol((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Tn(e.doc,n.pos)||(e.join(n.pos),!0)},bc=(e,t)=>{const n=Ol((e=>e.type===t))(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;const o=e.doc.nodeAt(r);return n.node.type!==(null==o?void 0:o.type)||!Tn(e.doc,r)||(e.join(r),!0)};var yc=(e,t,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:u,splittableMarks:h}=o.extensionManager,p=Ea(e,s.schema),f=Ea(t,s.schema),{selection:m,storedMarks:g}=s,{$from:v,$to:b}=m,y=v.blockRange(b),w=g||m.$to.parentOffset&&m.$from.marks();if(!y)return!1;const C=Ol((e=>tc(e.type.name,u)))(m),x=0===m.from&&m.to===s.doc.content.size,k=s.doc.content.content,$=1===k.length?k[0]:null,S=x&&$&&tc($.type.name,u)?{node:$,pos:0}:null,M=null!=C?C:S,E=!!S;if((!!C&&y.depth>=1&&y.depth-C.depth<=1||E)&&M){if(M.node.type===p)return x&&E?l().command((({tr:e,dispatch:t})=>{const n=function(e){const t=e.doc,n=t.firstChild;if(!n)return null;const r=t.resolve(1),o=t.resolve(n.nodeSize-1);return Xn.between(r,o)}(e);return!!n&&(e.setSelection(n),t&&t(e),!0)})).liftListItem(f).run():c.liftListItem(f);if(tc(M.node.type.name,u)&&p.validContent(M.node.content))return l().command((()=>(i.setNodeMarkup(M.pos,p),!0))).command((()=>vc(i,p))).command((()=>bc(i,p))).run()}return n&&w&&a?l().command((()=>{const e=d().wrapInList(p,r),t=w.filter((e=>h.includes(e.type.name)));return i.ensureMarks(t),!!e||c.clearNodes()})).wrapInList(p,r).command((()=>vc(i,p))).command((()=>bc(i,p))).run():l().command((()=>!!d().wrapInList(p,r)||c.clearNodes())).wrapInList(p,r).command((()=>vc(i,p))).command((()=>bc(i,p))).run()},wc=(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Ha(e,r.schema);return Ql(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},Cc=(e,t,n={})=>({state:r,commands:o})=>{const i=Ea(e,r.schema),s=Ea(t,r.schema),a=dl(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?o.setNode(s,l):o.setNode(i,{...l,...n})},xc=(e,t={})=>({state:n,commands:r})=>{const o=Ea(e,n.schema);return dl(n,o,t)?r.lift(o):r.wrapIn(o,t)},kc=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(e))){if(t){const t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){const n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},$c=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:o}=n;return r||t&&o.forEach((t=>{e.removeMark(t.$from.pos,t.$to.pos)})),!0},Sc=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=Ha(e,r.schema),{$from:c,empty:d,ranges:u}=a;if(!o)return!0;if(d&&s){let{from:e,to:t}=a;const r=null==(i=c.marks().find((e=>e.type===l)))?void 0:i.attrs,o=Va(c,l,r);o&&(e=o.from,t=o.to),n.removeMark(e,t,l)}else u.forEach((e=>{n.removeMark(e.$from.pos,e.$to.pos,l)}));return n.removeStoredMark(l),!0},Mc=e=>({tr:t,state:n,dispatch:r})=>{const{selection:o}=n;let i,s;return"number"==typeof e?(i=e,s=e):e&&"from"in e&&"to"in e?(i=e.from,s=e.to):(i=o.from,s=o.to),r&&t.doc.nodesBetween(i,s,((e,n)=>{if(e.isText)return;const r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)})),!0},Ec=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=ml("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(i=Ea(e,r.schema)),"mark"===a&&(s=Ha(e,r.schema));let l=!1;return n.selection.ranges.forEach((e=>{const a=e.$from.pos,c=e.$to.pos;let d,u,h,p;n.selection.empty?r.doc.nodesBetween(a,c,((e,t)=>{i&&i===e.type&&(l=!0,h=Math.max(t,a),p=Math.min(t+e.nodeSize,c),d=t,u=e)})):r.doc.nodesBetween(a,c,((e,r)=>{r<a&&i&&i===e.type&&(l=!0,h=Math.max(r,a),p=Math.min(r+e.nodeSize,c),d=r,u=e),r>=a&&r<=c&&(i&&i===e.type&&(l=!0,o&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),s&&e.marks.length&&e.marks.forEach((i=>{if(s===i.type&&(l=!0,o)){const o=Math.max(r,a),l=Math.min(r+e.nodeSize,c);n.addMark(o,l,s.create({...i.attrs,...t}))}})))})),u&&(void 0!==d&&o&&n.setNodeMarkup(d,void 0,{...u.attrs,...t}),s&&u.marks.length&&u.marks.forEach((e=>{s===e.type&&o&&n.addMark(h,p,s.create({...e.attrs,...t}))})))})),l},Tc=(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&kn(s,e,t);return!!a&&(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0)}}(Ea(e,n.schema),t)(n,r),Oc=(e,t={})=>({state:n,dispatch:r})=>Vr(Ea(e,n.schema),t)(n,r),Lc=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},Ac=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}};function Rc(e){var t;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find((e=>e.type.spec.code))))return!1;let d=!1;const u=((e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,o,i)=>{var s,a;const l=(null==(a=(s=e.type.spec).toText)?void 0:a.call(s,{node:e,pos:t,parent:o,index:i}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))})),n})(c)+i;return s.forEach((e=>{if(d)return;const t=((e,t)=>{if(Da(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(u,e.find);if(!t)return;const s=l.state.tr,c=va({state:l.state,transaction:s}),h={from:r-(t[0].length-i.length),to:o},{commands:p,chain:f,can:m}=new ba({editor:n,state:c});null!==e.handler({state:c,range:h,match:t,commands:p,chain:f,can:m})&&s.steps.length&&(e.undoable&&s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),d=!0)})),d}function Nc(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function Dc(e,t){const n={...e};return Nc(e)&&Nc(t)&&Object.keys(t).forEach((r=>{Nc(t[r])&&Nc(e[r])?n[r]=Dc(e[r],t[r]):n[r]=t[r]})),n}var Pc=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Dl(Ll(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Dl(Ll(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Dc(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},Ic=class e extends Pc{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!!!o.find((e=>(null==e?void 0:e.type.name)===t.name)))return!1;const i=o.find((e=>(null==e?void 0:e.type.name)===t.name));return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};var zc=class{constructor(e){this.find=e.find,this.handler=e.handler}};function Vc(e){const{editor:t,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:c,can:d}=new ba({editor:t,state:n}),u=[];n.doc.nodesBetween(r,o,((e,t)=>{var h,p,f,m,g;if((null==(p=null==(h=e.type)?void 0:h.spec)?void 0:p.code)||!(e.isText||e.isTextblock||e.isInline))return;const v=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,b=Math.max(r,t),y=Math.min(o,t+v);if(b>=y)return;const w=((e,t,n)=>{if(Da(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map((t=>{const n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]})(e.isText?e.text||"":e.textBetween(b-t,y-t,void 0,""),i.find,s);w.forEach((e=>{if(void 0===e.index)return;const t=b+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},h=i.handler({state:n,range:o,match:e,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:a});u.push(h)}))}));return u.every((e=>null!==e))}var Hc=null;function _c(e){const{editor:t,rules:n}=e;let r,o=null,i=!1,s=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const l=({state:e,from:n,to:o,rule:i,pasteEvt:s})=>{const l=e.tr,c=va({state:e,transaction:l});if(Vc({editor:t,state:c,from:Math.max(n-1,0),to:o.b-1,rule:i,pasteEvent:s,dropEvent:r})&&l.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}},c=n.map((e=>new hr({view(e){const n=n=>{var r;o=(null==(r=e.dom.parentElement)?void 0:r.contains(n.target))?e.dom.parentElement:null,o&&(Hc=t)},r=()=>{Hc&&(Hc=null)};return window.addEventListener("dragstart",n),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",n),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(s=o===e.dom.parentElement,r=t,!s){const e=Hc;(null==e?void 0:e.isEditable)&&setTimeout((()=>{const t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})}),10)}return!1},paste:(e,t)=>{var n;const r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{const o=t[0],c="paste"===o.getMeta("uiEvent")&&!i,d="drop"===o.getMeta("uiEvent")&&!s,u=o.getMeta("applyPasteRules"),h=!!u;if(!c&&!d&&!h)return;if(h){let{text:t}=u;"string"==typeof t||(t=Rl(Ge.from(t),r.schema));const{from:n}=u,o=n+t.length,i=(e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t);return l({rule:e,state:r,from:n,to:{b:o},pasteEvt:i})}const p=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);return"number"==typeof p&&f&&p!==f.b?l({rule:e,state:r,from:p,to:f,pasteEvt:a}):void 0}})));return c}var Bc=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=ql(e),this.schema=function(e,t){var n;const r=Il(e),{nodeExtensions:o,markExtensions:i}=Pl(e),s=null==(n=o.find((e=>Ll(e,"topNode"))))?void 0:n.name,a=Object.fromEntries(o.map((n=>{const o=r.filter((e=>e.type===n.name)),i={name:n.name,options:n.options,storage:n.storage,editor:t},s=Bl({...e.reduce(((e,t)=>{const r=Ll(t,"extendNodeSchema",i);return{...e,...r?r(n):{}}}),{}),content:Dl(Ll(n,"content",i)),marks:Dl(Ll(n,"marks",i)),group:Dl(Ll(n,"group",i)),inline:Dl(Ll(n,"inline",i)),atom:Dl(Ll(n,"atom",i)),selectable:Dl(Ll(n,"selectable",i)),draggable:Dl(Ll(n,"draggable",i)),code:Dl(Ll(n,"code",i)),whitespace:Dl(Ll(n,"whitespace",i)),linebreakReplacement:Dl(Ll(n,"linebreakReplacement",i)),defining:Dl(Ll(n,"defining",i)),isolating:Dl(Ll(n,"isolating",i)),attrs:Object.fromEntries(o.map(jl))}),a=Dl(Ll(n,"parseHTML",i));a&&(s.parseDOM=a.map((e=>_l(e,o))));const l=Ll(n,"renderHTML",i);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:Hl(e,o)}));const c=Ll(n,"renderText",i);return c&&(s.toText=c),[n.name,s]}))),l=Object.fromEntries(i.map((n=>{const o=r.filter((e=>e.type===n.name)),i={name:n.name,options:n.options,storage:n.storage,editor:t},s=Bl({...e.reduce(((e,t)=>{const r=Ll(t,"extendMarkSchema",i);return{...e,...r?r(n):{}}}),{}),inclusive:Dl(Ll(n,"inclusive",i)),excludes:Dl(Ll(n,"excludes",i)),group:Dl(Ll(n,"group",i)),spanning:Dl(Ll(n,"spanning",i)),code:Dl(Ll(n,"code",i)),attrs:Object.fromEntries(o.map(jl))}),a=Dl(Ll(n,"parseHTML",i));a&&(s.parseDOM=a.map((e=>_l(e,o))));const l=Ll(n,"renderHTML",i);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:Hl(e,o)})),[n.name,s]})));return new Vt({topNode:s,nodes:a,marks:l})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce(((e,t)=>{const n=Ll(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Xl(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=Fl([...this.extensions].reverse()).flatMap((t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Xl(t.name,this.schema)},r=[],o=Ll(t,"addKeyboardShortcuts",n);let i={};if("mark"===t.type&&Ll(t,"exitable",n)&&(i.ArrowRight=()=>Ic.handleExit({editor:e,mark:t})),o){const t=Object.fromEntries(Object.entries(o()).map((([t,n])=>[t,()=>n({editor:e})])));i={...i,...t}}const s=new hr({props:{handleKeyDown:fa(i)}});r.push(s);const a=Ll(t,"addInputRules",n);if(ec(t,e.options.enableInputRules)&&a){const t=a();if(t&&t.length){const n=function(e){const{editor:t,rules:n}=e,r=new hr({state:{init:()=>null,apply(e,o,i){const s=e.getMeta(r);if(s)return s;const a=e.getMeta("applyInputRules");return!!a&&setTimeout((()=>{let{text:e}=a;"string"==typeof e||(e=Rl(Ge.from(e),i.schema));const{from:o}=a,s=o+e.length;Rc({editor:t,from:o,to:s,text:e,rules:n,plugin:r})})),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput:(e,o,i,s)=>Rc({editor:t,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout((()=>{const{$cursor:o}=e.state.selection;o&&Rc({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;const{$cursor:i}=e.state.selection;return!!i&&Rc({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),o=Array.isArray(n)?n:[n];r.push(...o)}}const l=Ll(t,"addPasteRules",n);if(ec(t,e.options.enablePasteRules)&&l){const t=l();if(t&&t.length){const n=_c({editor:e,rules:t});r.push(...n)}}const c=Ll(t,"addProseMirrorPlugins",n);if(c){const e=c();r.push(...e)}return r}));return t}get attributes(){return Il(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Pl(this.extensions);return Object.fromEntries(t.filter((e=>!!Ll(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Ea(t.name,this.schema)},o=Ll(t,"addNodeView",r);if(!o)return[];const i=o();if(!i)return[];return[t.name,(r,o,s,a,l)=>{const c=Hl(r,n);return i({node:r,view:o,getPos:s,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:c})}]})))}dispatchTransaction(e){const{editor:t}=this;return Fl([...this.extensions].reverse()).reduceRight(((e,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Xl(n.name,this.schema)},o=Ll(n,"dispatchTransaction",r);return o?t=>{o.call(r,{transaction:t,next:e})}:e}),e)}transformPastedHTML(e){const{editor:t}=this;return Fl([...this.extensions]).reduce(((e,n)=>{const r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Xl(n.name,this.schema)},o=Ll(n,"transformPastedHTML",r);return o?(t,n)=>{const i=e(t,n);return o.call(r,i)}:e}),e||(e=>e))}get markViews(){const{editor:e}=this,{markExtensions:t}=Pl(this.extensions);return Object.fromEntries(t.filter((e=>!!Ll(e,"addMarkView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Ha(t.name,this.schema)},o=Ll(t,"addMarkView",r);if(!o)return[];return[t.name,(r,i,s)=>{const a=Hl(r,n);return o()({mark:r,view:i,inline:s,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{!function(e,t,n={}){const{state:r}=t,{doc:o,tr:i}=r,s=e;o.descendants(((t,r)=>{const o=i.mapping.map(r),a=i.mapping.map(r)+t.nodeSize;let l=null;if(t.marks.forEach((e=>{if(e!==s)return!1;l=e})),!l)return;let c=!1;if(Object.keys(n).forEach((e=>{n[e]!==l.attrs[e]&&(c=!0)})),c){const t=e.type.create({...e.attrs,...n});i.removeMark(o,a,e.type),i.addMark(o,a,t)}})),i.docChanged&&t.view.dispatch(i)}(r,e,t)}})}]})))}destroy(){this.extensions.forEach((e=>{let t=e;for(;t.parent;){const e=t.parent;e.child===t&&(e.child=null),t=e}})),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map((e=>[e.name,e.storage]))),e.forEach((e=>{var t;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Xl(e.name,this.schema)};if("mark"===e.type){(null==(t=Dl(Ll(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name)}const r=Ll(e,"onBeforeCreate",n),o=Ll(e,"onCreate",n),i=Ll(e,"onUpdate",n),s=Ll(e,"onSelectionUpdate",n),a=Ll(e,"onTransaction",n),l=Ll(e,"onFocus",n),c=Ll(e,"onBlur",n),d=Ll(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),i&&this.editor.on("update",i),s&&this.editor.on("selectionUpdate",s),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)}))}};Bc.resolve=ql,Bc.sort=Fl,Bc.flatten=Al;ga({},{ClipboardTextSerializer:()=>Fc,Commands:()=>qc,Delete:()=>Wc,Drop:()=>Uc,Editable:()=>Kc,FocusEvents:()=>Gc,Keymap:()=>Jc,Paste:()=>Xc,Tabindex:()=>Yc,TextDirection:()=>Qc,focusEventsPluginKey:()=>Zc});var jc=class e extends Pc{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}},Fc=jc.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new hr({key:new mr("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,s=Math.min(...i.map((e=>e.$from.pos))),a=Math.max(...i.map((e=>e.$to.pos))),l=Ul(n);return Wl(r,{from:s,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),qc=jc.create({name:"commands",addCommands:()=>({...ya})}),Wc=jc.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,o;const i=()=>{var n,r,o,i;if(null!=(i=null==(o=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:o.call(r,e))?i:e.getMeta("y-sync$"))return;const s=Tl(e.before,[e,...t]);Gl(s).forEach((t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,((n,r)=>{const o=r+n.nodeSize-2,i=t.oldRange.from<=r&&o<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:o,newFrom:s.mapping.map(r),newTo:s.mapping.map(o),deletedRange:t.oldRange,newRange:t.newRange,partial:!i,editor:this.editor,transaction:e,combinedTransform:s})}))}));const a=s.mapping;s.steps.forEach(((t,n)=>{var r,o;if(t instanceof fn){const i=a.slice(n).map(t.from,-1),l=a.slice(n).map(t.to),c=a.invert().map(i,-1),d=a.invert().map(l),u=i>0&&(null==(r=s.doc.nodeAt(i-1))?void 0:r.marks.some((e=>e.eq(t.mark)))),h=null==(o=s.doc.nodeAt(l))?void 0:o.marks.some((e=>e.eq(t.mark)));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:c,to:d},newRange:{from:i,to:l},partial:Boolean(h||u),editor:this.editor,transaction:e,combinedTransform:s})}}))};null==(o=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||o?setTimeout(i,0):i()}}),Uc=jc.create({name:"drop",addProseMirrorPlugins(){return[new hr({key:new mr("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Kc=jc.create({name:"editable",addProseMirrorPlugins(){return[new hr({key:new mr("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Zc=new mr("focusEvents"),Gc=jc.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new hr({key:Zc,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),Jc=jc.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:t})=>{const{selection:n,doc:r}=t,{empty:o,$anchor:i}=n,{pos:s,parent:a}=i,l=i.parent.isTextblock&&s>0?t.doc.resolve(s-1):i,c=l.parent.type.spec.isolating,d=i.pos-i.parentOffset,u=c&&1===l.parent.childCount?d===i.pos:Kn.atStart(r).from===s;return!(!o||!a.type.isTextblock||a.textContent.length||!u||u&&"paragraph"===i.parent.type.name)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ua()||ll()?o:r},addProseMirrorPlugins(){return[new hr({key:new mr("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some((e=>e.getMeta("composition"))))return;const r=e.some((e=>e.docChanged))&&!t.doc.eq(n.doc),o=e.some((e=>e.getMeta("preventClearDocument")));if(!r||o)return;const{empty:i,from:s,to:a}=t.selection,l=Kn.atStart(t.doc).from,c=Kn.atEnd(t.doc).to;if(i||!(s===l&&a===c))return;if(!nc(n.doc))return;const d=n.tr,u=va({state:n,transaction:d}),{commands:h}=new ba({editor:this.editor,state:u});return h.clearNodes(),d.steps.length?d:void 0}})]}}),Xc=jc.create({name:"paste",addProseMirrorPlugins(){return[new hr({key:new mr("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),Yc=jc.create({name:"tabindex",addOptions:()=>({value:void 0}),addProseMirrorPlugins(){return[new hr({key:new mr("tabindex"),props:{attributes:()=>{var e;return this.editor.isEditable||void 0!==this.options.value?{tabindex:null!=(e=this.options.value)?e:"0"}:{}}}})]}}),Qc=jc.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=Pl(this.extensions);return[{types:e.filter((e=>"text"!==e.name)).map((e=>e.name)),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return!t||"ltr"!==t&&"rtl"!==t&&"auto"!==t?this.options.direction:t},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new hr({key:new mr("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),ed=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){const t=[];return this.node.content.forEach(((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=n.isInline,a=this.pos+r+(i?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!o&&!s&&l.depth<=this.depth)return;const c=new e(l,this.editor,o,o||s?n:null);o&&(c.actualDepth=this.depth+1),t.push(c)})),t}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){const e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];if(e[o]!==t[o])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;const o=Object.keys(t);return this.children.forEach((i=>{if(!(n&&r.length>0)){if(i.node.type.name===e){o.every((e=>t[e]===i.node.attrs[e]))&&r.push(i)}n&&r.length>0||(r=r.concat(i.querySelectorAll(e,t,n)))}})),r}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}};var td=class extends Lc{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"undefined"!=typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:ic,createMappablePosition:sc},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",(({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n))),this.on("paste",(({event:e,slice:t})=>this.options.onPaste(e,t))),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=qa(t,this.options.autofocus);this.editorState=dr.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if("undefined"==typeof document)throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout((()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)}),0)}unmount(){if(this.editorView){const e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"undefined"!=typeof document&&(this.css=function(e,t){const n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}',this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=Nl(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach((e=>{const t="string"==typeof e?`${e}$`:e.key;n=n.filter((e=>!e.key.startsWith(t)))})),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t,n,r;const o=[...this.options.enableCoreExtensions?[Kc,Fc.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),qc,Gc,Jc,Yc.configure({value:null==(r=null==(n=this.options.coreExtensionOptions)?void 0:n.tabindex)?void 0:r.value}),Uc,Xc,Wc,Qc.configure({direction:this.options.textDirection})].filter((e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name])):[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new Bc(o,this)}createCommandManager(){this.commandManager=new ba({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Sl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message)))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter((e=>"collaboration"!==e.name)),this.createExtensionManager()}}),e=Sl(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,i=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(i);this.editorView=new Ys(e,{...t,attributes:{role:"textbox",...null==t?void 0:t.attributes},dispatchTransaction:o,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)})):void(this.capturedTransaction=e);const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),o=n.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!o)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const s=n.findLast((e=>e.getMeta("focus")||e.getMeta("blur"))),a=null==s?void 0:s.getMeta("focus"),l=null==s?void 0:s.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),e.getMeta("preventUpdate")||!n.some((e=>e.docChanged))||i.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return Kl(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return dl(e,null,n)||Ql(e,null,n);const r=ml(t,e.schema);return"node"===r?dl(e,t,n):"mark"===r&&Ql(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Rl(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){return Wl(e,{from:0,to:e.content.size},t)}(this.state.doc,{blockSeparator:t,textSerializers:{...Ul(this.schema),...n}})}get isEmpty(){return nc(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText?t.nodeAfter:null;return new ed(t,this,!1,n)}get $doc(){return this.$pos(0)}};function nd(e){return new Ac({find:e.find,handler:({state:t,range:n,match:r})=>{const o=Dl(e.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:i}=t,s=r[r.length-1],a=r[0];if(s){const r=a.search(/\S/),l=n.from+a.indexOf(s),c=l+s.length;if(Jl(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>l)).length)return null;c<n.to&&i.delete(c,n.to),l>n.from&&i.delete(n.from+r,l);const d=n.from+r+s.length;i.addMark(n.from+r,d,e.type.create(o||{})),i.removeStoredMark(e.type)}},undoable:e.undoable})}function rd(e){return new Ac({find:e.find,handler:({state:t,range:n,match:r})=>{const o=Dl(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from;let a=n.to;const l=e.type.create(o);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;const t=r[0][r[0].length-1];i.insertText(t,s+r[0].length-1),i.replaceWith(e,a,l)}else if(r[0]){const t=e.type.isInline?s:s-1;i.insert(t,e.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()},undoable:e.undoable})}function od(e){return new Ac({find:e.find,handler:({state:t,range:n,match:r})=>{const o=t.doc.resolve(n.from),i=Dl(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)},undoable:e.undoable})}function id(e){return new Ac({find:e.find,handler:({state:t,range:n,match:r,chain:o})=>{const i=Dl(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&kn(a,e.type,i);if(!l)return null;if(s.wrap(a,l),e.keepMarks&&e.editor){const{selection:n,storedMarks:r}=t,{splittableMarks:o}=e.editor.extensionManager,i=r||n.$to.parentOffset&&n.$from.marks();if(i){const e=i.filter((e=>o.includes(e.type.name)));s.ensureMarks(e)}}if(e.keepAttributes){const t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";o().updateAttributes(t,i).run()}const c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&Tn(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&s.join(n.from-1)},undoable:e.undoable})}var sd=class{constructor(e){var t,n,r,o,i,s;this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;const t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;const t=e.touches[0];if(!t)return;const n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;const e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=e=>{"Shift"===e.key&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{"Shift"===e.key&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,(null==(t=e.options)?void 0:t.min)&&(this.minSize={...this.minSize,...e.options.min}),(null==(n=e.options)?void 0:n.max)&&(this.maxSize=e.options.max),(null==(r=null==e?void 0:e.options)?void 0:r.directions)&&(this.directions=e.options.directions),(null==(o=e.options)?void 0:o.preserveAspectRatio)&&(this.preserveAspectRatio=e.options.preserveAspectRatio),(null==(i=e.options)?void 0:i.className)&&(this.classNames={container:e.options.className.container||"",wrapper:e.options.className.wrapper||"",handle:e.options.className.handle||"",resizing:e.options.className.resizing||""}),(null==(s=e.options)?void 0:s.createCustomHandle)&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var e;return null!=(e=this.contentElement)?e:null}handleEditorUpdate(){const e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&0===this.handleMap.size&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type&&(this.node=e,!this.onUpdate||this.onUpdate(e,t,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const e=document.createElement("div");return e.dataset.resizeContainer="",e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){const e=document.createElement("div");return e.style.position="relative",e.style.display="block",e.dataset.resizeWrapper="",this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){const t=document.createElement("div");return t.dataset.resizeHandle=e,t.style.position="absolute",this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){const n=t.includes("top"),r=t.includes("bottom"),o=t.includes("left"),i=t.includes("right");n&&(e.style.top="0"),r&&(e.style.bottom="0"),o&&(e.style.left="0"),i&&(e.style.right="0"),"top"!==t&&"bottom"!==t||(e.style.left="0",e.style.right="0"),"left"!==t&&"right"!==t||(e.style.top="0",e.style.bottom="0")}attachHandles(){this.directions.forEach((e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener("mousedown",(t=>this.handleResizeStart(t,e))),t.addEventListener("touchstart",(t=>this.handleResizeStart(t,e))),this.handleMap.set(e,t),this.wrapper.appendChild(t)}))}removeHandles(){this.handleMap.forEach((e=>e.remove())),this.handleMap.clear()}applyInitialSize(){const e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,"touches"in e?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:o}=this.calculateNewDimensions(this.activeHandle,e,t),i=this.applyConstraints(r,o,n);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,o=this.startHeight;const i=e.includes("right"),s=e.includes("left"),a=e.includes("bottom"),l=e.includes("top");i?r=this.startWidth+t:s&&(r=this.startWidth-t),a?o=this.startHeight+n:l&&(o=this.startHeight-n),"right"!==e&&"left"!==e||(r=this.startWidth+(i?t:-t)),"top"!==e&&"bottom"!==e||(o=this.startHeight+(a?n:-n));return this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,o,e):{width:r,height:o}}applyConstraints(e,t,n){var r,o,i,s;if(!n){let n=Math.max(this.minSize.width,e),i=Math.max(this.minSize.height,t);return(null==(r=this.maxSize)?void 0:r.width)&&(n=Math.min(this.maxSize.width,n)),(null==(o=this.maxSize)?void 0:o.height)&&(i=Math.min(this.maxSize.height,i)),{width:n,height:i}}let a=e,l=t;return a<this.minSize.width&&(a=this.minSize.width,l=a/this.aspectRatio),l<this.minSize.height&&(l=this.minSize.height,a=l*this.aspectRatio),(null==(i=this.maxSize)?void 0:i.width)&&a>this.maxSize.width&&(a=this.maxSize.width,l=a/this.aspectRatio),(null==(s=this.maxSize)?void 0:s.height)&&l>this.maxSize.height&&(l=this.maxSize.height,a=l*this.aspectRatio),{width:a,height:l}}applyAspectRatio(e,t,n){const r="top"===n||"bottom"===n;return"left"===n||"right"===n?{width:e,height:e/this.aspectRatio}:r?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};function ad(e,t){const n=e.getAttribute("style");if(!n)return null;const r=n.split(";").map((e=>e.trim())).filter(Boolean),o=t.toLowerCase();for(let e=r.length-1;e>=0;e-=1){const t=r[e],n=t.indexOf(":");if(-1===n)continue;if(t.slice(0,n).trim().toLowerCase()===o)return t.slice(n+1).trim()}return null}function ld(e){if(!(null==e?void 0:e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,(e=>(n.push(e),`__QUOTED_${n.length-1}__`))),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){const e=o.map((e=>e.trim().slice(1)));t.class=e.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(t.id=i[1]);Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach((([,e,r])=>{var o;const i=parseInt((null==(o=r.match(/__QUOTED_(\d+)__/))?void 0:o[1])||"0",10),s=n[i];s&&(t[e]=s.slice(1,-1))}));const s=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();if(s){s.split(/\s+/).filter(Boolean).forEach((e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}))}return t}function cd(e){if(!e||0===Object.keys(e).length)return"";const t=[];if(e.class){String(e.class).split(/\s+/).filter(Boolean).forEach((e=>t.push(`.${e}`)))}return e.id&&t.push(`#${e.id}`),Object.entries(e).forEach((([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))})),t.join(" ")}function dd(e){const{nodeName:t,name:n,parseAttributes:r=ld,serializeAttributes:o=cd,defaultAttributes:i={},requiredAttributes:s=[],allowedAttributes:a}=e,l=n||t;return{parseMarkdown:(e,n)=>{const r={...i,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${l}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,o){const i=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),a=e.match(i);if(!a)return;const c=a[1]||"",d=r(c);return s.find((e=>!(e in d)))?void 0:{type:t,raw:a[0],attributes:d}}},renderMarkdown:e=>{const t=(e=>{if(!a)return e;const t={};return a.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),n=o(t);return`:::${l}${n?` {${n}}`:""} :::`}}}function ud(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=ld,serializeAttributes:i=cd,defaultAttributes:s={},content:a="block",allowedAttributes:l}=e,c=n||t;return{parseMarkdown:(e,n)=>{let o;if(r){const t=r(e);o="string"==typeof t?[{type:"text",text:t}]:t}else o="block"===a?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);const i={...s,...e.attributes};return n.createNode(t,i,o)},markdownTokenizer:{name:t,level:"block",start(e){var t;const n=new RegExp(`^:::${c}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var i;const s=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),l=e.match(s);if(!l)return;const[d,u=""]=l,h=o(u);let p=1;const f=d.length;let m="";const g=/^:::([\w-]*)(\s.*)?/gm,v=e.slice(f);for(g.lastIndex=0;;){const n=g.exec(v);if(null===n)break;const o=n.index,s=n[1];if(!(null==(i=n[2])?void 0:i.endsWith(":::")))if(s)p+=1;else if(p-=1,0===p){const i=v.slice(0,o);m=i.trim();const s=e.slice(0,f+o+n[0].length);let l=[];if(m)if("block"===a)for(l=r.blockTokens(i),l.forEach((e=>{!e.text||e.tokens&&0!==e.tokens.length||(e.tokens=r.inlineTokens(e.text))}));l.length>0;){const e=l[l.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;l.pop()}else l=r.inlineTokens(m);return{type:t,raw:s,attributes:h,content:m,tokens:l}}}}},renderMarkdown:(e,t)=>{const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{n in e&&(t[n]=e[n])})),t})(e.attrs||{}),r=i(n),o=r?` {${r}}`:"",s=t.renderChildren(e.content||[],"\n\n");return`:::${c}${o}\n\n${s}\n\n:::`}}}function hd(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;null!==r;){const[,o,i,s]=r;t[o]=i||s,r=n.exec(e)}return t}function pd(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}="${t}"`)).join(" ")}function fd(e){const{nodeName:t,name:n,getContent:r,parseAttributes:o=hd,serializeAttributes:i=pd,defaultAttributes:s={},selfClosing:a=!1,allowedAttributes:l}=e,c=n||t,d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{const o={...s,...e.attributes};if(a)return n.createNode(t,o);const i=r?r(e):e.content||"";return i?n.createNode(t,o,[n.createTextNode(i)]):n.createNode(t,o,[])},markdownTokenizer:{name:t,level:"inline",start(e){const t=a?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){const i=a?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),s=e.match(i);if(!s)return;let l="",c="";if(a){const[,e]=s;c=e}else{const[,e,t]=s;c=e,l=t||""}const u=o(c.trim());return{type:t,raw:s[0],content:l.trim(),attributes:u}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter((e=>"text"===e.type)).map((e=>e.text)).join(""));const n=(e=>{if(!l)return e;const t={};return l.forEach((n=>{const r="string"==typeof n?n:n.name,o="string"==typeof n?void 0:n.skipIfDefault;if(r in e){const n=e[r];if(void 0!==o&&n===o)return;t[r]=n}})),t})(e.attrs||{}),o=i(n),s=o?` ${o}`:"";return a?`[${c}${s}]`:`[${c}${s}]${t}[/${c}]`}}}function md(e,t,n){var r,o,i,s;const a=e.split("\n"),l=[];let c="",d=0;const u=t.baseIndentSize||2;for(;d<a.length;){const e=a[d],h=e.match(t.itemPattern);if(!h){if(l.length>0)break;if(""===e.trim()){d+=1,c=`${c}${e}\n`;continue}return}const p=t.extractItemData(h),{indentLevel:f,mainContent:m}=p;c=`${c}${e}\n`;const g=[m];for(d+=1;d<a.length;){const e=a[d];if(""===e.trim()){const t=a.slice(d+1).findIndex((e=>""!==e.trim()));if(-1===t)break;if(((null==(o=null==(r=a[d+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:o.length)||0)>f){g.push(e),c=`${c}${e}\n`,d+=1;continue}break}if(!(((null==(s=null==(i=e.match(/^(\s*)/))?void 0:i[1])?void 0:s.length)||0)>f))break;g.push(e),c=`${c}${e}\n`,d+=1}let v;const b=g.slice(1);if(b.length>0){const e=b.map((e=>e.slice(f+u))).join("\n");e.trim()&&(v=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}const y=t.createToken(p,v);l.push(y)}if(0!==l.length)return{items:l,raw:c}}function gd(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const o="function"==typeof n?n(r):n,[i,...s]=e.content;let a=`${o}${t.renderChildren([i])}`;return s&&s.length>0&&s.forEach(((e,n)=>{var r,o;const i=null!=(o=null==(r=t.renderChild)?void 0:r.call(t,e,n+1))?o:t.renderChildren([e]);if(null!=i){const n=i.split("\n").map((e=>e?t.indent(e):t.indent(""))).join("\n");a+="paragraph"===e.type?`\n\n${n}`:`\n${n}`}})),a}ga({},{createAtomBlockMarkdownSpec:()=>dd,createBlockMarkdownSpec:()=>ud,createInlineMarkdownSpec:()=>fd,parseAttributes:()=>ld,parseIndentedBlocks:()=>md,renderNestedMarkdownContent:()=>gd,serializeAttributes:()=>cd});var vd=class e extends Pc{constructor(){super(...arguments),this.type="node"}static create(t={}){const n="function"==typeof t?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){const t="function"==typeof e?e():e;return super.extend(t)}};function bd(e){return new zc({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{const i=Dl(e.getAttributes,void 0,r,o);if(!1===i||null===i)return null;const{tr:s}=t,a=r[r.length-1],l=r[0];let c=n.to;if(a){const o=l.search(/\S/),d=n.from+l.indexOf(a),u=d+a.length;if(Jl(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>d)).length)return null;u<n.to&&s.delete(u,n.to),d>n.from&&s.delete(n.from+o,d),c=n.from+o+a.length,s.addMark(n.from+o,c,e.type.create(i||{}));void 0!==r.index&&void 0!==r.input&&r.index+r[0].length>=r.input.length||s.removeStoredMark(e.type)}}})}var yd=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,wd=vd.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",Vl(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,r,o,i,s;const a=null!=(n=null==(t=e.attrs)?void 0:t.src)?n:"",l=null!=(o=null==(r=e.attrs)?void 0:r.alt)?o:"",c=null!=(s=null==(i=e.attrs)?void 0:i.title)?s:"";return c?`![${l}](${a} "${c}")`:`![${l}](${a})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||"undefined"==typeof document)return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:o,getPos:i,HTMLAttributes:s,editor:a})=>{const l=document.createElement("img");Object.entries(s).forEach((([e,t])=>{if(null!=t)switch(e){case"width":case"height":break;default:l.setAttribute(e,t)}})),l.src=s.src;const c=new sd({element:l,editor:a,node:o,getPos:i,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{const n=i();void 0!==n&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===o.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:!0===r}}),d=c.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",l.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},c}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[rd({find:yd,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),Cd=wd;const xd="numeric",kd="ascii",$d="alpha",Sd="asciinumeric",Md="alphanumeric",Ed="domain",Td="emoji",Od="scheme",Ld="slashscheme",Ad="whitespace";function Rd(e,t){return e in t||(t[e]=[]),t[e]}function Nd(e,t,n){t[xd]&&(t[Sd]=!0,t[Md]=!0),t[kd]&&(t[Sd]=!0,t[$d]=!0),t[Sd]&&(t[Md]=!0),t[$d]&&(t[Md]=!0),t[Md]&&(t[Ed]=!0),t[Td]&&(t[Ed]=!0);for(const r in t){const t=Rd(r,n);t.indexOf(e)<0&&t.push(e)}}function Dd(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Dd.groups={},Dd.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){const r=t.jr[n][0],o=t.jr[n][1];if(o&&r.test(e))return o}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){let o;return r=r||Dd.groups,t&&t.j?o=t:(o=new Dd(t),n&&r&&Nd(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const i=e.length;if(!i)return o;for(let t=0;t<i-1;t++)o=o.tt(e[t]);return o.tt(e[i-1],t,n,r)},tt(e,t,n,r){r=r||Dd.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const i=t;let s,a=o.go(e);if(a?(s=new Dd,Object.assign(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Dd,i){if(r)if(s.t&&"string"==typeof s.t){const e=Object.assign(function(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(s.t,r),n);Nd(i,e,r)}else n&&Nd(i,n,r);s.t=i}return o.j[e]=s,s}};const Pd=(e,t,n,r,o)=>e.ta(t,n,r,o),Id=(e,t,n,r,o)=>e.tr(t,n,r,o),zd=(e,t,n,r,o)=>e.ts(t,n,r,o),Vd=(e,t,n,r,o)=>e.tt(t,n,r,o),Hd="WORD",_d="UWORD",Bd="ASCIINUMERICAL",jd="ALPHANUMERICAL",Fd="LOCALHOST",qd="TLD",Wd="UTLD",Ud="SCHEME",Kd="SLASH_SCHEME",Zd="NUM",Gd="WS",Jd="NL",Xd="OPENBRACE",Yd="CLOSEBRACE",Qd="OPENBRACKET",eu="CLOSEBRACKET",tu="OPENPAREN",nu="CLOSEPAREN",ru="OPENANGLEBRACKET",ou="CLOSEANGLEBRACKET",iu="FULLWIDTHLEFTPAREN",su="FULLWIDTHRIGHTPAREN",au="LEFTCORNERBRACKET",lu="RIGHTCORNERBRACKET",cu="LEFTWHITECORNERBRACKET",du="RIGHTWHITECORNERBRACKET",uu="FULLWIDTHLESSTHAN",hu="FULLWIDTHGREATERTHAN",pu="AMPERSAND",fu="APOSTROPHE",mu="ASTERISK",gu="AT",vu="BACKSLASH",bu="BACKTICK",yu="CARET",wu="COLON",Cu="COMMA",xu="DOLLAR",ku="DOT",$u="EQUALS",Su="EXCLAMATION",Mu="HYPHEN",Eu="PERCENT",Tu="PIPE",Ou="PLUS",Lu="POUND",Au="QUERY",Ru="QUOTE",Nu="FULLWIDTHMIDDLEDOT",Du="SEMI",Pu="SLASH",Iu="TILDE",zu="UNDERSCORE",Vu="EMOJI",Hu="SYM";var _u=Object.freeze({__proto__:null,ALPHANUMERICAL:jd,AMPERSAND:pu,APOSTROPHE:fu,ASCIINUMERICAL:Bd,ASTERISK:mu,AT:gu,BACKSLASH:vu,BACKTICK:bu,CARET:yu,CLOSEANGLEBRACKET:ou,CLOSEBRACE:Yd,CLOSEBRACKET:eu,CLOSEPAREN:nu,COLON:wu,COMMA:Cu,DOLLAR:xu,DOT:ku,EMOJI:Vu,EQUALS:$u,EXCLAMATION:Su,FULLWIDTHGREATERTHAN:hu,FULLWIDTHLEFTPAREN:iu,FULLWIDTHLESSTHAN:uu,FULLWIDTHMIDDLEDOT:Nu,FULLWIDTHRIGHTPAREN:su,HYPHEN:Mu,LEFTCORNERBRACKET:au,LEFTWHITECORNERBRACKET:cu,LOCALHOST:Fd,NL:Jd,NUM:Zd,OPENANGLEBRACKET:ru,OPENBRACE:Xd,OPENBRACKET:Qd,OPENPAREN:tu,PERCENT:Eu,PIPE:Tu,PLUS:Ou,POUND:Lu,QUERY:Au,QUOTE:Ru,RIGHTCORNERBRACKET:lu,RIGHTWHITECORNERBRACKET:du,SCHEME:Ud,SEMI:Du,SLASH:Pu,SLASH_SCHEME:Kd,SYM:Hu,TILDE:Iu,TLD:qd,UNDERSCORE:zu,UTLD:Wd,UWORD:_d,WORD:Hd,WS:Gd});const Bu=/[a-z]/,ju=/\p{L}/u,Fu=/\p{Emoji}/u,qu=/\d/,Wu=/\s/;let Uu=null,Ku=null;function Zu(e,t){const n=function(e){const t=[],n=e.length;let r=0;for(;r<n;){let o,i=e.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,(e=>e.toLowerCase()))),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=e,l=null,c=0,d=null,u=-1,h=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(u=0,h=0,d=a):u>=0&&(u+=n[s].length,h++),c+=n[s].length,i+=n[s].length,s++;i-=u,s-=h,c-=u,o.push({t:d.t,v:t.slice(i-c,i),s:i-c,e:i})}return o}function Gu(e,t,n,r,o){let i;const s=t.length;for(let n=0;n<s-1;n++){const s=t[n];e.j[s]?i=e.j[s]:(i=new Dd(r),i.jr=o.slice(),e.j[s]=i),e=i}return i=new Dd(n),i.jr=o.slice(),e.j[t[s-1]]=i,i}function Ju(e){const t=[],n=[];let r=0;for(;r<e.length;){let o=0;for(;"0123456789".indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+o),10);t>0;t--)n.pop();r+=o}else n.push(e[r]),r++}return t}const Xu={defaultProtocol:"http",events:null,format:Qu,formatHref:Qu,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Yu(e,t=null){let n=Object.assign({},Xu);e&&(n=Object.assign(n,e instanceof Yu?e.o:e));const r=n.ignoreTags,o=[];for(let e=0;e<r.length;e++)o.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}function Qu(e){return e}function eh(e,t){this.t="token",this.v=e,this.tk=t}function th(e,t){class n extends eh{constructor(t,n){super(t,n),this.t=e}}for(const e in t)n.prototype[e]=t[e];return n.t=e,n}Yu.prototype={o:Xu,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=null!=t;let o=this.o[e];return o?("object"==typeof o?(o=n.t in o?o[n.t]:Xu[e],"function"==typeof o&&r&&(o=o(t,n))):"function"==typeof o&&r&&(o=o(t,n.t,n)),o):o},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},eh.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Xu.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),s={},a=e.get("className",n,t),l=e.get("target",n,t),c=e.get("rel",n,t),d=e.getObj("attributes",n,t),u=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:o,attributes:s,content:i,eventListeners:u}}};const nh=th("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),rh=th("text"),oh=th("nl"),ih=th("url",{isLink:!0,toHref(e=Xu.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Fd&&e[1].t===wu}}),sh=e=>new Dd(e);function ah(e,t,n){const r=n[0].s,o=n[n.length-1].e;return new e(t.slice(r,o),n)}const lh="undefined"!=typeof console&&console&&console.warn||(()=>{}),ch={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function dh(e,t=!1){if(ch.initialized&&lh(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');ch.customSchemes.push([e,t])}function uh(){ch.scanner=function(e=[]){const t={};Dd.groups=t;const n=new Dd;null==Uu&&(Uu=Ju("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==Ku&&(Ku=Ju("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),Vd(n,"'",fu),Vd(n,"{",Xd),Vd(n,"}",Yd),Vd(n,"[",Qd),Vd(n,"]",eu),Vd(n,"(",tu),Vd(n,")",nu),Vd(n,"<",ru),Vd(n,">",ou),Vd(n,"(",iu),Vd(n,")",su),Vd(n,"「",au),Vd(n,"」",lu),Vd(n,"『",cu),Vd(n,"』",du),Vd(n,"<",uu),Vd(n,">",hu),Vd(n,"&",pu),Vd(n,"*",mu),Vd(n,"@",gu),Vd(n,"`",bu),Vd(n,"^",yu),Vd(n,":",wu),Vd(n,",",Cu),Vd(n,"$",xu),Vd(n,".",ku),Vd(n,"=",$u),Vd(n,"!",Su),Vd(n,"-",Mu),Vd(n,"%",Eu),Vd(n,"|",Tu),Vd(n,"+",Ou),Vd(n,"#",Lu),Vd(n,"?",Au),Vd(n,'"',Ru),Vd(n,"/",Pu),Vd(n,";",Du),Vd(n,"~",Iu),Vd(n,"_",zu),Vd(n,"\\",vu),Vd(n,"・",Nu);const r=Id(n,qu,Zd,{[xd]:!0});Id(r,qu,r);const o=Id(r,Bu,Bd,{[Sd]:!0}),i=Id(r,ju,jd,{[Md]:!0}),s=Id(n,Bu,Hd,{[kd]:!0});Id(s,qu,o),Id(s,Bu,s),Id(o,qu,o),Id(o,Bu,o);const a=Id(n,ju,_d,{[$d]:!0});Id(a,Bu),Id(a,qu,i),Id(a,ju,a),Id(i,qu,i),Id(i,Bu),Id(i,ju,i);const l=Vd(n,"\n",Jd,{[Ad]:!0}),c=Vd(n,"\r",Gd,{[Ad]:!0}),d=Id(n,Wu,Gd,{[Ad]:!0});Vd(n,"",d),Vd(c,"\n",l),Vd(c,"",d),Id(c,Wu,d),Vd(d,"\r"),Vd(d,"\n"),Id(d,Wu,d),Vd(d,"",d);const u=Id(n,Fu,Vu,{[Td]:!0});Vd(u,"#"),Id(u,Fu,u),Vd(u,"️",u);const h=Vd(u,"‍");Vd(h,"#"),Id(h,Fu,u);const p=[[Bu,s],[qu,o]],f=[[Bu,null],[ju,a],[qu,i]];for(let e=0;e<Uu.length;e++)Gu(n,Uu[e],qd,Hd,p);for(let e=0;e<Ku.length;e++)Gu(n,Ku[e],Wd,_d,f);Nd(qd,{tld:!0,ascii:!0},t),Nd(Wd,{utld:!0,alpha:!0},t),Gu(n,"file",Ud,Hd,p),Gu(n,"mailto",Ud,Hd,p),Gu(n,"http",Kd,Hd,p),Gu(n,"https",Kd,Hd,p),Gu(n,"ftp",Kd,Hd,p),Gu(n,"ftps",Kd,Hd,p),Nd(Ud,{scheme:!0,ascii:!0},t),Nd(Kd,{slashscheme:!0,ascii:!0},t),e=e.sort(((e,t)=>e[0]>t[0]?1:-1));for(let t=0;t<e.length;t++){const r=e[t][0],o=e[t][1]?{[Od]:!0}:{[Ld]:!0};r.indexOf("-")>=0?o[Ed]=!0:Bu.test(r)?qu.test(r)?o[Sd]=!0:o[kd]=!0:o[xd]=!0,zd(n,r,r,o)}return zd(n,"localhost",Fd,{ascii:!0}),n.jd=new Dd(Hu),{start:n,tokens:Object.assign({groups:t},_u)}}(ch.customSchemes);for(let e=0;e<ch.tokenQueue.length;e++)ch.tokenQueue[e][1]({scanner:ch.scanner});ch.parser=function({groups:e}){const t=e.domain.concat([pu,mu,gu,vu,bu,yu,xu,$u,Mu,Zd,Eu,Tu,Ou,Lu,Pu,Hu,Iu,zu]),n=[fu,wu,Cu,ku,Su,Eu,Au,Ru,Du,ru,ou,Xd,Yd,eu,Qd,tu,nu,iu,su,au,lu,cu,du,uu,hu],r=[pu,fu,mu,vu,bu,yu,xu,$u,Mu,Xd,Yd,Eu,Tu,Ou,Lu,Au,Pu,Hu,Iu,zu],o=sh(),i=Vd(o,Iu);Pd(i,r,i),Pd(i,e.domain,i);const s=sh(),a=sh(),l=sh();Pd(o,e.domain,s),Pd(o,e.scheme,a),Pd(o,e.slashscheme,l),Pd(s,r,i),Pd(s,e.domain,s);const c=Vd(s,gu);Vd(i,gu,c),Vd(a,gu,c),Vd(l,gu,c);const d=Vd(i,ku);Pd(d,r,i),Pd(d,e.domain,i);const u=sh();Pd(c,e.domain,u),Pd(u,e.domain,u);const h=Vd(u,ku);Pd(h,e.domain,u);const p=sh(nh);Pd(h,e.tld,p),Pd(h,e.utld,p),Vd(c,Fd,p);const f=Vd(u,Mu);Vd(f,Mu,f),Pd(f,e.domain,u),Pd(p,e.domain,u),Vd(p,ku,h),Vd(p,Mu,f);const m=Vd(s,Mu),g=Vd(s,ku);Vd(m,Mu,m),Pd(m,e.domain,s),Pd(g,r,i),Pd(g,e.domain,s);const v=sh(ih);Pd(g,e.tld,v),Pd(g,e.utld,v),Pd(v,e.domain,s),Pd(v,r,i),Vd(v,ku,g),Vd(v,Mu,m),Vd(v,gu,c);const b=Vd(v,wu),y=sh(ih);Pd(b,e.numeric,y);const w=sh(ih),C=sh();Pd(w,t,w),Pd(w,n,C),Pd(C,t,w),Pd(C,n,C),Vd(v,Pu,w),Vd(y,Pu,w);const x=Vd(a,wu),k=Vd(l,wu),$=Vd(k,Pu),S=Vd($,Pu);Pd(a,e.domain,s),Vd(a,ku,g),Vd(a,Mu,m),Pd(l,e.domain,s),Vd(l,ku,g),Vd(l,Mu,m),Pd(x,e.domain,w),Vd(x,Pu,w),Vd(x,Au,w),Pd(S,e.domain,w),Pd(S,t,w),Vd(S,Pu,w);const M=[[Xd,Yd],[Qd,eu],[tu,nu],[ru,ou],[iu,su],[au,lu],[cu,du],[uu,hu]];for(let e=0;e<M.length;e++){const[r,o]=M[e],i=Vd(w,r);Vd(C,r,i);const s=sh(ih);Pd(i,t,s);const a=sh();Pd(i,n,a),Vd(i,o,w),Pd(s,t,s),Pd(s,n,a),Pd(a,t,s),Pd(a,n,a),Vd(s,o,w),Vd(a,o,w)}return Vd(o,Fd,v),Vd(o,Jd,oh),{start:o,tokens:_u}}(ch.scanner.tokens);for(let e=0;e<ch.pluginQueue.length;e++)ch.pluginQueue[e][1]({scanner:ch.scanner,parser:ch.parser});return ch.initialized=!0,ch}function hh(e){return ch.initialized||uh(),function(e,t,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=e,l=null,c=null,d=0,u=null,h=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(h=0,u=a):h>=0&&h++,o++,d++;if(h<0)o-=d,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(ah(rh,t,s)),s=[]),o-=h,d-=h;const e=u.t,r=n.slice(o-d,o);i.push(ah(e,t,r))}}return s.length>0&&i.push(ah(rh,t,s)),i}(ch.parser.start,e,Zu(ch.scanner.start,e))}function ph(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new Yu(n),o=hh(e),i=[];for(let e=0;e<o.length;e++){const n=o[e];!n.isLink||t&&n.t!==t||!r.check(n)||i.push(n.toFormattedObject(r))}return i}hh.scan=Zu;var fh="[\0-   ᠎ -\u2029  ]",mh=new RegExp(fh),gh=new RegExp(`${fh}$`),vh=new RegExp(fh,"g");function bh(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach((e=>{const t="string"==typeof e?e:e.scheme;t&&n.push(t)})),!e||e.replace(vh,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var yh=Ic.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach((e=>{"string"!=typeof e?dh(e.scheme,e.optionalSlashes):dh(e)}))},onDestroy(){Dd.groups={},ch.scanner=null,ch.parser=null,ch.tokenQueue=[],ch.pluginQueue=[],ch.customSchemes=[],ch.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!bh(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(r)&&!!/\./.test(r)}}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!(!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!bh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!bh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Vl(this.options.HTMLAttributes,e),0]:["a",Vl(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,o,i;const s=null!=(r=null==(n=e.attrs)?void 0:n.href)?r:"",a=null!=(i=null==(o=e.attrs)?void 0:o.title)?i:"",l=t.renderChildren(e);return a?`[${l}](${s} "${a}")`:`[${l}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!bh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return!(n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!bh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[bd({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,o=ph(e).filter((e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!bh(e,n),protocols:n,defaultProtocol:r})));o.length&&o.forEach((e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})}))}return t},type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;var r;return this.options.autolink&&e.push((r={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!bh(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink},new hr({key:new mr("autolink"),appendTransaction:(e,t,n)=>{const o=e.some((e=>e.docChanged))&&!t.doc.eq(n.doc),i=e.some((e=>e.getMeta("preventAutolink")));if(!o||i)return;const{tr:s}=n;return Gl(Tl(t.doc,[...e])).forEach((({newRange:e})=>{const t=function(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,((e,t)=>{n(e)&&r.push({node:e,pos:t})})),r}(n.doc,e,(e=>e.isTextblock));let o,i;if(t.length>1)o=t[0],i=n.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ");else if(t.length){const r=n.doc.textBetween(e.from,e.to," "," ");if(!gh.test(r))return;o=t[0],i=n.doc.textBetween(o.pos,e.to,void 0," ")}if(o&&i){const e=i.split(mh).filter(Boolean);if(e.length<=0)return!1;const t=e[e.length-1],l=o.pos+i.lastIndexOf(t);if(!t)return!1;const c=hh(t).map((e=>e.toObject(r.defaultProtocol)));if(!(1===(a=c).length?a[0].isLink:3===a.length&&a[1].isLink&&["()","[]"].includes(a[0].value+a[2].value)))return!1;c.filter((e=>e.isLink)).map((e=>({...e,from:l+e.start+1,to:l+e.end+1}))).filter((e=>!n.schema.marks.code||!n.doc.rangeHasMark(e.from,e.to,n.schema.marks.code))).filter((e=>r.validate(e.value))).filter((e=>r.shouldAutoLink(e.value))).forEach((e=>{Jl(e.from,e.to,n.doc).some((e=>e.mark.type===r.type))||s.addMark(e.from,e.to,r.type.create({href:e.href}))}))}var a})),s.steps.length?s:void 0}}))),e.push(function(e){return new hr({key:new mr("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i;if(0!==r.button)return!1;if(!t.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{const t=r.target;if(!t)return!1;const n=e.editor.view.dom;s=t.closest("a"),s&&!n.contains(s)&&(s=null)}if(!s)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const n=Kl(t.state,e.type.name),r=null!=(o=s.href)?o:n.href,l=null!=(i=s.target)?i:n.target;r&&(window.open(r,l),a=!0)}return a}}})}({type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(function(e){return new hr({key:new mr("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:o}=e,{state:i}=t,{selection:s}=i,{empty:a}=s;if(a)return!1;let l="";r.content.forEach((e=>{l+=e.textContent}));const c=ph(l,{defaultProtocol:e.defaultProtocol}).find((e=>e.isLink&&e.value===l));return!(!l||!c||void 0!==o&&!o(c.value))&&e.editor.commands.setMark(e.type,{href:c.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),wh=yh;function Ch(e={}){return new hr({view:t=>new xh(t,e)})}class xh{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,s=o.height/r.offsetHeight;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let o=t.getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let a=this.width/2*s;e={left:o.left,right:o.right,top:i-a,bottom:i+a}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*i;e={left:t.left-n,right:t.left+n,top:t.top,bottom:t.bottom}}let a,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!c||c==document.body&&"static"==getComputedStyle(c).position)a=-pageXOffset,l=-pageYOffset;else{let e=c.getBoundingClientRect(),t=e.width/c.offsetWidth,n=e.height/c.offsetHeight;a=e.left-c.scrollLeft*t,l=e.top-c.scrollTop*n}this.element.style.left=(e.left-a)/i+"px",this.element.style.top=(e.top-l)/s+"px",this.element.style.width=(e.right-e.left)/i+"px",this.element.style.height=(e.bottom-e.top)/s+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(t&&!o){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=An(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class kh extends Kn{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return kh.valid(n)?new kh(n):Kn.near(n)}content(){return tt.empty}eq(e){return e instanceof kh&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new kh(e.resolve(t.pos))}getBookmark(){return new $h(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||Sh(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||Sh(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&kh.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(kh.valid(s))return s}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!Qn.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=i,r+=t;let s=e.doc.resolve(r);if(kh.valid(s))return s}return null}}}kh.prototype.visible=!1,kh.findFrom=kh.findGapCursorFrom,Kn.jsonID("gapcursor",kh);class $h{constructor(e){this.pos=e}map(e){return new $h(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return kh.valid(t)?new kh(t):Kn.near(t)}}function Sh(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}const Mh=fa({ArrowLeft:Eh("horiz",-1),ArrowRight:Eh("horiz",1),ArrowUp:Eh("vert",-1),ArrowDown:Eh("vert",1)});function Eh(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,s=t>0?i.$to:i.$from,a=i.empty;if(i instanceof Xn){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=kh.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new kh(l))),!0)}}function Th(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!kh.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&Qn.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new kh(r))),!0)}function Oh(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof kh))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=Ge.empty;for(let e=r.length-1;e>=0;e--)o=Ge.from(r[e].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new tt(o,0,0));return i.setSelection(Xn.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function Lh(e){if(!(e.selection instanceof kh))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Es.create(e.doc,[$s.widget(e.selection.head,t,{key:"gapcursor"})])}var Ah=200,Rh=function(){};Rh.prototype.append=function(e){return e.length?(e=Rh.from(e),!this.length&&e||e.length<Ah&&this.leafAppend(e)||this.length<Ah&&e.leafPrepend(this)||this.appendInner(e)):this},Rh.prototype.prepend=function(e){return e.length?Rh.from(e).append(this):this},Rh.prototype.appendInner=function(e){return new Dh(this,e)},Rh.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Rh.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Rh.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Rh.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Rh.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},Rh.from=function(e){return e instanceof Rh?e:e&&e.length?new Nh(e):Rh.empty};var Nh=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Ah)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Ah)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Rh);Rh.empty=new Nh([]);var Dh=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Rh);class Ph{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(o,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new Ih(e.map));let t,o=e.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new Ih(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(r)):e.selection,s=new Ph(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(e,t,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),d=new Ih(e.mapping.maps[n],c,t);(l=a&&a.merge(d))&&(d=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(d),t&&(i++,t=void 0),r||(a=d)}let l=i-n.depth;return l>Vh&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),i-=l),new Ph(s.append(o),i)}remapping(e,t){let n=new ln;return this.items.forEach(((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new Ph(this.items.append(e.map((e=>new Ih(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(a+1,r));c&&s++,n.push(new Ih(l,i,c))}else n.push(new Ih(l))}),r);let l=[];for(let e=t;e<i;e++)l.push(new Ih(o.maps[e]));let c=this.items.slice(0,r).append(l).append(n),d=new Ph(c,s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=i.selection&&i.selection.map(t.slice(n));a&&o++;let l,c=new Ih(s.invert(),e,a),d=r.length-1;(l=r.length&&r[d].merge(c))?r[d]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new Ph(Rh.from(r.reverse()),o)}}Ph.empty=new Ph(Rh.empty,0);class Ih{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Ih(t.getMap().invert(),t,this.selection)}}}class zh{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const Vh=20;function Hh(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(((e,n,r,o)=>t.push(r,o)));return t}function _h(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}let Bh=!1,jh=null;function Fh(e){let t=e.plugins;if(jh!=t){Bh=!1,jh=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Bh=!0;break}}return Bh}const qh=new mr("history"),Wh=new mr("closeHistory");function Uh(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new hr({key:qh,state:{init:()=>new zh(Ph.empty,Ph.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(qh);if(i)return i.historyState;n.getMeta(Wh)&&(e=new zh(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(qh))return s.getMeta(qh).redo?new zh(e.done.addTransform(n,void 0,r,Fh(t)),e.undone,Hh(n.mapping.maps),e.prevTime,e.prevComposition):new zh(e.done,e.undone.addTransform(n,void 0,r,Fh(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new zh(e.done.rebased(n,o),e.undone.rebased(n,o),_h(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new zh(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),_h(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!s&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),a=s?_h(e.prevRanges,n.mapping):Hh(n.mapping.maps);return new zh(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,Fh(t)),Ph.empty,a,n.time,null==o?e.prevComposition:o)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?Zh:"historyRedo"==n?Gh:null;return!(!r||!e.editable)&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Kh(e,t){return(n,r)=>{let o=qh.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=Fh(t),o=qh.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),l=new zh(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(qh,{redo:n,historyState:l})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const Zh=Kh(!1,!0),Gh=Kh(!0,!0);jc.create({name:"characterCount",addOptions:()=>({limit:null,autoTrim:!0,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter((e=>""!==e)).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){const e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new hr({key:new mr("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const o=this.options.limit,i=this.options.autoTrim;if(null==o||0===o||!1===i)return void(e=!0);const s=this.storage.characters({node:r.doc});if(s>o){const t=0,n=s-o;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const i=r.tr.deleteRange(t,n);return e=!0,i}e=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=n)return!0;if(r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r)return!1;if(!e.getMeta("paste"))return!1;const i=e.selection.$head.pos,s=i-(o-n),a=i;e.deleteRange(s,a);return!(this.storage.characters({node:e.doc})>n)}})]}});var Jh=jc.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[Ch(this.options)]}});jc.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new hr({key:new mr("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=t,i=[];if(!n||!r)return Es.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants(((e,t)=>{if(e.isText)return;if(!(o>=t&&o<=t+e.nodeSize-1))return!1;s+=1}));let a=0;return e.descendants(((e,t)=>{if(e.isText)return!1;if(!(o>=t&&o<=t+e.nodeSize-1))return!1;a+=1;if("deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1)return"deepest"===this.options.mode;i.push($s.node(t,t+e.nodeSize,{class:this.options.className}))})),Es.create(e,i)}}})]}});var Xh=jc.create({name:"gapCursor",addProseMirrorPlugins:()=>[new hr({props:{decorations:Lh,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&kh.valid(n)?new kh(n):null,handleClick:Th,handleKeyDown:Mh,handleDOMEvents:{beforeinput:Oh}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!=(t=Dl(Ll(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))?t:null}}});function Yh(e){const{editor:t,placeholder:n,dataAttribute:r,pos:o,node:i,isEmptyDoc:s,hasAnchor:a,classes:{emptyNode:l,emptyEditor:c}}=e,d=[l];return s&&d.push(c),$s.node(o,o+i.nodeSize,{class:d.join(" "),[r]:"function"==typeof n?n({editor:t,node:i,pos:o,hasAnchor:a}):n})}function Qh(e){const t=getComputedStyle(e),n=`${t.overflow} ${t.overflowY} ${t.overflowX}`;return/auto|scroll|overlay/.test(n)}function ep({doc:e,view:t,scrollContainer:n}){const r=t.dom.getBoundingClientRect(),o=n?(i=n)===window?{top:0,bottom:window.innerHeight}:i.getBoundingClientRect():{top:0,bottom:window.innerHeight};var i;const s=Math.max(r.top,o.top),a=Math.min(r.bottom,o.bottom);if(s>=a)return{top:0,bottom:e.content.size};const l="rtl"===getComputedStyle(t.dom).direction?Math.max(r.right-2,r.left+2):r.left+2,c=t.posAtCoords({left:l,top:s+2}),d=t.posAtCoords({left:l,top:a-2});return{top:c?c.pos:0,bottom:d?d.pos:e.content.size}}var tp="placeholder";var np=new mr("tiptap__placeholder"),rp=jc.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:tp,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${t=this.options.dataAttribute,t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${tp}`;var t;return[new hr({state:{init:()=>({topPos:null,bottomPos:null}),apply(e,t){const n=e.getMeta(np);return(null==n?void 0:n.positions)?{topPos:n.positions.top,bottomPos:n.positions.bottom}:e.docChanged?{topPos:null!==t.topPos?e.mapping.map(t.topPos):null,bottomPos:null!==t.bottomPos?e.mapping.map(t.bottomPos):null}:t}},key:np,view(e){const t=function(e){let t=e;for(;t;){if(Qh(t))return t;const e=t.parentElement;if(!e){const e=t.getRootNode();if(e instanceof ShadowRoot){t=e.host;continue}return window}t=e}return window}(e.dom),n=()=>{const n=ep({view:e,doc:e.state.doc,scrollContainer:t}),r=np.getState(e.state);if(r.topPos===n.top&&r.bottomPos===n.bottom)return;const o=e.state.tr.setMeta(np,{positions:n}).setMeta("tiptap__viewportUpdate",!0);e.dispatch(o)},{call:r,cancel:o}=function(e,t){let n=null;return{call:(...r)=>{n||(e(...r),n=setTimeout((()=>{n=null}),t))},cancel:()=>{n&&(clearTimeout(n),n=null)}}}(n,250),i=t;return i.addEventListener("scroll",r,{passive:!0}),n(),{update(t,r){e.state.doc.content.size!==r.doc.content.size&&n()},destroy:()=>{o(),i.removeEventListener("scroll",r)}}},props:{decorations:({doc:t,selection:n})=>{var r,o;if(!(this.editor.isEditable||!this.options.showOnlyWhenEditable))return null;const{anchor:i}=n,s=[],a=this.editor.isEmpty;if(this.options.showOnlyCurrent&&!this.options.includeChildren){const n=t.resolve(i);if(n.depth>0){const t=n.node(1),r=n.before(1);if(t.type.isTextblock&&nc(t)){const o=i>=r&&i<=r+t.nodeSize,l=Yh({node:t,dataAttribute:e,hasAnchor:o,placeholder:this.options.placeholder,classes:{emptyEditor:this.options.emptyEditorClass,emptyNode:this.options.emptyNodeClass},editor:this.editor,isEmptyDoc:a,pos:n.before(1)});s.push(l)}}}else{const n=np.getState(this.editor.state),l=null!=(r=n.topPos)?r:0,c=null!=(o=n.bottomPos)?o:t.content.size;t.nodesBetween(l,c,((t,n)=>{const r=i>=n&&i<=n+t.nodeSize,o=!t.isLeaf&&nc(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&o){const o=Yh({classes:{emptyEditor:this.options.emptyEditorClass,emptyNode:this.options.emptyNodeClass},editor:this.editor,isEmptyDoc:a,dataAttribute:e,hasAnchor:r,placeholder:this.options.placeholder,node:t,pos:n});s.push(o)}return this.options.includeChildren}))}return Es.create(t,s)}}})]}});jc.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new hr({key:new mr("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||rc(n.selection)||e.view.dragging?null:Es.create(n.doc,[$s.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});function op({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}var ip=jc.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;const t=new mr(this.name),n=this.options.node||(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map((([,e])=>e)).filter((e=>(this.options.notAfter||[]).concat(n).includes(e.name)));return[new hr({key:t,appendTransaction:(e,r,o)=>{const{doc:i,tr:s,schema:a}=o,l=t.getState(o),c=i.content.size,d=a.nodes[n];if(!e.some((e=>e.getMeta("skipTrailingNode")))&&l)return s.insert(c,d.create())},state:{init:(e,t)=>!op({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>{if(!e.docChanged)return t;if(e.getMeta("__uniqueIDTransaction"))return t;return!op({node:e.doc.lastChild,types:r})}}})]}}),sp=jc.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Zh(e,t),redo:()=>({state:e,dispatch:t})=>Gh(e,t)}),addProseMirrorPlugins(){return[Uh(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),ap=rp,lp=Ic.create({name:"subscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sub"},{style:"vertical-align",getAttrs:e=>"sub"===e&&null}],renderHTML({HTMLAttributes:e}){return["sub",Vl(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),cp=Ic.create({name:"superscript",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"sup"},{style:"vertical-align",getAttrs:e=>"super"===e&&null}],renderHTML({HTMLAttributes:e}){return["sup",Vl(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),dp=jc.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{const t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.map((n=>t.updateAttributes(n,{textAlign:e}))).some((e=>e)),unsetTextAlign:()=>({commands:e})=>this.options.types.map((t=>e.resetAttributes(t,"textAlign"))).some((e=>e)),toggleTextAlign:e=>({editor:t,commands:n})=>!!this.options.alignments.includes(e)&&(t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),up=(e,t=0)=>{const n=[];return!e.children.length||t>20||Array.from(e.children).forEach((e=>{"SPAN"===e.tagName?n.push(e):e.children.length&&n.push(...up(e,t+1))})),n},hp=Ic.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!0}),parseHTML(){return[{tag:"span",consuming:!1,getAttrs:e=>!!e.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(e=>{if(!e.children.length)return;const t=up(e);t&&t.forEach((e=>{var t,n;const r=e.getAttribute("style"),o=null==(n=null==(t=e.parentElement)?void 0:t.closest("span"))?void 0:n.getAttribute("style");e.setAttribute("style",`${o};${r}`)}))})(e),{})}]},renderHTML({HTMLAttributes:e}){return["span",Vl(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,((t,n)=>{if(t.isTextblock)return!0;t.marks.filter((e=>e.type===this.type)).some((e=>Object.values(e.attrs).some((e=>!!e))))||e.removeMark(n,n+t.nodeSize,this.type)})),!0}}}}),pp=jc.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>{var t;const n=null!=(t=ad(e,"background-color"))?t:e.style.backgroundColor;return null==n?void 0:n.replace(/['"]+/g,"")},renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands:()=>({setBackgroundColor:e=>({chain:t})=>t().setMark("textStyle",{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()})}),fp=jc.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;const n=null!=(t=ad(e,"color"))?t:e.style.color;return null==n?void 0:n.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),mp=jc.create({name:"fontFamily",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>{var t;return null!=(t=ad(e,"font-family"))?t:e.style.fontFamily},renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands:()=>({setFontFamily:e=>({chain:t})=>t().setMark("textStyle",{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()})}),gp=jc.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>{var t;return null!=(t=ad(e,"font-size"))?t:e.style.fontSize},renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands:()=>({setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()})}),vp=jc.create({name:"lineHeight",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>{var t;return null!=(t=ad(e,"line-height"))?t:e.style.lineHeight},renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands:()=>({setLineHeight:e=>({chain:t})=>t().setMark("textStyle",{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()})}),bp=jc.create({name:"textStyleKit",addExtensions(){const e=[];return!1!==this.options.backgroundColor&&e.push(pp.configure(this.options.backgroundColor)),!1!==this.options.color&&e.push(fp.configure(this.options.color)),!1!==this.options.fontFamily&&e.push(mp.configure(this.options.fontFamily)),!1!==this.options.fontSize&&e.push(gp.configure(this.options.fontSize)),!1!==this.options.lineHeight&&e.push(vp.configure(this.options.lineHeight)),!1!==this.options.textStyle&&e.push(hp.configure(this.options.textStyle)),e}}),yp=(e,t)=>{if("slot"===e)return 0;if(e instanceof Function)return e(t);const{children:n,...r}=null!=t?t:{};if("svg"===e)throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},wp=/^\s*>\s$/,Cp=vd.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return yp("blockquote",{...Vl(this.options.HTMLAttributes,e),children:yp("slot",{})})},parseMarkdown:(e,t)=>{var n;const r=null!=(n=t.parseBlockChildren)?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";const n=[];return e.content.forEach(((e,r)=>{var o,i;const s=(null!=(i=null==(o=t.renderChild)?void 0:o.call(t,e,r))?i:t.renderChildren([e])).split("\n").map((e=>""===e.trim()?">":`> ${e}`));n.push(s.join("\n"))})),n.join("\n>\n")},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[id({find:wp,type:this.type})]}}),xp=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,kp=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,$p=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Sp=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Mp=Ic.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return yp("strong",{...Vl(this.options.HTMLAttributes,e),children:yp("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[nd({find:xp,type:this.type}),nd({find:$p,type:this.type})]},addPasteRules(){return[bd({find:kp,type:this.type}),bd({find:Sp,type:this.type})]}}),Ep=/(^|[^`])`([^`]+)`(?!`)$/,Tp=/(^|[^`])`([^`]+)`(?!`)/g,Op=Ic.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",Vl(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[nd({find:Ep,type:this.type})]},addPasteRules(){return[bd({find:Tp,type:this.type})]}}),Lp=/^```([a-z]+)?[\s\n]$/,Ap=/^~~~([a-z]+)?[\s\n]$/,Rp=vd.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;if(!n)return null;const r=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter((e=>e.startsWith(n))).map((e=>e.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",Vl(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,r;return!1===(null==(n=e.raw)?void 0:n.startsWith("```"))&&!1===(null==(r=e.raw)?void 0:r.startsWith("~~~"))&&"indented"!==e.codeBlockStyle?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const o=(null==(n=e.attrs)?void 0:n.language)||"";if(e.content){r=[`\`\`\`${o}`,t.renderChildren(e.content),"```"].join("\n")}else r=`\`\`\`${o}\n\n\`\`\``;return r},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:o}=r,{$from:i,empty:s}=o;if(i.parent.type!==this.type)return!1;const a=" ".repeat(n);return s?e.commands.insertContent(a):e.commands.command((({tr:e})=>{const{from:t,to:n}=o,i=r.doc.textBetween(t,n,"\n","\n").split("\n").map((e=>a+e)).join("\n");return e.replaceWith(t,n,r.schema.text(i)),!0}))},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:o}=r,{$from:i,empty:s}=o;return i.parent.type===this.type&&(s?e.commands.command((({tr:e})=>{var t;const{pos:o}=i,s=i.start(),a=i.end(),l=r.doc.textBetween(s,a,"\n","\n").split("\n");let c=0,d=0;const u=o-s;for(let e=0;e<l.length;e+=1){if(d+l[e].length>=u){c=e;break}d+=l[e].length+1}const h=(null==(t=l[c].match(/^ */))?void 0:t[0])||"",p=Math.min(h.length,n);if(0===p)return!0;let f=s;for(let e=0;e<c;e+=1)f+=l[e].length+1;e.delete(f,f+p);return o-f<=p&&e.setSelection(Xn.create(e.doc,f)),!0})):e.commands.command((({tr:e})=>{const{from:t,to:i}=o,s=r.doc.textBetween(t,i,"\n","\n").split("\n").map((e=>{var t;const r=(null==(t=e.match(/^ */))?void 0:t[0])||"",o=Math.min(r.length,n);return e.slice(o)})).join("\n");return e.replaceWith(t,i,r.schema.text(s)),!0})))},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!i||!s)&&e.chain().command((({tr:e})=>(e.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type)return!1;if(!(o.parentOffset===o.parent.nodeSize-2))return!1;const s=o.after();if(void 0===s)return!1;return r.nodeAt(s)?e.commands.command((({tr:e})=>(e.setSelection(Kn.near(r.resolve(s))),!0))):e.commands.exitCode()}}},addInputRules(){return[od({find:Lp,type:this.type,getAttributes:e=>({language:e[1]})}),od({find:Ap,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new hr({key:new mr("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=null==o?void 0:o.mode;if(!n||!i)return!1;const{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(Xn.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),Np=vd.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),Dp=vd.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",Vl(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>" \n",parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:s}=r.extensionManager,a=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&i){const t=a.filter((e=>s.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Pp=vd.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map((e=>({tag:`h${e}`,attrs:{level:e}})))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Vl(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=(null==(n=e.attrs)?void 0:n.level)?parseInt(e.attrs.level,10):1,o="#".repeat(r);return e.content?`${o} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce(((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})})),{})},addInputRules(){return this.options.levels.map((e=>od({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}})))}}),Ip=vd.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",Vl(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!function(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof Qn){const e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let o=r.depth;for(;o>=0;){const e=r.index(o);if(r.node(o).contentMatchAt(e).matchType(t))return!0;o-=1}return!1}(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,o=e();return rc(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command((({state:e,tr:t,dispatch:n})=>{if(n){const{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(Xn.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(Qn.create(t.doc,n.pos)):t.setSelection(Xn.create(t.doc,n.pos));else{const o=e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType,i=null==o?void 0:o.create();i&&(t.insert(r,i),t.setSelection(Xn.create(t.doc,r+1)))}t.scrollIntoView()}return!0})).run()}}},addInputRules(){return[rd({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),zp=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Vp=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Hp=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,_p=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Bp=Ic.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",Vl(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[nd({find:zp,type:this.type}),nd({find:Hp,type:this.type})]},addPasteRules(){return[bd({find:Vp,type:this.type}),bd({find:_p,type:this.type})]}}),jp=Object.defineProperty,Fp="textStyle",qp=/^\s*([-+*])\s$/,Wp=vd.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",Vl(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>"list"!==e.type||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(Fp)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=id({find:qp,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=id({find:qp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Fp),editor:this.editor})),[e]}});function Up(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:"text",raw:e,text:e}])}var Kp=vd.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",Vl(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n;if("list_item"!==e.type)return[];const r=null!=(n=t.parseBlockChildren)?n:t.parseChildren;let o=[];if(e.tokens&&e.tokens.length>0){if(function(e){var t,n;const r=null==(t=e.tokens)?void 0:t[0];return Boolean(e.text&&1===(null==(n=e.tokens)?void 0:n.length)&&"list"===(null==r?void 0:r.type)&&r.ordered&&r.raw===e.text)}(e))return{type:"listItem",content:[{type:"paragraph",content:Up(e.text||"",t)}]};if(e.tokens.some((e=>"paragraph"===e.type)))o=r(e.tokens);else{const n=e.tokens[0];if(n&&"text"===n.type&&n.tokens&&n.tokens.length>0){if(o=[{type:"paragraph",content:t.parseInline(n.tokens)}],e.tokens.length>1){const t=r(e.tokens.slice(1));o.push(...t)}}else o=r(e.tokens)}}return 0===o.length&&(o=[{type:"paragraph",content:[]}]),{type:"listItem",content:o}},renderMarkdown:(e,t,n)=>gd(e,t,(e=>{var t,n;if("bulletList"===e.parentType)return"- ";if("orderedList"===e.parentType){return`${((null==(n=null==(t=e.meta)?void 0:t.parentAttrs)?void 0:n.start)||1)+e.index}. `}return"- "}),n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});((e,t)=>{for(var n in t)jp(e,n,{get:t[n],enumerable:!0})})({},{findListItemPos:()=>Zp,getNextListDepth:()=>Gp,handleBackspace:()=>Qp,handleDelete:()=>nf,hasListBefore:()=>Jp,hasListItemAfter:()=>rf,hasListItemBefore:()=>Xp,listItemHasSubList:()=>Yp,nextListIsDeeper:()=>ef,nextListIsHigher:()=>tf});var Zp=(e,t)=>{const{$from:n}=t.selection,r=Ea(e,t.schema);let o=null,i=n.depth,s=n.pos,a=null;for(;i>0&&null===a;)o=n.node(i),o.type===r?a=i:(i-=1,s-=1);return null===a?null:{$pos:t.doc.resolve(s),depth:a}},Gp=(e,t)=>{const n=Zp(e,t);if(!n)return!1;const[,r]=((e,t,n,r=20)=>{const o=e.doc.resolve(n);let i=r,s=null;for(;i>0&&null===s;){const e=o.node(i);(null==e?void 0:e.type.name)===t?s=e:i-=1}return[s,i]})(t,e,n.$pos.pos+4);return r},Jp=(e,t,n)=>{const{$anchor:r}=e.selection,o=Math.max(0,r.pos-2),i=e.doc.resolve(o).node();return!(!i||!n.includes(i.type.name))},Xp=(e,t)=>{var n;const{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-2);return 0!==o.index()&&(null==(n=o.nodeBefore)?void 0:n.type.name)===e},Yp=(e,t,n)=>{if(!n)return!1;const r=Ea(e,t.schema);let o=!1;return n.descendants((e=>{e.type===r&&(o=!0)})),o},Qp=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!dl(e.state,t)&&Jp(e.state,t,n)){const{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),o=[];r.node().descendants(((e,n)=>{e.type.name===t&&o.push({node:e,pos:n})}));const i=o.at(-1);if(!i)return!1;const s=e.state.doc.resolve(r.start()+i.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},s.end()).joinForward().run()}if(!dl(e.state,t))return!1;if(!(e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)})(e.state))return!1;const r=Zp(t,e.state);if(!r)return!1;const o=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),i=Yp(t,e.state,o);return Xp(t,e.state)&&!i?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},ef=(e,t)=>{const n=Gp(e,t),r=Zp(e,t);return!(!r||!n)&&n>r.depth},tf=(e,t)=>{const n=Gp(e,t),r=Zp(e,t);return!(!r||!n)&&n<r.depth},nf=(e,t)=>{if(!dl(e.state,t))return!1;if(!((e,t)=>{const{$from:n,$to:r,$anchor:o}=e.selection;if(t){const n=Ol((e=>e.type.name===t))(e.selection);if(!n)return!1;const r=e.doc.resolve(n.pos+1);return o.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)})(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:o}=n;return!(!n.empty&&r.sameParent(o))&&(ef(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():tf(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},rf=(e,t)=>{var n;const{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-r.parentOffset-2);return o.index()!==o.parent.childCount-1&&(null==(n=o.nodeAfter)?void 0:n.type.name)===e},of=jc.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach((({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&nf(e,n)&&(t=!0)})),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach((({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&nf(e,n)&&(t=!0)})),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach((({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&Qp(e,n,r)&&(t=!0)})),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach((({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&Qp(e,n,r)&&(t=!0)})),t}}}}),sf=/^(\s*)(\d+)\.\s+(.*)$/,af=/^\s/;function lf(e){const t=[],n=[];let r=!1;return e.forEach((e=>{if(!r)return""===e.trim()||t.length>0&&function(e){const t=e.trimStart();return/^[-+*]\s+/.test(t)||/^\d+\.\s+/.test(t)||/^>\s?/.test(t)||/^```/.test(t)||/^~~~/.test(t)}(e)?(r=!0,void n.push(e)):void t.push(e);n.push(e)})),{paragraphLines:t,blockLines:n}}function cf(e,t,n){const r=[];let o=0;for(;o<e.length;){const i=e[o];if(i.indent===t){const{paragraphLines:s,blockLines:a}=lf(i.contentLines),l=s.join("\n").trim(),c=[];l&&c.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});const d=a.join("\n").trim();if(d){const e=n.blockTokens(d);c.push(...e)}let u=o+1;const h=[];for(;u<e.length&&e[u].indent>t;)h.push(e[u]),u+=1;if(h.length>0){const e=Math.min(...h.map((e=>e.indent))),t=cf(h,e,n);c.push({type:"list",ordered:!0,start:h[0].number,items:t,raw:h.map((e=>e.raw)).join("\n")})}r.push({type:"list_item",raw:i.raw,tokens:c}),o=u}else o+=1}return r}var df="textStyle",uf=/^(\d+)\.\s$/,hf=vd.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",Vl(this.options.HTMLAttributes,n),0]:["ol",Vl(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if("list"!==e.type||!e.ordered)return[];const n=e.start||1,r=e.items?function(e,t){return e.map((e=>{if("list_item"!==e.type)return t.parseChildren([e])[0];const n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach((e=>{if("paragraph"===e.type||"list"===e.type||"blockquote"===e.type||"code"===e.type)n.push(...t.parseChildren([e]));else if("text"===e.type&&e.tokens){const r=t.parseChildren([e]);n.push({type:"paragraph",content:r})}else{const r=t.parseChildren([e]);r.length>0&&n.push(...r)}})),{type:"listItem",content:n}}))}(e.items,t):[];return 1!==n?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),n=null==t?void 0:t.index;return void 0!==n?n:-1},tokenize:(e,t,n)=>{var r;const o=e.split("\n"),[i,s]=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const o=e[n],i=o.match(sf);if(!i)break;const[,s,a,l]=i,c=s.length,d=[l];let u=n+1;const h=[o];let p=!1;for(;u<e.length;){const t=e[u];if(t.match(sf))break;if(""===t.trim())h.push(t),d.push(""),p=!0,u+=1;else if(t.match(af))h.push(t),d.push(t.slice(c+2)),u+=1;else{if(p)break;h.push(t),d.push(t),u+=1}}t.push({indent:c,number:parseInt(a,10),content:d.join("\n").trim(),contentLines:d,raw:h.join("\n")}),r=u,n=u}return[t,r]}(o);if(0===i.length)return;const a=cf(i,0,n);if(0===a.length)return;return{type:"list",ordered:!0,start:(null==(r=i[0])?void 0:r.number)||1,items:a,raw:o.slice(0,s).join("\n")}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(df)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=id({find:uf,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=id({find:uf,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(df)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),pf=/^\s*(\[([( |x])?\])\s$/,ff=vd.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",Vl(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;return gd(e,t,`- [${(null==(n=e.attrs)?void 0:n.checked)?"x":" "}] `)},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=e=>{var t,n;a.ariaLabel=(null==(n=null==(t=this.options.a11y)?void 0:t.checkboxLabel)?void 0:n.call(t,e,a.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};c(e),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",(e=>e.preventDefault())),a.addEventListener("change",(t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked)return void(a.checked=!a.checked);const{checked:o}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus(void 0,{scrollIntoView:!1}).command((({tr:e})=>{const t=n();if("number"!=typeof t)return!1;const r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==r?void 0:r.attrs,checked:o}),!0})).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,o)||(a.checked=!a.checked))})),Object.entries(this.options.HTMLAttributes).forEach((([e,t])=>{o.setAttribute(e,t)})),o.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,i.append(a,s),o.append(i,l),Object.entries(t).forEach((([e,t])=>{o.setAttribute(e,t)}));let d=new Set(Object.keys(t));return{dom:o,contentDOM:l,update:e=>{if(e.type!==this.type)return!1;o.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,c(e);const t=Hl(e,r.extensionManager.attributes),n=new Set(Object.keys(t)),i=this.options.HTMLAttributes;return d.forEach((e=>{n.has(e)||(e in i?o.setAttribute(e,i[e]):o.removeAttribute(e))})),Object.entries(t).forEach((([e,t])=>{null==t?e in i?o.setAttribute(e,i[e]):o.removeAttribute(e):o.setAttribute(e,t)})),d=n,!0}}}},addInputRules(){return[id({find:pf,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),mf=vd.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",Vl(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=null==(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:t.index;return void 0!==n?n:-1},tokenize(e,t,n){const r=e=>{const t=md(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:"taskList",raw:t.raw,items:t.items}]:n.blockTokens(e)},o=md(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});jc.create({name:"listKit",addExtensions(){const e=[];return!1!==this.options.bulletList&&e.push(Wp.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(Kp.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(of.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(hf.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(ff.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(mf.configure(this.options.taskList)),e}});var gf="&nbsp;",vf=vd.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Vl(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(1===n.length&&"image"===n[0].type)return t.parseChildren([n[0]]);const r=t.parseInline(n);return!(1===n.length&&"text"===n[0].type&&(n[0].raw===gf||n[0].text===gf||" "===n[0].raw||" "===n[0].text))||1!==r.length||"text"!==r[0].type||r[0].text!==gf&&" "!==r[0].text?t.createNode("paragraph",void 0,r):t.createNode("paragraph",void 0,[])},renderMarkdown:(e,t,n)=>{var r,o;if(!e)return"";const i=Array.isArray(e.content)?e.content:[];if(0===i.length){const e=Array.isArray(null==(r=null==n?void 0:n.previousNode)?void 0:r.content)?n.previousNode.content:[];return"paragraph"===(null==(o=null==n?void 0:n.previousNode)?void 0:o.type)&&0===e.length?gf:""}return t.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),bf=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,yf=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,wf=Ic.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",Vl(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[nd({find:bf,type:this.type})]},addPasteRules(){return[bd({find:yf,type:this.type})]}}),Cf=vd.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),xf=Ic.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",Vl(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>`++${t.renderChildren(e)}++`,markdownTokenizer:{name:"underline",level:"inline",start:e=>e.indexOf("++"),tokenize(e,t,n){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;const o=r[2].trim();return{type:"underline",raw:r[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),kf=xf,$f=jc.create({name:"starterKit",addExtensions(){var e,t,n,r;const o=[];return!1!==this.options.bold&&o.push(Mp.configure(this.options.bold)),!1!==this.options.blockquote&&o.push(Cp.configure(this.options.blockquote)),!1!==this.options.bulletList&&o.push(Wp.configure(this.options.bulletList)),!1!==this.options.code&&o.push(Op.configure(this.options.code)),!1!==this.options.codeBlock&&o.push(Rp.configure(this.options.codeBlock)),!1!==this.options.document&&o.push(Np.configure(this.options.document)),!1!==this.options.dropcursor&&o.push(Jh.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&o.push(Xh.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&o.push(Dp.configure(this.options.hardBreak)),!1!==this.options.heading&&o.push(Pp.configure(this.options.heading)),!1!==this.options.undoRedo&&o.push(sp.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&o.push(Ip.configure(this.options.horizontalRule)),!1!==this.options.italic&&o.push(Bp.configure(this.options.italic)),!1!==this.options.listItem&&o.push(Kp.configure(this.options.listItem)),!1!==this.options.listKeymap&&o.push(of.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&o.push(yh.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&o.push(hf.configure(this.options.orderedList)),!1!==this.options.paragraph&&o.push(vf.configure(this.options.paragraph)),!1!==this.options.strike&&o.push(wf.configure(this.options.strike)),!1!==this.options.text&&o.push(Cf.configure(this.options.text)),!1!==this.options.underline&&o.push(xf.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&o.push(ip.configure(null==(r=this.options)?void 0:r.trailingNode)),o}}),Sf=$f;function Mf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ef,Tf={exports:{}},Of={};var Lf,Af,Rf={};
2
2
  /**
3
3
  * @license React
4
4
  * use-sync-external-store-shim.development.js
@@ -7,7 +7,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */function Rf(){return Af||(Af=1,"production"===process.env.NODE_ENV?Tf.exports=function(){if(Mf)return Of;Mf=1;var e=ne,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function s(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(e){return!0}}var a="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var a=t(),l=n({inst:{value:a,getSnapshot:t}}),c=l[0].inst,d=l[1];return o((function(){c.value=a,c.getSnapshot=t,s(c)&&d({inst:c})}),[e,a,t]),r((function(){return s(c)&&d({inst:c}),e((function(){s(c)&&d({inst:c})}))}),[e]),i(a),a};return Of.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:a,Of}():Tf.exports=(Lf||(Lf=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=ne,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue,a=!1,l=!1,c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(c,d){a||void 0===t.startTransition||(a=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var u=d();if(!l){var h=d();n(u,h)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}var p=(h=r({inst:{value:u,getSnapshot:d}}))[0].inst,f=h[1];return i((function(){p.value=u,p.getSnapshot=d,e(p)&&f({inst:p})}),[c,u,d]),o((function(){return e(p)&&f({inst:p}),c((function(){e(p)&&f({inst:p})}))}),[c]),s(u),u};Nf.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:c,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Nf)),Tf.exports}var Df=Rf();const{getOwnPropertyNames:Pf,getOwnPropertySymbols:If}=Object,{hasOwnProperty:zf}=Object.prototype;function Vf(e,t){return function(n,r,o){return e(n,r,o)&&t(n,r,o)}}function Hf(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);const{cache:o}=r,i=o.get(t),s=o.get(n);if(i&&s)return i===n&&s===t;o.set(t,n),o.set(n,t);const a=e(t,n,r);return o.delete(t),o.delete(n),a}}function _f(e){return Pf(e).concat(If(e))}const Bf=Object.hasOwn||((e,t)=>zf.call(e,t));function jf(e,t){return e===t||!e&&!t&&e!=e&&t!=t}const{getOwnPropertyDescriptor:Ff,keys:qf}=Object;function Wf(e,t){return e.byteLength===t.byteLength&&om(new Uint8Array(e),new Uint8Array(t))}function Uf(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Kf(e,t){return e.byteLength===t.byteLength&&om(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Zf(e,t){return jf(e.getTime(),t.getTime())}function Gf(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Jf(e,t){return e===t}function Xf(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const o=new Array(r),i=e.entries();let s,a,l=0;for(;(s=i.next())&&!s.done;){const r=t.entries();let i=!1,c=0;for(;(a=r.next())&&!a.done;){if(o[c]){c++;continue}const r=s.value,d=a.value;if(n.equals(r[0],d[0],l,c,e,t,n)&&n.equals(r[1],d[1],r[0],d[0],e,t,n)){i=o[c]=!0;break}c++}if(!i)return!1;l++}return!0}const Yf=jf;function Qf(e,t,n){const r=qf(e);let o=r.length;if(qf(t).length!==o)return!1;for(;o-- >0;)if(!sm(e,t,n,r[o]))return!1;return!0}function em(e,t,n){const r=_f(e);let o,i,s,a=r.length;if(_f(t).length!==a)return!1;for(;a-- >0;){if(o=r[a],!sm(e,t,n,o))return!1;if(i=Ff(e,o),s=Ff(t,o),(i||s)&&(!i||!s||i.configurable!==s.configurable||i.enumerable!==s.enumerable||i.writable!==s.writable))return!1}return!0}function tm(e,t){return jf(e.valueOf(),t.valueOf())}function nm(e,t){return e.source===t.source&&e.flags===t.flags}function rm(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const o=new Array(r),i=e.values();let s,a;for(;(s=i.next())&&!s.done;){const r=t.values();let i=!1,l=0;for(;(a=r.next())&&!a.done;){if(!o[l]&&n.equals(s.value,a.value,s.value,a.value,e,t,n)){i=o[l]=!0;break}l++}if(!i)return!1}return!0}function om(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function im(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function sm(e,t,n,r){return!("_owner"!==r&&"__o"!==r&&"__v"!==r||!e.$$typeof&&!t.$$typeof)||Bf(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const am={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},lm=Object.prototype.toString;function cm({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:o,areFunctionsEqual:i,areMapsEqual:s,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:d,areSetsEqual:u,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,v){if(m===g)return!0;if(null==m||null==g)return!1;const b=typeof m;if(b!==typeof g)return!1;if("object"!==b)return"number"===b?a(m,g,v):"function"===b&&i(m,g,v);const y=m.constructor;if(y!==g.constructor)return!1;if(y===Object)return l(m,g,v);if(Array.isArray(m))return t(m,g,v);if(y===Date)return r(m,g,v);if(y===RegExp)return d(m,g,v);if(y===Map)return s(m,g,v);if(y===Set)return u(m,g,v);const w=lm.call(m);if("[object Date]"===w)return r(m,g,v);if("[object RegExp]"===w)return d(m,g,v);if("[object Map]"===w)return s(m,g,v);if("[object Set]"===w)return u(m,g,v);if("[object Object]"===w)return"function"!=typeof m.then&&"function"!=typeof g.then&&l(m,g,v);if("[object URL]"===w)return p(m,g,v);if("[object Error]"===w)return o(m,g,v);if("[object Arguments]"===w)return l(m,g,v);if(am[w])return h(m,g,v);if("[object ArrayBuffer]"===w)return e(m,g,v);if("[object DataView]"===w)return n(m,g,v);if("[object Boolean]"===w||"[object Number]"===w||"[object String]"===w)return c(m,g,v);if(f){let e=f[w];if(!e){const t=null!=(C=m)?C[Symbol.toStringTag]:void 0;t&&(e=f[t])}if(e)return e(m,g,v)}var C;return!1}}const dm=um();function um(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:o=!1}=e,i=function({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Wf,areArraysEqual:n?em:Uf,areDataViewsEqual:Kf,areDatesEqual:Zf,areErrorsEqual:Gf,areFunctionsEqual:Jf,areMapsEqual:n?Vf(Xf,em):Xf,areNumbersEqual:Yf,areObjectsEqual:n?em:Qf,arePrimitiveWrappersEqual:tm,areRegExpsEqual:nm,areSetsEqual:n?Vf(rm,em):rm,areTypedArraysEqual:n?Vf(om,em):om,areUrlsEqual:im,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const e=Hf(r.areArraysEqual),t=Hf(r.areMapsEqual),n=Hf(r.areObjectsEqual),o=Hf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:o})}return r}(e),s=cm(i);var a;return function({circular:e,comparator:t,createState:n,equals:r,strict:o}){if(n)return function(i,s){const{cache:a=(e?new WeakMap:void 0),meta:l}=n();return t(i,s,{cache:a,equals:r,meta:l,strict:o})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:o})};const i={cache:void 0,equals:r,meta:void 0,strict:o};return function(e,n){return t(e,n,i)}}({circular:t,comparator:s,createState:r,equals:n?n(s):(a=s,function(e,t,n,r,o,i,s){return a(e,t,s)}),strict:o})}um({strict:!0}),um({circular:!0}),um({circular:!0,strict:!0}),um({createInternalComparator:()=>jf}),um({strict:!0,createInternalComparator:()=>jf}),um({circular:!0,createInternalComparator:()=>jf}),um({circular:!0,createInternalComparator:()=>jf,strict:!0});var hm,pm={exports:{}},fm={};var mm,gm,vm={};
10
+ */function Nf(){return Af||(Af=1,"production"===process.env.NODE_ENV?Tf.exports=function(){if(Ef)return Of;Ef=1;var e=ne,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function s(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(e){return!0}}var a="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var a=t(),l=n({inst:{value:a,getSnapshot:t}}),c=l[0].inst,d=l[1];return o((function(){c.value=a,c.getSnapshot=t,s(c)&&d({inst:c})}),[e,a,t]),r((function(){return s(c)&&d({inst:c}),e((function(){s(c)&&d({inst:c})}))}),[e]),i(a),a};return Of.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:a,Of}():Tf.exports=(Lf||(Lf=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=ne,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue,a=!1,l=!1,c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(c,d){a||void 0===t.startTransition||(a=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var u=d();if(!l){var h=d();n(u,h)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}var p=(h=r({inst:{value:u,getSnapshot:d}}))[0].inst,f=h[1];return i((function(){p.value=u,p.getSnapshot=d,e(p)&&f({inst:p})}),[c,u,d]),o((function(){return e(p)&&f({inst:p}),c((function(){e(p)&&f({inst:p})}))}),[c]),s(u),u};Rf.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:c,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Rf)),Tf.exports}var Df=Nf();const{getOwnPropertyNames:Pf,getOwnPropertySymbols:If}=Object,{hasOwnProperty:zf}=Object.prototype;function Vf(e,t){return function(n,r,o){return e(n,r,o)&&t(n,r,o)}}function Hf(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);const{cache:o}=r,i=o.get(t),s=o.get(n);if(i&&s)return i===n&&s===t;o.set(t,n),o.set(n,t);const a=e(t,n,r);return o.delete(t),o.delete(n),a}}function _f(e){return Pf(e).concat(If(e))}const Bf=Object.hasOwn||((e,t)=>zf.call(e,t));function jf(e,t){return e===t||!e&&!t&&e!=e&&t!=t}const{getOwnPropertyDescriptor:Ff,keys:qf}=Object;function Wf(e,t){return e.byteLength===t.byteLength&&om(new Uint8Array(e),new Uint8Array(t))}function Uf(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Kf(e,t){return e.byteLength===t.byteLength&&om(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Zf(e,t){return jf(e.getTime(),t.getTime())}function Gf(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Jf(e,t){return e===t}function Xf(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const o=new Array(r),i=e.entries();let s,a,l=0;for(;(s=i.next())&&!s.done;){const r=t.entries();let i=!1,c=0;for(;(a=r.next())&&!a.done;){if(o[c]){c++;continue}const r=s.value,d=a.value;if(n.equals(r[0],d[0],l,c,e,t,n)&&n.equals(r[1],d[1],r[0],d[0],e,t,n)){i=o[c]=!0;break}c++}if(!i)return!1;l++}return!0}const Yf=jf;function Qf(e,t,n){const r=qf(e);let o=r.length;if(qf(t).length!==o)return!1;for(;o-- >0;)if(!sm(e,t,n,r[o]))return!1;return!0}function em(e,t,n){const r=_f(e);let o,i,s,a=r.length;if(_f(t).length!==a)return!1;for(;a-- >0;){if(o=r[a],!sm(e,t,n,o))return!1;if(i=Ff(e,o),s=Ff(t,o),(i||s)&&(!i||!s||i.configurable!==s.configurable||i.enumerable!==s.enumerable||i.writable!==s.writable))return!1}return!0}function tm(e,t){return jf(e.valueOf(),t.valueOf())}function nm(e,t){return e.source===t.source&&e.flags===t.flags}function rm(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const o=new Array(r),i=e.values();let s,a;for(;(s=i.next())&&!s.done;){const r=t.values();let i=!1,l=0;for(;(a=r.next())&&!a.done;){if(!o[l]&&n.equals(s.value,a.value,s.value,a.value,e,t,n)){i=o[l]=!0;break}l++}if(!i)return!1}return!0}function om(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function im(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function sm(e,t,n,r){return!("_owner"!==r&&"__o"!==r&&"__v"!==r||!e.$$typeof&&!t.$$typeof)||Bf(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const am={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},lm=Object.prototype.toString;function cm({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:o,areFunctionsEqual:i,areMapsEqual:s,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:d,areSetsEqual:u,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:f}){return function(m,g,v){if(m===g)return!0;if(null==m||null==g)return!1;const b=typeof m;if(b!==typeof g)return!1;if("object"!==b)return"number"===b?a(m,g,v):"function"===b&&i(m,g,v);const y=m.constructor;if(y!==g.constructor)return!1;if(y===Object)return l(m,g,v);if(Array.isArray(m))return t(m,g,v);if(y===Date)return r(m,g,v);if(y===RegExp)return d(m,g,v);if(y===Map)return s(m,g,v);if(y===Set)return u(m,g,v);const w=lm.call(m);if("[object Date]"===w)return r(m,g,v);if("[object RegExp]"===w)return d(m,g,v);if("[object Map]"===w)return s(m,g,v);if("[object Set]"===w)return u(m,g,v);if("[object Object]"===w)return"function"!=typeof m.then&&"function"!=typeof g.then&&l(m,g,v);if("[object URL]"===w)return p(m,g,v);if("[object Error]"===w)return o(m,g,v);if("[object Arguments]"===w)return l(m,g,v);if(am[w])return h(m,g,v);if("[object ArrayBuffer]"===w)return e(m,g,v);if("[object DataView]"===w)return n(m,g,v);if("[object Boolean]"===w||"[object Number]"===w||"[object String]"===w)return c(m,g,v);if(f){let e=f[w];if(!e){const t=null!=(C=m)?C[Symbol.toStringTag]:void 0;t&&(e=f[t])}if(e)return e(m,g,v)}var C;return!1}}const dm=um();function um(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:o=!1}=e,i=function({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Wf,areArraysEqual:n?em:Uf,areDataViewsEqual:Kf,areDatesEqual:Zf,areErrorsEqual:Gf,areFunctionsEqual:Jf,areMapsEqual:n?Vf(Xf,em):Xf,areNumbersEqual:Yf,areObjectsEqual:n?em:Qf,arePrimitiveWrappersEqual:tm,areRegExpsEqual:nm,areSetsEqual:n?Vf(rm,em):rm,areTypedArraysEqual:n?Vf(om,em):om,areUrlsEqual:im,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const e=Hf(r.areArraysEqual),t=Hf(r.areMapsEqual),n=Hf(r.areObjectsEqual),o=Hf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:o})}return r}(e),s=cm(i);var a;return function({circular:e,comparator:t,createState:n,equals:r,strict:o}){if(n)return function(i,s){const{cache:a=(e?new WeakMap:void 0),meta:l}=n();return t(i,s,{cache:a,equals:r,meta:l,strict:o})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:o})};const i={cache:void 0,equals:r,meta:void 0,strict:o};return function(e,n){return t(e,n,i)}}({circular:t,comparator:s,createState:r,equals:n?n(s):(a=s,function(e,t,n,r,o,i,s){return a(e,t,s)}),strict:o})}um({strict:!0}),um({circular:!0}),um({circular:!0,strict:!0}),um({createInternalComparator:()=>jf}),um({strict:!0,createInternalComparator:()=>jf}),um({circular:!0,createInternalComparator:()=>jf}),um({circular:!0,createInternalComparator:()=>jf,strict:!0});var hm,pm={exports:{}},fm={};var mm,gm,vm={};
11
11
  /**
12
12
  * @license React
13
13
  * use-sync-external-store-shim/with-selector.development.js
@@ -16,7 +16,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var bm=(gm||(gm=1,"production"===process.env.NODE_ENV?pm.exports=function(){if(hm)return fm;hm=1;var e=ne,t=Rf(),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,s=e.useMemo,a=e.useDebugValue;return fm.useSyncExternalStoreWithSelector=function(e,t,l,c,d){var u=o(null);if(null===u.current){var h={hasValue:!1,value:null};u.current=h}else h=u.current;u=s((function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==d&&h.hasValue){var t=h.value;if(d(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var s=c(e);return void 0!==d&&d(t,s)?(r=e,t):(r=e,o=s)}var r,o,i=!1,s=void 0===l?null:l;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]}),[t,l,c,d]);var p=r(e,u[0],u[1]);return i((function(){h.hasValue=!0,h.value=p}),[p]),a(p),p},fm}():pm.exports=(mm||(mm=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=ne,t=Rf(),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,s=e.useMemo,a=e.useDebugValue;vm.useSyncExternalStoreWithSelector=function(e,t,l,c,d){var u=o(null);if(null===u.current){var h={hasValue:!1,value:null};u.current=h}else h=u.current;u=s((function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==d&&h.hasValue){var t=h.value;if(d(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var s=c(e);return void 0!==d&&d(t,s)?(r=e,t):(r=e,o=s)}var r,o,i=!1,s=void 0===l?null:l;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]}),[t,l,c,d]);var p=r(e,u[0],u[1]);return i((function(){h.hasValue=!0,h.value=p}),[p]),a(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),vm)),pm.exports),ym=(...e)=>t=>{e.forEach((e=>{"function"==typeof e?e(t):e&&(e.current=t)}))},wm=({contentComponent:e})=>{const t=Df.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return Y(ee,{children:Object.values(t)})};var Cm=class extends ne.Component{constructor(e){super(e),this.editorContentRef=ne.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&(null==(e=t.view.dom)?void 0:e.parentNode)){if(t.contentComponent)return;const e=this.editorContentRef.current;e.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:e}),t.contentComponent=function(){const e=new Set;let t={};return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>t,getServerSnapshot:()=>t,setRenderer(n,r){t={...t,[n]:xe.createPortal(r.reactElement,r.element,n)},e.forEach((e=>e()))},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach((e=>e()))}}}(),t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var e;const t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.parentNode))return;const n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return Q(ee,{children:[Y("div",{ref:ym(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&Y(wm,{contentComponent:e.contentComponent})]})}},xm=se(((e,t)=>{const n=ne.useMemo((()=>Math.floor(4294967295*Math.random()).toString()),[e.editor]);return ne.createElement(Cm,{key:n,innerRef:t,...e})})),km=ne.memo(xm),$m="undefined"!=typeof window?ue:de,Sm=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach((e=>e()))},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};var Em="production"!==process.env.NODE_ENV,Mm="undefined"==typeof window,Tm=Mm||Boolean("undefined"!=typeof window&&window.next),Om=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach((e=>e()))}getInitialEditor(){const e=this.options.current.immediatelyRender;let t=null==e||e;return Mm?(t&&Em&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),t=!1):Tm&&void 0===e&&(t=!1,Em&&console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")),t?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}};return new td(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every((n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every(((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])})):e[n]===t[n])))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=e);const t=this.previousDeps.length===e.length&&this.previousDeps.every(((t,n)=>t===e[n]));if(t)return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout((()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))}),1)}};function Lm(e={},t=[]){const n=ae(e);n.current=e;const[r]=le((()=>new Om(n))),o=Df.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return ce(o),de(r.onRender(t)),function(e){var t;const[n]=le((()=>new Sm(e.editor))),r=bm.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:dm);$m((()=>n.watch(e.editor)),[e.editor,n]),ce(r)}({editor:o,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),o}var Am=re({editor:null});Am.Consumer;var Nm=re({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});ne.forwardRef(((e,t)=>{const{onDragStart:n}=oe(Nm),r=e.as||"div";return Y(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})})),ne.createContext({markViewContentRef:()=>{}});var Rm=re({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Rm.displayName="TiptapContext";function Dm({editor:e,instance:t,children:n}){const r=null!=e?e:t;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const o=ie((()=>({editor:r})),[r]),i=ie((()=>({editor:r})),[r]);return Y(Am.Provider,{value:i,children:Y(Rm.Provider,{value:o,children:n})})}function Pm({...e}){const{editor:t}=oe(Rm);return Y(km,{editor:t,...e})}Dm.displayName="Tiptap",Pm.displayName="Tiptap.Content",Object.assign(Dm,{Content:Pm});const Im=te.createContext(null);function zm(){const e=te.useContext(Im);if(!e)throw new Error("useRichTextEditorContext must be used within a RichTextEditorRoot");return e}Im.displayName="RichTextEditorContext";const Vm={display:"flex",flexDirection:"column",borderStyle:"solid",borderWidth:je(100),borderColor:ze("neutral",300),borderRadius:Be(200),backgroundColor:ze("neutral",100),"& .ProseMirror":{outline:"none",minHeight:He(1600),padding:He(400),"& em, & i":{fontStyle:"italic"},"& ul, & ol":{paddingInlineStart:He(700),marginTop:He(300),marginBottom:He(300)},"& ul":{listStyleType:"disc"},"& ol":{listStyleType:"decimal"},"& a":{color:ze("primary",700),textDecoration:"underline",cursor:"pointer"},"& h1":{fontSize:Ve(900),lineHeight:_e(1100),fontWeight:700,color:ze("neutral",900)},"& h2":{fontSize:Ve(800),lineHeight:_e(1e3),fontWeight:700,color:ze("neutral",900)},"& h3":{fontSize:Ve(700),lineHeight:_e(900),fontWeight:700,color:ze("neutral",900)},"& blockquote":{marginInline:0,paddingInlineStart:He(400),borderInlineStart:`${je(300)} solid ${ze("neutral",500)}`,color:ze("neutral",700),fontStyle:"italic"},"& hr":{border:0,borderTop:`${je(100)} solid ${ze("neutral",400)}`,marginBlock:He(400)},"&:focus-visible":{boxShadow:`inset 0 0 0 ${je(200)} ${ze("primary",600)}`,borderRadius:Be(100)},"& p.is-editor-empty:first-of-type::before":{content:"attr(data-placeholder)",color:ze("neutral",500),pointerEvents:"none",float:"left",height:"0"}},"& .ProseMirror > * + *":{marginTop:He(300)},'& [data-rte-icon="true"]':{display:"inline-flex",color:ze("neutral",800)},"&[data-disabled] .ProseMirror":{pointerEvents:"none",opacity:.6,cursor:"not-allowed"}},Hm=e=>$e`
19
+ */var bm=(gm||(gm=1,"production"===process.env.NODE_ENV?pm.exports=function(){if(hm)return fm;hm=1;var e=ne,t=Nf(),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,s=e.useMemo,a=e.useDebugValue;return fm.useSyncExternalStoreWithSelector=function(e,t,l,c,d){var u=o(null);if(null===u.current){var h={hasValue:!1,value:null};u.current=h}else h=u.current;u=s((function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==d&&h.hasValue){var t=h.value;if(d(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var s=c(e);return void 0!==d&&d(t,s)?(r=e,t):(r=e,o=s)}var r,o,i=!1,s=void 0===l?null:l;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]}),[t,l,c,d]);var p=r(e,u[0],u[1]);return i((function(){h.hasValue=!0,h.value=p}),[p]),a(p),p},fm}():pm.exports=(mm||(mm=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=ne,t=Nf(),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useSyncExternalStore,o=e.useRef,i=e.useEffect,s=e.useMemo,a=e.useDebugValue;vm.useSyncExternalStoreWithSelector=function(e,t,l,c,d){var u=o(null);if(null===u.current){var h={hasValue:!1,value:null};u.current=h}else h=u.current;u=s((function(){function e(e){if(!i){if(i=!0,r=e,e=c(e),void 0!==d&&h.hasValue){var t=h.value;if(d(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var s=c(e);return void 0!==d&&d(t,s)?(r=e,t):(r=e,o=s)}var r,o,i=!1,s=void 0===l?null:l;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]}),[t,l,c,d]);var p=r(e,u[0],u[1]);return i((function(){h.hasValue=!0,h.value=p}),[p]),a(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),vm)),pm.exports),ym=(...e)=>t=>{e.forEach((e=>{"function"==typeof e?e(t):e&&(e.current=t)}))},wm=({contentComponent:e})=>{const t=Df.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return Y(ee,{children:Object.values(t)})};var Cm=class extends ne.Component{constructor(e){super(e),this.editorContentRef=ne.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&(null==(e=t.view.dom)?void 0:e.parentNode)){if(t.contentComponent)return;const e=this.editorContentRef.current;e.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:e}),t.contentComponent=function(){const e=new Set;let t={};return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>t,getServerSnapshot:()=>t,setRenderer(n,r){t={...t,[n]:xe.createPortal(r.reactElement,r.element,n)},e.forEach((e=>e()))},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach((e=>e()))}}}(),t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var e;const t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.parentNode))return;const n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return Q(ee,{children:[Y("div",{ref:ym(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&Y(wm,{contentComponent:e.contentComponent})]})}},xm=se(((e,t)=>{const n=ne.useMemo((()=>Math.floor(4294967295*Math.random()).toString()),[e.editor]);return ne.createElement(Cm,{key:n,innerRef:t,...e})})),km=ne.memo(xm),$m="undefined"!=typeof window?ue:de,Sm=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach((e=>e()))},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};var Mm="production"!==process.env.NODE_ENV,Em="undefined"==typeof window,Tm=Em||Boolean("undefined"!=typeof window&&window.next),Om=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach((e=>e()))}getInitialEditor(){const e=this.options.current.immediatelyRender;let t=null==e||e;return Em?(t&&Mm&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),t=!1):Tm&&void 0===e&&(t=!1,Mm&&console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")),t?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}};return new td(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every((n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every(((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])})):e[n]===t[n])))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=e);const t=this.previousDeps.length===e.length&&this.previousDeps.every(((t,n)=>t===e[n]));if(t)return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout((()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))}),1)}};function Lm(e={},t=[]){const n=ae(e);n.current=e;const[r]=le((()=>new Om(n))),o=Df.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return ce(o),de(r.onRender(t)),function(e){var t;const[n]=le((()=>new Sm(e.editor))),r=bm.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:dm);$m((()=>n.watch(e.editor)),[e.editor,n]),ce(r)}({editor:o,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),o}var Am=re({editor:null});Am.Consumer;var Rm=re({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});ne.forwardRef(((e,t)=>{const{onDragStart:n}=oe(Rm),r=e.as||"div";return Y(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})})),ne.createContext({markViewContentRef:()=>{}});var Nm=re({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});Nm.displayName="TiptapContext";function Dm({editor:e,instance:t,children:n}){const r=null!=e?e:t;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const o=ie((()=>({editor:r})),[r]),i=ie((()=>({editor:r})),[r]);return Y(Am.Provider,{value:i,children:Y(Nm.Provider,{value:o,children:n})})}function Pm({...e}){const{editor:t}=oe(Nm);return Y(km,{editor:t,...e})}Dm.displayName="Tiptap",Pm.displayName="Tiptap.Content",Object.assign(Dm,{Content:Pm});const Im=te.createContext(null);function zm(){const e=te.useContext(Im);if(!e)throw new Error("useRichTextEditorContext must be used within a RichTextEditorRoot");return e}Im.displayName="RichTextEditorContext";const Vm={display:"flex",flexDirection:"column",borderStyle:"solid",borderWidth:je(100),borderColor:ze("neutral",300),borderRadius:Be(200),backgroundColor:ze("neutral",100),"& .ProseMirror":{outline:"none",minHeight:He(1600),padding:He(400),"& em, & i":{fontStyle:"italic"},"& ul, & ol":{paddingInlineStart:He(700),marginTop:He(300),marginBottom:He(300)},"& ul":{listStyleType:"disc"},"& ol":{listStyleType:"decimal"},"& a":{color:ze("primary",700),textDecoration:"underline",cursor:"pointer"},"& h1":{fontSize:Ve(900),lineHeight:_e(1100),fontWeight:700,color:ze("neutral",900)},"& h2":{fontSize:Ve(800),lineHeight:_e(1e3),fontWeight:700,color:ze("neutral",900)},"& h3":{fontSize:Ve(700),lineHeight:_e(900),fontWeight:700,color:ze("neutral",900)},"& blockquote":{marginInline:0,paddingInlineStart:He(400),borderInlineStart:`${je(300)} solid ${ze("neutral",500)}`,color:ze("neutral",700),fontStyle:"italic"},"& hr":{border:0,borderTop:`${je(100)} solid ${ze("neutral",400)}`,marginBlock:He(400)},"&:focus-visible":{boxShadow:`inset 0 0 0 ${je(200)} ${ze("primary",600)}`,borderRadius:Be(100)},"& p.is-editor-empty:first-of-type::before":{content:"attr(data-placeholder)",color:ze("neutral",500),pointerEvents:"none",float:"left",height:"0"}},"& .ProseMirror > * + *":{marginTop:He(300)},'& [data-rte-icon="true"]':{display:"inline-flex",color:ze("neutral",800)},"&[data-disabled] .ProseMirror":{pointerEvents:"none",opacity:.6,cursor:"not-allowed"}},Hm=e=>$e`
20
20
  width: auto;
21
21
  height: ${He("small"===e?700:1e3)};
22
22
  font-size: ${Ve("small"===e?200:400)};
@@ -103,7 +103,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
103
103
  }
104
104
  }
105
105
  }
106
- `,Km=({icon:e,disabled:t,...r})=>ye(n,{css:Um,"aria-label":r["aria-label"],disabled:t,...r,children:e}),Zm=e=>Y(i,{...e,children:Q("svg",{viewBox:"0 0 16 17",children:[Q("g",{clipPath:"url(#clip0_1216_84)",children:[Y("path",{d:"M9.78791 8.03125H16V2.21875C16 1.27103 15.229 0.5 14.2812 0.5H7.1875V16.5H14.2812C15.229 16.5 16 15.729 16 14.7812V8.96875H9.78791L10.5502 9.73106C10.7333 9.91413 10.7333 10.2109 10.5502 10.394C10.3672 10.577 10.0704 10.577 9.88731 10.394L8.32481 8.83147C8.14175 8.64841 8.14175 8.35162 8.32481 8.16856L9.88731 6.60606C10.0704 6.423 10.3672 6.423 10.5502 6.60606C10.7333 6.78912 10.7333 7.08591 10.5502 7.26897L9.78791 8.03125Z",fill:"#4F4E4E"}),Y("path",{d:"M0 2.21875V14.7812C0 15.729 0.771031 16.5 1.71875 16.5H6.25V0.5H1.71875C0.771031 0.5 0 1.27103 0 2.21875ZM4.375 7.0625H1.875C1.61612 7.0625 1.40625 6.85262 1.40625 6.59375C1.40625 6.33488 1.61612 6.125 1.875 6.125H4.375C4.63387 6.125 4.84375 6.33488 4.84375 6.59375C4.84375 6.85262 4.63387 7.0625 4.375 7.0625ZM4.375 5.1875H1.875C1.61612 5.1875 1.40625 4.97762 1.40625 4.71875C1.40625 4.45988 1.61612 4.25 1.875 4.25H4.375C4.63387 4.25 4.84375 4.45988 4.84375 4.71875C4.84375 4.97762 4.63387 5.1875 4.375 5.1875ZM4.375 2.375C4.63387 2.375 4.84375 2.58488 4.84375 2.84375C4.84375 3.10262 4.63387 3.3125 4.375 3.3125H1.875C1.61612 3.3125 1.40625 3.10262 1.40625 2.84375C1.40625 2.58488 1.61612 2.375 1.875 2.375H4.375Z",fill:"#4F4E4E"})]}),Y("defs",{children:Y("clipPath",{id:"clip0_1216_84",children:Y("rect",{width:"16",height:"16",fill:"white",transform:"translate(0 0.5)"})})})]})}),Gm=e=>Y(i,{...e,children:Q("svg",{viewBox:"0 0 16 17",children:[Y("path",{d:"M0 2.21875V14.7812C0 15.729 0.771031 16.5 1.71875 16.5H6.25V0.5H1.71875C0.771031 0.5 0 1.27103 0 2.21875ZM4.375 7.0625H1.875C1.61612 7.0625 1.40625 6.85262 1.40625 6.59375C1.40625 6.33488 1.61612 6.125 1.875 6.125H4.375C4.63387 6.125 4.84375 6.33488 4.84375 6.59375C4.84375 6.85262 4.63387 7.0625 4.375 7.0625ZM4.375 5.1875H1.875C1.61612 5.1875 1.40625 4.97762 1.40625 4.71875C1.40625 4.45988 1.61612 4.25 1.875 4.25H4.375C4.63387 4.25 4.84375 4.45988 4.84375 4.71875C4.84375 4.97762 4.63387 5.1875 4.375 5.1875ZM4.375 2.375C4.63387 2.375 4.84375 2.58488 4.84375 2.84375C4.84375 3.10262 4.63387 3.3125 4.375 3.3125H1.875C1.61612 3.3125 1.40625 3.10262 1.40625 2.84375C1.40625 2.58488 1.61612 2.375 1.875 2.375H4.375Z",fill:"#4F4E4E"}),Y("path",{d:"M14.2812 0.5H7.1875V8.03125H12.4621L11.6998 7.26897C11.5168 7.08591 11.5168 6.78912 11.6998 6.60606C11.8829 6.423 12.1797 6.423 12.3627 6.60606L13.9252 8.16856C14.1083 8.35162 14.1083 8.64841 13.9252 8.83147L12.3627 10.394C12.1797 10.577 11.8829 10.577 11.6998 10.394C11.5168 10.2109 11.5168 9.91413 11.6998 9.73106L12.4621 8.96875H7.1875V16.5H14.2812C15.229 16.5 16 15.729 16 14.7812V2.21875C16 1.27103 15.229 0.5 14.2812 0.5Z",fill:"#4F4E4E"})]})}),Jm=e=>Y(i,{...e,children:Y("svg",{viewBox:"0 0 12 12",height:"12px",width:"12px",children:Y("path",{d:"M4.19632 10.4277L0 6.23139L1.04908 5.18231L4.19632 8.32955L10.9509 1.57495L12 2.62403L4.19632 10.4277Z",fill:"currentColor"})})}),Xm=e=>Y(i,{...e,children:Y("svg",{viewBox:"0 0 12 12",height:"12px",width:"12px",children:Y("path",{d:"M0 6.75V5.25H12V6.75H0Z",fill:"auto"})})}),Ym=e=>Y(i,{...e,children:Y("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M4.5 7.49997H5.5V4.49997H4.5V7.49997ZM5 3.49997C5.14167 3.49997 5.26042 3.45205 5.35625 3.35622C5.45208 3.26039 5.5 3.14164 5.5 2.99997C5.5 2.8583 5.45208 2.73955 5.35625 2.64372C5.26042 2.54789 5.14167 2.49997 5 2.49997C4.85833 2.49997 4.73958 2.54789 4.64375 2.64372C4.54792 2.73955 4.5 2.8583 4.5 2.99997C4.5 3.14164 4.54792 3.26039 4.64375 3.35622C4.73958 3.45205 4.85833 3.49997 5 3.49997ZM5 9.99997C4.30833 9.99997 3.65833 9.86872 3.05 9.60622C2.44167 9.34372 1.9125 8.98747 1.4625 8.53747C1.0125 8.08747 0.65625 7.5583 0.39375 6.94997C0.13125 6.34164 0 5.69164 0 4.99997C0 4.3083 0.13125 3.6583 0.39375 3.04997C0.65625 2.44164 1.0125 1.91247 1.4625 1.46247C1.9125 1.01247 2.44167 0.656219 3.05 0.393719C3.65833 0.131219 4.30833 -3.05176e-05 5 -3.05176e-05C5.69167 -3.05176e-05 6.34167 0.131219 6.95 0.393719C7.55833 0.656219 8.0875 1.01247 8.5375 1.46247C8.9875 1.91247 9.34375 2.44164 9.60625 3.04997C9.86875 3.6583 10 4.3083 10 4.99997C10 5.69164 9.86875 6.34164 9.60625 6.94997C9.34375 7.5583 8.9875 8.08747 8.5375 8.53747C8.0875 8.98747 7.55833 9.34372 6.95 9.60622C6.34167 9.86872 5.69167 9.99997 5 9.99997Z",fill:"currentColor"})})}),Qm=e=>Y(i,{...e,children:Y("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M8 13.3667L0 5.36667L1.86667 3.5L8 9.63333L14.1333 3.5L16 5.36667L8 13.3667Z",fill:"currentColor"})})}),eg=e=>Y(i,{...e,children:Y("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M5.37 0L13.37 8L5.37 16L3.50333 14.1333L9.63667 8L3.50333 1.86667L5.37 0Z",fill:"currentColor"})})}),tg=e=>Y(i,{...e,children:Y("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M1 10L0 9L4 5L0 1L1 0L5 4L9 0L10 1L6 5L10 9L9 10L5 6L1 10Z",fill:"currentColor"})})}),ng=e=>Y(i,{...e,children:Y("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M8 16C7.45 16 6.97917 15.8042 6.5875 15.4125C6.19583 15.0208 6 14.55 6 14C6 13.45 6.19583 12.9792 6.5875 12.5875C6.97917 12.1958 7.45 12 8 12C8.55 12 9.02083 12.1958 9.4125 12.5875C9.80417 12.9792 10 13.45 10 14C10 14.55 9.80417 15.0208 9.4125 15.4125C9.02083 15.8042 8.55 16 8 16ZM8 10C7.45 10 6.97917 9.80417 6.5875 9.4125C6.19583 9.02083 6 8.55 6 8C6 7.45 6.19583 6.97917 6.5875 6.5875C6.97917 6.19583 7.45 6 8 6C8.55 6 9.02083 6.19583 9.4125 6.5875C9.80417 6.97917 10 7.45 10 8C10 8.55 9.80417 9.02083 9.4125 9.4125C9.02083 9.80417 8.55 10 8 10ZM8 4C7.45 4 6.97917 3.80417 6.5875 3.4125C6.19583 3.02083 6 2.55 6 2C6 1.45 6.19583 0.979167 6.5875 0.5875C6.97917 0.195833 7.45 0 8 0C8.55 0 9.02083 0.195833 9.4125 0.5875C9.80417 0.979167 10 1.45 10 2C10 2.55 9.80417 3.02083 9.4125 3.4125C9.02083 3.80417 8.55 4 8 4Z",fill:"currentColor"})})}),rg=e=>Y(i,{...e,children:Y("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M5 6.95455C5.56818 6.95455 6.05114 6.75568 6.44886 6.35795C6.84659 5.96023 7.04545 5.47727 7.04545 4.90909C7.04545 4.34091 6.84659 3.85795 6.44886 3.46023C6.05114 3.0625 5.56818 2.86364 5 2.86364C4.43182 2.86364 3.94886 3.0625 3.55114 3.46023C3.15341 3.85795 2.95455 4.34091 2.95455 4.90909C2.95455 5.47727 3.15341 5.96023 3.55114 6.35795C3.94886 6.75568 4.43182 6.95455 5 6.95455ZM5 6.13636C4.65909 6.13636 4.36932 6.01705 4.13068 5.77841C3.89205 5.53977 3.77273 5.25 3.77273 4.90909C3.77273 4.56818 3.89205 4.27841 4.13068 4.03977C4.36932 3.80114 4.65909 3.68182 5 3.68182C5.34091 3.68182 5.63068 3.80114 5.86932 4.03977C6.10795 4.27841 6.22727 4.56818 6.22727 4.90909C6.22727 5.25 6.10795 5.53977 5.86932 5.77841C5.63068 6.01705 5.34091 6.13636 5 6.13636ZM5 8.31818C3.89394 8.31818 2.88636 8.00947 1.97727 7.39205C1.06818 6.77462 0.409091 5.94697 0 4.90909C0.409091 3.87121 1.06818 3.04356 1.97727 2.42614C2.88636 1.80871 3.89394 1.5 5 1.5C6.10606 1.5 7.11364 1.80871 8.02273 2.42614C8.93182 3.04356 9.59091 3.87121 10 4.90909C9.59091 5.94697 8.93182 6.77462 8.02273 7.39205C7.11364 8.00947 6.10606 8.31818 5 8.31818Z",fill:"currentColor"})})}),og=e=>Y(i,{...e,children:Q("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("g",{clipPath:"url(#clip0_4626_1381)",children:Y("path",{d:"M8.54545 9.9375L6.63636 8.05114C6.37121 8.13447 6.10417 8.19697 5.83523 8.23864C5.56629 8.2803 5.28788 8.30114 5 8.30114C3.85606 8.30114 2.83712 7.98485 1.94318 7.35227C1.04924 6.7197 0.401515 5.89962 0 4.89205C0.159091 4.49053 0.359848 4.11742 0.602273 3.77273C0.844697 3.42803 1.12121 3.11932 1.43182 2.84659L0.181818 1.57386L0.818182 0.9375L9.18182 9.30114L8.54545 9.9375ZM5 6.9375C5.08333 6.9375 5.16098 6.93371 5.23295 6.92614C5.30492 6.91856 5.38258 6.90341 5.46591 6.88068L3.01136 4.42614C2.98864 4.50947 2.97348 4.58712 2.96591 4.65909C2.95833 4.73106 2.95455 4.80871 2.95455 4.89205C2.95455 5.46023 3.15341 5.94318 3.55114 6.34091C3.94886 6.73864 4.43182 6.9375 5 6.9375ZM8.31818 7.14205L6.875 5.71023C6.92803 5.58144 6.9697 5.45076 7 5.31818C7.0303 5.18561 7.04545 5.04356 7.04545 4.89205C7.04545 4.32386 6.84659 3.84091 6.44886 3.44318C6.05114 3.04545 5.56818 2.84659 5 2.84659C4.84848 2.84659 4.70644 2.86174 4.57386 2.89205C4.44129 2.92235 4.31061 2.9678 4.18182 3.02841L3.02273 1.86932C3.33333 1.74053 3.65152 1.64394 3.97727 1.57955C4.30303 1.51515 4.64394 1.48295 5 1.48295C6.14394 1.48295 7.16288 1.79924 8.05682 2.43182C8.95076 3.06439 9.59848 3.88447 10 4.89205C9.82576 5.33902 9.59659 5.75379 9.3125 6.13636C9.02841 6.51894 8.69697 6.85417 8.31818 7.14205ZM6.21591 5.05114L4.85227 3.6875C5.06439 3.64962 5.25947 3.66667 5.4375 3.73864C5.61553 3.81061 5.76894 3.91477 5.89773 4.05114C6.02652 4.1875 6.11932 4.3447 6.17614 4.52273C6.23295 4.70076 6.24621 4.87689 6.21591 5.05114Z",fill:"currentColor"})}),Y("defs",{children:Y("clipPath",{id:"clip0_4626_1381",children:Y("rect",{width:"10",height:"10",fill:"white"})})})]})}),ig=e=>Y(i,{...e,children:Q("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("g",{clipPath:"url(#clip0_4916_54426)",children:Y("path",{d:"M8.6 14.6L15.65 7.55L14.25 6.15L8.6 11.8L5.75 8.95L4.35 10.35L8.6 14.6ZM10 20C8.61667 20 7.31667 19.7375 6.1 19.2125C4.88333 18.6875 3.825 17.975 2.925 17.075C2.025 16.175 1.3125 15.1167 0.7875 13.9C0.2625 12.6833 0 11.3833 0 10C0 8.61667 0.2625 7.31667 0.7875 6.1C1.3125 4.88333 2.025 3.825 2.925 2.925C3.825 2.025 4.88333 1.3125 6.1 0.7875C7.31667 0.2625 8.61667 0 10 0C11.3833 0 12.6833 0.2625 13.9 0.7875C15.1167 1.3125 16.175 2.025 17.075 2.925C17.975 3.825 18.6875 4.88333 19.2125 6.1C19.7375 7.31667 20 8.61667 20 10C20 11.3833 19.7375 12.6833 19.2125 13.9C18.6875 15.1167 17.975 16.175 17.075 17.075C16.175 17.975 15.1167 18.6875 13.9 19.2125C12.6833 19.7375 11.3833 20 10 20Z",fill:"currentColor"})}),Y("defs",{children:Y("clipPath",{id:"clip0_4916_54426",children:Y("rect",{width:"20",height:"20",fill:"white"})})})]})}),sg=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M0 18.6477L10 1.375L20 18.6477H0ZM10 15.9205C10.2576 15.9205 10.4735 15.8333 10.6477 15.6591C10.822 15.4848 10.9091 15.2689 10.9091 15.0114C10.9091 14.7538 10.822 14.5379 10.6477 14.3636C10.4735 14.1894 10.2576 14.1023 10 14.1023C9.74242 14.1023 9.52652 14.1894 9.35227 14.3636C9.17803 14.5379 9.09091 14.7538 9.09091 15.0114C9.09091 15.2689 9.17803 15.4848 9.35227 15.6591C9.52652 15.8333 9.74242 15.9205 10 15.9205ZM9.09091 13.1932H10.9091V8.64773H9.09091V13.1932Z",fill:"currentColor"})})}),ag=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M10 15C10.2833 15 10.5208 14.9042 10.7125 14.7125C10.9042 14.5208 11 14.2833 11 14C11 13.7167 10.9042 13.4792 10.7125 13.2875C10.5208 13.0958 10.2833 13 10 13C9.71667 13 9.47917 13.0958 9.2875 13.2875C9.09583 13.4792 9 13.7167 9 14C9 14.2833 9.09583 14.5208 9.2875 14.7125C9.47917 14.9042 9.71667 15 10 15ZM9 11H11V5H9V11ZM10 20C8.61667 20 7.31667 19.7375 6.1 19.2125C4.88333 18.6875 3.825 17.975 2.925 17.075C2.025 16.175 1.3125 15.1167 0.7875 13.9C0.2625 12.6833 0 11.3833 0 10C0 8.61667 0.2625 7.31667 0.7875 6.1C1.3125 4.88333 2.025 3.825 2.925 2.925C3.825 2.025 4.88333 1.3125 6.1 0.7875C7.31667 0.2625 8.61667 0 10 0C11.3833 0 12.6833 0.2625 13.9 0.7875C15.1167 1.3125 16.175 2.025 17.075 2.925C17.975 3.825 18.6875 4.88333 19.2125 6.1C19.7375 7.31667 20 8.61667 20 10C20 11.3833 19.7375 12.6833 19.2125 13.9C18.6875 15.1167 17.975 16.175 17.075 17.075C16.175 17.975 15.1167 18.6875 13.9 19.2125C12.6833 19.7375 11.3833 20 10 20Z",fill:"currentColor"})})}),lg=e=>Y(i,{...e,children:Q("svg",{width:"91",height:"32",viewBox:"0 0 91 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.79733 2.62109L7.05688 4.36154L8.6964 6.00105L10.4368 4.26061L8.79733 2.62109",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.4348 17.7395L26.7261 24.0306L28.4666 22.2904L22.1753 15.999L20.4348 17.7395",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.83032 8.73722L8.57056 10.4775L15.5197 3.52853L17.9952 6.00428L19.7357 4.26384L15.5197 0.0478516L6.83032 8.73722",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.0828 8.74062L26.823 10.4811L28.4667 8.83761L26.7262 7.09717L25.0828 8.74062",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.05664 26.7665L8.79688 28.5069L15.088 22.216L13.3476 20.4756L7.05664 26.7665",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9583 17.865L17.6987 19.6052L24.2126 13.0913L22.4722 11.3511L15.9583 17.865",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.606 8.61475L27.5582 15.5672L25.086 18.0396L26.8264 19.7799L31.0391 15.5672L22.3462 6.87451L20.606 8.61475",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.58008 22.2898L4.32031 24.0302L5.95651 22.394L4.21607 20.6538L2.58008 22.2898",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9583 8.91145L17.6987 10.6517L23.99 4.36056L22.2496 2.62012L15.9583 8.91145",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 15.5676L8.69268 24.2603L10.4331 22.5198L3.48068 15.5676L5.96016 13.0881L4.21971 11.3477L0 15.5676",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.3071 8.61154L17.8244 15.1288L19.5646 13.3885L13.0474 6.87109L11.3071 8.61154",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.6091 26.8674L22.2493 28.5073L23.9897 26.7671L22.3496 25.127L20.6091 26.8674",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.58008 8.83789L8.87079 15.1286L10.6112 13.3884L4.32052 7.09766L2.58008 8.83789",fill:"#9B9B9B"}),Y("mask",{id:"mask0_2684_24177",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"11",y:"15",width:"14",height:"17",children:Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.3035 15.999H24.2159V31.0746H11.3035V15.999Z",fill:"white"})}),Q("g",{mask:"url(#mask0_2684_24177)",children:[Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4817 17.7395L17.9989 24.2567L19.7392 22.5163L13.2219 15.999L11.4817 17.7395",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5195 27.6061L13.0437 25.1303L11.3035 26.8706L15.5195 31.0868L24.2159 22.3903L22.4756 20.6499L15.5195 27.6061",fill:"#9B9B9B"})]}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.82666 18.0429L8.5669 19.7834L15.0881 13.2624L13.3476 11.522L6.82666 18.0429",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.8376 3.46878C39.7609 3.22403 39.6861 3.06362 39.5918 2.99958C39.5199 2.95005 39.386 2.93948 39.3278 2.93948C39.2598 2.93948 39.219 2.93264 39.219 2.87834C39.219 2.83171 39.2754 2.82031 39.3653 2.82031C39.7133 2.82031 40.0782 2.83648 40.1396 2.83648C40.1999 2.83648 40.4927 2.82031 40.8782 2.82031C40.9688 2.82031 41.0173 2.83648 41.0173 2.87834C41.0173 2.93264 40.9628 2.93948 40.8968 2.93948C40.8442 2.93948 40.7783 2.93948 40.7319 2.96373C40.6714 2.99191 40.6579 3.0373 40.6579 3.10921C40.6579 3.19853 40.724 3.42402 40.8055 3.721C40.9174 4.16202 41.5358 6.18037 41.656 6.55196H41.6755L42.9658 3.08496C43.0325 2.89616 43.0773 2.84497 43.1336 2.84497C43.2064 2.84497 43.2387 2.94632 43.3278 3.15999L44.7104 6.5043H44.7296C44.8482 6.05851 45.3823 4.30149 45.6173 3.52391C45.66 3.37138 45.6811 3.23169 45.6811 3.13615C45.6811 3.0315 45.6222 2.93948 45.3617 2.93948C45.2969 2.93948 45.2502 2.9171 45.2502 2.87834C45.2502 2.83171 45.3008 2.82031 45.4036 2.82031C45.7549 2.82031 46.034 2.83648 46.0939 2.83648C46.1395 2.83648 46.4268 2.82031 46.6462 2.82031C46.7184 2.82031 46.7658 2.83171 46.7658 2.87233C46.7658 2.9171 46.7351 2.93948 46.6744 2.93948C46.6067 2.93948 46.5142 2.94632 46.4407 2.97139C46.2796 3.0315 46.2092 3.29656 46.0657 3.67831C45.763 4.51578 45.0639 6.63155 44.7377 7.62964C44.6639 7.86258 44.6308 7.94279 44.5435 7.94279C44.4756 7.94279 44.4378 7.86258 44.3377 7.6141L42.9542 4.2818H42.9397C42.8143 4.62169 41.9279 6.97723 41.6423 7.58778C41.514 7.86258 41.4831 7.94279 41.4034 7.94279C41.3358 7.94279 41.3105 7.87025 41.2502 7.69575L39.8376 3.46878",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M52.4736 5.46052C52.4736 3.96919 51.6156 3.04363 50.5241 3.04363C49.7593 3.04363 48.8862 3.46848 48.8862 5.12686C48.8862 6.51167 49.6547 7.61007 50.9315 7.61007C51.3984 7.61007 52.4736 7.38417 52.4736 5.46052ZM47.9695 5.33425C47.9695 4.19523 48.7201 2.72607 50.7182 2.72607C52.3747 2.72607 53.4068 3.68811 53.4068 5.21384C53.4068 6.73834 52.3397 7.94243 50.6521 7.94243C48.7413 7.94243 47.9695 6.51161 47.9695 5.33425V5.33425Z",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M56.6253 5.27407C56.6253 5.34806 56.6388 5.37251 56.685 5.39469C56.8222 5.44111 57.0255 5.46059 57.1911 5.46059C57.4551 5.46059 57.5428 5.43261 57.6644 5.34806C57.8634 5.20029 58.0557 4.89253 58.0557 4.34561C58.0557 3.40327 57.4331 3.13178 57.0371 3.13178C56.8709 3.13178 56.7515 3.13593 56.685 3.15976C56.6388 3.17219 56.6253 3.19831 56.6253 3.25115V5.27407ZM55.8409 4.74893C55.8409 3.73799 55.8409 3.5494 55.8277 3.33842C55.8144 3.10921 55.7609 3.00435 55.5421 2.95689C55.4865 2.94632 55.3769 2.93948 55.2814 2.93948C55.208 2.93948 55.1667 2.92352 55.1667 2.87834C55.1667 2.83171 55.2146 2.82031 55.3122 2.82031C55.6681 2.82031 56.0873 2.83648 56.2272 2.83648C56.4521 2.83648 56.9576 2.82031 57.1633 2.82031C57.5836 2.82031 58.0313 2.86052 58.3884 3.10465C58.5765 3.23169 58.841 3.5724 58.841 4.01632C58.841 4.50957 58.6354 4.95825 57.9633 5.50455C58.5554 6.25187 59.014 6.84501 59.4066 7.25598C59.7788 7.64145 60.0519 7.68767 60.1537 7.70984C60.225 7.72373 60.2867 7.72891 60.3379 7.72891C60.3924 7.72891 60.4187 7.75233 60.4187 7.78404C60.4187 7.83357 60.3732 7.8489 60.2913 7.8489H59.6602C59.2866 7.8489 59.1197 7.81429 58.9498 7.72373C58.6626 7.56974 58.4076 7.25598 58.0369 6.74512C57.7708 6.37705 57.4665 5.92671 57.3766 5.82371C57.3461 5.78785 57.3051 5.78018 57.2585 5.78018L56.6788 5.76485C56.6469 5.76485 56.6253 5.78018 56.6253 5.8179V5.91344C56.6253 6.53145 56.6253 7.05661 56.6585 7.3368C56.6788 7.52871 56.7165 7.6773 56.9194 7.70155C57.0195 7.71751 57.1633 7.72891 57.2429 7.72891C57.297 7.72891 57.3264 7.75233 57.3264 7.78404C57.3264 7.82984 57.279 7.8489 57.1911 7.8489C56.8056 7.8489 56.3132 7.82984 56.2142 7.82984C56.0873 7.82984 55.6681 7.8489 55.4016 7.8489C55.3122 7.8489 55.2681 7.82984 55.2681 7.78404C55.2681 7.75233 55.2944 7.72891 55.3769 7.72891C55.4751 7.72891 55.5543 7.71751 55.6142 7.70155C55.7466 7.6773 55.7808 7.52871 55.8071 7.3368C55.8409 7.05661 55.8409 6.53145 55.8409 5.92028V4.74893V4.74893Z",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M62.7401 5.92028C62.7401 6.76978 62.7401 7.22986 62.8795 7.34944C62.9923 7.45099 63.167 7.49804 63.6837 7.49804C64.037 7.49804 64.2973 7.48913 64.4635 7.30945C64.5458 7.22385 64.6235 7.03567 64.6351 6.91236C64.6426 6.85164 64.6544 6.8104 64.7079 6.8104C64.7576 6.8104 64.7636 6.84501 64.7636 6.92273C64.7636 6.99858 64.7159 7.49804 64.6633 7.68767C64.6235 7.83357 64.5885 7.87025 64.2426 7.87025C63.7651 7.87025 63.4198 7.85491 63.1195 7.8489C62.8194 7.83357 62.5805 7.82984 62.3067 7.82984C62.2352 7.82984 62.0852 7.82984 61.9272 7.83357C61.7749 7.83357 61.6029 7.8489 61.4709 7.8489C61.3832 7.8489 61.3349 7.82984 61.3349 7.78404C61.3349 7.75233 61.365 7.72891 61.4413 7.72891C61.543 7.72891 61.6216 7.71751 61.6819 7.70155C61.8176 7.6773 61.8487 7.52871 61.874 7.3368C61.9082 7.05661 61.9082 6.53145 61.9082 5.92028V4.74893C61.9082 3.73799 61.9082 3.5494 61.8951 3.33842C61.8817 3.10921 61.8269 3.00435 61.6095 2.95689C61.5577 2.94632 61.474 2.93948 61.3886 2.93948C61.3155 2.93948 61.2759 2.92352 61.2759 2.87834C61.2759 2.83171 61.3233 2.82031 61.4214 2.82031C61.7353 2.82031 62.1536 2.83648 62.3341 2.83648C62.4939 2.83648 62.9803 2.82031 63.2387 2.82031C63.3324 2.82031 63.38 2.83171 63.38 2.87834C63.38 2.92352 63.339 2.93948 63.2588 2.93948C63.1867 2.93948 63.0816 2.94632 62.9991 2.95689C62.8194 2.99191 62.7647 3.10465 62.7533 3.33842C62.7401 3.5494 62.7401 3.73799 62.7401 4.74893V5.92028",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.8097 5.48049C67.8097 6.18388 67.8141 6.6966 67.8234 6.82509C67.8294 6.99068 67.8447 7.25575 67.8978 7.33056C67.9832 7.45595 68.2426 7.59501 68.7672 7.59501C69.4469 7.59501 69.9002 7.46237 70.2973 7.11627C70.7267 6.74903 70.8568 6.14512 70.8568 5.46059C70.8568 4.61607 70.5043 4.06832 70.22 3.79517C69.6061 3.21012 68.8478 3.13178 68.3284 3.13178C68.1954 3.13178 67.9498 3.1496 67.8978 3.17696C67.8375 3.20432 67.8141 3.23706 67.8141 3.30918C67.8097 3.53819 67.8097 4.11682 67.8097 4.64343V5.48049ZM66.9788 4.74893C66.9788 3.73799 66.9788 3.5494 66.9632 3.33842C66.95 3.10921 66.8969 3.00435 66.6779 2.95689C66.6254 2.94632 66.5114 2.93948 66.4196 2.93948C66.3438 2.93948 66.3042 2.92352 66.3042 2.87834C66.3042 2.83171 66.3531 2.82031 66.4509 2.82031C66.8041 2.82031 67.2215 2.83648 67.4096 2.83648C67.6156 2.83648 68.0355 2.82031 68.4355 2.82031C69.267 2.82031 70.3786 2.82031 71.1044 3.57676C71.4374 3.92389 71.7481 4.47661 71.7481 5.26622C71.7481 6.10556 71.3968 6.74512 71.0236 7.125C70.7169 7.43669 70.0257 7.90942 68.7953 7.90942C68.5559 7.90942 68.2817 7.88911 68.0297 7.87025C67.7761 7.8489 67.5417 7.82984 67.379 7.82984C67.3042 7.82984 67.1574 7.82984 66.9964 7.83357C66.8441 7.83357 66.6721 7.8489 66.5373 7.8489C66.4509 7.8489 66.407 7.82984 66.407 7.78404C66.407 7.75233 66.4335 7.72891 66.5114 7.72891C66.612 7.72891 66.6932 7.71751 66.7518 7.70155C66.8855 7.6773 66.9187 7.52871 66.9456 7.3368C66.9788 7.05661 66.9788 6.53145 66.9788 5.92028V4.74893V4.74893Z",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M41.2173 16.0733C41.2173 16.1481 41.231 16.1755 41.2755 16.1948C41.4152 16.241 41.6173 16.2607 41.7812 16.2607C42.0492 16.2607 42.1356 16.2333 42.2543 16.1481C42.456 16.0002 42.6456 15.6964 42.6456 15.1501C42.6456 14.2044 42.022 13.9325 41.6299 13.9325C41.4637 13.9325 41.3425 13.9385 41.2755 13.9582C41.231 13.9727 41.2173 13.9965 41.2173 14.0508V16.0733ZM40.4308 15.5499C40.4308 14.5375 40.4308 14.3499 40.419 14.1383C40.4055 13.9131 40.3531 13.8053 40.1297 13.7597C40.0783 13.746 39.966 13.7406 39.8735 13.7406C39.8016 13.7406 39.761 13.727 39.761 13.6772C39.761 13.6316 39.8055 13.6167 39.9083 13.6167C40.258 13.6167 40.6772 13.6397 40.8181 13.6397C41.0424 13.6397 41.5472 13.6167 41.757 13.6167C42.1733 13.6167 42.6222 13.6606 42.9812 13.9075C43.1658 14.0335 43.434 14.3723 43.434 14.8179C43.434 15.3084 43.2251 15.7621 42.5542 16.3086C43.1463 17.053 43.6056 17.6457 43.9979 18.0588C44.3697 18.4434 44.6426 18.4917 44.7425 18.5095C44.8176 18.5228 44.8756 18.5328 44.9299 18.5328C44.9804 18.5328 45.0097 18.5489 45.0097 18.5829C45.0097 18.6376 44.9628 18.6492 44.8837 18.6492H44.2503C43.8754 18.6492 43.7123 18.6171 43.5376 18.5228C43.2522 18.3697 42.9996 18.0588 42.627 17.5452C42.3611 17.1811 42.056 16.727 41.9688 16.6288C41.9358 16.5867 41.8937 16.5815 41.8463 16.5815L41.2714 16.5683C41.2376 16.5683 41.2173 16.5815 41.2173 16.6203V16.7152C41.2173 17.3328 41.2173 17.8571 41.2502 18.1375C41.2714 18.3294 41.3106 18.477 41.5097 18.5035C41.6096 18.5174 41.757 18.5328 41.8347 18.5328C41.8892 18.5328 41.9163 18.5489 41.9163 18.5829C41.9163 18.6287 41.8678 18.6492 41.7812 18.6492C41.3959 18.6492 40.9046 18.6287 40.8055 18.6287C40.6772 18.6287 40.258 18.6492 39.9937 18.6492C39.9083 18.6492 39.8582 18.6287 39.8582 18.5829C39.8582 18.5489 39.8862 18.5328 39.966 18.5328C40.0661 18.5328 40.1465 18.5174 40.2076 18.5035C40.3396 18.477 40.3734 18.3294 40.3999 18.1375C40.4308 17.8571 40.4308 17.3328 40.4308 16.7192V15.5499V15.5499Z",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.4986 15.5498C46.4986 14.5374 46.4986 14.3499 46.4862 14.1383C46.4737 13.913 46.419 13.8052 46.1998 13.7596C46.1463 13.7459 46.0306 13.7406 45.9419 13.7406C45.8675 13.7406 45.8257 13.7269 45.8257 13.6771C45.8257 13.6315 45.8736 13.6166 45.9734 13.6166C46.1531 13.6166 46.3475 13.6247 46.5142 13.6247C46.6849 13.6315 46.8387 13.6396 46.932 13.6396C47.1456 13.6396 48.4681 13.6396 48.5961 13.6315C48.7201 13.6166 48.827 13.6054 48.8813 13.5928C48.914 13.5868 48.9553 13.5654 48.9864 13.5654C49.0191 13.5654 49.0272 13.5928 49.0272 13.6247C49.0272 13.6722 48.9959 13.7528 48.9727 14.0589C48.9686 14.1248 48.9553 14.4201 48.9414 14.4964C48.9352 14.5306 48.9199 14.5695 48.8736 14.5695C48.827 14.5695 48.8144 14.5374 48.8144 14.4781C48.8144 14.4315 48.8096 14.3167 48.7762 14.239C48.7275 14.1186 48.662 14.0375 48.3282 13.9965C48.2154 13.9836 47.5162 13.9727 47.384 13.9727C47.35 13.9727 47.3377 13.9905 47.3377 14.0375V15.7226C47.3377 15.7684 47.3454 15.7946 47.384 15.7946C47.5299 15.7946 48.2969 15.7946 48.4484 15.7809C48.6098 15.7684 48.7085 15.7488 48.7667 15.6818C48.8144 15.6281 48.8405 15.5948 48.8736 15.5948C48.902 15.5948 48.9199 15.6085 48.9199 15.6491C48.9199 15.6887 48.8952 15.7946 48.8678 16.1344C48.8627 16.2665 48.8405 16.5336 48.8405 16.5815C48.8405 16.6333 48.8405 16.7056 48.7802 16.7056C48.7335 16.7056 48.7201 16.6799 48.7201 16.6474C48.7165 16.5815 48.7165 16.4955 48.695 16.4063C48.662 16.2745 48.5704 16.1755 48.3222 16.1481C48.1959 16.1344 47.5359 16.1268 47.3784 16.1268C47.3454 16.1268 47.3377 16.1541 47.3377 16.1947V16.7191C47.3377 16.9454 47.3301 17.5599 47.3377 17.753C47.35 18.2081 47.4559 18.3115 48.1344 18.3115C48.3085 18.3115 48.5881 18.3115 48.7617 18.233C48.9352 18.1499 49.0146 18.0135 49.0628 17.7385C49.0749 17.6627 49.0869 17.6376 49.1348 17.6376C49.188 17.6376 49.188 17.6923 49.188 17.7582C49.188 17.9118 49.1348 18.3648 49.1008 18.4968C49.0521 18.6697 48.9959 18.6697 48.7427 18.6697C48.2428 18.6697 47.8782 18.6545 47.5902 18.6491C47.3046 18.6375 47.0969 18.6286 46.898 18.6286C46.8246 18.6286 46.6785 18.6286 46.5181 18.6375C46.3656 18.6375 46.1938 18.6491 46.0597 18.6491C45.9734 18.6491 45.9239 18.6286 45.9239 18.5828C45.9239 18.5488 45.9542 18.5327 46.0306 18.5327C46.1314 18.5327 46.2132 18.5173 46.2735 18.5035C46.4064 18.4769 46.4379 18.3294 46.4657 18.1375C46.4986 17.8571 46.4986 17.3327 46.4986 16.7191V15.5498",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M51.3845 18.5715C51.2755 18.5227 51.2566 18.4917 51.2566 18.3445C51.2566 17.9771 51.2813 17.579 51.2875 17.4735C51.2951 17.3723 51.3163 17.3017 51.3685 17.3017C51.429 17.3017 51.435 17.3607 51.435 17.4134C51.435 17.4979 51.463 17.6376 51.4951 17.753C51.6408 18.2448 52.0348 18.4243 52.4487 18.4243C53.0447 18.4243 53.3388 18.016 53.3388 17.6627C53.3388 17.3373 53.2368 17.0335 52.6864 16.6006L52.3805 16.3597C51.6485 15.7888 51.3959 15.3208 51.3959 14.7843C51.3959 14.0508 52.0079 13.5244 52.9342 13.5244C53.3649 13.5244 53.6447 13.5928 53.8181 13.6396C53.8789 13.655 53.9126 13.6722 53.9126 13.719C53.9126 13.8052 53.883 13.9965 53.883 14.5173C53.883 14.6647 53.8625 14.7171 53.8113 14.7171C53.7628 14.7171 53.7439 14.6771 53.7439 14.5986C53.7439 14.5374 53.7129 14.3304 53.5723 14.158C53.4708 14.0334 53.2795 13.8326 52.8445 13.8326C52.3531 13.8326 52.0545 14.1186 52.0545 14.5173C52.0545 14.8247 52.2099 15.0547 52.7614 15.4773L52.9454 15.6161C53.7533 16.2211 54.0368 16.6799 54.0368 17.3135C54.0368 17.6975 53.8913 18.1594 53.4136 18.4703C53.0816 18.6819 52.7088 18.7449 52.3531 18.7449C51.9691 18.7449 51.6698 18.6966 51.3845 18.5715",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.4449 16.2609C60.4449 14.7716 59.5867 13.8452 58.4976 13.8452C57.731 13.8452 56.8585 14.2726 56.8585 15.9289C56.8585 17.3137 57.6253 18.4106 58.9013 18.4106C59.3691 18.4106 60.4449 18.1835 60.4449 16.2609ZM55.9399 16.1345C55.9399 14.9975 56.6912 13.5244 58.689 13.5244C60.3437 13.5244 61.3787 14.4918 61.3787 16.0161C61.3787 17.5404 60.3116 18.7449 58.6225 18.7449C56.713 18.7449 55.9399 17.3135 55.9399 16.1345V16.1345Z",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M63.5918 15.5499C63.5918 14.5375 63.5918 14.3499 63.579 14.1383C63.5653 13.9131 63.5118 13.8053 63.2915 13.7597C63.2387 13.746 63.1243 13.7406 63.0314 13.7406C62.9575 13.7406 62.9187 13.727 62.9187 13.6772C62.9187 13.6316 62.9649 13.6167 63.0661 13.6167C63.4175 13.6167 63.8366 13.6397 64.037 13.6397C64.1955 13.6397 64.6175 13.6167 64.8544 13.6167C64.9557 13.6167 65.0017 13.6316 65.0017 13.6772C65.0017 13.727 64.9615 13.7406 64.8956 13.7406C64.8216 13.7406 64.781 13.746 64.7012 13.7597C64.5207 13.791 64.4712 13.9075 64.4554 14.1383C64.4438 14.3499 64.4438 14.5375 64.4438 15.5499V16.481C64.4438 17.4441 64.6351 17.8515 64.9615 18.1189C65.2608 18.3649 65.5685 18.3908 65.7924 18.3908C66.086 18.3908 66.4466 18.2979 66.7125 18.0314C67.0781 17.6627 67.0972 17.0661 67.0972 16.3803V15.5499C67.0972 14.5375 67.0972 14.3499 67.0858 14.1383C67.0721 13.9131 67.018 13.8053 66.7992 13.7597C66.7459 13.746 66.6332 13.7406 66.5573 13.7406C66.4858 13.7406 66.4466 13.727 66.4466 13.6772C66.4466 13.6316 66.491 13.6167 66.5876 13.6167C66.9237 13.6167 67.3417 13.6397 67.3417 13.6397C67.4323 13.6397 67.8491 13.6167 68.1089 13.6167C68.2041 13.6167 68.2476 13.6316 68.2476 13.6772C68.2476 13.727 68.2097 13.7406 68.1282 13.7406C68.0561 13.7406 68.0138 13.746 67.9382 13.7597C67.7572 13.791 67.7013 13.9075 67.6893 14.1383C67.6762 14.3499 67.6762 14.5375 67.6762 15.5499V16.2607C67.6762 17.0006 67.6045 17.7832 67.0431 18.2627C66.5718 18.6697 66.0937 18.745 65.6583 18.745C65.3091 18.745 64.6681 18.723 64.1835 18.2826C63.8428 17.9771 63.5918 17.4851 63.5918 16.5212V15.5499",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M71.3762 16.0733C71.3762 16.1481 71.3888 16.1755 71.4361 16.1948C71.5762 16.241 71.7749 16.2607 71.942 16.2607C72.2083 16.2607 72.2937 16.2333 72.4141 16.1481C72.6143 16.0002 72.8066 15.6964 72.8066 15.1501C72.8066 14.2044 72.1809 13.9325 71.7886 13.9325C71.622 13.9325 71.5043 13.9385 71.4361 13.9582C71.3888 13.9727 71.3762 13.9965 71.3762 14.0508V16.0733ZM70.5907 15.5499C70.5907 14.5375 70.5907 14.3499 70.5772 14.1383C70.5634 13.9131 70.5117 13.8053 70.2917 13.7597C70.2361 13.746 70.1248 13.7406 70.0322 13.7406C69.9599 13.7406 69.9167 13.727 69.9167 13.6772C69.9167 13.6316 69.9634 13.6167 70.0664 13.6167C70.4158 13.6167 70.8371 13.6397 70.9762 13.6397C71.2044 13.6397 71.7084 13.6167 71.9152 13.6167C72.3343 13.6167 72.7813 13.6606 73.138 13.9075C73.3268 14.0335 73.5924 14.3723 73.5924 14.8179C73.5924 15.3084 73.3864 15.7621 72.7125 16.3086C73.305 17.053 73.7636 17.6457 74.1555 18.0588C74.5284 18.4434 74.8025 18.4917 74.9016 18.5095C74.9754 18.5228 75.0363 18.5328 75.0888 18.5328C75.1422 18.5328 75.1683 18.5489 75.1683 18.5829C75.1683 18.6376 75.1227 18.6492 75.0403 18.6492H74.4102C74.0393 18.6492 73.8699 18.6171 73.6994 18.5228C73.4121 18.3697 73.1579 18.0588 72.7867 17.5452C72.5195 17.1811 72.2143 16.727 72.1274 16.6288C72.0939 16.5867 72.053 16.5815 72.0081 16.5815L71.4315 16.5683C71.3969 16.5683 71.3762 16.5815 71.3762 16.6203V16.7152C71.3762 17.3328 71.3762 17.8571 71.4102 18.1375C71.4315 18.3294 71.4682 18.477 71.6702 18.5035C71.7683 18.5174 71.9152 18.5328 71.9946 18.5328C72.0476 18.5328 72.0738 18.5489 72.0738 18.5829C72.0738 18.6287 72.0273 18.6492 71.9419 18.6492C71.5558 18.6492 71.0626 18.6287 70.9635 18.6287C70.8371 18.6287 70.4158 18.6492 70.1522 18.6492C70.0664 18.6492 70.0197 18.6287 70.0197 18.5829C70.0197 18.5489 70.044 18.5328 70.1248 18.5328C70.2258 18.5328 70.3053 18.5174 70.3642 18.5035C70.4974 18.477 70.5304 18.3294 70.558 18.1375C70.5907 17.8571 70.5907 17.3328 70.5907 16.7192V15.5499V15.5499Z",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M76.7248 18.016C76.0707 17.444 75.9004 16.6996 75.9004 16.0549C75.9004 15.6041 76.0397 14.8178 76.68 14.2313C77.1561 13.7909 77.789 13.5244 78.7811 13.5244C79.1931 13.5244 79.4405 13.553 79.7454 13.5928C79.9991 13.6247 80.2123 13.6879 80.4121 13.7047C80.4836 13.7124 80.512 13.746 80.512 13.787C80.512 13.8403 80.4917 13.9167 80.4784 14.1503C80.4648 14.3723 80.4701 14.7376 80.4571 14.869C80.4511 14.9695 80.4374 15.0236 80.3773 15.0236C80.3251 15.0236 80.3122 14.9695 80.3122 14.8761C80.3046 14.6701 80.2179 14.4404 80.0525 14.2655C79.8333 14.0334 79.3152 13.8519 78.7017 13.8519C78.1229 13.8519 77.7424 13.9965 77.4508 14.2655C76.9646 14.7094 76.8376 15.3413 76.8376 15.9871C76.8376 17.5711 78.0433 18.3559 78.9345 18.3559C79.5251 18.3559 79.8849 18.2919 80.1499 17.9833C80.2648 17.8571 80.352 17.6627 80.3773 17.5452C80.3972 17.4374 80.4121 17.4134 80.4648 17.4134C80.512 17.4134 80.5249 17.4585 80.5249 17.5131C80.5249 17.591 80.4455 18.1715 80.3773 18.3969C80.3421 18.5095 80.3176 18.5447 80.2065 18.5907C79.9384 18.6966 79.4325 18.7449 79.0066 18.7449C78.0959 18.7449 77.3306 18.5447 76.7248 18.016",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M82.9906 15.5498C82.9906 14.5374 82.9906 14.3499 82.9794 14.1383C82.9659 13.913 82.9112 13.8052 82.6928 13.7596C82.6399 13.7459 82.5272 13.7406 82.4333 13.7406C82.3601 13.7406 82.3191 13.7269 82.3191 13.6771C82.3191 13.6315 82.3661 13.6166 82.4629 13.6166C82.6474 13.6166 82.8378 13.6247 83.0049 13.6247C83.1806 13.6315 83.3331 13.6396 83.4252 13.6396C83.6378 13.6396 84.9615 13.6396 85.0891 13.6315C85.2143 13.6166 85.3208 13.6054 85.3739 13.5928C85.4089 13.5868 85.451 13.5654 85.4783 13.5654C85.5152 13.5654 85.519 13.5928 85.519 13.6247C85.519 13.6722 85.4862 13.7528 85.4686 14.0589C85.4613 14.1248 85.451 14.4201 85.4354 14.4964C85.4282 14.5306 85.4145 14.5695 85.3697 14.5695C85.3208 14.5695 85.3078 14.5374 85.3078 14.4781C85.3078 14.4315 85.302 14.3167 85.2667 14.239C85.2211 14.1186 85.1542 14.0375 84.8224 13.9965C84.7097 13.9836 84.0092 13.9727 83.8784 13.9727C83.8436 13.9727 83.8299 13.9905 83.8299 14.0375V15.7226C83.8299 15.7684 83.8399 15.7946 83.8784 15.7946C84.0224 15.7946 84.7913 15.7946 84.9426 15.7809C85.102 15.7684 85.2006 15.7488 85.2611 15.6818C85.3078 15.6281 85.3351 15.5948 85.3697 15.5948C85.3932 15.5948 85.4145 15.6085 85.4145 15.6491C85.4145 15.6887 85.3874 15.7946 85.3621 16.1344C85.3532 16.2665 85.3351 16.5336 85.3351 16.5815C85.3351 16.6333 85.3351 16.7056 85.2742 16.7056C85.2288 16.7056 85.2143 16.6799 85.2143 16.6474C85.2095 16.5815 85.2095 16.4955 85.1892 16.4063C85.1542 16.2745 85.0609 16.1755 84.8143 16.1481C84.6885 16.1344 84.0297 16.1268 83.873 16.1268C83.8399 16.1268 83.8299 16.1541 83.8299 16.1947V16.7191C83.8299 16.9454 83.8251 17.5599 83.8299 17.753C83.8436 18.2081 83.9524 18.3115 84.629 18.3115C84.8027 18.3115 85.0815 18.3115 85.2553 18.233C85.4282 18.1499 85.508 18.0135 85.5563 17.7385C85.5656 17.6627 85.5813 17.6376 85.6284 17.6376C85.6814 17.6376 85.6814 17.6923 85.6814 17.7582C85.6814 17.9118 85.6284 18.3648 85.595 18.4968C85.5482 18.6697 85.4862 18.6697 85.2354 18.6697C84.7378 18.6697 84.3714 18.6545 84.0844 18.6491C83.7965 18.6375 83.5907 18.6286 83.3949 18.6286C83.3193 18.6286 83.1725 18.6286 83.014 18.6375C82.8588 18.6375 82.6863 18.6491 82.5535 18.6491C82.4629 18.6491 82.4202 18.6286 82.4202 18.5828C82.4202 18.5488 82.4476 18.5327 82.5272 18.5327C82.6279 18.5327 82.7073 18.5173 82.7661 18.5035C82.8998 18.4769 82.9332 18.3294 82.9599 18.1375C82.9906 17.8571 82.9906 17.3327 82.9906 16.7191V15.5498",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M87.8766 18.5715C87.7717 18.5227 87.7495 18.4917 87.7495 18.3445C87.7495 17.9771 87.7754 17.579 87.7837 17.4735C87.7912 17.3723 87.8084 17.3017 87.861 17.3017C87.9232 17.3017 87.9269 17.3607 87.9269 17.4134C87.9269 17.4979 87.953 17.6376 87.9893 17.753C88.1342 18.2448 88.529 18.4243 88.941 18.4243C89.5376 18.4243 89.8323 18.016 89.8323 17.6627C89.8323 17.3373 89.7326 17.0335 89.1795 16.6006L88.8734 16.3597C88.1418 15.7888 87.8904 15.3208 87.8904 14.7843C87.8904 14.0508 88.5016 13.5244 89.4263 13.5244C89.8591 13.5244 90.1405 13.5928 90.3117 13.6396C90.3718 13.655 90.4051 13.6722 90.4051 13.719C90.4051 13.8052 90.3799 13.9965 90.3799 14.5173C90.3799 14.6647 90.3581 14.7171 90.3038 14.7171C90.259 14.7171 90.2369 14.6771 90.2369 14.5986C90.2369 14.5374 90.2049 14.3304 90.0661 14.158C89.965 14.0334 89.7716 13.8326 89.338 13.8326C88.8475 13.8326 88.5486 14.1186 88.5486 14.5173C88.5486 14.8247 88.7024 15.0547 89.2551 15.4773L89.4394 15.6161C90.2454 16.2211 90.5312 16.6799 90.5312 17.3135C90.5312 17.6975 90.3834 18.1594 89.9057 18.4703C89.5714 18.6819 89.1992 18.7449 88.8475 18.7449C88.4612 18.7449 88.1619 18.6966 87.8766 18.5715",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.4308 26.351C40.4308 25.3411 40.4308 25.1548 40.419 24.9405C40.4055 24.7134 40.3396 24.6015 40.1919 24.5681C40.1202 24.547 40.03 24.5443 39.9511 24.5443C39.8862 24.5443 39.8462 24.5289 39.8462 24.4726C39.8462 24.4359 39.9005 24.4214 40.0037 24.4214C40.258 24.4214 40.6772 24.4402 40.8696 24.4402C41.0368 24.4402 41.43 24.4214 41.6832 24.4214C41.7688 24.4214 41.821 24.4359 41.821 24.4726C41.821 24.5289 41.7812 24.5443 41.7141 24.5443C41.6505 24.5443 41.596 24.547 41.5141 24.5615C41.3359 24.5949 41.2832 24.7074 41.2714 24.9405C41.2561 25.1548 41.2561 25.3411 41.2561 26.351V27.5214C41.2561 28.1675 41.2561 28.6935 41.2832 28.9814C41.3046 29.1605 41.3502 29.2786 41.5473 29.3043C41.6424 29.3186 41.7881 29.3331 41.8892 29.3331C41.962 29.3331 41.9941 29.3528 41.9941 29.3868C41.9941 29.4322 41.9425 29.4518 41.8679 29.4518C41.43 29.4518 41.0097 29.4322 40.8298 29.4322C40.6772 29.4322 40.258 29.4518 39.9937 29.4518C39.9084 29.4518 39.8582 29.4322 39.8582 29.3868C39.8582 29.3528 39.8862 29.3331 39.966 29.3331C40.0661 29.3331 40.1465 29.3186 40.2076 29.3043C40.3396 29.2786 40.3782 29.1683 40.3999 28.9737C40.4308 28.6935 40.4308 28.1675 40.4308 27.5214V26.351",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44.8558 28.5483C44.8695 29.0666 44.9551 29.2398 45.089 29.2861C45.2017 29.3252 45.3281 29.3329 45.4347 29.3329C45.5095 29.3329 45.5472 29.3457 45.5472 29.3866C45.5472 29.438 45.489 29.4516 45.3957 29.4516C44.9628 29.4516 44.6938 29.432 44.5696 29.432C44.5104 29.432 44.198 29.4516 43.8503 29.4516C43.7659 29.4516 43.7046 29.4465 43.7046 29.3866C43.7046 29.3457 43.7433 29.3329 43.8092 29.3329C43.8969 29.3329 44.0171 29.3252 44.1104 29.3006C44.2851 29.2467 44.3095 29.0512 44.3164 28.4749L44.3786 24.5339C44.3786 24.4007 44.3958 24.3076 44.4637 24.3076C44.5354 24.3076 44.5957 24.3949 44.7103 24.5132C44.7881 24.6013 45.8019 25.6856 46.7726 26.6505C47.2261 27.1038 48.1224 28.0625 48.2345 28.1673H48.271L48.2037 25.1793C48.196 24.7721 48.1345 24.6475 47.9763 24.5799C47.8783 24.5441 47.7164 24.5441 47.6252 24.5441C47.5453 24.5441 47.5162 24.5219 47.5162 24.4809C47.5162 24.4264 47.5921 24.4212 47.6914 24.4212C48.0379 24.4212 48.3572 24.44 48.4967 24.44C48.5705 24.44 48.8221 24.4212 49.1473 24.4212C49.2341 24.4212 49.3019 24.4264 49.3019 24.4809C49.3019 24.5219 49.2617 24.5441 49.1802 24.5441C49.1143 24.5441 49.0629 24.5441 48.9806 24.5613C48.7939 24.616 48.7427 24.7544 48.7359 25.1273L48.6621 29.3252C48.6621 29.4713 48.6347 29.5345 48.5746 29.5345C48.5023 29.5345 48.4221 29.4577 48.3496 29.3866C47.9311 28.9856 47.0783 28.1145 46.3861 27.4291C45.6599 26.7092 44.9219 25.8785 44.8017 25.7523H44.7843L44.8558 28.5483",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M51.4631 29.3742C51.3557 29.3253 51.3379 29.2921 51.3379 29.1469C51.3379 28.7815 51.363 28.3817 51.3686 28.2744C51.3766 28.1761 51.3959 28.1019 51.4488 28.1019C51.5085 28.1019 51.5165 28.1616 51.5165 28.2163C51.5165 28.2999 51.5426 28.44 51.5768 28.5527C51.7223 29.0455 52.1149 29.2264 52.5283 29.2264C53.1243 29.2264 53.4197 28.8209 53.4197 28.4673C53.4197 28.143 53.3183 27.8365 52.7673 27.4019L52.4601 27.1637C51.7281 26.589 51.4757 26.1256 51.4757 25.5866C51.4757 24.8534 52.0865 24.3301 53.0116 24.3301C53.4449 24.3301 53.7243 24.3949 53.8978 24.4401C53.9583 24.4555 53.991 24.4725 53.991 24.522C53.991 24.6101 53.9651 24.8011 53.9651 25.3186C53.9651 25.4654 53.9457 25.5192 53.8914 25.5192C53.8447 25.5192 53.8234 25.4807 53.8234 25.3988C53.8234 25.341 53.791 25.1344 53.6528 24.9626C53.5515 24.8335 53.3575 24.6356 52.927 24.6356C52.4344 24.6356 52.136 24.9216 52.136 25.3186C52.136 25.626 52.2894 25.8573 52.8408 26.2782L53.0269 26.4174C53.8313 27.022 54.1162 27.4829 54.1162 28.1146C54.1162 28.4996 53.9691 28.9599 53.4912 29.2708C53.161 29.4841 52.7865 29.5466 52.4344 29.5466C52.0483 29.5466 51.7474 29.4977 51.4631 29.3742",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.6296 24.7953L56.6388 24.82C56.2502 24.8335 56.0945 24.8662 55.994 25.0138C55.9275 25.1145 55.891 25.193 55.8788 25.2453C55.8668 25.2998 55.8469 25.3261 55.8071 25.3261C55.7609 25.3261 55.7466 25.2938 55.7466 25.2204C55.7466 25.1145 55.872 24.5093 55.8896 24.4555C55.9086 24.3659 55.9275 24.3301 55.965 24.3301C56.0193 24.3301 56.0873 24.3949 56.2502 24.407C56.445 24.4264 56.697 24.4401 56.9167 24.4401H59.5543C59.7653 24.4401 59.9116 24.4213 60.0115 24.407C60.1118 24.3871 60.165 24.3761 60.1924 24.3761C60.2394 24.3761 60.245 24.4144 60.245 24.5133C60.245 24.6544 60.2249 25.1145 60.2249 25.2863C60.2189 25.3545 60.2061 25.393 60.165 25.393C60.1118 25.393 60.0973 25.358 60.09 25.2625L60.0875 25.1864C60.0722 25.0138 59.8931 24.8285 59.301 24.815L58.4623 24.7953V27.5212C58.4623 28.1343 58.4623 28.6592 58.4976 28.9454C58.5148 29.1332 58.5554 29.2785 58.7543 29.3042C58.8478 29.3185 58.9941 29.333 59.0934 29.333C59.167 29.333 59.2003 29.3527 59.2003 29.3866C59.2003 29.432 59.1464 29.4517 59.0741 29.4517C58.6354 29.4517 58.2178 29.432 58.0313 29.432C57.876 29.432 57.4551 29.4517 57.1911 29.4517C57.1049 29.4517 57.0562 29.432 57.0562 29.3866C57.0562 29.3527 57.0852 29.333 57.1633 29.333C57.2663 29.333 57.3461 29.3185 57.4037 29.3042C57.5386 29.2785 57.5766 29.1332 57.5962 28.9413C57.6296 28.6592 57.6296 28.1343 57.6296 27.5212V24.7953",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M62.5148 26.351C62.5148 25.3411 62.5148 25.1548 62.5011 24.9405C62.4876 24.7134 62.4195 24.6015 62.2752 24.5681C62.2023 24.547 62.1156 24.5443 62.0331 24.5443C61.9675 24.5443 61.9272 24.5289 61.9272 24.4726C61.9272 24.4359 61.9807 24.4214 62.0852 24.4214C62.3403 24.4214 62.7614 24.4402 62.9535 24.4402C63.1195 24.4402 63.5118 24.4214 63.7651 24.4214C63.8509 24.4214 63.9037 24.4359 63.9037 24.4726C63.9037 24.5289 63.8633 24.5443 63.798 24.5443C63.7321 24.5443 63.6801 24.547 63.5991 24.5615C63.4198 24.5949 63.3635 24.7074 63.3535 24.9405C63.339 25.1548 63.339 25.3411 63.339 26.351V27.5214C63.339 28.1675 63.339 28.6935 63.3635 28.9814C63.3863 29.1605 63.4312 29.2786 63.6331 29.3043C63.7234 29.3186 63.8712 29.3331 63.973 29.3331C64.0451 29.3331 64.0778 29.3528 64.0778 29.3868C64.0778 29.4322 64.0217 29.4518 63.9493 29.4518C63.5118 29.4518 63.092 29.4322 62.9121 29.4322C62.7614 29.4322 62.3403 29.4518 62.0736 29.4518C61.9867 29.4518 61.9401 29.4322 61.9401 29.3868C61.9401 29.3528 61.9675 29.3331 62.0474 29.3331C62.1475 29.3331 62.2273 29.3186 62.2856 29.3043C62.4195 29.2786 62.4588 29.1683 62.4789 28.9737C62.5148 28.6935 62.5148 28.1675 62.5148 27.5214V26.351",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.4491 24.7953L66.4598 24.82C66.0741 24.8335 65.9133 24.8662 65.8121 25.0138C65.7464 25.1145 65.7122 25.193 65.7014 25.2453C65.6857 25.2998 65.6662 25.3261 65.6277 25.3261C65.579 25.3261 65.5686 25.2938 65.5686 25.2204C65.5686 25.1145 65.6934 24.5093 65.707 24.4555C65.7276 24.3659 65.7464 24.3301 65.7875 24.3301C65.8401 24.3301 65.9072 24.3949 66.0741 24.407C66.2674 24.4264 66.519 24.4401 66.7379 24.4401H69.3734C69.5869 24.4401 69.7326 24.4213 69.8356 24.407C69.9321 24.3871 69.9869 24.3761 70.0117 24.3761C70.0586 24.3761 70.0664 24.4144 70.0664 24.5133C70.0664 24.6544 70.0449 25.1145 70.0449 25.2863C70.0393 25.3545 70.0258 25.393 69.9869 25.393C69.9321 25.393 69.9195 25.358 69.9118 25.2625L69.9075 25.1864C69.8938 25.0138 69.7121 24.8285 69.1229 24.815L68.2819 24.7953V27.5212C68.2819 28.1343 68.2819 28.6592 68.3148 28.9454C68.3351 29.1332 68.3747 29.2785 68.5749 29.3042C68.6688 29.3185 68.8139 29.333 68.9129 29.333C68.989 29.333 69.0223 29.3527 69.0223 29.3866C69.0223 29.432 68.9682 29.4517 68.8932 29.4517C68.4559 29.4517 68.0356 29.432 67.8479 29.432C67.6976 29.432 67.278 29.4517 67.0098 29.4517C66.9238 29.4517 66.8761 29.432 66.8761 29.3866C66.8761 29.3527 66.9053 29.333 66.9839 29.333C67.084 29.333 67.1636 29.3185 67.2216 29.3042C67.3573 29.2785 67.3965 29.1332 67.4181 28.9413C67.4491 28.6592 67.4491 28.1343 67.4491 27.5212V24.7953",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M72.0477 26.351C72.0477 25.3411 72.0477 25.1548 72.033 24.9405C72.0197 24.7134 71.9681 24.6102 71.7482 24.5615C71.6927 24.547 71.5826 24.5443 71.49 24.5443C71.4177 24.5443 71.3762 24.5289 71.3762 24.4811C71.3762 24.4359 71.4216 24.4214 71.5227 24.4214C71.874 24.4214 72.2937 24.4402 72.4937 24.4402C72.6528 24.4402 73.0702 24.4214 73.3123 24.4214C73.4122 24.4214 73.4588 24.4359 73.4588 24.4811C73.4588 24.5289 73.4182 24.5443 73.3515 24.5443C73.2804 24.5443 73.2373 24.547 73.1579 24.5615C72.9809 24.5949 72.9248 24.7074 72.9129 24.9405C72.8995 25.1548 72.8995 25.3411 72.8995 26.351V27.2824C72.8995 28.2482 73.0924 28.6554 73.4182 28.9198C73.7171 29.1683 74.0236 29.1932 74.2509 29.1932C74.5423 29.1932 74.8994 29.1001 75.1684 28.8336C75.5348 28.4674 75.5528 27.8699 75.5528 27.1833V26.351C75.5528 25.3411 75.5528 25.1548 75.5402 24.9405C75.5302 24.7134 75.4761 24.6102 75.255 24.5615C75.2026 24.547 75.0888 24.5443 75.0181 24.5443C74.9402 24.5443 74.8994 24.5289 74.8994 24.4811C74.8994 24.4359 74.9481 24.4214 75.0403 24.4214C75.3829 24.4214 75.8007 24.4402 75.8065 24.4402C75.8882 24.4402 76.3072 24.4214 76.5675 24.4214C76.6589 24.4214 76.7055 24.4359 76.7055 24.4811C76.7055 24.5289 76.6666 24.5443 76.587 24.5443C76.5122 24.5443 76.4742 24.547 76.3928 24.5615C76.2121 24.5949 76.1596 24.7074 76.146 24.9405C76.1323 25.1548 76.1323 25.3411 76.1323 26.351V27.0619C76.1323 27.8016 76.0589 28.587 75.5006 29.0668C75.0295 29.4715 74.5504 29.5468 74.1162 29.5468C73.7637 29.5468 73.1245 29.5269 72.64 29.0898C72.3009 28.7816 72.0477 28.288 72.0477 27.3224V26.351",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M79.9309 24.7953L78.9403 24.82C78.554 24.8335 78.3952 24.8662 78.2958 25.0138C78.2296 25.1145 78.1967 25.193 78.1809 25.2453C78.1693 25.2998 78.148 25.3261 78.1084 25.3261C78.0626 25.3261 78.0481 25.2938 78.0481 25.2204C78.0481 25.1145 78.1737 24.5093 78.1867 24.4555C78.2083 24.3659 78.2296 24.3301 78.2684 24.3301C78.3208 24.3301 78.3867 24.3949 78.554 24.407C78.7463 24.4264 79.0004 24.4401 79.2201 24.4401H81.855C82.0689 24.4401 82.2125 24.4213 82.3151 24.407C82.4143 24.3871 82.4668 24.3761 82.4966 24.3761C82.5401 24.3761 82.5482 24.4144 82.5482 24.5133C82.5482 24.6544 82.5271 25.1145 82.5271 25.2863C82.5192 25.3545 82.5072 25.393 82.4668 25.393C82.4143 25.393 82.3986 25.358 82.3951 25.2625L82.389 25.1864C82.3735 25.0138 82.1949 24.8285 81.6046 24.815L80.764 24.7953V27.5212C80.764 28.1343 80.764 28.6592 80.7968 28.9454C80.8181 29.1332 80.8592 29.2785 81.055 29.3042C81.1524 29.3185 81.2942 29.333 81.3949 29.333C81.4703 29.333 81.5033 29.3527 81.5033 29.3866C81.5033 29.432 81.4484 29.4517 81.3764 29.4517C80.9346 29.4517 80.5172 29.432 80.333 29.432C80.1792 29.432 79.7581 29.4517 79.4918 29.4517C79.4064 29.4517 79.36 29.432 79.36 29.3866C79.36 29.3527 79.3848 29.333 79.4667 29.333C79.5658 29.333 79.6455 29.3185 79.7046 29.3042C79.8393 29.2785 79.8774 29.1332 79.9 28.9413C79.9309 28.6592 79.9309 28.1343 79.9309 27.5212V24.7953",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M84.8142 26.3512C84.8142 25.3413 84.8142 25.155 84.8026 24.9407C84.7889 24.7136 84.7377 24.6103 84.517 24.5616C84.4629 24.5471 84.3502 24.5444 84.2555 24.5444C84.1832 24.5444 84.1423 24.5291 84.1423 24.4812C84.1423 24.4361 84.1892 24.4215 84.2905 24.4215C84.4706 24.4215 84.6611 24.4267 84.8316 24.4267C85.0028 24.4361 85.1541 24.4404 85.2472 24.4404C85.4612 24.4404 86.7872 24.4404 86.9113 24.4361C87.0375 24.4215 87.1453 24.4072 87.1988 24.3952C87.2328 24.3873 87.2705 24.3662 87.3047 24.3662C87.3374 24.3662 87.3447 24.3952 87.3447 24.4267C87.3447 24.4727 87.3097 24.554 87.2922 24.8595C87.2842 24.9262 87.2705 25.2207 87.2549 25.3001C87.2514 25.3349 87.2367 25.3718 87.1911 25.3718C87.1453 25.3718 87.131 25.3413 87.131 25.2806C87.131 25.2335 87.1269 25.1216 87.0898 25.0406C87.0433 24.9218 86.9797 24.84 86.6434 24.8014C86.5327 24.7871 85.8357 24.7724 85.7004 24.7724C85.6666 24.7724 85.6534 24.7956 85.6534 24.84V26.5236C85.6534 26.5723 85.6612 26.597 85.7004 26.597C85.8471 26.597 86.6135 26.597 86.7654 26.5844C86.9229 26.5723 87.022 26.5524 87.0838 26.4853C87.131 26.4322 87.1584 26.3989 87.1911 26.3989C87.2172 26.3989 87.2367 26.4109 87.2367 26.4501C87.2367 26.4905 87.2102 26.597 87.1834 26.9352C87.1756 27.0691 87.1584 27.3371 87.1584 27.3822C87.1584 27.4363 87.1584 27.5122 87.0972 27.5122C87.0512 27.5122 87.0375 27.4832 87.0375 27.4498C87.0301 27.3822 87.0301 27.2962 87.0104 27.21C86.9797 27.077 86.884 26.976 86.6403 26.953C86.5136 26.9352 85.8511 26.93 85.6919 26.93C85.6612 26.93 85.6534 26.9572 85.6534 26.9974V27.5215C85.6534 27.7487 85.6473 28.3609 85.6534 28.553C85.6666 29.0139 85.7756 29.1113 86.4506 29.1113C86.6251 29.1113 86.9045 29.1113 87.0784 29.0327C87.2514 28.9523 87.331 28.8141 87.3776 28.5391C87.3892 28.4676 87.4023 28.4402 87.4516 28.4402C87.5043 28.4402 87.5043 28.4933 87.5043 28.5606C87.5043 28.7142 87.4516 29.1685 87.417 29.3009C87.3696 29.4717 87.3097 29.4717 87.0568 29.4717C86.558 29.4717 86.1912 29.458 85.9074 29.452C85.621 29.4383 85.4144 29.4323 85.2142 29.4323C85.1408 29.4323 84.9947 29.4323 84.8339 29.4383C84.6818 29.4383 84.5077 29.452 84.3761 29.452C84.2905 29.452 84.2443 29.4323 84.2443 29.3869C84.2443 29.3529 84.2685 29.3333 84.3502 29.3333C84.4493 29.3333 84.5307 29.3187 84.5892 29.3044C84.7232 29.2787 84.757 29.1335 84.7815 28.9416C84.8142 28.6595 84.8142 28.1345 84.8142 27.5215V26.3512",fill:"#686767"})]})}),cg=e=>Y(i,{...e,children:Q("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M7.99573 16C9.25964 16 10.2883 14.9745 10.2938 13.7118H5.69775C5.70325 14.9744 6.73181 16 7.99573 16Z",fill:"currentColor"}),Y("path",{d:"M14.2106 12.7737V12.0912C14.2106 11.3503 13.7648 10.6915 13.108 10.4019V6.52185C13.108 5.4281 12.7614 4.40417 12.1055 3.56079C11.5471 2.8429 10.7917 2.28613 9.90662 1.93701V1.91077C9.90662 0.857178 9.04944 0 7.99585 0C6.94226 0 6.08521 0.857178 6.08521 1.91077V1.93701C5.20007 2.28613 4.4447 2.8429 3.88635 3.56079C3.23047 4.40417 2.88367 5.4281 2.88367 6.52185V10.4017C2.22705 10.6914 1.78125 11.3503 1.78125 12.0912V12.7736H14.2106V12.7737Z",fill:"currentColor"})]})}),dg=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M8.57143 11.4285H0V8.57137H8.57143V-6.10352e-05H11.4286V8.57137H20V11.4285H11.4286V19.9999H8.57143V11.4285Z",fill:"currentColor"})})}),ug=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M0 11.2499V8.74994H20V11.2499H0Z",fill:"currentColor"})})}),hg=e=>Y(i,{...e,children:Q("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("g",{clipPath:"url(#clip0_8714_101)",children:Y("path",{d:"M0 20V13.3333H2.22222V16.2222L5.66667 12.7778L7.22222 14.3333L3.77778 17.7778H6.66667V20H0ZM14.3333 7.22222L12.7778 5.66667L16.2222 2.22222H13.3333V0H20V6.66667H17.7778V3.77778L14.3333 7.22222Z",fill:"currentColor"})}),Y("defs",{children:Y("clipPath",{id:"clip0_8714_101",children:Y("rect",{width:"20",height:"20",fill:"white"})})})]})}),pg=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M16 20C15.1667 20 14.4583 19.7083 13.875 19.125C13.2917 18.5417 13 17.8333 13 17C13 16.9 13.025 16.6667 13.075 16.3L6.05 12.2C5.78333 12.45 5.475 12.6458 5.125 12.7875C4.775 12.9292 4.4 13 4 13C3.16667 13 2.45833 12.7083 1.875 12.125C1.29167 11.5417 1 10.8333 1 10C1 9.16667 1.29167 8.45833 1.875 7.875C2.45833 7.29167 3.16667 7 4 7C4.4 7 4.775 7.07083 5.125 7.2125C5.475 7.35417 5.78333 7.55 6.05 7.8L13.075 3.7C13.0417 3.58333 13.0208 3.47083 13.0125 3.3625C13.0042 3.25417 13 3.13333 13 3C13 2.16667 13.2917 1.45833 13.875 0.875C14.4583 0.291667 15.1667 0 16 0C16.8333 0 17.5417 0.291667 18.125 0.875C18.7083 1.45833 19 2.16667 19 3C19 3.83333 18.7083 4.54167 18.125 5.125C17.5417 5.70833 16.8333 6 16 6C15.6 6 15.225 5.92917 14.875 5.7875C14.525 5.64583 14.2167 5.45 13.95 5.2L6.925 9.3C6.95833 9.41667 6.97917 9.52917 6.9875 9.6375C6.99583 9.74583 7 9.86667 7 10C7 10.1333 6.99583 10.2542 6.9875 10.3625C6.97917 10.4708 6.95833 10.5833 6.925 10.7L13.95 14.8C14.2167 14.55 14.525 14.3542 14.875 14.2125C15.225 14.0708 15.6 14 16 14C16.8333 14 17.5417 14.2917 18.125 14.875C18.7083 15.4583 19 16.1667 19 17C19 17.8333 18.7083 18.5417 18.125 19.125C17.5417 19.7083 16.8333 20 16 20Z",fill:"currentColor"})})}),fg=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M16 5H4V1H16V5ZM16 10.5C16.2833 10.5 16.5208 10.4042 16.7125 10.2125C16.9042 10.0208 17 9.78333 17 9.5C17 9.21667 16.9042 8.97917 16.7125 8.7875C16.5208 8.59583 16.2833 8.5 16 8.5C15.7167 8.5 15.4792 8.59583 15.2875 8.7875C15.0958 8.97917 15 9.21667 15 9.5C15 9.78333 15.0958 10.0208 15.2875 10.2125C15.4792 10.4042 15.7167 10.5 16 10.5ZM14 17V13H6V17H14ZM16 19H4V15H0V9C0 8.15 0.291667 7.4375 0.875 6.8625C1.45833 6.2875 2.16667 6 3 6H17C17.85 6 18.5625 6.2875 19.1375 6.8625C19.7125 7.4375 20 8.15 20 9V15H16V19Z",fill:"currentColor"})})}),mg=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M7.26368 20L6.86567 16.8C6.65008 16.7167 6.44693 16.6167 6.25622 16.5C6.06551 16.3833 5.87894 16.2583 5.69652 16.125L2.73632 17.375L0 12.625L2.56219 10.675C2.54561 10.5583 2.53731 10.4458 2.53731 10.3375V9.6625C2.53731 9.55417 2.54561 9.44167 2.56219 9.325L0 7.375L2.73632 2.625L5.69652 3.875C5.87894 3.74167 6.06965 3.61667 6.26866 3.5C6.46766 3.38333 6.66667 3.28333 6.86567 3.2L7.26368 0H12.7363L13.1343 3.2C13.3499 3.28333 13.5531 3.38333 13.7438 3.5C13.9345 3.61667 14.1211 3.74167 14.3035 3.875L17.2637 2.625L20 7.375L17.4378 9.325C17.4544 9.44167 17.4627 9.55417 17.4627 9.6625V10.3375C17.4627 10.4458 17.4461 10.5583 17.4129 10.675L19.9751 12.625L17.2388 17.375L14.3035 16.125C14.1211 16.2583 13.9303 16.3833 13.7313 16.5C13.5323 16.6167 13.3333 16.7167 13.1343 16.8L12.7363 20H7.26368ZM10.0498 13.5C11.0116 13.5 11.8325 13.1583 12.5124 12.475C13.1924 11.7917 13.5323 10.9667 13.5323 10C13.5323 9.03333 13.1924 8.20833 12.5124 7.525C11.8325 6.84167 11.0116 6.5 10.0498 6.5C9.07131 6.5 8.24627 6.84167 7.57463 7.525C6.90299 8.20833 6.56716 9.03333 6.56716 10C6.56716 10.9667 6.90299 11.7917 7.57463 12.475C8.24627 13.1583 9.07131 13.5 10.0498 13.5Z",fill:"currentColor"})})}),gg=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M9.95 15.9999C10.3 15.9999 10.5958 15.8791 10.8375 15.6374C11.0792 15.3958 11.2 15.0999 11.2 14.7499C11.2 14.3999 11.0792 14.1041 10.8375 13.8624C10.5958 13.6208 10.3 13.4999 9.95 13.4999C9.6 13.4999 9.30417 13.6208 9.0625 13.8624C8.82083 14.1041 8.7 14.3999 8.7 14.7499C8.7 15.0999 8.82083 15.3958 9.0625 15.6374C9.30417 15.8791 9.6 15.9999 9.95 15.9999ZM9.05 12.1499H10.9C10.9 11.5999 10.9625 11.1666 11.0875 10.8499C11.2125 10.5333 11.5667 10.0999 12.15 9.54994C12.5833 9.11661 12.925 8.70411 13.175 8.31244C13.425 7.92077 13.55 7.44994 13.55 6.89994C13.55 5.96661 13.2083 5.24994 12.525 4.74994C11.8417 4.24994 11.0333 3.99994 10.1 3.99994C9.15 3.99994 8.37917 4.24994 7.7875 4.74994C7.19583 5.24994 6.78333 5.84994 6.55 6.54994L8.2 7.19994C8.28333 6.89994 8.47083 6.57494 8.7625 6.22494C9.05417 5.87494 9.5 5.69994 10.1 5.69994C10.6333 5.69994 11.0333 5.84577 11.3 6.13744C11.5667 6.42911 11.7 6.74994 11.7 7.09994C11.7 7.43327 11.6 7.74577 11.4 8.03744C11.2 8.32911 10.95 8.59994 10.65 8.84994C9.91667 9.49994 9.46667 9.99161 9.3 10.3249C9.13333 10.6583 9.05 11.2666 9.05 12.1499ZM10 19.9999C8.61667 19.9999 7.31667 19.7374 6.1 19.2124C4.88333 18.6874 3.825 17.9749 2.925 17.0749C2.025 16.1749 1.3125 15.1166 0.7875 13.8999C0.2625 12.6833 0 11.3833 0 9.99994C0 8.61661 0.2625 7.31661 0.7875 6.09994C1.3125 4.88327 2.025 3.82494 2.925 2.92494C3.825 2.02494 4.88333 1.31244 6.1 0.787439C7.31667 0.262439 8.61667 -6.10352e-05 10 -6.10352e-05C11.3833 -6.10352e-05 12.6833 0.262439 13.9 0.787439C15.1167 1.31244 16.175 2.02494 17.075 2.92494C17.975 3.82494 18.6875 4.88327 19.2125 6.09994C19.7375 7.31661 20 8.61661 20 9.99994C20 11.3833 19.7375 12.6833 19.2125 13.8999C18.6875 15.1166 17.975 16.1749 17.075 17.0749C16.175 17.9749 15.1167 18.6874 13.9 19.2124C12.6833 19.7374 11.3833 19.9999 10 19.9999Z",fill:"currentColor"})})}),vg=e=>Y(i,{...e,children:Y("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M1.55556 14C1.12778 14 0.761574 13.8477 0.456944 13.5431C0.152315 13.2384 0 12.8722 0 12.4444V1.55556C0 1.12778 0.152315 0.761574 0.456944 0.456944C0.761574 0.152315 1.12778 0 1.55556 0H12.4444C12.8722 0 13.2384 0.152315 13.5431 0.456944C13.8477 0.761574 14 1.12778 14 1.55556V12.4444C14 12.8722 13.8477 13.2384 13.5431 13.5431C13.2384 13.8477 12.8722 14 12.4444 14H1.55556ZM2.33333 10.8889H11.6667L8.75 7L6.41667 10.1111L4.66667 7.77778L2.33333 10.8889Z",fill:"currentColor"})})}),bg=e=>Y(i,{...e,children:Y("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M1.33333 12C0.966667 12 0.652778 11.8694 0.391667 11.6083C0.130556 11.3472 0 11.0333 0 10.6667V1.33333C0 0.966667 0.130556 0.652778 0.391667 0.391667C0.652778 0.130556 0.966667 0 1.33333 0H10.6667C11.0333 0 11.3472 0.130556 11.6083 0.391667C11.8694 0.652778 12 0.966667 12 1.33333V10.6667C12 11.0333 11.8694 11.3472 11.6083 11.6083C11.3472 11.8694 11.0333 12 10.6667 12H1.33333ZM2.66667 9.33333H7.33333V8H2.66667V9.33333ZM2.66667 6.66667H9.33333V5.33333H2.66667V6.66667ZM2.66667 4H9.33333V2.66667H2.66667V4Z",fill:"currentColor"})})}),yg=e=>Y(i,{...e,children:Y("svg",{width:"11",height:"12",viewBox:"0 0 11 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M5.27472 12C3.81319 12 2.56868 11.4945 1.54121 10.4835C0.513736 9.47253 0 8.24176 0 6.79121C0 6.0989 0.134615 5.43681 0.403846 4.80495C0.673077 4.17308 1.05494 3.61538 1.54945 3.13187L4.35165 0.379121C4.48352 0.258242 4.62912 0.164835 4.78846 0.0989011C4.9478 0.032967 5.10989 0 5.27472 0C5.43956 0 5.60165 0.032967 5.76099 0.0989011C5.92033 0.164835 6.06593 0.258242 6.1978 0.379121L9 3.13187C9.4945 3.61538 9.87637 4.17308 10.1456 4.80495C10.4148 5.43681 10.5494 6.0989 10.5494 6.79121C10.5494 8.24176 10.0357 9.47253 9.00824 10.4835C7.98077 11.4945 6.73626 12 5.27472 12Z",fill:"currentColor"})})}),wg=e=>Y(i,{...e,children:Y("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M5.33333 12V6.68333C4.62222 6.68333 3.93889 6.54722 3.28333 6.275C2.62778 6.00278 2.05 5.61667 1.55 5.11667C1.05 4.61667 0.666667 4.03889 0.4 3.38333C0.133333 2.72778 0 2.04444 0 1.33333V0H1.33333C2.03333 0 2.71111 0.136111 3.36667 0.408333C4.02222 0.680556 4.6 1.06667 5.1 1.56667C5.44444 1.91111 5.73056 2.28889 5.95833 2.7C6.18611 3.11111 6.36111 3.55 6.48333 4.01667C6.53889 3.93889 6.6 3.86389 6.66667 3.79167C6.73333 3.71944 6.80556 3.64444 6.88333 3.56667C7.38333 3.06667 7.96111 2.68056 8.61667 2.40833C9.27222 2.13611 9.95556 2 10.6667 2H12V3.33333C12 4.04444 11.8639 4.72778 11.5917 5.38333C11.3194 6.03889 10.9333 6.61667 10.4333 7.11667C9.93333 7.61667 9.35833 8 8.70833 8.26667C8.05833 8.53333 7.37778 8.66667 6.66667 8.66667V12H5.33333Z",fill:"currentColor"})})}),Cg=e=>Y(i,{...e,children:Q("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.013 8.18324C16.013 7.61597 15.9621 7.07051 15.8676 6.54688H8.33301V9.64142H12.6385C12.453 10.6414 11.8894 11.4887 11.0421 12.056V14.0632H13.6276C15.1403 12.6705 16.013 10.6196 16.013 8.18324Z",fill:"#4285F4"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.33268 15.9995C10.4927 15.9995 12.3036 15.2832 13.6272 14.0613L11.0418 12.0541C10.3254 12.5341 9.40905 12.8177 8.33268 12.8177C6.24905 12.8177 4.48541 11.4104 3.85632 9.51953H1.18359V11.5923C2.49996 14.2068 5.20541 15.9995 8.33268 15.9995Z",fill:"#34A853"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.85664 9.51898C3.69664 9.03898 3.60574 8.52625 3.60574 7.99898C3.60574 7.4717 3.69664 6.95898 3.85664 6.47898V4.40625H1.18392C0.642099 5.48625 0.333008 6.70807 0.333008 7.99898C0.333008 9.28989 0.642099 10.5117 1.18392 11.5917L3.85664 9.51898Z",fill:"#FBBC05"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.33268 3.18182C9.50723 3.18182 10.5618 3.58545 11.3909 4.37818L13.6854 2.08364C12.3 0.792727 10.489 0 8.33268 0C5.20541 0 2.49996 1.79273 1.18359 4.40727L3.85632 6.48C4.48541 4.58909 6.24905 3.18182 8.33268 3.18182Z",fill:"#EA4335"})]})}),xg=e=>Y(i,{...e,children:Q("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M16.167 8.04974C16.167 3.60622 12.5831 0 8.16699 0C3.75093 0 0.166992 3.60622 0.166992 8.04974C0.166992 12.0705 3.09181 15.4031 6.92291 16V10.371H4.87966V8.04974H6.92291V6.27565C6.92291 4.26114 8.10932 3.14197 9.93836 3.14197C10.8117 3.14197 11.718 3.30777 11.718 3.30777V5.27254H10.7128C9.71591 5.27254 9.40283 5.90259 9.40283 6.53264V8.04145H11.6273L11.2731 10.3627H9.40283V15.9917C13.2422 15.4031 16.167 12.0705 16.167 8.04974Z",fill:"#1877F2"}),Y("path",{d:"M11.2811 10.3096L11.6354 8.00384H9.41086V6.50513C9.41086 5.87106 9.73218 5.25346 10.7209 5.25346H11.726V3.2936C11.726 3.2936 10.8197 3.12891 9.94639 3.12891C8.11735 3.12891 6.93095 4.24059 6.93095 6.24162V8.00384H4.8877V10.3096H6.93095V15.9009C7.33466 15.9668 7.75484 15.9997 8.17502 15.9997C8.59521 15.9997 9.0154 15.9668 9.4191 15.9009V10.3096H11.2811Z",fill:"white"})]})}),kg=e=>Y(i,{...e,children:Q("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("g",{clipPath:"url(#clip0_703_2142)",children:Y("path",{d:"M10.3552 6.77143L16.3115 0H14.9001L9.72817 5.87954L5.59738 0H0.833008L7.07957 8.8909L0.833008 15.9918H2.24455L7.70622 9.78279L12.0686 15.9918H16.833L10.3548 6.77143H10.3552ZM8.42187 8.96923L7.78897 8.0839L2.75315 1.03921H4.92121L8.98517 6.7245L9.61807 7.60983L14.9007 14.9998H12.7327L8.42187 8.96957V8.96923Z",fill:"#5C5959"})}),Y("defs",{children:Y("clipPath",{id:"clip0_703_2142",children:Y("rect",{width:"16",height:"16",fill:"white",transform:"translate(0.833008)"})})})]})}),$g=e=>Y(i,{...e,children:Q("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M7.66699 0H0.166992V7.5H7.66699V0Z",fill:"#F35325"}),Y("path",{d:"M16.167 0H8.66699V7.5H16.167V0Z",fill:"#81BC06"}),Y("path",{d:"M7.66699 8.5H0.166992V16H7.66699V8.5Z",fill:"#05A6F0"}),Y("path",{d:"M16.167 8.5H8.66699V16H16.167V8.5Z",fill:"#FFBA08"})]})}),Sg=e=>Y(i,{...e,children:Y("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M0 13.3267V11.5489H16V13.3267H0ZM0 8.88223V7.10445H16V8.88223H0ZM0 4.43778V2.66H16V4.43778H0Z",fill:"currentColor"})})}),Eg=e=>{const{size:t="16px",...n}=e;return Y(i,{boxSize:t,...n,children:Y("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M8 8.88889C5.97297 8.88889 4.32432 7.24024 4.32432 5.21321C4.32432 3.18618 5.97297 1.53753 8 1.53753C10.027 1.53753 11.6757 3.18618 11.6757 5.21321C11.6757 7.24024 10.027 8.88889 8 8.88889ZM2 14.4625V13.136C2 11.2583 4.85714 9.92589 8 9.92589C11.1429 9.92589 14 11.2583 14 13.136V14.4625H2Z",fill:"currentColor"})})})},Mg=e=>Y(i,{...e,children:Y("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M5.22857 6.85714L0 1.6L1.6 0L8.45714 6.85714L1.6 13.7143L0 12.1143L5.22857 6.85714ZM12.7714 6.85714L7.54286 1.6L9.14286 0L16 6.85714L9.14286 13.7143L7.54286 12.1143L12.7714 6.85714Z",fill:"#5C5959"})})}),Tg=e=>Y(i,{...e,children:Y("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M10.7714 6.85714L16 12.1143L14.4 13.7143L7.54286 6.85714L14.4 0L16 1.6L10.7714 6.85714ZM3.22857 6.85714L8.45714 12.1143L6.85714 13.7143L0 6.85714L6.85714 0L8.45714 1.6L3.22857 6.85714Z",fill:"#5C5959"})})}),Og=e=>{const{fill:t,width:n,height:r,...o}=e,s=t||"currentColor",a=n??"20",l=r??n??"20";return Y(i,{...e,fill:s,children:Y("svg",{width:a,height:l,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M18.4444 20L11.4444 13C10.8889 13.4444 10.25 13.7963 9.52778 14.0556C8.80556 14.3148 8.03704 14.4444 7.22222 14.4444C5.2037 14.4444 3.49537 13.7454 2.09722 12.3472C0.699074 10.9491 0 9.24074 0 7.22222C0 5.2037 0.699074 3.49537 2.09722 2.09722C3.49537 0.699074 5.2037 0 7.22222 0C9.24074 0 10.9491 0.699074 12.3472 2.09722C13.7454 3.49537 14.4444 5.2037 14.4444 7.22222C14.4444 8.03704 14.3148 8.80556 14.0556 9.52778C13.7963 10.25 13.4444 10.8889 13 11.4444L20 18.4444L18.4444 20ZM7.22222 12.2222C8.61111 12.2222 9.79167 11.7361 10.7639 10.7639C11.7361 9.79167 12.2222 8.61111 12.2222 7.22222C12.2222 5.83333 11.7361 4.65278 10.7639 3.68056C9.79167 2.70833 8.61111 2.22222 7.22222 2.22222C5.83333 2.22222 4.65278 2.70833 3.68056 3.68056C2.70833 4.65278 2.22222 5.83333 2.22222 7.22222C2.22222 8.61111 2.70833 9.79167 3.68056 10.7639C4.65278 11.7361 5.83333 12.2222 7.22222 12.2222Z"})})})},Lg=e=>Y(i,{...e,children:Q("svg",{width:"16",height:"12.2513",viewBox:"0 0 16 12.2513",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M15.0602 0.939796C14.7633 0.641913 14.4106 0.405559 14.0222 0.244287C13.6338 0.0830158 13.2174 0 12.7969 0C12.3763 0 11.9599 0.0830158 11.5716 0.244287C11.1832 0.405559 10.8304 0.641913 10.5336 0.939796L11.2898 1.69601C11.4881 1.49774 11.7234 1.34047 11.9825 1.23317C12.2415 1.12587 12.5192 1.07064 12.7996 1.07064C13.0799 1.07064 13.3576 1.12587 13.6166 1.23317C13.8757 1.34047 14.111 1.49774 14.3093 1.69601C14.5076 1.89427 14.6649 2.12965 14.7722 2.38869C14.8795 2.64774 14.9347 2.92538 14.9347 3.20577C14.9347 3.48616 14.8795 3.7638 14.7722 4.02285C14.6649 4.28189 14.5076 4.51727 14.3093 4.71553L10.049 8.97588C9.64926 9.37629 9.10686 9.60152 8.54109 9.60202C7.97532 9.60252 7.43252 9.37825 7.03211 8.97854C6.63169 8.57883 6.40646 8.03643 6.40596 7.47066C6.40546 6.90489 6.62974 6.3621 7.02944 5.96168L7.78033 5.20547L7.02944 4.44926L6.27323 5.20547C5.97535 5.50232 5.73899 5.85505 5.57772 6.24344C5.41645 6.63183 5.33344 7.04824 5.33344 7.46878C5.33344 7.88932 5.41645 8.30572 5.57772 8.69411C5.73899 9.0825 5.97535 9.43524 6.27323 9.73209C6.8758 10.3269 7.68984 10.6583 8.53654 10.6534C8.9587 10.6551 9.37701 10.5732 9.76732 10.4123C10.1576 10.2514 10.5122 10.0148 10.8105 9.71611L15.0709 5.45576C15.6678 4.85524 16.002 4.04232 16 3.19558C15.998 2.34883 15.66 1.5375 15.0602 0.939796Z",fill:"black",stroke:"none"}),Y("path",{d:"M1.71466 10.5575C1.5158 10.3596 1.35801 10.1243 1.25034 9.86524C1.14267 9.60615 1.08724 9.32834 1.08724 9.04777C1.08724 8.7672 1.14267 8.48939 1.25034 8.2303C1.35801 7.97121 1.5158 7.73594 1.71466 7.53801L5.97501 3.27766C6.17294 3.07881 6.40821 2.92101 6.6673 2.81334C6.92639 2.70567 7.2042 2.65024 7.48477 2.65024C7.76534 2.65024 8.04315 2.70567 8.30224 2.81334C8.56133 2.92101 8.7966 3.07881 8.99453 3.27766C9.19213 3.47715 9.34768 3.71428 9.45196 3.97498C9.55624 4.23569 9.60714 4.51468 9.60163 4.79541C9.60325 5.07702 9.54902 5.35616 9.44207 5.61668C9.33512 5.8772 9.17758 6.11392 8.97855 6.31316L7.84956 7.45813L8.60577 8.21434L9.73476 7.08535C10.3357 6.48437 10.6734 5.66928 10.6734 4.81938C10.6734 3.96947 10.3357 3.15438 9.73476 2.5534C9.13379 1.95243 8.3187 1.61481 7.46879 1.61481C6.61889 1.61481 5.80379 1.95243 5.20282 2.5534L0.942471 6.81375C0.643787 7.1107 0.406756 7.46376 0.245012 7.85265C0.0832669 8.24153 0 8.65855 0 9.07972C0 9.5009 0.0832669 9.91792 0.245012 10.3068C0.406756 10.6957 0.643787 11.0487 0.942471 11.3457C1.54894 11.936 2.36484 12.2616 3.21111 12.251C4.06483 12.2518 4.88421 11.9149 5.49039 11.3137L4.73418 10.5575C4.53625 10.7564 4.30098 10.9142 4.04189 11.0219C3.7828 11.1295 3.50499 11.185 3.22442 11.185C2.94385 11.185 2.66604 11.1295 2.40695 11.0219C2.14786 10.9142 1.91259 10.7564 1.71466 10.5575Z",fill:"black",stroke:"none"})]})}),Ag=e=>Y(i,{...e,children:Q("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M2 3H14V4.5H2V3Z",fill:"black",stroke:"none"}),Y("path",{d:"M2 6.5H10V8H2V6.5Z",fill:"black",stroke:"none"}),Y("path",{d:"M2 10H14V11.5H2V10Z",fill:"black",stroke:"none"}),Y("path",{d:"M2 13.5H10V15H2V13.5Z",fill:"black",stroke:"none"})]})}),Ng=e=>Y(i,{...e,children:Q("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M1 3H15V4.5H1V3Z",fill:"black",stroke:"none"}),Y("path",{d:"M4 6.5H12V8H4V6.5Z",fill:"black",stroke:"none"}),Y("path",{d:"M1 10H15V11.5H1V10Z",fill:"black",stroke:"none"}),Y("path",{d:"M4 13.5H12V15H4V13.5Z",fill:"black",stroke:"none"})]})}),Rg=e=>Y(i,{...e,children:Q("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M2 3H14V4.5H2V3Z",fill:"black",stroke:"none"}),Y("path",{d:"M6 6.5H14V8H6V6.5Z",fill:"black",stroke:"none"}),Y("path",{d:"M2 10H14V11.5H2V10Z",fill:"black",stroke:"none"}),Y("path",{d:"M6 13.5H14V15H6V13.5Z",fill:"black",stroke:"none"})]})}),Dg=e=>Y(i,{...e,children:Q("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M1 3H15V4.5H1V3Z",fill:"black",stroke:"none"}),Y("path",{d:"M1 6.5H15V8H1V6.5Z",fill:"black",stroke:"none"}),Y("path",{d:"M1 10H15V11.5H1V10Z",fill:"black",stroke:"none"}),Y("path",{d:"M1 13.5H15V15H1V13.5Z",fill:"black",stroke:"none"})]})}),Pg=$e`
106
+ `,Km=({icon:e,disabled:t,...r})=>ye(n,{css:Um,"aria-label":r["aria-label"],disabled:t,...r,children:e}),Zm=e=>Y(i,{...e,children:Q("svg",{viewBox:"0 0 16 17",children:[Q("g",{clipPath:"url(#clip0_1216_84)",children:[Y("path",{d:"M9.78791 8.03125H16V2.21875C16 1.27103 15.229 0.5 14.2812 0.5H7.1875V16.5H14.2812C15.229 16.5 16 15.729 16 14.7812V8.96875H9.78791L10.5502 9.73106C10.7333 9.91413 10.7333 10.2109 10.5502 10.394C10.3672 10.577 10.0704 10.577 9.88731 10.394L8.32481 8.83147C8.14175 8.64841 8.14175 8.35162 8.32481 8.16856L9.88731 6.60606C10.0704 6.423 10.3672 6.423 10.5502 6.60606C10.7333 6.78912 10.7333 7.08591 10.5502 7.26897L9.78791 8.03125Z",fill:"#4F4E4E"}),Y("path",{d:"M0 2.21875V14.7812C0 15.729 0.771031 16.5 1.71875 16.5H6.25V0.5H1.71875C0.771031 0.5 0 1.27103 0 2.21875ZM4.375 7.0625H1.875C1.61612 7.0625 1.40625 6.85262 1.40625 6.59375C1.40625 6.33488 1.61612 6.125 1.875 6.125H4.375C4.63387 6.125 4.84375 6.33488 4.84375 6.59375C4.84375 6.85262 4.63387 7.0625 4.375 7.0625ZM4.375 5.1875H1.875C1.61612 5.1875 1.40625 4.97762 1.40625 4.71875C1.40625 4.45988 1.61612 4.25 1.875 4.25H4.375C4.63387 4.25 4.84375 4.45988 4.84375 4.71875C4.84375 4.97762 4.63387 5.1875 4.375 5.1875ZM4.375 2.375C4.63387 2.375 4.84375 2.58488 4.84375 2.84375C4.84375 3.10262 4.63387 3.3125 4.375 3.3125H1.875C1.61612 3.3125 1.40625 3.10262 1.40625 2.84375C1.40625 2.58488 1.61612 2.375 1.875 2.375H4.375Z",fill:"#4F4E4E"})]}),Y("defs",{children:Y("clipPath",{id:"clip0_1216_84",children:Y("rect",{width:"16",height:"16",fill:"white",transform:"translate(0 0.5)"})})})]})}),Gm=e=>Y(i,{...e,children:Q("svg",{viewBox:"0 0 16 17",children:[Y("path",{d:"M0 2.21875V14.7812C0 15.729 0.771031 16.5 1.71875 16.5H6.25V0.5H1.71875C0.771031 0.5 0 1.27103 0 2.21875ZM4.375 7.0625H1.875C1.61612 7.0625 1.40625 6.85262 1.40625 6.59375C1.40625 6.33488 1.61612 6.125 1.875 6.125H4.375C4.63387 6.125 4.84375 6.33488 4.84375 6.59375C4.84375 6.85262 4.63387 7.0625 4.375 7.0625ZM4.375 5.1875H1.875C1.61612 5.1875 1.40625 4.97762 1.40625 4.71875C1.40625 4.45988 1.61612 4.25 1.875 4.25H4.375C4.63387 4.25 4.84375 4.45988 4.84375 4.71875C4.84375 4.97762 4.63387 5.1875 4.375 5.1875ZM4.375 2.375C4.63387 2.375 4.84375 2.58488 4.84375 2.84375C4.84375 3.10262 4.63387 3.3125 4.375 3.3125H1.875C1.61612 3.3125 1.40625 3.10262 1.40625 2.84375C1.40625 2.58488 1.61612 2.375 1.875 2.375H4.375Z",fill:"#4F4E4E"}),Y("path",{d:"M14.2812 0.5H7.1875V8.03125H12.4621L11.6998 7.26897C11.5168 7.08591 11.5168 6.78912 11.6998 6.60606C11.8829 6.423 12.1797 6.423 12.3627 6.60606L13.9252 8.16856C14.1083 8.35162 14.1083 8.64841 13.9252 8.83147L12.3627 10.394C12.1797 10.577 11.8829 10.577 11.6998 10.394C11.5168 10.2109 11.5168 9.91413 11.6998 9.73106L12.4621 8.96875H7.1875V16.5H14.2812C15.229 16.5 16 15.729 16 14.7812V2.21875C16 1.27103 15.229 0.5 14.2812 0.5Z",fill:"#4F4E4E"})]})}),Jm=e=>Y(i,{...e,children:Y("svg",{viewBox:"0 0 12 12",height:"12px",width:"12px",children:Y("path",{d:"M4.19632 10.4277L0 6.23139L1.04908 5.18231L4.19632 8.32955L10.9509 1.57495L12 2.62403L4.19632 10.4277Z",fill:"currentColor"})})}),Xm=e=>Y(i,{...e,children:Y("svg",{viewBox:"0 0 12 12",height:"12px",width:"12px",children:Y("path",{d:"M0 6.75V5.25H12V6.75H0Z",fill:"auto"})})}),Ym=e=>Y(i,{...e,children:Y("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M4.5 7.49997H5.5V4.49997H4.5V7.49997ZM5 3.49997C5.14167 3.49997 5.26042 3.45205 5.35625 3.35622C5.45208 3.26039 5.5 3.14164 5.5 2.99997C5.5 2.8583 5.45208 2.73955 5.35625 2.64372C5.26042 2.54789 5.14167 2.49997 5 2.49997C4.85833 2.49997 4.73958 2.54789 4.64375 2.64372C4.54792 2.73955 4.5 2.8583 4.5 2.99997C4.5 3.14164 4.54792 3.26039 4.64375 3.35622C4.73958 3.45205 4.85833 3.49997 5 3.49997ZM5 9.99997C4.30833 9.99997 3.65833 9.86872 3.05 9.60622C2.44167 9.34372 1.9125 8.98747 1.4625 8.53747C1.0125 8.08747 0.65625 7.5583 0.39375 6.94997C0.13125 6.34164 0 5.69164 0 4.99997C0 4.3083 0.13125 3.6583 0.39375 3.04997C0.65625 2.44164 1.0125 1.91247 1.4625 1.46247C1.9125 1.01247 2.44167 0.656219 3.05 0.393719C3.65833 0.131219 4.30833 -3.05176e-05 5 -3.05176e-05C5.69167 -3.05176e-05 6.34167 0.131219 6.95 0.393719C7.55833 0.656219 8.0875 1.01247 8.5375 1.46247C8.9875 1.91247 9.34375 2.44164 9.60625 3.04997C9.86875 3.6583 10 4.3083 10 4.99997C10 5.69164 9.86875 6.34164 9.60625 6.94997C9.34375 7.5583 8.9875 8.08747 8.5375 8.53747C8.0875 8.98747 7.55833 9.34372 6.95 9.60622C6.34167 9.86872 5.69167 9.99997 5 9.99997Z",fill:"currentColor"})})}),Qm=e=>Y(i,{...e,children:Y("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M8 13.3667L0 5.36667L1.86667 3.5L8 9.63333L14.1333 3.5L16 5.36667L8 13.3667Z",fill:"currentColor"})})}),eg=e=>Y(i,{...e,children:Y("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M5.37 0L13.37 8L5.37 16L3.50333 14.1333L9.63667 8L3.50333 1.86667L5.37 0Z",fill:"currentColor"})})}),tg=e=>Y(i,{...e,children:Y("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M1 10L0 9L4 5L0 1L1 0L5 4L9 0L10 1L6 5L10 9L9 10L5 6L1 10Z",fill:"currentColor"})})}),ng=e=>Y(i,{...e,children:Y("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M8 16C7.45 16 6.97917 15.8042 6.5875 15.4125C6.19583 15.0208 6 14.55 6 14C6 13.45 6.19583 12.9792 6.5875 12.5875C6.97917 12.1958 7.45 12 8 12C8.55 12 9.02083 12.1958 9.4125 12.5875C9.80417 12.9792 10 13.45 10 14C10 14.55 9.80417 15.0208 9.4125 15.4125C9.02083 15.8042 8.55 16 8 16ZM8 10C7.45 10 6.97917 9.80417 6.5875 9.4125C6.19583 9.02083 6 8.55 6 8C6 7.45 6.19583 6.97917 6.5875 6.5875C6.97917 6.19583 7.45 6 8 6C8.55 6 9.02083 6.19583 9.4125 6.5875C9.80417 6.97917 10 7.45 10 8C10 8.55 9.80417 9.02083 9.4125 9.4125C9.02083 9.80417 8.55 10 8 10ZM8 4C7.45 4 6.97917 3.80417 6.5875 3.4125C6.19583 3.02083 6 2.55 6 2C6 1.45 6.19583 0.979167 6.5875 0.5875C6.97917 0.195833 7.45 0 8 0C8.55 0 9.02083 0.195833 9.4125 0.5875C9.80417 0.979167 10 1.45 10 2C10 2.55 9.80417 3.02083 9.4125 3.4125C9.02083 3.80417 8.55 4 8 4Z",fill:"currentColor"})})}),rg=e=>Y(i,{...e,children:Y("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M5 6.95455C5.56818 6.95455 6.05114 6.75568 6.44886 6.35795C6.84659 5.96023 7.04545 5.47727 7.04545 4.90909C7.04545 4.34091 6.84659 3.85795 6.44886 3.46023C6.05114 3.0625 5.56818 2.86364 5 2.86364C4.43182 2.86364 3.94886 3.0625 3.55114 3.46023C3.15341 3.85795 2.95455 4.34091 2.95455 4.90909C2.95455 5.47727 3.15341 5.96023 3.55114 6.35795C3.94886 6.75568 4.43182 6.95455 5 6.95455ZM5 6.13636C4.65909 6.13636 4.36932 6.01705 4.13068 5.77841C3.89205 5.53977 3.77273 5.25 3.77273 4.90909C3.77273 4.56818 3.89205 4.27841 4.13068 4.03977C4.36932 3.80114 4.65909 3.68182 5 3.68182C5.34091 3.68182 5.63068 3.80114 5.86932 4.03977C6.10795 4.27841 6.22727 4.56818 6.22727 4.90909C6.22727 5.25 6.10795 5.53977 5.86932 5.77841C5.63068 6.01705 5.34091 6.13636 5 6.13636ZM5 8.31818C3.89394 8.31818 2.88636 8.00947 1.97727 7.39205C1.06818 6.77462 0.409091 5.94697 0 4.90909C0.409091 3.87121 1.06818 3.04356 1.97727 2.42614C2.88636 1.80871 3.89394 1.5 5 1.5C6.10606 1.5 7.11364 1.80871 8.02273 2.42614C8.93182 3.04356 9.59091 3.87121 10 4.90909C9.59091 5.94697 8.93182 6.77462 8.02273 7.39205C7.11364 8.00947 6.10606 8.31818 5 8.31818Z",fill:"currentColor"})})}),og=e=>Y(i,{...e,children:Q("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("g",{clipPath:"url(#clip0_4626_1381)",children:Y("path",{d:"M8.54545 9.9375L6.63636 8.05114C6.37121 8.13447 6.10417 8.19697 5.83523 8.23864C5.56629 8.2803 5.28788 8.30114 5 8.30114C3.85606 8.30114 2.83712 7.98485 1.94318 7.35227C1.04924 6.7197 0.401515 5.89962 0 4.89205C0.159091 4.49053 0.359848 4.11742 0.602273 3.77273C0.844697 3.42803 1.12121 3.11932 1.43182 2.84659L0.181818 1.57386L0.818182 0.9375L9.18182 9.30114L8.54545 9.9375ZM5 6.9375C5.08333 6.9375 5.16098 6.93371 5.23295 6.92614C5.30492 6.91856 5.38258 6.90341 5.46591 6.88068L3.01136 4.42614C2.98864 4.50947 2.97348 4.58712 2.96591 4.65909C2.95833 4.73106 2.95455 4.80871 2.95455 4.89205C2.95455 5.46023 3.15341 5.94318 3.55114 6.34091C3.94886 6.73864 4.43182 6.9375 5 6.9375ZM8.31818 7.14205L6.875 5.71023C6.92803 5.58144 6.9697 5.45076 7 5.31818C7.0303 5.18561 7.04545 5.04356 7.04545 4.89205C7.04545 4.32386 6.84659 3.84091 6.44886 3.44318C6.05114 3.04545 5.56818 2.84659 5 2.84659C4.84848 2.84659 4.70644 2.86174 4.57386 2.89205C4.44129 2.92235 4.31061 2.9678 4.18182 3.02841L3.02273 1.86932C3.33333 1.74053 3.65152 1.64394 3.97727 1.57955C4.30303 1.51515 4.64394 1.48295 5 1.48295C6.14394 1.48295 7.16288 1.79924 8.05682 2.43182C8.95076 3.06439 9.59848 3.88447 10 4.89205C9.82576 5.33902 9.59659 5.75379 9.3125 6.13636C9.02841 6.51894 8.69697 6.85417 8.31818 7.14205ZM6.21591 5.05114L4.85227 3.6875C5.06439 3.64962 5.25947 3.66667 5.4375 3.73864C5.61553 3.81061 5.76894 3.91477 5.89773 4.05114C6.02652 4.1875 6.11932 4.3447 6.17614 4.52273C6.23295 4.70076 6.24621 4.87689 6.21591 5.05114Z",fill:"currentColor"})}),Y("defs",{children:Y("clipPath",{id:"clip0_4626_1381",children:Y("rect",{width:"10",height:"10",fill:"white"})})})]})}),ig=e=>Y(i,{...e,children:Q("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("g",{clipPath:"url(#clip0_4916_54426)",children:Y("path",{d:"M8.6 14.6L15.65 7.55L14.25 6.15L8.6 11.8L5.75 8.95L4.35 10.35L8.6 14.6ZM10 20C8.61667 20 7.31667 19.7375 6.1 19.2125C4.88333 18.6875 3.825 17.975 2.925 17.075C2.025 16.175 1.3125 15.1167 0.7875 13.9C0.2625 12.6833 0 11.3833 0 10C0 8.61667 0.2625 7.31667 0.7875 6.1C1.3125 4.88333 2.025 3.825 2.925 2.925C3.825 2.025 4.88333 1.3125 6.1 0.7875C7.31667 0.2625 8.61667 0 10 0C11.3833 0 12.6833 0.2625 13.9 0.7875C15.1167 1.3125 16.175 2.025 17.075 2.925C17.975 3.825 18.6875 4.88333 19.2125 6.1C19.7375 7.31667 20 8.61667 20 10C20 11.3833 19.7375 12.6833 19.2125 13.9C18.6875 15.1167 17.975 16.175 17.075 17.075C16.175 17.975 15.1167 18.6875 13.9 19.2125C12.6833 19.7375 11.3833 20 10 20Z",fill:"currentColor"})}),Y("defs",{children:Y("clipPath",{id:"clip0_4916_54426",children:Y("rect",{width:"20",height:"20",fill:"white"})})})]})}),sg=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M0 18.6477L10 1.375L20 18.6477H0ZM10 15.9205C10.2576 15.9205 10.4735 15.8333 10.6477 15.6591C10.822 15.4848 10.9091 15.2689 10.9091 15.0114C10.9091 14.7538 10.822 14.5379 10.6477 14.3636C10.4735 14.1894 10.2576 14.1023 10 14.1023C9.74242 14.1023 9.52652 14.1894 9.35227 14.3636C9.17803 14.5379 9.09091 14.7538 9.09091 15.0114C9.09091 15.2689 9.17803 15.4848 9.35227 15.6591C9.52652 15.8333 9.74242 15.9205 10 15.9205ZM9.09091 13.1932H10.9091V8.64773H9.09091V13.1932Z",fill:"currentColor"})})}),ag=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M10 15C10.2833 15 10.5208 14.9042 10.7125 14.7125C10.9042 14.5208 11 14.2833 11 14C11 13.7167 10.9042 13.4792 10.7125 13.2875C10.5208 13.0958 10.2833 13 10 13C9.71667 13 9.47917 13.0958 9.2875 13.2875C9.09583 13.4792 9 13.7167 9 14C9 14.2833 9.09583 14.5208 9.2875 14.7125C9.47917 14.9042 9.71667 15 10 15ZM9 11H11V5H9V11ZM10 20C8.61667 20 7.31667 19.7375 6.1 19.2125C4.88333 18.6875 3.825 17.975 2.925 17.075C2.025 16.175 1.3125 15.1167 0.7875 13.9C0.2625 12.6833 0 11.3833 0 10C0 8.61667 0.2625 7.31667 0.7875 6.1C1.3125 4.88333 2.025 3.825 2.925 2.925C3.825 2.025 4.88333 1.3125 6.1 0.7875C7.31667 0.2625 8.61667 0 10 0C11.3833 0 12.6833 0.2625 13.9 0.7875C15.1167 1.3125 16.175 2.025 17.075 2.925C17.975 3.825 18.6875 4.88333 19.2125 6.1C19.7375 7.31667 20 8.61667 20 10C20 11.3833 19.7375 12.6833 19.2125 13.9C18.6875 15.1167 17.975 16.175 17.075 17.075C16.175 17.975 15.1167 18.6875 13.9 19.2125C12.6833 19.7375 11.3833 20 10 20Z",fill:"currentColor"})})}),lg=e=>Y(i,{...e,children:Q("svg",{width:"91",height:"32",viewBox:"0 0 91 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.79733 2.62109L7.05688 4.36154L8.6964 6.00105L10.4368 4.26061L8.79733 2.62109",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.4348 17.7395L26.7261 24.0306L28.4666 22.2904L22.1753 15.999L20.4348 17.7395",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.83032 8.73722L8.57056 10.4775L15.5197 3.52853L17.9952 6.00428L19.7357 4.26384L15.5197 0.0478516L6.83032 8.73722",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.0828 8.74062L26.823 10.4811L28.4667 8.83761L26.7262 7.09717L25.0828 8.74062",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.05664 26.7665L8.79688 28.5069L15.088 22.216L13.3476 20.4756L7.05664 26.7665",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9583 17.865L17.6987 19.6052L24.2126 13.0913L22.4722 11.3511L15.9583 17.865",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.606 8.61475L27.5582 15.5672L25.086 18.0396L26.8264 19.7799L31.0391 15.5672L22.3462 6.87451L20.606 8.61475",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.58008 22.2898L4.32031 24.0302L5.95651 22.394L4.21607 20.6538L2.58008 22.2898",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9583 8.91145L17.6987 10.6517L23.99 4.36056L22.2496 2.62012L15.9583 8.91145",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 15.5676L8.69268 24.2603L10.4331 22.5198L3.48068 15.5676L5.96016 13.0881L4.21971 11.3477L0 15.5676",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.3071 8.61154L17.8244 15.1288L19.5646 13.3885L13.0474 6.87109L11.3071 8.61154",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.6091 26.8674L22.2493 28.5073L23.9897 26.7671L22.3496 25.127L20.6091 26.8674",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.58008 8.83789L8.87079 15.1286L10.6112 13.3884L4.32052 7.09766L2.58008 8.83789",fill:"#9B9B9B"}),Y("mask",{id:"mask0_2684_24177",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"11",y:"15",width:"14",height:"17",children:Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.3035 15.999H24.2159V31.0746H11.3035V15.999Z",fill:"white"})}),Q("g",{mask:"url(#mask0_2684_24177)",children:[Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4817 17.7395L17.9989 24.2567L19.7392 22.5163L13.2219 15.999L11.4817 17.7395",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5195 27.6061L13.0437 25.1303L11.3035 26.8706L15.5195 31.0868L24.2159 22.3903L22.4756 20.6499L15.5195 27.6061",fill:"#9B9B9B"})]}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.82666 18.0429L8.5669 19.7834L15.0881 13.2624L13.3476 11.522L6.82666 18.0429",fill:"#9B9B9B"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M39.8376 3.46878C39.7609 3.22403 39.6861 3.06362 39.5918 2.99958C39.5199 2.95005 39.386 2.93948 39.3278 2.93948C39.2598 2.93948 39.219 2.93264 39.219 2.87834C39.219 2.83171 39.2754 2.82031 39.3653 2.82031C39.7133 2.82031 40.0782 2.83648 40.1396 2.83648C40.1999 2.83648 40.4927 2.82031 40.8782 2.82031C40.9688 2.82031 41.0173 2.83648 41.0173 2.87834C41.0173 2.93264 40.9628 2.93948 40.8968 2.93948C40.8442 2.93948 40.7783 2.93948 40.7319 2.96373C40.6714 2.99191 40.6579 3.0373 40.6579 3.10921C40.6579 3.19853 40.724 3.42402 40.8055 3.721C40.9174 4.16202 41.5358 6.18037 41.656 6.55196H41.6755L42.9658 3.08496C43.0325 2.89616 43.0773 2.84497 43.1336 2.84497C43.2064 2.84497 43.2387 2.94632 43.3278 3.15999L44.7104 6.5043H44.7296C44.8482 6.05851 45.3823 4.30149 45.6173 3.52391C45.66 3.37138 45.6811 3.23169 45.6811 3.13615C45.6811 3.0315 45.6222 2.93948 45.3617 2.93948C45.2969 2.93948 45.2502 2.9171 45.2502 2.87834C45.2502 2.83171 45.3008 2.82031 45.4036 2.82031C45.7549 2.82031 46.034 2.83648 46.0939 2.83648C46.1395 2.83648 46.4268 2.82031 46.6462 2.82031C46.7184 2.82031 46.7658 2.83171 46.7658 2.87233C46.7658 2.9171 46.7351 2.93948 46.6744 2.93948C46.6067 2.93948 46.5142 2.94632 46.4407 2.97139C46.2796 3.0315 46.2092 3.29656 46.0657 3.67831C45.763 4.51578 45.0639 6.63155 44.7377 7.62964C44.6639 7.86258 44.6308 7.94279 44.5435 7.94279C44.4756 7.94279 44.4378 7.86258 44.3377 7.6141L42.9542 4.2818H42.9397C42.8143 4.62169 41.9279 6.97723 41.6423 7.58778C41.514 7.86258 41.4831 7.94279 41.4034 7.94279C41.3358 7.94279 41.3105 7.87025 41.2502 7.69575L39.8376 3.46878",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M52.4736 5.46052C52.4736 3.96919 51.6156 3.04363 50.5241 3.04363C49.7593 3.04363 48.8862 3.46848 48.8862 5.12686C48.8862 6.51167 49.6547 7.61007 50.9315 7.61007C51.3984 7.61007 52.4736 7.38417 52.4736 5.46052ZM47.9695 5.33425C47.9695 4.19523 48.7201 2.72607 50.7182 2.72607C52.3747 2.72607 53.4068 3.68811 53.4068 5.21384C53.4068 6.73834 52.3397 7.94243 50.6521 7.94243C48.7413 7.94243 47.9695 6.51161 47.9695 5.33425V5.33425Z",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M56.6253 5.27407C56.6253 5.34806 56.6388 5.37251 56.685 5.39469C56.8222 5.44111 57.0255 5.46059 57.1911 5.46059C57.4551 5.46059 57.5428 5.43261 57.6644 5.34806C57.8634 5.20029 58.0557 4.89253 58.0557 4.34561C58.0557 3.40327 57.4331 3.13178 57.0371 3.13178C56.8709 3.13178 56.7515 3.13593 56.685 3.15976C56.6388 3.17219 56.6253 3.19831 56.6253 3.25115V5.27407ZM55.8409 4.74893C55.8409 3.73799 55.8409 3.5494 55.8277 3.33842C55.8144 3.10921 55.7609 3.00435 55.5421 2.95689C55.4865 2.94632 55.3769 2.93948 55.2814 2.93948C55.208 2.93948 55.1667 2.92352 55.1667 2.87834C55.1667 2.83171 55.2146 2.82031 55.3122 2.82031C55.6681 2.82031 56.0873 2.83648 56.2272 2.83648C56.4521 2.83648 56.9576 2.82031 57.1633 2.82031C57.5836 2.82031 58.0313 2.86052 58.3884 3.10465C58.5765 3.23169 58.841 3.5724 58.841 4.01632C58.841 4.50957 58.6354 4.95825 57.9633 5.50455C58.5554 6.25187 59.014 6.84501 59.4066 7.25598C59.7788 7.64145 60.0519 7.68767 60.1537 7.70984C60.225 7.72373 60.2867 7.72891 60.3379 7.72891C60.3924 7.72891 60.4187 7.75233 60.4187 7.78404C60.4187 7.83357 60.3732 7.8489 60.2913 7.8489H59.6602C59.2866 7.8489 59.1197 7.81429 58.9498 7.72373C58.6626 7.56974 58.4076 7.25598 58.0369 6.74512C57.7708 6.37705 57.4665 5.92671 57.3766 5.82371C57.3461 5.78785 57.3051 5.78018 57.2585 5.78018L56.6788 5.76485C56.6469 5.76485 56.6253 5.78018 56.6253 5.8179V5.91344C56.6253 6.53145 56.6253 7.05661 56.6585 7.3368C56.6788 7.52871 56.7165 7.6773 56.9194 7.70155C57.0195 7.71751 57.1633 7.72891 57.2429 7.72891C57.297 7.72891 57.3264 7.75233 57.3264 7.78404C57.3264 7.82984 57.279 7.8489 57.1911 7.8489C56.8056 7.8489 56.3132 7.82984 56.2142 7.82984C56.0873 7.82984 55.6681 7.8489 55.4016 7.8489C55.3122 7.8489 55.2681 7.82984 55.2681 7.78404C55.2681 7.75233 55.2944 7.72891 55.3769 7.72891C55.4751 7.72891 55.5543 7.71751 55.6142 7.70155C55.7466 7.6773 55.7808 7.52871 55.8071 7.3368C55.8409 7.05661 55.8409 6.53145 55.8409 5.92028V4.74893V4.74893Z",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M62.7401 5.92028C62.7401 6.76978 62.7401 7.22986 62.8795 7.34944C62.9923 7.45099 63.167 7.49804 63.6837 7.49804C64.037 7.49804 64.2973 7.48913 64.4635 7.30945C64.5458 7.22385 64.6235 7.03567 64.6351 6.91236C64.6426 6.85164 64.6544 6.8104 64.7079 6.8104C64.7576 6.8104 64.7636 6.84501 64.7636 6.92273C64.7636 6.99858 64.7159 7.49804 64.6633 7.68767C64.6235 7.83357 64.5885 7.87025 64.2426 7.87025C63.7651 7.87025 63.4198 7.85491 63.1195 7.8489C62.8194 7.83357 62.5805 7.82984 62.3067 7.82984C62.2352 7.82984 62.0852 7.82984 61.9272 7.83357C61.7749 7.83357 61.6029 7.8489 61.4709 7.8489C61.3832 7.8489 61.3349 7.82984 61.3349 7.78404C61.3349 7.75233 61.365 7.72891 61.4413 7.72891C61.543 7.72891 61.6216 7.71751 61.6819 7.70155C61.8176 7.6773 61.8487 7.52871 61.874 7.3368C61.9082 7.05661 61.9082 6.53145 61.9082 5.92028V4.74893C61.9082 3.73799 61.9082 3.5494 61.8951 3.33842C61.8817 3.10921 61.8269 3.00435 61.6095 2.95689C61.5577 2.94632 61.474 2.93948 61.3886 2.93948C61.3155 2.93948 61.2759 2.92352 61.2759 2.87834C61.2759 2.83171 61.3233 2.82031 61.4214 2.82031C61.7353 2.82031 62.1536 2.83648 62.3341 2.83648C62.4939 2.83648 62.9803 2.82031 63.2387 2.82031C63.3324 2.82031 63.38 2.83171 63.38 2.87834C63.38 2.92352 63.339 2.93948 63.2588 2.93948C63.1867 2.93948 63.0816 2.94632 62.9991 2.95689C62.8194 2.99191 62.7647 3.10465 62.7533 3.33842C62.7401 3.5494 62.7401 3.73799 62.7401 4.74893V5.92028",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.8097 5.48049C67.8097 6.18388 67.8141 6.6966 67.8234 6.82509C67.8294 6.99068 67.8447 7.25575 67.8978 7.33056C67.9832 7.45595 68.2426 7.59501 68.7672 7.59501C69.4469 7.59501 69.9002 7.46237 70.2973 7.11627C70.7267 6.74903 70.8568 6.14512 70.8568 5.46059C70.8568 4.61607 70.5043 4.06832 70.22 3.79517C69.6061 3.21012 68.8478 3.13178 68.3284 3.13178C68.1954 3.13178 67.9498 3.1496 67.8978 3.17696C67.8375 3.20432 67.8141 3.23706 67.8141 3.30918C67.8097 3.53819 67.8097 4.11682 67.8097 4.64343V5.48049ZM66.9788 4.74893C66.9788 3.73799 66.9788 3.5494 66.9632 3.33842C66.95 3.10921 66.8969 3.00435 66.6779 2.95689C66.6254 2.94632 66.5114 2.93948 66.4196 2.93948C66.3438 2.93948 66.3042 2.92352 66.3042 2.87834C66.3042 2.83171 66.3531 2.82031 66.4509 2.82031C66.8041 2.82031 67.2215 2.83648 67.4096 2.83648C67.6156 2.83648 68.0355 2.82031 68.4355 2.82031C69.267 2.82031 70.3786 2.82031 71.1044 3.57676C71.4374 3.92389 71.7481 4.47661 71.7481 5.26622C71.7481 6.10556 71.3968 6.74512 71.0236 7.125C70.7169 7.43669 70.0257 7.90942 68.7953 7.90942C68.5559 7.90942 68.2817 7.88911 68.0297 7.87025C67.7761 7.8489 67.5417 7.82984 67.379 7.82984C67.3042 7.82984 67.1574 7.82984 66.9964 7.83357C66.8441 7.83357 66.6721 7.8489 66.5373 7.8489C66.4509 7.8489 66.407 7.82984 66.407 7.78404C66.407 7.75233 66.4335 7.72891 66.5114 7.72891C66.612 7.72891 66.6932 7.71751 66.7518 7.70155C66.8855 7.6773 66.9187 7.52871 66.9456 7.3368C66.9788 7.05661 66.9788 6.53145 66.9788 5.92028V4.74893V4.74893Z",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M41.2173 16.0733C41.2173 16.1481 41.231 16.1755 41.2755 16.1948C41.4152 16.241 41.6173 16.2607 41.7812 16.2607C42.0492 16.2607 42.1356 16.2333 42.2543 16.1481C42.456 16.0002 42.6456 15.6964 42.6456 15.1501C42.6456 14.2044 42.022 13.9325 41.6299 13.9325C41.4637 13.9325 41.3425 13.9385 41.2755 13.9582C41.231 13.9727 41.2173 13.9965 41.2173 14.0508V16.0733ZM40.4308 15.5499C40.4308 14.5375 40.4308 14.3499 40.419 14.1383C40.4055 13.9131 40.3531 13.8053 40.1297 13.7597C40.0783 13.746 39.966 13.7406 39.8735 13.7406C39.8016 13.7406 39.761 13.727 39.761 13.6772C39.761 13.6316 39.8055 13.6167 39.9083 13.6167C40.258 13.6167 40.6772 13.6397 40.8181 13.6397C41.0424 13.6397 41.5472 13.6167 41.757 13.6167C42.1733 13.6167 42.6222 13.6606 42.9812 13.9075C43.1658 14.0335 43.434 14.3723 43.434 14.8179C43.434 15.3084 43.2251 15.7621 42.5542 16.3086C43.1463 17.053 43.6056 17.6457 43.9979 18.0588C44.3697 18.4434 44.6426 18.4917 44.7425 18.5095C44.8176 18.5228 44.8756 18.5328 44.9299 18.5328C44.9804 18.5328 45.0097 18.5489 45.0097 18.5829C45.0097 18.6376 44.9628 18.6492 44.8837 18.6492H44.2503C43.8754 18.6492 43.7123 18.6171 43.5376 18.5228C43.2522 18.3697 42.9996 18.0588 42.627 17.5452C42.3611 17.1811 42.056 16.727 41.9688 16.6288C41.9358 16.5867 41.8937 16.5815 41.8463 16.5815L41.2714 16.5683C41.2376 16.5683 41.2173 16.5815 41.2173 16.6203V16.7152C41.2173 17.3328 41.2173 17.8571 41.2502 18.1375C41.2714 18.3294 41.3106 18.477 41.5097 18.5035C41.6096 18.5174 41.757 18.5328 41.8347 18.5328C41.8892 18.5328 41.9163 18.5489 41.9163 18.5829C41.9163 18.6287 41.8678 18.6492 41.7812 18.6492C41.3959 18.6492 40.9046 18.6287 40.8055 18.6287C40.6772 18.6287 40.258 18.6492 39.9937 18.6492C39.9083 18.6492 39.8582 18.6287 39.8582 18.5829C39.8582 18.5489 39.8862 18.5328 39.966 18.5328C40.0661 18.5328 40.1465 18.5174 40.2076 18.5035C40.3396 18.477 40.3734 18.3294 40.3999 18.1375C40.4308 17.8571 40.4308 17.3328 40.4308 16.7192V15.5499V15.5499Z",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.4986 15.5498C46.4986 14.5374 46.4986 14.3499 46.4862 14.1383C46.4737 13.913 46.419 13.8052 46.1998 13.7596C46.1463 13.7459 46.0306 13.7406 45.9419 13.7406C45.8675 13.7406 45.8257 13.7269 45.8257 13.6771C45.8257 13.6315 45.8736 13.6166 45.9734 13.6166C46.1531 13.6166 46.3475 13.6247 46.5142 13.6247C46.6849 13.6315 46.8387 13.6396 46.932 13.6396C47.1456 13.6396 48.4681 13.6396 48.5961 13.6315C48.7201 13.6166 48.827 13.6054 48.8813 13.5928C48.914 13.5868 48.9553 13.5654 48.9864 13.5654C49.0191 13.5654 49.0272 13.5928 49.0272 13.6247C49.0272 13.6722 48.9959 13.7528 48.9727 14.0589C48.9686 14.1248 48.9553 14.4201 48.9414 14.4964C48.9352 14.5306 48.9199 14.5695 48.8736 14.5695C48.827 14.5695 48.8144 14.5374 48.8144 14.4781C48.8144 14.4315 48.8096 14.3167 48.7762 14.239C48.7275 14.1186 48.662 14.0375 48.3282 13.9965C48.2154 13.9836 47.5162 13.9727 47.384 13.9727C47.35 13.9727 47.3377 13.9905 47.3377 14.0375V15.7226C47.3377 15.7684 47.3454 15.7946 47.384 15.7946C47.5299 15.7946 48.2969 15.7946 48.4484 15.7809C48.6098 15.7684 48.7085 15.7488 48.7667 15.6818C48.8144 15.6281 48.8405 15.5948 48.8736 15.5948C48.902 15.5948 48.9199 15.6085 48.9199 15.6491C48.9199 15.6887 48.8952 15.7946 48.8678 16.1344C48.8627 16.2665 48.8405 16.5336 48.8405 16.5815C48.8405 16.6333 48.8405 16.7056 48.7802 16.7056C48.7335 16.7056 48.7201 16.6799 48.7201 16.6474C48.7165 16.5815 48.7165 16.4955 48.695 16.4063C48.662 16.2745 48.5704 16.1755 48.3222 16.1481C48.1959 16.1344 47.5359 16.1268 47.3784 16.1268C47.3454 16.1268 47.3377 16.1541 47.3377 16.1947V16.7191C47.3377 16.9454 47.3301 17.5599 47.3377 17.753C47.35 18.2081 47.4559 18.3115 48.1344 18.3115C48.3085 18.3115 48.5881 18.3115 48.7617 18.233C48.9352 18.1499 49.0146 18.0135 49.0628 17.7385C49.0749 17.6627 49.0869 17.6376 49.1348 17.6376C49.188 17.6376 49.188 17.6923 49.188 17.7582C49.188 17.9118 49.1348 18.3648 49.1008 18.4968C49.0521 18.6697 48.9959 18.6697 48.7427 18.6697C48.2428 18.6697 47.8782 18.6545 47.5902 18.6491C47.3046 18.6375 47.0969 18.6286 46.898 18.6286C46.8246 18.6286 46.6785 18.6286 46.5181 18.6375C46.3656 18.6375 46.1938 18.6491 46.0597 18.6491C45.9734 18.6491 45.9239 18.6286 45.9239 18.5828C45.9239 18.5488 45.9542 18.5327 46.0306 18.5327C46.1314 18.5327 46.2132 18.5173 46.2735 18.5035C46.4064 18.4769 46.4379 18.3294 46.4657 18.1375C46.4986 17.8571 46.4986 17.3327 46.4986 16.7191V15.5498",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M51.3845 18.5715C51.2755 18.5227 51.2566 18.4917 51.2566 18.3445C51.2566 17.9771 51.2813 17.579 51.2875 17.4735C51.2951 17.3723 51.3163 17.3017 51.3685 17.3017C51.429 17.3017 51.435 17.3607 51.435 17.4134C51.435 17.4979 51.463 17.6376 51.4951 17.753C51.6408 18.2448 52.0348 18.4243 52.4487 18.4243C53.0447 18.4243 53.3388 18.016 53.3388 17.6627C53.3388 17.3373 53.2368 17.0335 52.6864 16.6006L52.3805 16.3597C51.6485 15.7888 51.3959 15.3208 51.3959 14.7843C51.3959 14.0508 52.0079 13.5244 52.9342 13.5244C53.3649 13.5244 53.6447 13.5928 53.8181 13.6396C53.8789 13.655 53.9126 13.6722 53.9126 13.719C53.9126 13.8052 53.883 13.9965 53.883 14.5173C53.883 14.6647 53.8625 14.7171 53.8113 14.7171C53.7628 14.7171 53.7439 14.6771 53.7439 14.5986C53.7439 14.5374 53.7129 14.3304 53.5723 14.158C53.4708 14.0334 53.2795 13.8326 52.8445 13.8326C52.3531 13.8326 52.0545 14.1186 52.0545 14.5173C52.0545 14.8247 52.2099 15.0547 52.7614 15.4773L52.9454 15.6161C53.7533 16.2211 54.0368 16.6799 54.0368 17.3135C54.0368 17.6975 53.8913 18.1594 53.4136 18.4703C53.0816 18.6819 52.7088 18.7449 52.3531 18.7449C51.9691 18.7449 51.6698 18.6966 51.3845 18.5715",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.4449 16.2609C60.4449 14.7716 59.5867 13.8452 58.4976 13.8452C57.731 13.8452 56.8585 14.2726 56.8585 15.9289C56.8585 17.3137 57.6253 18.4106 58.9013 18.4106C59.3691 18.4106 60.4449 18.1835 60.4449 16.2609ZM55.9399 16.1345C55.9399 14.9975 56.6912 13.5244 58.689 13.5244C60.3437 13.5244 61.3787 14.4918 61.3787 16.0161C61.3787 17.5404 60.3116 18.7449 58.6225 18.7449C56.713 18.7449 55.9399 17.3135 55.9399 16.1345V16.1345Z",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M63.5918 15.5499C63.5918 14.5375 63.5918 14.3499 63.579 14.1383C63.5653 13.9131 63.5118 13.8053 63.2915 13.7597C63.2387 13.746 63.1243 13.7406 63.0314 13.7406C62.9575 13.7406 62.9187 13.727 62.9187 13.6772C62.9187 13.6316 62.9649 13.6167 63.0661 13.6167C63.4175 13.6167 63.8366 13.6397 64.037 13.6397C64.1955 13.6397 64.6175 13.6167 64.8544 13.6167C64.9557 13.6167 65.0017 13.6316 65.0017 13.6772C65.0017 13.727 64.9615 13.7406 64.8956 13.7406C64.8216 13.7406 64.781 13.746 64.7012 13.7597C64.5207 13.791 64.4712 13.9075 64.4554 14.1383C64.4438 14.3499 64.4438 14.5375 64.4438 15.5499V16.481C64.4438 17.4441 64.6351 17.8515 64.9615 18.1189C65.2608 18.3649 65.5685 18.3908 65.7924 18.3908C66.086 18.3908 66.4466 18.2979 66.7125 18.0314C67.0781 17.6627 67.0972 17.0661 67.0972 16.3803V15.5499C67.0972 14.5375 67.0972 14.3499 67.0858 14.1383C67.0721 13.9131 67.018 13.8053 66.7992 13.7597C66.7459 13.746 66.6332 13.7406 66.5573 13.7406C66.4858 13.7406 66.4466 13.727 66.4466 13.6772C66.4466 13.6316 66.491 13.6167 66.5876 13.6167C66.9237 13.6167 67.3417 13.6397 67.3417 13.6397C67.4323 13.6397 67.8491 13.6167 68.1089 13.6167C68.2041 13.6167 68.2476 13.6316 68.2476 13.6772C68.2476 13.727 68.2097 13.7406 68.1282 13.7406C68.0561 13.7406 68.0138 13.746 67.9382 13.7597C67.7572 13.791 67.7013 13.9075 67.6893 14.1383C67.6762 14.3499 67.6762 14.5375 67.6762 15.5499V16.2607C67.6762 17.0006 67.6045 17.7832 67.0431 18.2627C66.5718 18.6697 66.0937 18.745 65.6583 18.745C65.3091 18.745 64.6681 18.723 64.1835 18.2826C63.8428 17.9771 63.5918 17.4851 63.5918 16.5212V15.5499",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M71.3762 16.0733C71.3762 16.1481 71.3888 16.1755 71.4361 16.1948C71.5762 16.241 71.7749 16.2607 71.942 16.2607C72.2083 16.2607 72.2937 16.2333 72.4141 16.1481C72.6143 16.0002 72.8066 15.6964 72.8066 15.1501C72.8066 14.2044 72.1809 13.9325 71.7886 13.9325C71.622 13.9325 71.5043 13.9385 71.4361 13.9582C71.3888 13.9727 71.3762 13.9965 71.3762 14.0508V16.0733ZM70.5907 15.5499C70.5907 14.5375 70.5907 14.3499 70.5772 14.1383C70.5634 13.9131 70.5117 13.8053 70.2917 13.7597C70.2361 13.746 70.1248 13.7406 70.0322 13.7406C69.9599 13.7406 69.9167 13.727 69.9167 13.6772C69.9167 13.6316 69.9634 13.6167 70.0664 13.6167C70.4158 13.6167 70.8371 13.6397 70.9762 13.6397C71.2044 13.6397 71.7084 13.6167 71.9152 13.6167C72.3343 13.6167 72.7813 13.6606 73.138 13.9075C73.3268 14.0335 73.5924 14.3723 73.5924 14.8179C73.5924 15.3084 73.3864 15.7621 72.7125 16.3086C73.305 17.053 73.7636 17.6457 74.1555 18.0588C74.5284 18.4434 74.8025 18.4917 74.9016 18.5095C74.9754 18.5228 75.0363 18.5328 75.0888 18.5328C75.1422 18.5328 75.1683 18.5489 75.1683 18.5829C75.1683 18.6376 75.1227 18.6492 75.0403 18.6492H74.4102C74.0393 18.6492 73.8699 18.6171 73.6994 18.5228C73.4121 18.3697 73.1579 18.0588 72.7867 17.5452C72.5195 17.1811 72.2143 16.727 72.1274 16.6288C72.0939 16.5867 72.053 16.5815 72.0081 16.5815L71.4315 16.5683C71.3969 16.5683 71.3762 16.5815 71.3762 16.6203V16.7152C71.3762 17.3328 71.3762 17.8571 71.4102 18.1375C71.4315 18.3294 71.4682 18.477 71.6702 18.5035C71.7683 18.5174 71.9152 18.5328 71.9946 18.5328C72.0476 18.5328 72.0738 18.5489 72.0738 18.5829C72.0738 18.6287 72.0273 18.6492 71.9419 18.6492C71.5558 18.6492 71.0626 18.6287 70.9635 18.6287C70.8371 18.6287 70.4158 18.6492 70.1522 18.6492C70.0664 18.6492 70.0197 18.6287 70.0197 18.5829C70.0197 18.5489 70.044 18.5328 70.1248 18.5328C70.2258 18.5328 70.3053 18.5174 70.3642 18.5035C70.4974 18.477 70.5304 18.3294 70.558 18.1375C70.5907 17.8571 70.5907 17.3328 70.5907 16.7192V15.5499V15.5499Z",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M76.7248 18.016C76.0707 17.444 75.9004 16.6996 75.9004 16.0549C75.9004 15.6041 76.0397 14.8178 76.68 14.2313C77.1561 13.7909 77.789 13.5244 78.7811 13.5244C79.1931 13.5244 79.4405 13.553 79.7454 13.5928C79.9991 13.6247 80.2123 13.6879 80.4121 13.7047C80.4836 13.7124 80.512 13.746 80.512 13.787C80.512 13.8403 80.4917 13.9167 80.4784 14.1503C80.4648 14.3723 80.4701 14.7376 80.4571 14.869C80.4511 14.9695 80.4374 15.0236 80.3773 15.0236C80.3251 15.0236 80.3122 14.9695 80.3122 14.8761C80.3046 14.6701 80.2179 14.4404 80.0525 14.2655C79.8333 14.0334 79.3152 13.8519 78.7017 13.8519C78.1229 13.8519 77.7424 13.9965 77.4508 14.2655C76.9646 14.7094 76.8376 15.3413 76.8376 15.9871C76.8376 17.5711 78.0433 18.3559 78.9345 18.3559C79.5251 18.3559 79.8849 18.2919 80.1499 17.9833C80.2648 17.8571 80.352 17.6627 80.3773 17.5452C80.3972 17.4374 80.4121 17.4134 80.4648 17.4134C80.512 17.4134 80.5249 17.4585 80.5249 17.5131C80.5249 17.591 80.4455 18.1715 80.3773 18.3969C80.3421 18.5095 80.3176 18.5447 80.2065 18.5907C79.9384 18.6966 79.4325 18.7449 79.0066 18.7449C78.0959 18.7449 77.3306 18.5447 76.7248 18.016",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M82.9906 15.5498C82.9906 14.5374 82.9906 14.3499 82.9794 14.1383C82.9659 13.913 82.9112 13.8052 82.6928 13.7596C82.6399 13.7459 82.5272 13.7406 82.4333 13.7406C82.3601 13.7406 82.3191 13.7269 82.3191 13.6771C82.3191 13.6315 82.3661 13.6166 82.4629 13.6166C82.6474 13.6166 82.8378 13.6247 83.0049 13.6247C83.1806 13.6315 83.3331 13.6396 83.4252 13.6396C83.6378 13.6396 84.9615 13.6396 85.0891 13.6315C85.2143 13.6166 85.3208 13.6054 85.3739 13.5928C85.4089 13.5868 85.451 13.5654 85.4783 13.5654C85.5152 13.5654 85.519 13.5928 85.519 13.6247C85.519 13.6722 85.4862 13.7528 85.4686 14.0589C85.4613 14.1248 85.451 14.4201 85.4354 14.4964C85.4282 14.5306 85.4145 14.5695 85.3697 14.5695C85.3208 14.5695 85.3078 14.5374 85.3078 14.4781C85.3078 14.4315 85.302 14.3167 85.2667 14.239C85.2211 14.1186 85.1542 14.0375 84.8224 13.9965C84.7097 13.9836 84.0092 13.9727 83.8784 13.9727C83.8436 13.9727 83.8299 13.9905 83.8299 14.0375V15.7226C83.8299 15.7684 83.8399 15.7946 83.8784 15.7946C84.0224 15.7946 84.7913 15.7946 84.9426 15.7809C85.102 15.7684 85.2006 15.7488 85.2611 15.6818C85.3078 15.6281 85.3351 15.5948 85.3697 15.5948C85.3932 15.5948 85.4145 15.6085 85.4145 15.6491C85.4145 15.6887 85.3874 15.7946 85.3621 16.1344C85.3532 16.2665 85.3351 16.5336 85.3351 16.5815C85.3351 16.6333 85.3351 16.7056 85.2742 16.7056C85.2288 16.7056 85.2143 16.6799 85.2143 16.6474C85.2095 16.5815 85.2095 16.4955 85.1892 16.4063C85.1542 16.2745 85.0609 16.1755 84.8143 16.1481C84.6885 16.1344 84.0297 16.1268 83.873 16.1268C83.8399 16.1268 83.8299 16.1541 83.8299 16.1947V16.7191C83.8299 16.9454 83.8251 17.5599 83.8299 17.753C83.8436 18.2081 83.9524 18.3115 84.629 18.3115C84.8027 18.3115 85.0815 18.3115 85.2553 18.233C85.4282 18.1499 85.508 18.0135 85.5563 17.7385C85.5656 17.6627 85.5813 17.6376 85.6284 17.6376C85.6814 17.6376 85.6814 17.6923 85.6814 17.7582C85.6814 17.9118 85.6284 18.3648 85.595 18.4968C85.5482 18.6697 85.4862 18.6697 85.2354 18.6697C84.7378 18.6697 84.3714 18.6545 84.0844 18.6491C83.7965 18.6375 83.5907 18.6286 83.3949 18.6286C83.3193 18.6286 83.1725 18.6286 83.014 18.6375C82.8588 18.6375 82.6863 18.6491 82.5535 18.6491C82.4629 18.6491 82.4202 18.6286 82.4202 18.5828C82.4202 18.5488 82.4476 18.5327 82.5272 18.5327C82.6279 18.5327 82.7073 18.5173 82.7661 18.5035C82.8998 18.4769 82.9332 18.3294 82.9599 18.1375C82.9906 17.8571 82.9906 17.3327 82.9906 16.7191V15.5498",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M87.8766 18.5715C87.7717 18.5227 87.7495 18.4917 87.7495 18.3445C87.7495 17.9771 87.7754 17.579 87.7837 17.4735C87.7912 17.3723 87.8084 17.3017 87.861 17.3017C87.9232 17.3017 87.9269 17.3607 87.9269 17.4134C87.9269 17.4979 87.953 17.6376 87.9893 17.753C88.1342 18.2448 88.529 18.4243 88.941 18.4243C89.5376 18.4243 89.8323 18.016 89.8323 17.6627C89.8323 17.3373 89.7326 17.0335 89.1795 16.6006L88.8734 16.3597C88.1418 15.7888 87.8904 15.3208 87.8904 14.7843C87.8904 14.0508 88.5016 13.5244 89.4263 13.5244C89.8591 13.5244 90.1405 13.5928 90.3117 13.6396C90.3718 13.655 90.4051 13.6722 90.4051 13.719C90.4051 13.8052 90.3799 13.9965 90.3799 14.5173C90.3799 14.6647 90.3581 14.7171 90.3038 14.7171C90.259 14.7171 90.2369 14.6771 90.2369 14.5986C90.2369 14.5374 90.2049 14.3304 90.0661 14.158C89.965 14.0334 89.7716 13.8326 89.338 13.8326C88.8475 13.8326 88.5486 14.1186 88.5486 14.5173C88.5486 14.8247 88.7024 15.0547 89.2551 15.4773L89.4394 15.6161C90.2454 16.2211 90.5312 16.6799 90.5312 17.3135C90.5312 17.6975 90.3834 18.1594 89.9057 18.4703C89.5714 18.6819 89.1992 18.7449 88.8475 18.7449C88.4612 18.7449 88.1619 18.6966 87.8766 18.5715",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.4308 26.351C40.4308 25.3411 40.4308 25.1548 40.419 24.9405C40.4055 24.7134 40.3396 24.6015 40.1919 24.5681C40.1202 24.547 40.03 24.5443 39.9511 24.5443C39.8862 24.5443 39.8462 24.5289 39.8462 24.4726C39.8462 24.4359 39.9005 24.4214 40.0037 24.4214C40.258 24.4214 40.6772 24.4402 40.8696 24.4402C41.0368 24.4402 41.43 24.4214 41.6832 24.4214C41.7688 24.4214 41.821 24.4359 41.821 24.4726C41.821 24.5289 41.7812 24.5443 41.7141 24.5443C41.6505 24.5443 41.596 24.547 41.5141 24.5615C41.3359 24.5949 41.2832 24.7074 41.2714 24.9405C41.2561 25.1548 41.2561 25.3411 41.2561 26.351V27.5214C41.2561 28.1675 41.2561 28.6935 41.2832 28.9814C41.3046 29.1605 41.3502 29.2786 41.5473 29.3043C41.6424 29.3186 41.7881 29.3331 41.8892 29.3331C41.962 29.3331 41.9941 29.3528 41.9941 29.3868C41.9941 29.4322 41.9425 29.4518 41.8679 29.4518C41.43 29.4518 41.0097 29.4322 40.8298 29.4322C40.6772 29.4322 40.258 29.4518 39.9937 29.4518C39.9084 29.4518 39.8582 29.4322 39.8582 29.3868C39.8582 29.3528 39.8862 29.3331 39.966 29.3331C40.0661 29.3331 40.1465 29.3186 40.2076 29.3043C40.3396 29.2786 40.3782 29.1683 40.3999 28.9737C40.4308 28.6935 40.4308 28.1675 40.4308 27.5214V26.351",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44.8558 28.5483C44.8695 29.0666 44.9551 29.2398 45.089 29.2861C45.2017 29.3252 45.3281 29.3329 45.4347 29.3329C45.5095 29.3329 45.5472 29.3457 45.5472 29.3866C45.5472 29.438 45.489 29.4516 45.3957 29.4516C44.9628 29.4516 44.6938 29.432 44.5696 29.432C44.5104 29.432 44.198 29.4516 43.8503 29.4516C43.7659 29.4516 43.7046 29.4465 43.7046 29.3866C43.7046 29.3457 43.7433 29.3329 43.8092 29.3329C43.8969 29.3329 44.0171 29.3252 44.1104 29.3006C44.2851 29.2467 44.3095 29.0512 44.3164 28.4749L44.3786 24.5339C44.3786 24.4007 44.3958 24.3076 44.4637 24.3076C44.5354 24.3076 44.5957 24.3949 44.7103 24.5132C44.7881 24.6013 45.8019 25.6856 46.7726 26.6505C47.2261 27.1038 48.1224 28.0625 48.2345 28.1673H48.271L48.2037 25.1793C48.196 24.7721 48.1345 24.6475 47.9763 24.5799C47.8783 24.5441 47.7164 24.5441 47.6252 24.5441C47.5453 24.5441 47.5162 24.5219 47.5162 24.4809C47.5162 24.4264 47.5921 24.4212 47.6914 24.4212C48.0379 24.4212 48.3572 24.44 48.4967 24.44C48.5705 24.44 48.8221 24.4212 49.1473 24.4212C49.2341 24.4212 49.3019 24.4264 49.3019 24.4809C49.3019 24.5219 49.2617 24.5441 49.1802 24.5441C49.1143 24.5441 49.0629 24.5441 48.9806 24.5613C48.7939 24.616 48.7427 24.7544 48.7359 25.1273L48.6621 29.3252C48.6621 29.4713 48.6347 29.5345 48.5746 29.5345C48.5023 29.5345 48.4221 29.4577 48.3496 29.3866C47.9311 28.9856 47.0783 28.1145 46.3861 27.4291C45.6599 26.7092 44.9219 25.8785 44.8017 25.7523H44.7843L44.8558 28.5483",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M51.4631 29.3742C51.3557 29.3253 51.3379 29.2921 51.3379 29.1469C51.3379 28.7815 51.363 28.3817 51.3686 28.2744C51.3766 28.1761 51.3959 28.1019 51.4488 28.1019C51.5085 28.1019 51.5165 28.1616 51.5165 28.2163C51.5165 28.2999 51.5426 28.44 51.5768 28.5527C51.7223 29.0455 52.1149 29.2264 52.5283 29.2264C53.1243 29.2264 53.4197 28.8209 53.4197 28.4673C53.4197 28.143 53.3183 27.8365 52.7673 27.4019L52.4601 27.1637C51.7281 26.589 51.4757 26.1256 51.4757 25.5866C51.4757 24.8534 52.0865 24.3301 53.0116 24.3301C53.4449 24.3301 53.7243 24.3949 53.8978 24.4401C53.9583 24.4555 53.991 24.4725 53.991 24.522C53.991 24.6101 53.9651 24.8011 53.9651 25.3186C53.9651 25.4654 53.9457 25.5192 53.8914 25.5192C53.8447 25.5192 53.8234 25.4807 53.8234 25.3988C53.8234 25.341 53.791 25.1344 53.6528 24.9626C53.5515 24.8335 53.3575 24.6356 52.927 24.6356C52.4344 24.6356 52.136 24.9216 52.136 25.3186C52.136 25.626 52.2894 25.8573 52.8408 26.2782L53.0269 26.4174C53.8313 27.022 54.1162 27.4829 54.1162 28.1146C54.1162 28.4996 53.9691 28.9599 53.4912 29.2708C53.161 29.4841 52.7865 29.5466 52.4344 29.5466C52.0483 29.5466 51.7474 29.4977 51.4631 29.3742",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.6296 24.7953L56.6388 24.82C56.2502 24.8335 56.0945 24.8662 55.994 25.0138C55.9275 25.1145 55.891 25.193 55.8788 25.2453C55.8668 25.2998 55.8469 25.3261 55.8071 25.3261C55.7609 25.3261 55.7466 25.2938 55.7466 25.2204C55.7466 25.1145 55.872 24.5093 55.8896 24.4555C55.9086 24.3659 55.9275 24.3301 55.965 24.3301C56.0193 24.3301 56.0873 24.3949 56.2502 24.407C56.445 24.4264 56.697 24.4401 56.9167 24.4401H59.5543C59.7653 24.4401 59.9116 24.4213 60.0115 24.407C60.1118 24.3871 60.165 24.3761 60.1924 24.3761C60.2394 24.3761 60.245 24.4144 60.245 24.5133C60.245 24.6544 60.2249 25.1145 60.2249 25.2863C60.2189 25.3545 60.2061 25.393 60.165 25.393C60.1118 25.393 60.0973 25.358 60.09 25.2625L60.0875 25.1864C60.0722 25.0138 59.8931 24.8285 59.301 24.815L58.4623 24.7953V27.5212C58.4623 28.1343 58.4623 28.6592 58.4976 28.9454C58.5148 29.1332 58.5554 29.2785 58.7543 29.3042C58.8478 29.3185 58.9941 29.333 59.0934 29.333C59.167 29.333 59.2003 29.3527 59.2003 29.3866C59.2003 29.432 59.1464 29.4517 59.0741 29.4517C58.6354 29.4517 58.2178 29.432 58.0313 29.432C57.876 29.432 57.4551 29.4517 57.1911 29.4517C57.1049 29.4517 57.0562 29.432 57.0562 29.3866C57.0562 29.3527 57.0852 29.333 57.1633 29.333C57.2663 29.333 57.3461 29.3185 57.4037 29.3042C57.5386 29.2785 57.5766 29.1332 57.5962 28.9413C57.6296 28.6592 57.6296 28.1343 57.6296 27.5212V24.7953",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M62.5148 26.351C62.5148 25.3411 62.5148 25.1548 62.5011 24.9405C62.4876 24.7134 62.4195 24.6015 62.2752 24.5681C62.2023 24.547 62.1156 24.5443 62.0331 24.5443C61.9675 24.5443 61.9272 24.5289 61.9272 24.4726C61.9272 24.4359 61.9807 24.4214 62.0852 24.4214C62.3403 24.4214 62.7614 24.4402 62.9535 24.4402C63.1195 24.4402 63.5118 24.4214 63.7651 24.4214C63.8509 24.4214 63.9037 24.4359 63.9037 24.4726C63.9037 24.5289 63.8633 24.5443 63.798 24.5443C63.7321 24.5443 63.6801 24.547 63.5991 24.5615C63.4198 24.5949 63.3635 24.7074 63.3535 24.9405C63.339 25.1548 63.339 25.3411 63.339 26.351V27.5214C63.339 28.1675 63.339 28.6935 63.3635 28.9814C63.3863 29.1605 63.4312 29.2786 63.6331 29.3043C63.7234 29.3186 63.8712 29.3331 63.973 29.3331C64.0451 29.3331 64.0778 29.3528 64.0778 29.3868C64.0778 29.4322 64.0217 29.4518 63.9493 29.4518C63.5118 29.4518 63.092 29.4322 62.9121 29.4322C62.7614 29.4322 62.3403 29.4518 62.0736 29.4518C61.9867 29.4518 61.9401 29.4322 61.9401 29.3868C61.9401 29.3528 61.9675 29.3331 62.0474 29.3331C62.1475 29.3331 62.2273 29.3186 62.2856 29.3043C62.4195 29.2786 62.4588 29.1683 62.4789 28.9737C62.5148 28.6935 62.5148 28.1675 62.5148 27.5214V26.351",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.4491 24.7953L66.4598 24.82C66.0741 24.8335 65.9133 24.8662 65.8121 25.0138C65.7464 25.1145 65.7122 25.193 65.7014 25.2453C65.6857 25.2998 65.6662 25.3261 65.6277 25.3261C65.579 25.3261 65.5686 25.2938 65.5686 25.2204C65.5686 25.1145 65.6934 24.5093 65.707 24.4555C65.7276 24.3659 65.7464 24.3301 65.7875 24.3301C65.8401 24.3301 65.9072 24.3949 66.0741 24.407C66.2674 24.4264 66.519 24.4401 66.7379 24.4401H69.3734C69.5869 24.4401 69.7326 24.4213 69.8356 24.407C69.9321 24.3871 69.9869 24.3761 70.0117 24.3761C70.0586 24.3761 70.0664 24.4144 70.0664 24.5133C70.0664 24.6544 70.0449 25.1145 70.0449 25.2863C70.0393 25.3545 70.0258 25.393 69.9869 25.393C69.9321 25.393 69.9195 25.358 69.9118 25.2625L69.9075 25.1864C69.8938 25.0138 69.7121 24.8285 69.1229 24.815L68.2819 24.7953V27.5212C68.2819 28.1343 68.2819 28.6592 68.3148 28.9454C68.3351 29.1332 68.3747 29.2785 68.5749 29.3042C68.6688 29.3185 68.8139 29.333 68.9129 29.333C68.989 29.333 69.0223 29.3527 69.0223 29.3866C69.0223 29.432 68.9682 29.4517 68.8932 29.4517C68.4559 29.4517 68.0356 29.432 67.8479 29.432C67.6976 29.432 67.278 29.4517 67.0098 29.4517C66.9238 29.4517 66.8761 29.432 66.8761 29.3866C66.8761 29.3527 66.9053 29.333 66.9839 29.333C67.084 29.333 67.1636 29.3185 67.2216 29.3042C67.3573 29.2785 67.3965 29.1332 67.4181 28.9413C67.4491 28.6592 67.4491 28.1343 67.4491 27.5212V24.7953",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M72.0477 26.351C72.0477 25.3411 72.0477 25.1548 72.033 24.9405C72.0197 24.7134 71.9681 24.6102 71.7482 24.5615C71.6927 24.547 71.5826 24.5443 71.49 24.5443C71.4177 24.5443 71.3762 24.5289 71.3762 24.4811C71.3762 24.4359 71.4216 24.4214 71.5227 24.4214C71.874 24.4214 72.2937 24.4402 72.4937 24.4402C72.6528 24.4402 73.0702 24.4214 73.3123 24.4214C73.4122 24.4214 73.4588 24.4359 73.4588 24.4811C73.4588 24.5289 73.4182 24.5443 73.3515 24.5443C73.2804 24.5443 73.2373 24.547 73.1579 24.5615C72.9809 24.5949 72.9248 24.7074 72.9129 24.9405C72.8995 25.1548 72.8995 25.3411 72.8995 26.351V27.2824C72.8995 28.2482 73.0924 28.6554 73.4182 28.9198C73.7171 29.1683 74.0236 29.1932 74.2509 29.1932C74.5423 29.1932 74.8994 29.1001 75.1684 28.8336C75.5348 28.4674 75.5528 27.8699 75.5528 27.1833V26.351C75.5528 25.3411 75.5528 25.1548 75.5402 24.9405C75.5302 24.7134 75.4761 24.6102 75.255 24.5615C75.2026 24.547 75.0888 24.5443 75.0181 24.5443C74.9402 24.5443 74.8994 24.5289 74.8994 24.4811C74.8994 24.4359 74.9481 24.4214 75.0403 24.4214C75.3829 24.4214 75.8007 24.4402 75.8065 24.4402C75.8882 24.4402 76.3072 24.4214 76.5675 24.4214C76.6589 24.4214 76.7055 24.4359 76.7055 24.4811C76.7055 24.5289 76.6666 24.5443 76.587 24.5443C76.5122 24.5443 76.4742 24.547 76.3928 24.5615C76.2121 24.5949 76.1596 24.7074 76.146 24.9405C76.1323 25.1548 76.1323 25.3411 76.1323 26.351V27.0619C76.1323 27.8016 76.0589 28.587 75.5006 29.0668C75.0295 29.4715 74.5504 29.5468 74.1162 29.5468C73.7637 29.5468 73.1245 29.5269 72.64 29.0898C72.3009 28.7816 72.0477 28.288 72.0477 27.3224V26.351",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M79.9309 24.7953L78.9403 24.82C78.554 24.8335 78.3952 24.8662 78.2958 25.0138C78.2296 25.1145 78.1967 25.193 78.1809 25.2453C78.1693 25.2998 78.148 25.3261 78.1084 25.3261C78.0626 25.3261 78.0481 25.2938 78.0481 25.2204C78.0481 25.1145 78.1737 24.5093 78.1867 24.4555C78.2083 24.3659 78.2296 24.3301 78.2684 24.3301C78.3208 24.3301 78.3867 24.3949 78.554 24.407C78.7463 24.4264 79.0004 24.4401 79.2201 24.4401H81.855C82.0689 24.4401 82.2125 24.4213 82.3151 24.407C82.4143 24.3871 82.4668 24.3761 82.4966 24.3761C82.5401 24.3761 82.5482 24.4144 82.5482 24.5133C82.5482 24.6544 82.5271 25.1145 82.5271 25.2863C82.5192 25.3545 82.5072 25.393 82.4668 25.393C82.4143 25.393 82.3986 25.358 82.3951 25.2625L82.389 25.1864C82.3735 25.0138 82.1949 24.8285 81.6046 24.815L80.764 24.7953V27.5212C80.764 28.1343 80.764 28.6592 80.7968 28.9454C80.8181 29.1332 80.8592 29.2785 81.055 29.3042C81.1524 29.3185 81.2942 29.333 81.3949 29.333C81.4703 29.333 81.5033 29.3527 81.5033 29.3866C81.5033 29.432 81.4484 29.4517 81.3764 29.4517C80.9346 29.4517 80.5172 29.432 80.333 29.432C80.1792 29.432 79.7581 29.4517 79.4918 29.4517C79.4064 29.4517 79.36 29.432 79.36 29.3866C79.36 29.3527 79.3848 29.333 79.4667 29.333C79.5658 29.333 79.6455 29.3185 79.7046 29.3042C79.8393 29.2785 79.8774 29.1332 79.9 28.9413C79.9309 28.6592 79.9309 28.1343 79.9309 27.5212V24.7953",fill:"#686767"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M84.8142 26.3512C84.8142 25.3413 84.8142 25.155 84.8026 24.9407C84.7889 24.7136 84.7377 24.6103 84.517 24.5616C84.4629 24.5471 84.3502 24.5444 84.2555 24.5444C84.1832 24.5444 84.1423 24.5291 84.1423 24.4812C84.1423 24.4361 84.1892 24.4215 84.2905 24.4215C84.4706 24.4215 84.6611 24.4267 84.8316 24.4267C85.0028 24.4361 85.1541 24.4404 85.2472 24.4404C85.4612 24.4404 86.7872 24.4404 86.9113 24.4361C87.0375 24.4215 87.1453 24.4072 87.1988 24.3952C87.2328 24.3873 87.2705 24.3662 87.3047 24.3662C87.3374 24.3662 87.3447 24.3952 87.3447 24.4267C87.3447 24.4727 87.3097 24.554 87.2922 24.8595C87.2842 24.9262 87.2705 25.2207 87.2549 25.3001C87.2514 25.3349 87.2367 25.3718 87.1911 25.3718C87.1453 25.3718 87.131 25.3413 87.131 25.2806C87.131 25.2335 87.1269 25.1216 87.0898 25.0406C87.0433 24.9218 86.9797 24.84 86.6434 24.8014C86.5327 24.7871 85.8357 24.7724 85.7004 24.7724C85.6666 24.7724 85.6534 24.7956 85.6534 24.84V26.5236C85.6534 26.5723 85.6612 26.597 85.7004 26.597C85.8471 26.597 86.6135 26.597 86.7654 26.5844C86.9229 26.5723 87.022 26.5524 87.0838 26.4853C87.131 26.4322 87.1584 26.3989 87.1911 26.3989C87.2172 26.3989 87.2367 26.4109 87.2367 26.4501C87.2367 26.4905 87.2102 26.597 87.1834 26.9352C87.1756 27.0691 87.1584 27.3371 87.1584 27.3822C87.1584 27.4363 87.1584 27.5122 87.0972 27.5122C87.0512 27.5122 87.0375 27.4832 87.0375 27.4498C87.0301 27.3822 87.0301 27.2962 87.0104 27.21C86.9797 27.077 86.884 26.976 86.6403 26.953C86.5136 26.9352 85.8511 26.93 85.6919 26.93C85.6612 26.93 85.6534 26.9572 85.6534 26.9974V27.5215C85.6534 27.7487 85.6473 28.3609 85.6534 28.553C85.6666 29.0139 85.7756 29.1113 86.4506 29.1113C86.6251 29.1113 86.9045 29.1113 87.0784 29.0327C87.2514 28.9523 87.331 28.8141 87.3776 28.5391C87.3892 28.4676 87.4023 28.4402 87.4516 28.4402C87.5043 28.4402 87.5043 28.4933 87.5043 28.5606C87.5043 28.7142 87.4516 29.1685 87.417 29.3009C87.3696 29.4717 87.3097 29.4717 87.0568 29.4717C86.558 29.4717 86.1912 29.458 85.9074 29.452C85.621 29.4383 85.4144 29.4323 85.2142 29.4323C85.1408 29.4323 84.9947 29.4323 84.8339 29.4383C84.6818 29.4383 84.5077 29.452 84.3761 29.452C84.2905 29.452 84.2443 29.4323 84.2443 29.3869C84.2443 29.3529 84.2685 29.3333 84.3502 29.3333C84.4493 29.3333 84.5307 29.3187 84.5892 29.3044C84.7232 29.2787 84.757 29.1335 84.7815 28.9416C84.8142 28.6595 84.8142 28.1345 84.8142 27.5215V26.3512",fill:"#686767"})]})}),cg=e=>Y(i,{...e,children:Q("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M7.99573 16C9.25964 16 10.2883 14.9745 10.2938 13.7118H5.69775C5.70325 14.9744 6.73181 16 7.99573 16Z",fill:"currentColor"}),Y("path",{d:"M14.2106 12.7737V12.0912C14.2106 11.3503 13.7648 10.6915 13.108 10.4019V6.52185C13.108 5.4281 12.7614 4.40417 12.1055 3.56079C11.5471 2.8429 10.7917 2.28613 9.90662 1.93701V1.91077C9.90662 0.857178 9.04944 0 7.99585 0C6.94226 0 6.08521 0.857178 6.08521 1.91077V1.93701C5.20007 2.28613 4.4447 2.8429 3.88635 3.56079C3.23047 4.40417 2.88367 5.4281 2.88367 6.52185V10.4017C2.22705 10.6914 1.78125 11.3503 1.78125 12.0912V12.7736H14.2106V12.7737Z",fill:"currentColor"})]})}),dg=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M8.57143 11.4285H0V8.57137H8.57143V-6.10352e-05H11.4286V8.57137H20V11.4285H11.4286V19.9999H8.57143V11.4285Z",fill:"currentColor"})})}),ug=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M0 11.2499V8.74994H20V11.2499H0Z",fill:"currentColor"})})}),hg=e=>Y(i,{...e,children:Q("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("g",{clipPath:"url(#clip0_8714_101)",children:Y("path",{d:"M0 20V13.3333H2.22222V16.2222L5.66667 12.7778L7.22222 14.3333L3.77778 17.7778H6.66667V20H0ZM14.3333 7.22222L12.7778 5.66667L16.2222 2.22222H13.3333V0H20V6.66667H17.7778V3.77778L14.3333 7.22222Z",fill:"currentColor"})}),Y("defs",{children:Y("clipPath",{id:"clip0_8714_101",children:Y("rect",{width:"20",height:"20",fill:"white"})})})]})}),pg=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M16 20C15.1667 20 14.4583 19.7083 13.875 19.125C13.2917 18.5417 13 17.8333 13 17C13 16.9 13.025 16.6667 13.075 16.3L6.05 12.2C5.78333 12.45 5.475 12.6458 5.125 12.7875C4.775 12.9292 4.4 13 4 13C3.16667 13 2.45833 12.7083 1.875 12.125C1.29167 11.5417 1 10.8333 1 10C1 9.16667 1.29167 8.45833 1.875 7.875C2.45833 7.29167 3.16667 7 4 7C4.4 7 4.775 7.07083 5.125 7.2125C5.475 7.35417 5.78333 7.55 6.05 7.8L13.075 3.7C13.0417 3.58333 13.0208 3.47083 13.0125 3.3625C13.0042 3.25417 13 3.13333 13 3C13 2.16667 13.2917 1.45833 13.875 0.875C14.4583 0.291667 15.1667 0 16 0C16.8333 0 17.5417 0.291667 18.125 0.875C18.7083 1.45833 19 2.16667 19 3C19 3.83333 18.7083 4.54167 18.125 5.125C17.5417 5.70833 16.8333 6 16 6C15.6 6 15.225 5.92917 14.875 5.7875C14.525 5.64583 14.2167 5.45 13.95 5.2L6.925 9.3C6.95833 9.41667 6.97917 9.52917 6.9875 9.6375C6.99583 9.74583 7 9.86667 7 10C7 10.1333 6.99583 10.2542 6.9875 10.3625C6.97917 10.4708 6.95833 10.5833 6.925 10.7L13.95 14.8C14.2167 14.55 14.525 14.3542 14.875 14.2125C15.225 14.0708 15.6 14 16 14C16.8333 14 17.5417 14.2917 18.125 14.875C18.7083 15.4583 19 16.1667 19 17C19 17.8333 18.7083 18.5417 18.125 19.125C17.5417 19.7083 16.8333 20 16 20Z",fill:"currentColor"})})}),fg=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M16 5H4V1H16V5ZM16 10.5C16.2833 10.5 16.5208 10.4042 16.7125 10.2125C16.9042 10.0208 17 9.78333 17 9.5C17 9.21667 16.9042 8.97917 16.7125 8.7875C16.5208 8.59583 16.2833 8.5 16 8.5C15.7167 8.5 15.4792 8.59583 15.2875 8.7875C15.0958 8.97917 15 9.21667 15 9.5C15 9.78333 15.0958 10.0208 15.2875 10.2125C15.4792 10.4042 15.7167 10.5 16 10.5ZM14 17V13H6V17H14ZM16 19H4V15H0V9C0 8.15 0.291667 7.4375 0.875 6.8625C1.45833 6.2875 2.16667 6 3 6H17C17.85 6 18.5625 6.2875 19.1375 6.8625C19.7125 7.4375 20 8.15 20 9V15H16V19Z",fill:"currentColor"})})}),mg=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M7.26368 20L6.86567 16.8C6.65008 16.7167 6.44693 16.6167 6.25622 16.5C6.06551 16.3833 5.87894 16.2583 5.69652 16.125L2.73632 17.375L0 12.625L2.56219 10.675C2.54561 10.5583 2.53731 10.4458 2.53731 10.3375V9.6625C2.53731 9.55417 2.54561 9.44167 2.56219 9.325L0 7.375L2.73632 2.625L5.69652 3.875C5.87894 3.74167 6.06965 3.61667 6.26866 3.5C6.46766 3.38333 6.66667 3.28333 6.86567 3.2L7.26368 0H12.7363L13.1343 3.2C13.3499 3.28333 13.5531 3.38333 13.7438 3.5C13.9345 3.61667 14.1211 3.74167 14.3035 3.875L17.2637 2.625L20 7.375L17.4378 9.325C17.4544 9.44167 17.4627 9.55417 17.4627 9.6625V10.3375C17.4627 10.4458 17.4461 10.5583 17.4129 10.675L19.9751 12.625L17.2388 17.375L14.3035 16.125C14.1211 16.2583 13.9303 16.3833 13.7313 16.5C13.5323 16.6167 13.3333 16.7167 13.1343 16.8L12.7363 20H7.26368ZM10.0498 13.5C11.0116 13.5 11.8325 13.1583 12.5124 12.475C13.1924 11.7917 13.5323 10.9667 13.5323 10C13.5323 9.03333 13.1924 8.20833 12.5124 7.525C11.8325 6.84167 11.0116 6.5 10.0498 6.5C9.07131 6.5 8.24627 6.84167 7.57463 7.525C6.90299 8.20833 6.56716 9.03333 6.56716 10C6.56716 10.9667 6.90299 11.7917 7.57463 12.475C8.24627 13.1583 9.07131 13.5 10.0498 13.5Z",fill:"currentColor"})})}),gg=e=>Y(i,{...e,children:Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M9.95 15.9999C10.3 15.9999 10.5958 15.8791 10.8375 15.6374C11.0792 15.3958 11.2 15.0999 11.2 14.7499C11.2 14.3999 11.0792 14.1041 10.8375 13.8624C10.5958 13.6208 10.3 13.4999 9.95 13.4999C9.6 13.4999 9.30417 13.6208 9.0625 13.8624C8.82083 14.1041 8.7 14.3999 8.7 14.7499C8.7 15.0999 8.82083 15.3958 9.0625 15.6374C9.30417 15.8791 9.6 15.9999 9.95 15.9999ZM9.05 12.1499H10.9C10.9 11.5999 10.9625 11.1666 11.0875 10.8499C11.2125 10.5333 11.5667 10.0999 12.15 9.54994C12.5833 9.11661 12.925 8.70411 13.175 8.31244C13.425 7.92077 13.55 7.44994 13.55 6.89994C13.55 5.96661 13.2083 5.24994 12.525 4.74994C11.8417 4.24994 11.0333 3.99994 10.1 3.99994C9.15 3.99994 8.37917 4.24994 7.7875 4.74994C7.19583 5.24994 6.78333 5.84994 6.55 6.54994L8.2 7.19994C8.28333 6.89994 8.47083 6.57494 8.7625 6.22494C9.05417 5.87494 9.5 5.69994 10.1 5.69994C10.6333 5.69994 11.0333 5.84577 11.3 6.13744C11.5667 6.42911 11.7 6.74994 11.7 7.09994C11.7 7.43327 11.6 7.74577 11.4 8.03744C11.2 8.32911 10.95 8.59994 10.65 8.84994C9.91667 9.49994 9.46667 9.99161 9.3 10.3249C9.13333 10.6583 9.05 11.2666 9.05 12.1499ZM10 19.9999C8.61667 19.9999 7.31667 19.7374 6.1 19.2124C4.88333 18.6874 3.825 17.9749 2.925 17.0749C2.025 16.1749 1.3125 15.1166 0.7875 13.8999C0.2625 12.6833 0 11.3833 0 9.99994C0 8.61661 0.2625 7.31661 0.7875 6.09994C1.3125 4.88327 2.025 3.82494 2.925 2.92494C3.825 2.02494 4.88333 1.31244 6.1 0.787439C7.31667 0.262439 8.61667 -6.10352e-05 10 -6.10352e-05C11.3833 -6.10352e-05 12.6833 0.262439 13.9 0.787439C15.1167 1.31244 16.175 2.02494 17.075 2.92494C17.975 3.82494 18.6875 4.88327 19.2125 6.09994C19.7375 7.31661 20 8.61661 20 9.99994C20 11.3833 19.7375 12.6833 19.2125 13.8999C18.6875 15.1166 17.975 16.1749 17.075 17.0749C16.175 17.9749 15.1167 18.6874 13.9 19.2124C12.6833 19.7374 11.3833 19.9999 10 19.9999Z",fill:"currentColor"})})}),vg=e=>Y(i,{...e,children:Y("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M1.55556 14C1.12778 14 0.761574 13.8477 0.456944 13.5431C0.152315 13.2384 0 12.8722 0 12.4444V1.55556C0 1.12778 0.152315 0.761574 0.456944 0.456944C0.761574 0.152315 1.12778 0 1.55556 0H12.4444C12.8722 0 13.2384 0.152315 13.5431 0.456944C13.8477 0.761574 14 1.12778 14 1.55556V12.4444C14 12.8722 13.8477 13.2384 13.5431 13.5431C13.2384 13.8477 12.8722 14 12.4444 14H1.55556ZM2.33333 10.8889H11.6667L8.75 7L6.41667 10.1111L4.66667 7.77778L2.33333 10.8889Z",fill:"currentColor"})})}),bg=e=>Y(i,{...e,children:Y("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M1.33333 12C0.966667 12 0.652778 11.8694 0.391667 11.6083C0.130556 11.3472 0 11.0333 0 10.6667V1.33333C0 0.966667 0.130556 0.652778 0.391667 0.391667C0.652778 0.130556 0.966667 0 1.33333 0H10.6667C11.0333 0 11.3472 0.130556 11.6083 0.391667C11.8694 0.652778 12 0.966667 12 1.33333V10.6667C12 11.0333 11.8694 11.3472 11.6083 11.6083C11.3472 11.8694 11.0333 12 10.6667 12H1.33333ZM2.66667 9.33333H7.33333V8H2.66667V9.33333ZM2.66667 6.66667H9.33333V5.33333H2.66667V6.66667ZM2.66667 4H9.33333V2.66667H2.66667V4Z",fill:"currentColor"})})}),yg=e=>Y(i,{...e,children:Y("svg",{width:"11",height:"12",viewBox:"0 0 11 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M5.27472 12C3.81319 12 2.56868 11.4945 1.54121 10.4835C0.513736 9.47253 0 8.24176 0 6.79121C0 6.0989 0.134615 5.43681 0.403846 4.80495C0.673077 4.17308 1.05494 3.61538 1.54945 3.13187L4.35165 0.379121C4.48352 0.258242 4.62912 0.164835 4.78846 0.0989011C4.9478 0.032967 5.10989 0 5.27472 0C5.43956 0 5.60165 0.032967 5.76099 0.0989011C5.92033 0.164835 6.06593 0.258242 6.1978 0.379121L9 3.13187C9.4945 3.61538 9.87637 4.17308 10.1456 4.80495C10.4148 5.43681 10.5494 6.0989 10.5494 6.79121C10.5494 8.24176 10.0357 9.47253 9.00824 10.4835C7.98077 11.4945 6.73626 12 5.27472 12Z",fill:"currentColor"})})}),wg=e=>Y(i,{...e,children:Y("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M5.33333 12V6.68333C4.62222 6.68333 3.93889 6.54722 3.28333 6.275C2.62778 6.00278 2.05 5.61667 1.55 5.11667C1.05 4.61667 0.666667 4.03889 0.4 3.38333C0.133333 2.72778 0 2.04444 0 1.33333V0H1.33333C2.03333 0 2.71111 0.136111 3.36667 0.408333C4.02222 0.680556 4.6 1.06667 5.1 1.56667C5.44444 1.91111 5.73056 2.28889 5.95833 2.7C6.18611 3.11111 6.36111 3.55 6.48333 4.01667C6.53889 3.93889 6.6 3.86389 6.66667 3.79167C6.73333 3.71944 6.80556 3.64444 6.88333 3.56667C7.38333 3.06667 7.96111 2.68056 8.61667 2.40833C9.27222 2.13611 9.95556 2 10.6667 2H12V3.33333C12 4.04444 11.8639 4.72778 11.5917 5.38333C11.3194 6.03889 10.9333 6.61667 10.4333 7.11667C9.93333 7.61667 9.35833 8 8.70833 8.26667C8.05833 8.53333 7.37778 8.66667 6.66667 8.66667V12H5.33333Z",fill:"currentColor"})})}),Cg=e=>Y(i,{...e,children:Q("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.013 8.18324C16.013 7.61597 15.9621 7.07051 15.8676 6.54688H8.33301V9.64142H12.6385C12.453 10.6414 11.8894 11.4887 11.0421 12.056V14.0632H13.6276C15.1403 12.6705 16.013 10.6196 16.013 8.18324Z",fill:"#4285F4"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.33268 15.9995C10.4927 15.9995 12.3036 15.2832 13.6272 14.0613L11.0418 12.0541C10.3254 12.5341 9.40905 12.8177 8.33268 12.8177C6.24905 12.8177 4.48541 11.4104 3.85632 9.51953H1.18359V11.5923C2.49996 14.2068 5.20541 15.9995 8.33268 15.9995Z",fill:"#34A853"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.85664 9.51898C3.69664 9.03898 3.60574 8.52625 3.60574 7.99898C3.60574 7.4717 3.69664 6.95898 3.85664 6.47898V4.40625H1.18392C0.642099 5.48625 0.333008 6.70807 0.333008 7.99898C0.333008 9.28989 0.642099 10.5117 1.18392 11.5917L3.85664 9.51898Z",fill:"#FBBC05"}),Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.33268 3.18182C9.50723 3.18182 10.5618 3.58545 11.3909 4.37818L13.6854 2.08364C12.3 0.792727 10.489 0 8.33268 0C5.20541 0 2.49996 1.79273 1.18359 4.40727L3.85632 6.48C4.48541 4.58909 6.24905 3.18182 8.33268 3.18182Z",fill:"#EA4335"})]})}),xg=e=>Y(i,{...e,children:Q("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M16.167 8.04974C16.167 3.60622 12.5831 0 8.16699 0C3.75093 0 0.166992 3.60622 0.166992 8.04974C0.166992 12.0705 3.09181 15.4031 6.92291 16V10.371H4.87966V8.04974H6.92291V6.27565C6.92291 4.26114 8.10932 3.14197 9.93836 3.14197C10.8117 3.14197 11.718 3.30777 11.718 3.30777V5.27254H10.7128C9.71591 5.27254 9.40283 5.90259 9.40283 6.53264V8.04145H11.6273L11.2731 10.3627H9.40283V15.9917C13.2422 15.4031 16.167 12.0705 16.167 8.04974Z",fill:"#1877F2"}),Y("path",{d:"M11.2811 10.3096L11.6354 8.00384H9.41086V6.50513C9.41086 5.87106 9.73218 5.25346 10.7209 5.25346H11.726V3.2936C11.726 3.2936 10.8197 3.12891 9.94639 3.12891C8.11735 3.12891 6.93095 4.24059 6.93095 6.24162V8.00384H4.8877V10.3096H6.93095V15.9009C7.33466 15.9668 7.75484 15.9997 8.17502 15.9997C8.59521 15.9997 9.0154 15.9668 9.4191 15.9009V10.3096H11.2811Z",fill:"white"})]})}),kg=e=>Y(i,{...e,children:Q("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("g",{clipPath:"url(#clip0_703_2142)",children:Y("path",{d:"M10.3552 6.77143L16.3115 0H14.9001L9.72817 5.87954L5.59738 0H0.833008L7.07957 8.8909L0.833008 15.9918H2.24455L7.70622 9.78279L12.0686 15.9918H16.833L10.3548 6.77143H10.3552ZM8.42187 8.96923L7.78897 8.0839L2.75315 1.03921H4.92121L8.98517 6.7245L9.61807 7.60983L14.9007 14.9998H12.7327L8.42187 8.96957V8.96923Z",fill:"#5C5959"})}),Y("defs",{children:Y("clipPath",{id:"clip0_703_2142",children:Y("rect",{width:"16",height:"16",fill:"white",transform:"translate(0.833008)"})})})]})}),$g=e=>Y(i,{...e,children:Q("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M7.66699 0H0.166992V7.5H7.66699V0Z",fill:"#F35325"}),Y("path",{d:"M16.167 0H8.66699V7.5H16.167V0Z",fill:"#81BC06"}),Y("path",{d:"M7.66699 8.5H0.166992V16H7.66699V8.5Z",fill:"#05A6F0"}),Y("path",{d:"M16.167 8.5H8.66699V16H16.167V8.5Z",fill:"#FFBA08"})]})}),Sg=e=>Y(i,{...e,children:Y("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M0 13.3267V11.5489H16V13.3267H0ZM0 8.88223V7.10445H16V8.88223H0ZM0 4.43778V2.66H16V4.43778H0Z",fill:"currentColor"})})}),Mg=e=>{const{size:t="16px",...n}=e;return Y(i,{boxSize:t,...n,children:Y("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M8 8.88889C5.97297 8.88889 4.32432 7.24024 4.32432 5.21321C4.32432 3.18618 5.97297 1.53753 8 1.53753C10.027 1.53753 11.6757 3.18618 11.6757 5.21321C11.6757 7.24024 10.027 8.88889 8 8.88889ZM2 14.4625V13.136C2 11.2583 4.85714 9.92589 8 9.92589C11.1429 9.92589 14 11.2583 14 13.136V14.4625H2Z",fill:"currentColor"})})})},Eg=e=>Y(i,{...e,children:Y("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M5.22857 6.85714L0 1.6L1.6 0L8.45714 6.85714L1.6 13.7143L0 12.1143L5.22857 6.85714ZM12.7714 6.85714L7.54286 1.6L9.14286 0L16 6.85714L9.14286 13.7143L7.54286 12.1143L12.7714 6.85714Z",fill:"#5C5959"})})}),Tg=e=>Y(i,{...e,children:Y("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M10.7714 6.85714L16 12.1143L14.4 13.7143L7.54286 6.85714L14.4 0L16 1.6L10.7714 6.85714ZM3.22857 6.85714L8.45714 12.1143L6.85714 13.7143L0 6.85714L6.85714 0L8.45714 1.6L3.22857 6.85714Z",fill:"#5C5959"})})}),Og=e=>{const{fill:t,width:n,height:r,...o}=e,s=t||"currentColor",a=n??"20",l=r??n??"20";return Y(i,{...e,fill:s,children:Y("svg",{width:a,height:l,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M18.4444 20L11.4444 13C10.8889 13.4444 10.25 13.7963 9.52778 14.0556C8.80556 14.3148 8.03704 14.4444 7.22222 14.4444C5.2037 14.4444 3.49537 13.7454 2.09722 12.3472C0.699074 10.9491 0 9.24074 0 7.22222C0 5.2037 0.699074 3.49537 2.09722 2.09722C3.49537 0.699074 5.2037 0 7.22222 0C9.24074 0 10.9491 0.699074 12.3472 2.09722C13.7454 3.49537 14.4444 5.2037 14.4444 7.22222C14.4444 8.03704 14.3148 8.80556 14.0556 9.52778C13.7963 10.25 13.4444 10.8889 13 11.4444L20 18.4444L18.4444 20ZM7.22222 12.2222C8.61111 12.2222 9.79167 11.7361 10.7639 10.7639C11.7361 9.79167 12.2222 8.61111 12.2222 7.22222C12.2222 5.83333 11.7361 4.65278 10.7639 3.68056C9.79167 2.70833 8.61111 2.22222 7.22222 2.22222C5.83333 2.22222 4.65278 2.70833 3.68056 3.68056C2.70833 4.65278 2.22222 5.83333 2.22222 7.22222C2.22222 8.61111 2.70833 9.79167 3.68056 10.7639C4.65278 11.7361 5.83333 12.2222 7.22222 12.2222Z"})})})},Lg=e=>Y(i,{...e,children:Q("svg",{width:"16",height:"12.2513",viewBox:"0 0 16 12.2513",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M15.0602 0.939796C14.7633 0.641913 14.4106 0.405559 14.0222 0.244287C13.6338 0.0830158 13.2174 0 12.7969 0C12.3763 0 11.9599 0.0830158 11.5716 0.244287C11.1832 0.405559 10.8304 0.641913 10.5336 0.939796L11.2898 1.69601C11.4881 1.49774 11.7234 1.34047 11.9825 1.23317C12.2415 1.12587 12.5192 1.07064 12.7996 1.07064C13.0799 1.07064 13.3576 1.12587 13.6166 1.23317C13.8757 1.34047 14.111 1.49774 14.3093 1.69601C14.5076 1.89427 14.6649 2.12965 14.7722 2.38869C14.8795 2.64774 14.9347 2.92538 14.9347 3.20577C14.9347 3.48616 14.8795 3.7638 14.7722 4.02285C14.6649 4.28189 14.5076 4.51727 14.3093 4.71553L10.049 8.97588C9.64926 9.37629 9.10686 9.60152 8.54109 9.60202C7.97532 9.60252 7.43252 9.37825 7.03211 8.97854C6.63169 8.57883 6.40646 8.03643 6.40596 7.47066C6.40546 6.90489 6.62974 6.3621 7.02944 5.96168L7.78033 5.20547L7.02944 4.44926L6.27323 5.20547C5.97535 5.50232 5.73899 5.85505 5.57772 6.24344C5.41645 6.63183 5.33344 7.04824 5.33344 7.46878C5.33344 7.88932 5.41645 8.30572 5.57772 8.69411C5.73899 9.0825 5.97535 9.43524 6.27323 9.73209C6.8758 10.3269 7.68984 10.6583 8.53654 10.6534C8.9587 10.6551 9.37701 10.5732 9.76732 10.4123C10.1576 10.2514 10.5122 10.0148 10.8105 9.71611L15.0709 5.45576C15.6678 4.85524 16.002 4.04232 16 3.19558C15.998 2.34883 15.66 1.5375 15.0602 0.939796Z",fill:"black",stroke:"none"}),Y("path",{d:"M1.71466 10.5575C1.5158 10.3596 1.35801 10.1243 1.25034 9.86524C1.14267 9.60615 1.08724 9.32834 1.08724 9.04777C1.08724 8.7672 1.14267 8.48939 1.25034 8.2303C1.35801 7.97121 1.5158 7.73594 1.71466 7.53801L5.97501 3.27766C6.17294 3.07881 6.40821 2.92101 6.6673 2.81334C6.92639 2.70567 7.2042 2.65024 7.48477 2.65024C7.76534 2.65024 8.04315 2.70567 8.30224 2.81334C8.56133 2.92101 8.7966 3.07881 8.99453 3.27766C9.19213 3.47715 9.34768 3.71428 9.45196 3.97498C9.55624 4.23569 9.60714 4.51468 9.60163 4.79541C9.60325 5.07702 9.54902 5.35616 9.44207 5.61668C9.33512 5.8772 9.17758 6.11392 8.97855 6.31316L7.84956 7.45813L8.60577 8.21434L9.73476 7.08535C10.3357 6.48437 10.6734 5.66928 10.6734 4.81938C10.6734 3.96947 10.3357 3.15438 9.73476 2.5534C9.13379 1.95243 8.3187 1.61481 7.46879 1.61481C6.61889 1.61481 5.80379 1.95243 5.20282 2.5534L0.942471 6.81375C0.643787 7.1107 0.406756 7.46376 0.245012 7.85265C0.0832669 8.24153 0 8.65855 0 9.07972C0 9.5009 0.0832669 9.91792 0.245012 10.3068C0.406756 10.6957 0.643787 11.0487 0.942471 11.3457C1.54894 11.936 2.36484 12.2616 3.21111 12.251C4.06483 12.2518 4.88421 11.9149 5.49039 11.3137L4.73418 10.5575C4.53625 10.7564 4.30098 10.9142 4.04189 11.0219C3.7828 11.1295 3.50499 11.185 3.22442 11.185C2.94385 11.185 2.66604 11.1295 2.40695 11.0219C2.14786 10.9142 1.91259 10.7564 1.71466 10.5575Z",fill:"black",stroke:"none"})]})}),Ag=e=>Y(i,{...e,children:Q("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M2 3H14V4.5H2V3Z",fill:"black",stroke:"none"}),Y("path",{d:"M2 6.5H10V8H2V6.5Z",fill:"black",stroke:"none"}),Y("path",{d:"M2 10H14V11.5H2V10Z",fill:"black",stroke:"none"}),Y("path",{d:"M2 13.5H10V15H2V13.5Z",fill:"black",stroke:"none"})]})}),Rg=e=>Y(i,{...e,children:Q("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M1 3H15V4.5H1V3Z",fill:"black",stroke:"none"}),Y("path",{d:"M4 6.5H12V8H4V6.5Z",fill:"black",stroke:"none"}),Y("path",{d:"M1 10H15V11.5H1V10Z",fill:"black",stroke:"none"}),Y("path",{d:"M4 13.5H12V15H4V13.5Z",fill:"black",stroke:"none"})]})}),Ng=e=>Y(i,{...e,children:Q("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M2 3H14V4.5H2V3Z",fill:"black",stroke:"none"}),Y("path",{d:"M6 6.5H14V8H6V6.5Z",fill:"black",stroke:"none"}),Y("path",{d:"M2 10H14V11.5H2V10Z",fill:"black",stroke:"none"}),Y("path",{d:"M6 13.5H14V15H6V13.5Z",fill:"black",stroke:"none"})]})}),Dg=e=>Y(i,{...e,children:Q("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M1 3H15V4.5H1V3Z",fill:"black",stroke:"none"}),Y("path",{d:"M1 6.5H15V8H1V6.5Z",fill:"black",stroke:"none"}),Y("path",{d:"M1 10H15V11.5H1V10Z",fill:"black",stroke:"none"}),Y("path",{d:"M1 13.5H15V15H1V13.5Z",fill:"black",stroke:"none"})]})}),Pg=$e`
107
107
  display: flex;
108
108
  align-items: flex-start;
109
109
  gap: 0;
@@ -180,11 +180,11 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
180
180
  font-weight: 400;
181
181
  color: ${ze("neutral",700)};
182
182
  }
183
- `,zg=({item:e,isChecked:t=!1})=>{return ye(s.Item,{css:Pg,value:e.value||e.label||"",disabled:e.disabled,role:"menuitem","aria-label":e.label,children:e.children?e.children:be(we,{children:[e.startIcon,be("div",{css:(n=!!e.startIcon,r=!!e.endIcon,$e`
183
+ `,zg=({item:e,isChecked:t=!1,labels:n})=>{return ye(s.Item,{css:Pg,value:e.value||e.label||"",disabled:e.disabled,role:"menuitem","aria-label":e.label,children:e.children?e.children:be(we,{children:[e.startIcon,be("div",{css:(r=!!e.startIcon,o=!!e.endIcon,$e`
184
184
  width: 100%;
185
- margin-left: ${n?He(200):"0"};
186
- margin-right: ${r?He(200):"0"};
187
- `),children:[be("div",{css:Ig(t),children:[ye("p",{className:"ds-menu-item-label",children:e.label}),e.command?ye(s.ItemCommand,{"aria-label":`Shortcut ${e.command}`,children:e.command}):null]}),e.caption?ye("p",{className:"ds-menu-item-caption",children:e.caption}):null]}),t?ye(Jm,{}):e.endIcon]})});var n,r},Vg=(e,t)=>$e`
185
+ margin-left: ${r?He(200):"0"};
186
+ margin-right: ${o?He(200):"0"};
187
+ `),children:[be("div",{css:Ig(t),children:[ye("p",{className:"ds-menu-item-label",children:e.label}),e.command?ye(s.ItemCommand,{"aria-label":`${n.shortcutPrefix} ${e.command}`,children:e.command}):null]}),e.caption?ye("p",{className:"ds-menu-item-caption",children:e.caption}):null]}),t?ye(Jm,{}):e.endIcon]})});var r,o},Vg=(e,t)=>$e`
188
188
  display: flex;
189
189
  align-items: center;
190
190
  justify-content: center;
@@ -300,7 +300,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
300
300
  line-height: ${_e(500)};
301
301
  font-weight: 700;
302
302
  color: ${ze("neutral",900)};
303
- `,Fg=({theme:e="light",label:t,hideArrow:n=!1,fontSize:r,items:o,groups:i,onSelect:l,customTrigger:c,selectionMode:d,defaultSelectedValues:u=[],menuWidth:h="14rem"})=>{const[p,f]=le(!1),[m,g]=le(new Set(u)),v=ae(null);return de((()=>{if(!p||!v.current)return;const e=new window.IntersectionObserver((([e])=>{e.isIntersecting||f(!1)}),{threshold:.01});return e.observe(v.current),()=>{e.disconnect()}}),[p]),be(s.Root,{closeOnSelect:"multiple"!==d,onSelect:({value:e})=>{g((t=>{const n=new Set(t);return"radio"===d?(n.clear(),n.add(e)):n.has(e)?n.delete(e):n.add(e),n})),l&&l(e)},onOpenChange:({open:e})=>f(e),open:p,children:[ye(s.Trigger,{css:Vg(e,r),asChild:!0,children:c||be("button",{type:"button",ref:v,children:[t,ye(Qm,{marginLeft:"0.375rem",rotate:p?"180":"0",height:"0.875rem",width:"0.875rem"})]})}),ye(a,{children:ye(s.Positioner,{children:be(s.Content,{css:_g(h),role:"menu","aria-label":t||"Menu",children:[n?null:ye("div",{css:Hg}),o?.map(((e,t)=>{if(e.submenu){const[n,r]=le(!1);return be(s.Root,{positioning:{placement:"right-start",gutter:2},onSelect:({value:e})=>l&&l(e),onOpenChange:({open:e})=>r(e),open:n,children:[be(s.TriggerItem,{css:Bg,role:"menuitem","aria-haspopup":"true","aria-expanded":n?"true":"false",children:[e.label,ye(Qm,{rotate:"270",color:"var(--chakra-colors-neutral-700)"})]}),ye(a,{children:ye(s.Positioner,{children:ye(s.Content,{css:_g(e.menuWidth),role:"menu","aria-label":`${e.label} submenu`,children:e.submenu.map(((e,t)=>ye(zg,{item:e},e.value)))})})})]},`${e.value}-${t}`)}return ye(zg,{item:e,isChecked:!!d&&m.has(e.value||e.label||"")},`${e.value}-${t}`)})),i?.map(((e,t)=>be(ne.Fragment,{children:[be(s.ItemGroup,{role:"group","aria-labelledby":`group-${t}`,children:[ye(s.ItemGroupLabel,{id:`group-${t}`,css:jg,children:e.title}),e.items?.map((e=>ye(zg,{item:e,isChecked:!!d&&m.has(e.value||e.label||"")},e.value)))]}),t!==i.length-1?ye(s.Separator,{borderColor:"var(--chakra-colors-neutral-300)"}):null]},e.title)))]})})})]})},qg=$e`
303
+ `,Fg=({theme:e="light",label:t,hideArrow:n=!1,fontSize:r,items:o,groups:i,onSelect:l,customTrigger:c,selectionMode:d,defaultSelectedValues:u=[],menuWidth:h="14rem",labels:p})=>{const f=qm("Menu",p),[m,g]=le(!1),[v,b]=le(new Set(u)),y=ae(null);return de((()=>{if(!m||!y.current)return;const e=new window.IntersectionObserver((([e])=>{e.isIntersecting||g(!1)}),{threshold:.01});return e.observe(y.current),()=>{e.disconnect()}}),[m]),be(s.Root,{closeOnSelect:"multiple"!==d,onSelect:({value:e})=>{b((t=>{const n=new Set(t);return"radio"===d?(n.clear(),n.add(e)):n.has(e)?n.delete(e):n.add(e),n})),l&&l(e)},onOpenChange:({open:e})=>g(e),open:m,children:[ye(s.Trigger,{css:Vg(e,r),asChild:!0,children:c||be("button",{type:"button",ref:y,children:[t,ye(Qm,{marginLeft:"0.375rem",rotate:m?"180":"0",height:"0.875rem",width:"0.875rem"})]})}),ye(a,{children:ye(s.Positioner,{children:be(s.Content,{css:_g(h),role:"menu","aria-label":t||f.menuAriaLabel,children:[n?null:ye("div",{css:Hg}),o?.map(((e,t)=>{if(e.submenu){const[n,r]=le(!1);return be(s.Root,{positioning:{placement:"right-start",gutter:2},onSelect:({value:e})=>l&&l(e),onOpenChange:({open:e})=>r(e),open:n,children:[be(s.TriggerItem,{css:Bg,role:"menuitem","aria-haspopup":"true","aria-expanded":n?"true":"false",children:[e.label,ye(Qm,{rotate:"270",color:"var(--chakra-colors-neutral-700)"})]}),ye(a,{children:ye(s.Positioner,{children:ye(s.Content,{css:_g(e.menuWidth),role:"menu","aria-label":f.submenuAriaLabel(e.label||f.menuAriaLabel),children:e.submenu.map(((e,t)=>ye(zg,{item:e,labels:f},e.value)))})})})]},`${e.value}-${t}`)}return ye(zg,{item:e,labels:f,isChecked:!!d&&v.has(e.value||e.label||"")},`${e.value}-${t}`)})),i?.map(((e,t)=>be(ne.Fragment,{children:[be(s.ItemGroup,{role:"group","aria-labelledby":`group-${t}`,children:[ye(s.ItemGroupLabel,{id:`group-${t}`,css:jg,children:e.title}),e.items?.map((e=>ye(zg,{item:e,labels:f,isChecked:!!d&&v.has(e.value||e.label||"")},e.value)))]}),t!==i.length-1?ye(s.Separator,{borderColor:"var(--chakra-colors-neutral-300)"}):null]},e.title)))]})})})]})},qg=$e`
304
304
  &:focus-visible {
305
305
  outline: none;
306
306
  }
@@ -320,7 +320,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
320
320
  }
321
321
 
322
322
  ${"text"===e&&`\n background-color: transparent;\n border: none;\n box-shadow: none;\n color: ${ze("neutral",800)};\n font-size: ${Ve(400)};\n line-height: ${_e(600)};\n text-shadow: 0 0 ${je(100)} ${ze("neutral",100)};\n `}
323
- `,Ug=({children:e,content:t,showArrow:n=!0,disabled:r,position:o="bottom",variant:i="pill",portalRef:s,openDelay:c=0,closeDelay:d=0})=>{const[u,h]=le(!1);return r?e:be(l.Root,{positioning:{placement:o,offset:"pill"===i?void 0:{mainAxis:0,crossAxis:0}},openDelay:c,closeDelay:d,open:u,onOpenChange:({open:e})=>h(e),children:[ye(l.Trigger,{tabIndex:0,onClick:()=>h(!0),css:qg,children:e}),ye(a,{disabled:r,container:s,children:ye(l.Positioner,{children:be(l.Content,{css:Wg(i),children:[n&&"pill"===i?ye(l.Arrow,{children:ye(l.ArrowTip,{})}):null,t]})})})]})},Kg=e=>{const{icon:t,label:n,active:r,...o}=e;return Y(Ug,{content:n,children:Y(Km,{icon:Y("span",{"data-rte-icon":"true",children:t}),"aria-label":n,"aria-pressed":r,onMouseDown:e=>{e.preventDefault()},...o})})};function Zg(e){const{label:t,icon:n,isDisabled:r,isActive:o,command:i}=e,s=e=>{const{editor:s,disabled:a}=zm();if(!s)return null;const{label:l,icon:c,...d}=e,u=l||t,h=a||!!r&&r(s),p=!!o&&o(s);return Y(Kg,{label:u,icon:c||Y(n,{}),active:p,onClick:()=>i(s),disabled:h,...d})};return s.displayName=`BooleanControl(${t})`,s}function Gg(e){const{label:t,options:n,getValue:o,command:i,isDisabled:s}=e,a=({label:e}={})=>{const{editor:a,disabled:l}=zm();if(!a)return null;const c=e||t,d=o(a),u=l||!!s&&s(a),h=n.find((e=>e.value===d));return Y(Fg,{label:c,hideArrow:!0,items:n.map((e=>({label:e.label,value:e.value,disabled:u}))),onSelect:e=>{u||i(a,e)},customTrigger:Y(r,{css:{"& button":{fontWeight:"normal"},'&[data-part="trigger"]':{padding:0}},children:Y(Wm,{variant:"secondary",size:"small",disabled:u,label:h?.label||c,"aria-label":`${c}: ${h?.label||c}`,rightIcon:Y(Qm,{width:"0.875rem",height:"0.875rem"}),borderColor:ze("neutral",400)})})})};return a.displayName=`OptionControl(${t})`,a}const Jg=Gg({label:"Text Type",options:[{value:"normalText",label:"Normal text"},{value:"heading1",label:"Heading 1"},{value:"heading2",label:"Heading 2"},{value:"heading3",label:"Heading 3"},{value:"blockquote",label:"Quote"},{value:"divider",label:"Divider"}],getValue:e=>e.isActive("heading",{level:1})?"heading1":e.isActive("heading",{level:2})?"heading2":e.isActive("heading",{level:3})?"heading3":e.isActive("blockquote")?"blockquote":"normalText",command:(e,t)=>{"normalText"!==t?"heading1"!==t?"heading2"!==t?"heading3"!==t?"blockquote"!==t?"divider"===t&&e.chain().focus().setHorizontalRule().run():e.isActive("blockquote")||e.chain().focus().toggleBlockquote().run():e.chain().focus().setHeading({level:3}).run():e.chain().focus().setHeading({level:2}).run():e.chain().focus().setHeading({level:1}).run():e.chain().focus().setParagraph().run()}}),Xg=Gg({label:"Font Size",options:[{value:"12px",label:"12px"},{value:"14px",label:"14px"},{value:"16px",label:"16px"},{value:"18px",label:"18px"}],getValue:e=>e.getAttributes("textStyle")?.fontSize||"16px",command:(e,t)=>{e.chain().focus().setFontSize(t).run()}}),Yg=Zg({label:"Bold",icon:e=>Y(i,{...e,children:Y("svg",{width:"11.2552",height:"14",viewBox:"0 0 11.2552 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M7.19444 14H0V0H6.61111C7.39057 4.63933e-05 8.15373 0.223185 8.81044 0.643056C9.46714 1.06293 9.98996 1.66199 10.3171 2.36946C10.6443 3.07694 10.7621 3.86327 10.6567 4.63557C10.5513 5.40787 10.227 6.13386 9.72222 6.72778C10.3816 7.25508 10.8612 7.97379 11.0952 8.78497C11.3292 9.59616 11.3061 10.4599 11.0289 11.2574C10.7517 12.0548 10.2341 12.7468 9.54742 13.2379C8.86074 13.7291 8.03869 13.9953 7.19444 14ZM2.33333 11.6667H7.17889C7.4087 11.6667 7.63626 11.6214 7.84858 11.5335C8.0609 11.4455 8.25382 11.3166 8.41633 11.1541C8.57883 10.9916 8.70773 10.7987 8.79568 10.5864C8.88362 10.374 8.92889 10.1465 8.92889 9.91667C8.92889 9.68685 8.88362 9.45929 8.79568 9.24697C8.70773 9.03465 8.57883 8.84173 8.41633 8.67923C8.25382 8.51673 8.0609 8.38782 7.84858 8.29988C7.63626 8.21193 7.4087 8.16667 7.17889 8.16667H2.33333V11.6667ZM2.33333 5.83333H6.61111C6.84092 5.83333 7.06849 5.78807 7.28081 5.70012C7.49313 5.61218 7.68604 5.48327 7.84855 5.32077C8.01105 5.15827 8.13995 4.96535 8.2279 4.75303C8.31585 4.54071 8.36111 4.31315 8.36111 4.08333C8.36111 3.85352 8.31585 3.62596 8.2279 3.41364C8.13995 3.20132 8.01105 3.0084 7.84855 2.8459C7.68604 2.68339 7.49313 2.55449 7.28081 2.46654C7.06849 2.3786 6.84092 2.33333 6.61111 2.33333H2.33333V5.83333Z",fill:"black",stroke:"none"})})}),command:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive("bold")}),Qg=Zg({label:"Italic",icon:e=>Y(i,{...e,children:Y("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M13 1.44444V0H3.61111V1.44444H7.32333L4.16722 11.5556H0V13H9.38889V11.5556H5.67667L8.83278 1.44444H13Z",fill:"black",stroke:"none"})})}),command:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive("italic")}),ev=Zg({label:"Underline",icon:e=>Y(i,{...e,children:Y("svg",{width:"14.6087",height:"14",viewBox:"0 0 14.6087 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M0 12.7826H14.6087V14H0V12.7826ZM7.30435 10.9565C6.1743 10.9565 5.09053 10.5076 4.29146 9.70854C3.49239 8.90947 3.04348 7.8257 3.04348 6.69565V0H4.26087V6.69565C4.26087 7.50283 4.58152 8.27695 5.15228 8.84772C5.72305 9.41848 6.49717 9.73913 7.30435 9.73913C8.11153 9.73913 8.88565 9.41848 9.45641 8.84772C10.0272 8.27695 10.3478 7.50283 10.3478 6.69565V0H11.5652V6.69565C11.5652 7.8257 11.1163 8.90947 10.3172 9.70854C9.51817 10.5076 8.4344 10.9565 7.30435 10.9565V10.9565Z",fill:"black",stroke:"none"})})}),command:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive("underline")}),tv=Zg({label:"Strikethrough",icon:e=>Y(i,{...e,children:Y("svg",{width:"16",height:"13.3507",viewBox:"0 0 16 13.3507",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M16 6.01707H9.304C9.00798 5.93748 8.7106 5.86302 8.412 5.79374C6.54 5.35107 5.48133 5.02707 5.48133 3.51174C5.46613 3.25015 5.50486 2.98823 5.59512 2.74224C5.68537 2.49624 5.82523 2.27143 6.006 2.08174C6.57226 1.61607 7.28154 1.35948 8.01467 1.35507C9.90133 1.30841 10.7713 1.94841 11.4827 2.92174L12.5593 2.13507C12.0554 1.41131 11.3683 0.834307 10.5683 0.463013C9.76831 0.0917179 8.8841 -0.0605588 8.006 0.0217402C6.92734 0.0286269 5.88679 0.421436 5.07267 1.12907C4.7641 1.44207 4.52292 1.81496 4.364 2.22475C4.20509 2.63454 4.1318 3.07254 4.14867 3.51174C4.11943 3.99233 4.20971 4.47268 4.41143 4.90986C4.61316 5.34704 4.92004 5.72744 5.30467 6.01707H0V7.35041H9.10133C10.4127 7.73041 11.1967 8.22507 11.2167 9.58907C11.2383 9.88044 11.1984 10.1731 11.0993 10.448C11.0003 10.7229 10.8445 10.9738 10.642 11.1844C9.93654 11.7405 9.0601 12.0348 8.162 12.0171C7.49168 11.9977 6.83454 11.8261 6.24031 11.5152C5.64608 11.2044 5.1303 10.7626 4.732 10.2231L3.71 11.0791C4.22782 11.7691 4.89593 12.3323 5.6637 12.7258C6.43148 13.1194 7.27876 13.3329 8.14133 13.3504H8.208C9.43919 13.3645 10.6341 12.934 11.5733 12.1377C11.9067 11.8017 12.1658 11.3994 12.334 10.957C12.5023 10.5145 12.5758 10.0417 12.55 9.56907C12.5749 8.76057 12.3021 7.97106 11.7833 7.35041H16V6.01707Z",fill:"black",stroke:"none"})})}),command:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive("strike")});Zg({label:"Code",icon:e=>Y(i,{...e,children:Q("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"m16 18 6-6-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),Y("path",{d:"m8 6-6 6 6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),command:e=>e.chain().focus().toggleCode().run(),isActive:e=>e.isActive("code")});const nv=Zg({label:"Bullet List",icon:e=>Y(i,{...e,children:Q("svg",{width:"16",height:"12.3077",viewBox:"0 0 16 12.3077",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M1.84615 3.69231C2.86576 3.69231 3.69231 2.86576 3.69231 1.84615C3.69231 0.826551 2.86576 0 1.84615 0C0.826551 0 0 0.826551 0 1.84615C0 2.86576 0.826551 3.69231 1.84615 3.69231Z",fill:"black",stroke:"none"}),Y("path",{d:"M1.84615 12.3077C2.86576 12.3077 3.69231 11.4811 3.69231 10.4615C3.69231 9.44194 2.86576 8.61538 1.84615 8.61538C0.826551 8.61538 0 9.44194 0 10.4615C0 11.4811 0.826551 12.3077 1.84615 12.3077Z",fill:"black",stroke:"none"}),Y("path",{d:"M7.38462 9.84615H16V11.0769H7.38462V9.84615ZM7.38462 1.23077H16V2.46154H7.38462V1.23077Z",fill:"black",stroke:"none"})]})}),command:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isActive("bulletList")}),rv=Zg({label:"Ordered List",icon:e=>Y(i,{...e,children:Y("svg",{width:"16",height:"15",viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M7.38462 11.25H16V12.5H7.38462V11.25ZM7.38462 2.5H16V3.75H7.38462V2.5ZM2.46154 5V0H1.23077V0.625H0V1.875H1.23077V5H0V6.25H3.69231V5H2.46154ZM3.69231 15H0V12.5C0 12.1685 0.12967 11.8505 0.360484 11.6161C0.591298 11.3817 0.904349 11.25 1.23077 11.25H2.46154V10H0V8.75H2.46154C2.78796 8.75 3.10101 8.8817 3.33182 9.11612C3.56264 9.35054 3.69231 9.66848 3.69231 10V11.25C3.69231 11.5815 3.56264 11.8995 3.33182 12.1339C3.10101 12.3683 2.78796 12.5 2.46154 12.5H1.23077V13.75H3.69231V15Z",fill:"black",stroke:"none"})})}),command:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isActive("orderedList")}),ov=Zg({label:"Image",icon:e=>Y(i,{...e,children:Y("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M1.77778 16C1.28889 16 0.87037 15.8259 0.522222 15.4778C0.174074 15.1296 0 14.7111 0 14.2222V1.77778C0 1.28889 0.174074 0.87037 0.522222 0.522222C0.87037 0.174074 1.28889 0 1.77778 0H14.2222C14.7111 0 15.1296 0.174074 15.4778 0.522222C15.8259 0.87037 16 1.28889 16 1.77778V14.2222C16 14.7111 15.8259 15.1296 15.4778 15.4778C15.1296 15.8259 14.7111 16 14.2222 16H1.77778ZM2.66667 12.4444H13.3333L10 8L7.33333 11.5556L5.33333 8.88889L2.66667 12.4444Z",fill:"black",stroke:"none"})})}),command:e=>{if("undefined"==typeof document)return;const t=document.createElement("input");t.type="file",t.accept="image/*",t.onchange=()=>{const n=t.files?.[0];if(!n)return;const r=new FileReader;r.onload=()=>{"string"==typeof r.result&&e.chain().focus().insertContent({type:"image",attrs:{src:r.result,alt:n.name}}).run()},r.readAsDataURL(n)},t.click()}}),iv=Zg({label:"Undo",icon:e=>Y(i,{...e,children:Y("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M10.6667 3.33333H2.54333L4.93467 0.942667L4 0L0 4L4 8L4.93467 7.05667L2.54533 4.66667H10.6667C11.7275 4.66667 12.7449 5.08809 13.4951 5.83824C14.2452 6.58839 14.6667 7.6058 14.6667 8.66667C14.6667 9.72753 14.2452 10.7449 13.4951 11.4951C12.7449 12.2452 11.7275 12.6667 10.6667 12.6667H5.33333V14H10.6667C12.0812 14 13.4377 13.4381 14.4379 12.4379C15.4381 11.4377 16 10.0812 16 8.66667C16 7.25218 15.4381 5.89562 14.4379 4.89543C13.4377 3.89524 12.0812 3.33333 10.6667 3.33333Z",fill:"black",stroke:"none"})})}),command:e=>e.chain().focus().undo().run(),isDisabled:e=>!e.can().undo()}),sv=Zg({label:"Redo",icon:e=>Y(i,{...e,children:Y("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M5.33333 3.33333H13.4567L11.0653 0.942667L12 0L16 4L12 8L11.0653 7.05667L13.4547 4.66667H5.33333C4.27247 4.66667 3.25505 5.08809 2.50491 5.83824C1.75476 6.58839 1.33333 7.6058 1.33333 8.66667C1.33333 9.72753 1.75476 10.7449 2.50491 11.4951C3.25505 12.2452 4.27247 12.6667 5.33333 12.6667H10.6667V14H5.33333C3.91885 14 2.56229 13.4381 1.5621 12.4379C0.561903 11.4377 0 10.0812 0 8.66667C0 7.25218 0.561903 5.89562 1.5621 4.89543C2.56229 3.89524 3.91885 3.33333 5.33333 3.33333V3.33333Z",fill:"black",stroke:"none"})})}),command:e=>e.chain().focus().redo().run(),isDisabled:e=>!e.can().redo()}),av={left:Ag,center:Ng,right:Rg,justify:Dg},lv=e=>{const{editor:t,disabled:n}=zm();if(!t)return null;const{label:o="Alignment",alignLeftLabel:i="Align left",alignCenterLabel:s="Align center",alignRightLabel:a="Align right",alignJustifyLabel:l="Justify",...c}=e,d=(e=>e.isActive({textAlign:"center"})?"center":e.isActive({textAlign:"right"})?"right":e.isActive({textAlign:"justify"})?"justify":"left")(t),u=av[d],h=[{label:i,value:"left",startIcon:Y(Ag,{})},{label:s,value:"center",startIcon:Y(Ng,{})},{label:a,value:"right",startIcon:Y(Rg,{})},{label:l,value:"justify",startIcon:Y(Dg,{})}],p=h.find((e=>e.value===d));return Y(Fg,{label:o,hideArrow:!0,items:h.map((e=>({...e,disabled:n}))),onSelect:e=>{n||t.chain().focus().setTextAlign(e).run()},customTrigger:Y(r,{css:{"& button":{fontWeight:"normal"},'&[data-part="trigger"]':{padding:0}},children:Y(Wm,{variant:"secondary",size:"small",disabled:n,label:"","aria-label":`${o}: ${p?.label||o}`,leftIcon:Y(r,{display:"inline-flex",marginRight:He(200),children:Y(u,{width:"0.875rem",height:"0.875rem"})}),rightIcon:Y(Qm,{width:"0.875rem",height:"0.875rem"}),borderColor:ze("neutral",400),...c})})})},cv=(e,t)=>$e`
323
+ `,Ug=({children:e,content:t,showArrow:n=!0,disabled:r,position:o="bottom",variant:i="pill",portalRef:s,openDelay:c=0,closeDelay:d=0})=>{const[u,h]=le(!1);return r?e:be(l.Root,{positioning:{placement:o,offset:"pill"===i?void 0:{mainAxis:0,crossAxis:0}},openDelay:c,closeDelay:d,open:u,onOpenChange:({open:e})=>h(e),children:[ye(l.Trigger,{tabIndex:0,onClick:()=>h(!0),css:qg,children:e}),ye(a,{disabled:r,container:s,children:ye(l.Positioner,{children:be(l.Content,{css:Wg(i),children:[n&&"pill"===i?ye(l.Arrow,{children:ye(l.ArrowTip,{})}):null,t]})})})]})},Kg=e=>{const{icon:t,label:n,active:r,...o}=e;return Y(Ug,{content:n,children:Y(Km,{icon:Y("span",{"data-rte-icon":"true",children:t}),"aria-label":n,"aria-pressed":r,onMouseDown:e=>{e.preventDefault()},...o})})};function Zg(e){const{label:t,icon:n,isDisabled:r,isActive:o,command:i}=e,s=e=>{const{editor:s,disabled:a}=zm();if(!s)return null;const{label:l,icon:c,...d}=e,u=l||t,h=a||!!r&&r(s),p=!!o&&o(s);return Y(Kg,{label:u,icon:c||Y(n,{}),active:p,onClick:()=>i(s),disabled:h,...d})};return s.displayName=`BooleanControl(${t})`,s}function Gg(e){const{label:t,options:n,getValue:o,command:i,isDisabled:s}=e,a=({label:e}={})=>{const{editor:a,disabled:l}=zm();if(!a)return null;const c=e||t,d=o(a),u=l||!!s&&s(a),h=n.find((e=>e.value===d));return Y(Fg,{label:c,hideArrow:!0,items:n.map((e=>({label:e.label,value:e.value,disabled:u}))),onSelect:e=>{u||i(a,e)},customTrigger:Y(r,{css:{"& button":{fontWeight:"normal"},'&[data-part="trigger"]':{padding:0}},children:Y(Wm,{variant:"secondary",size:"small",disabled:u,label:h?.label||c,"aria-label":`${c}: ${h?.label||c}`,rightIcon:Y(Qm,{width:"0.875rem",height:"0.875rem"}),borderColor:ze("neutral",400)})})})};return a.displayName=`OptionControl(${t})`,a}const Jg=Gg({label:"Text Type",options:[{value:"normalText",label:"Normal text"},{value:"heading1",label:"Heading 1"},{value:"heading2",label:"Heading 2"},{value:"heading3",label:"Heading 3"},{value:"blockquote",label:"Quote"},{value:"divider",label:"Divider"}],getValue:e=>e.isActive("heading",{level:1})?"heading1":e.isActive("heading",{level:2})?"heading2":e.isActive("heading",{level:3})?"heading3":e.isActive("blockquote")?"blockquote":"normalText",command:(e,t)=>{"normalText"!==t?"heading1"!==t?"heading2"!==t?"heading3"!==t?"blockquote"!==t?"divider"===t&&e.chain().focus().setHorizontalRule().run():e.isActive("blockquote")||e.chain().focus().toggleBlockquote().run():e.chain().focus().setHeading({level:3}).run():e.chain().focus().setHeading({level:2}).run():e.chain().focus().setHeading({level:1}).run():e.chain().focus().setParagraph().run()}}),Xg=Gg({label:"Font Size",options:[{value:"12px",label:"12px"},{value:"14px",label:"14px"},{value:"16px",label:"16px"},{value:"18px",label:"18px"}],getValue:e=>e.getAttributes("textStyle")?.fontSize||"16px",command:(e,t)=>{e.chain().focus().setFontSize(t).run()}}),Yg=Zg({label:"Bold",icon:e=>Y(i,{...e,children:Y("svg",{width:"11.2552",height:"14",viewBox:"0 0 11.2552 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M7.19444 14H0V0H6.61111C7.39057 4.63933e-05 8.15373 0.223185 8.81044 0.643056C9.46714 1.06293 9.98996 1.66199 10.3171 2.36946C10.6443 3.07694 10.7621 3.86327 10.6567 4.63557C10.5513 5.40787 10.227 6.13386 9.72222 6.72778C10.3816 7.25508 10.8612 7.97379 11.0952 8.78497C11.3292 9.59616 11.3061 10.4599 11.0289 11.2574C10.7517 12.0548 10.2341 12.7468 9.54742 13.2379C8.86074 13.7291 8.03869 13.9953 7.19444 14ZM2.33333 11.6667H7.17889C7.4087 11.6667 7.63626 11.6214 7.84858 11.5335C8.0609 11.4455 8.25382 11.3166 8.41633 11.1541C8.57883 10.9916 8.70773 10.7987 8.79568 10.5864C8.88362 10.374 8.92889 10.1465 8.92889 9.91667C8.92889 9.68685 8.88362 9.45929 8.79568 9.24697C8.70773 9.03465 8.57883 8.84173 8.41633 8.67923C8.25382 8.51673 8.0609 8.38782 7.84858 8.29988C7.63626 8.21193 7.4087 8.16667 7.17889 8.16667H2.33333V11.6667ZM2.33333 5.83333H6.61111C6.84092 5.83333 7.06849 5.78807 7.28081 5.70012C7.49313 5.61218 7.68604 5.48327 7.84855 5.32077C8.01105 5.15827 8.13995 4.96535 8.2279 4.75303C8.31585 4.54071 8.36111 4.31315 8.36111 4.08333C8.36111 3.85352 8.31585 3.62596 8.2279 3.41364C8.13995 3.20132 8.01105 3.0084 7.84855 2.8459C7.68604 2.68339 7.49313 2.55449 7.28081 2.46654C7.06849 2.3786 6.84092 2.33333 6.61111 2.33333H2.33333V5.83333Z",fill:"black",stroke:"none"})})}),command:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive("bold")}),Qg=Zg({label:"Italic",icon:e=>Y(i,{...e,children:Y("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M13 1.44444V0H3.61111V1.44444H7.32333L4.16722 11.5556H0V13H9.38889V11.5556H5.67667L8.83278 1.44444H13Z",fill:"black",stroke:"none"})})}),command:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive("italic")}),ev=Zg({label:"Underline",icon:e=>Y(i,{...e,children:Y("svg",{width:"14.6087",height:"14",viewBox:"0 0 14.6087 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M0 12.7826H14.6087V14H0V12.7826ZM7.30435 10.9565C6.1743 10.9565 5.09053 10.5076 4.29146 9.70854C3.49239 8.90947 3.04348 7.8257 3.04348 6.69565V0H4.26087V6.69565C4.26087 7.50283 4.58152 8.27695 5.15228 8.84772C5.72305 9.41848 6.49717 9.73913 7.30435 9.73913C8.11153 9.73913 8.88565 9.41848 9.45641 8.84772C10.0272 8.27695 10.3478 7.50283 10.3478 6.69565V0H11.5652V6.69565C11.5652 7.8257 11.1163 8.90947 10.3172 9.70854C9.51817 10.5076 8.4344 10.9565 7.30435 10.9565V10.9565Z",fill:"black",stroke:"none"})})}),command:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive("underline")}),tv=Zg({label:"Strikethrough",icon:e=>Y(i,{...e,children:Y("svg",{width:"16",height:"13.3507",viewBox:"0 0 16 13.3507",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M16 6.01707H9.304C9.00798 5.93748 8.7106 5.86302 8.412 5.79374C6.54 5.35107 5.48133 5.02707 5.48133 3.51174C5.46613 3.25015 5.50486 2.98823 5.59512 2.74224C5.68537 2.49624 5.82523 2.27143 6.006 2.08174C6.57226 1.61607 7.28154 1.35948 8.01467 1.35507C9.90133 1.30841 10.7713 1.94841 11.4827 2.92174L12.5593 2.13507C12.0554 1.41131 11.3683 0.834307 10.5683 0.463013C9.76831 0.0917179 8.8841 -0.0605588 8.006 0.0217402C6.92734 0.0286269 5.88679 0.421436 5.07267 1.12907C4.7641 1.44207 4.52292 1.81496 4.364 2.22475C4.20509 2.63454 4.1318 3.07254 4.14867 3.51174C4.11943 3.99233 4.20971 4.47268 4.41143 4.90986C4.61316 5.34704 4.92004 5.72744 5.30467 6.01707H0V7.35041H9.10133C10.4127 7.73041 11.1967 8.22507 11.2167 9.58907C11.2383 9.88044 11.1984 10.1731 11.0993 10.448C11.0003 10.7229 10.8445 10.9738 10.642 11.1844C9.93654 11.7405 9.0601 12.0348 8.162 12.0171C7.49168 11.9977 6.83454 11.8261 6.24031 11.5152C5.64608 11.2044 5.1303 10.7626 4.732 10.2231L3.71 11.0791C4.22782 11.7691 4.89593 12.3323 5.6637 12.7258C6.43148 13.1194 7.27876 13.3329 8.14133 13.3504H8.208C9.43919 13.3645 10.6341 12.934 11.5733 12.1377C11.9067 11.8017 12.1658 11.3994 12.334 10.957C12.5023 10.5145 12.5758 10.0417 12.55 9.56907C12.5749 8.76057 12.3021 7.97106 11.7833 7.35041H16V6.01707Z",fill:"black",stroke:"none"})})}),command:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive("strike")});Zg({label:"Code",icon:e=>Y(i,{...e,children:Q("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"m16 18 6-6-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),Y("path",{d:"m8 6-6 6 6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),command:e=>e.chain().focus().toggleCode().run(),isActive:e=>e.isActive("code")});const nv=Zg({label:"Bullet List",icon:e=>Y(i,{...e,children:Q("svg",{width:"16",height:"12.3077",viewBox:"0 0 16 12.3077",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Y("path",{d:"M1.84615 3.69231C2.86576 3.69231 3.69231 2.86576 3.69231 1.84615C3.69231 0.826551 2.86576 0 1.84615 0C0.826551 0 0 0.826551 0 1.84615C0 2.86576 0.826551 3.69231 1.84615 3.69231Z",fill:"black",stroke:"none"}),Y("path",{d:"M1.84615 12.3077C2.86576 12.3077 3.69231 11.4811 3.69231 10.4615C3.69231 9.44194 2.86576 8.61538 1.84615 8.61538C0.826551 8.61538 0 9.44194 0 10.4615C0 11.4811 0.826551 12.3077 1.84615 12.3077Z",fill:"black",stroke:"none"}),Y("path",{d:"M7.38462 9.84615H16V11.0769H7.38462V9.84615ZM7.38462 1.23077H16V2.46154H7.38462V1.23077Z",fill:"black",stroke:"none"})]})}),command:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isActive("bulletList")}),rv=Zg({label:"Ordered List",icon:e=>Y(i,{...e,children:Y("svg",{width:"16",height:"15",viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M7.38462 11.25H16V12.5H7.38462V11.25ZM7.38462 2.5H16V3.75H7.38462V2.5ZM2.46154 5V0H1.23077V0.625H0V1.875H1.23077V5H0V6.25H3.69231V5H2.46154ZM3.69231 15H0V12.5C0 12.1685 0.12967 11.8505 0.360484 11.6161C0.591298 11.3817 0.904349 11.25 1.23077 11.25H2.46154V10H0V8.75H2.46154C2.78796 8.75 3.10101 8.8817 3.33182 9.11612C3.56264 9.35054 3.69231 9.66848 3.69231 10V11.25C3.69231 11.5815 3.56264 11.8995 3.33182 12.1339C3.10101 12.3683 2.78796 12.5 2.46154 12.5H1.23077V13.75H3.69231V15Z",fill:"black",stroke:"none"})})}),command:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isActive("orderedList")}),ov=Zg({label:"Image",icon:e=>Y(i,{...e,children:Y("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M1.77778 16C1.28889 16 0.87037 15.8259 0.522222 15.4778C0.174074 15.1296 0 14.7111 0 14.2222V1.77778C0 1.28889 0.174074 0.87037 0.522222 0.522222C0.87037 0.174074 1.28889 0 1.77778 0H14.2222C14.7111 0 15.1296 0.174074 15.4778 0.522222C15.8259 0.87037 16 1.28889 16 1.77778V14.2222C16 14.7111 15.8259 15.1296 15.4778 15.4778C15.1296 15.8259 14.7111 16 14.2222 16H1.77778ZM2.66667 12.4444H13.3333L10 8L7.33333 11.5556L5.33333 8.88889L2.66667 12.4444Z",fill:"black",stroke:"none"})})}),command:e=>{if("undefined"==typeof document)return;const t=document.createElement("input");t.type="file",t.accept="image/*",t.onchange=()=>{const n=t.files?.[0];if(!n)return;const r=new FileReader;r.onload=()=>{"string"==typeof r.result&&e.chain().focus().insertContent({type:"image",attrs:{src:r.result,alt:n.name}}).run()},r.readAsDataURL(n)},t.click()}}),iv=Zg({label:"Undo",icon:e=>Y(i,{...e,children:Y("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M10.6667 3.33333H2.54333L4.93467 0.942667L4 0L0 4L4 8L4.93467 7.05667L2.54533 4.66667H10.6667C11.7275 4.66667 12.7449 5.08809 13.4951 5.83824C14.2452 6.58839 14.6667 7.6058 14.6667 8.66667C14.6667 9.72753 14.2452 10.7449 13.4951 11.4951C12.7449 12.2452 11.7275 12.6667 10.6667 12.6667H5.33333V14H10.6667C12.0812 14 13.4377 13.4381 14.4379 12.4379C15.4381 11.4377 16 10.0812 16 8.66667C16 7.25218 15.4381 5.89562 14.4379 4.89543C13.4377 3.89524 12.0812 3.33333 10.6667 3.33333Z",fill:"black",stroke:"none"})})}),command:e=>e.chain().focus().undo().run(),isDisabled:e=>!e.can().undo()}),sv=Zg({label:"Redo",icon:e=>Y(i,{...e,children:Y("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Y("path",{d:"M5.33333 3.33333H13.4567L11.0653 0.942667L12 0L16 4L12 8L11.0653 7.05667L13.4547 4.66667H5.33333C4.27247 4.66667 3.25505 5.08809 2.50491 5.83824C1.75476 6.58839 1.33333 7.6058 1.33333 8.66667C1.33333 9.72753 1.75476 10.7449 2.50491 11.4951C3.25505 12.2452 4.27247 12.6667 5.33333 12.6667H10.6667V14H5.33333C3.91885 14 2.56229 13.4381 1.5621 12.4379C0.561903 11.4377 0 10.0812 0 8.66667C0 7.25218 0.561903 5.89562 1.5621 4.89543C2.56229 3.89524 3.91885 3.33333 5.33333 3.33333V3.33333Z",fill:"black",stroke:"none"})})}),command:e=>e.chain().focus().redo().run(),isDisabled:e=>!e.can().redo()}),av={left:Ag,center:Rg,right:Ng,justify:Dg},lv=e=>{const{editor:t,disabled:n}=zm();if(!t)return null;const{label:o="Alignment",alignLeftLabel:i="Align left",alignCenterLabel:s="Align center",alignRightLabel:a="Align right",alignJustifyLabel:l="Justify",...c}=e,d=(e=>e.isActive({textAlign:"center"})?"center":e.isActive({textAlign:"right"})?"right":e.isActive({textAlign:"justify"})?"justify":"left")(t),u=av[d],h=[{label:i,value:"left",startIcon:Y(Ag,{})},{label:s,value:"center",startIcon:Y(Rg,{})},{label:a,value:"right",startIcon:Y(Ng,{})},{label:l,value:"justify",startIcon:Y(Dg,{})}],p=h.find((e=>e.value===d));return Y(Fg,{label:o,hideArrow:!0,items:h.map((e=>({...e,disabled:n}))),onSelect:e=>{n||t.chain().focus().setTextAlign(e).run()},customTrigger:Y(r,{css:{"& button":{fontWeight:"normal"},'&[data-part="trigger"]':{padding:0}},children:Y(Wm,{variant:"secondary",size:"small",disabled:n,label:"","aria-label":`${o}: ${p?.label||o}`,leftIcon:Y(r,{display:"inline-flex",marginRight:He(200),children:Y(u,{width:"0.875rem",height:"0.875rem"})}),rightIcon:Y(Qm,{width:"0.875rem",height:"0.875rem"}),borderColor:ze("neutral",400),...c})})})},cv=(e,t)=>$e`
324
324
  position: relative;
325
325
  height: 100%;
326
326
  width: 100%;
@@ -450,9 +450,9 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
450
450
  }
451
451
  }
452
452
  }
453
- `,Sv=({disabled:e,labels:t,...n})=>{const r=qm("CloseButton",t);return ye(Km,{css:$v,icon:ye(tg,{}),"aria-label":n["aria-label"]||r.closeLabel,disabled:e,...n})},Ev=$e`
453
+ `,Sv=({disabled:e,labels:t,...n})=>{const r=qm("CloseButton",t);return ye(Km,{css:$v,icon:ye(tg,{}),"aria-label":n["aria-label"]||r.closeLabel,disabled:e,...n})},Mv=$e`
454
454
  position: relative;
455
- `,Mv=$e`
455
+ `,Ev=$e`
456
456
  padding: ${He(100)};
457
457
  background: rgba(0, 0, 0, 0);
458
458
  border: none;
@@ -512,13 +512,13 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
512
512
  }
513
513
  }
514
514
  }
515
- `),"aria-label":t,disabled:a,onClick:l,mr:c&&!d?"1rem":"0",mb:c&&d?"1rem":"0",children:be(r,{display:"flex",overflow:"hidden",style:{justifyContent:"flex-end",alignItems:"center"},whiteSpace:"nowrap",transition:"max-width 0.3s ease, opacity 0.2s ease, margin-left 0.3s ease",maxWidth:e?"9.375rem":"2rem",padding:"0.5rem",margin:e?"0.5rem":"0",children:[o&&ye(r,{as:"span",mr:o&&e?"0.5rem":"0px",children:ye(Ug,{content:s,disabled:!s,children:o})}),i&&ye(r,{"aria-hidden":!e,overflow:"hidden",maxWidth:e?"9.375rem":"0px",whiteSpace:"nowrap",transition:"max-width 0.3s ease, opacity 0.2s ease, margin-left 0.3s ease",children:ye(Ug,{content:s,disabled:!s,children:i})})]})});var u},Ov=e=>{const t=Me(e),n=parseFloat(getComputedStyle(document.documentElement).fontSize)||16;return t.endsWith("px")?parseFloat(t)/n:(t.endsWith("rem"),parseFloat(t))};const Lv=({items:e,vertical:t=!1,expanded:n=!1,showExpandedToggle:r,autoCollapse:o=!1,ariaLabel:i,defaultGaps:l,labels:c})=>{const d=qm("Toolbar",c),[u,h]=le(n),{containerRef:p,visibleNumberOfItems:f,shouldForceCollapse:g}=function({itemsCount:e,isExpanded:t,isVertical:n,collapsedWidth:r,expandedLabelWidth:o,gap:i=0,showExpandedToggle:s,autoCollapse:a}){const l=ae(null),[c,d]=le(0),[u,h]=le(e),[p,f]=le(!1);return de((()=>{if(!l.current)return;const e=new ResizeObserver((e=>{const t=e[0],n=parseFloat(getComputedStyle(document.documentElement).fontSize)||16;d(t.contentRect.width/n)}));return e.observe(l.current),()=>e.disconnect()}),[]),de((()=>{if(0===c)return;if(!a)return f(!1),void h(e);const l=Ov(r),d=Ov(o),u=Ov(i),p=c-(s?l+u:0),m=l+u;f(e*(t?d+u:m)-u>p),e>1&&!n&&h(Math.floor(p/m))}),[c,e,t,n,r,o,i,s,a]),{containerRef:l,visibleNumberOfItems:u,shouldForceCollapse:p}}({itemsCount:e.length,isExpanded:u,isVertical:t,collapsedWidth:"3rem",expandedLabelWidth:"6.25rem",gap:"1rem",showExpandedToggle:r,autoCollapse:o});de((()=>{h(n)}),[n]);const v=e.slice(0,f),b=e.slice(f,e.length),y=b.map((e=>({label:e.label,startIcon:e.icon,disabled:e.disabled,onClick:e.onClick,itemAriaLabel:e.ariaLabel}))),w=ye("div",{style:{position:"relative",display:"flex",width:"3rem"},children:ye(Tv,{isExpanded:u,ariaLabel:u?"Collapse":"Expand",icon:ye(ng,{}),showGap:!1,vertical:t})}),[C,x]=le(!1);return ye("div",{role:"toolbar","aria-label":i,css:Ev,children:be(m,{ref:p,orientation:t?"vertical":"horizontal",attached:!0,display:"grid",borderCollapse:"collapse",gridAutoFlow:t||1===e.length?"row":"column",children:[v.map((e=>{const n=l&&!1!==e.gap||!l&&!0===e.gap;return ye(Tv,{isExpanded:u&&!g,ariaLabel:e.ariaLabel,icon:e.icon,label:e.label,tooltip:e.tooltip,disabled:e.disabled,onClick:e.onClick,showGap:n,vertical:t},e.ariaLabel)})),g&&y.length>1&&be(s.Root,{onSelect:({value:e})=>(e=>{const t=b.find((t=>t.label===e));t&&t.onClick&&t.onClick()})(e),onOpenChange:({open:e})=>x(e),open:C,children:[ye(s.Trigger,{asChild:!0,children:w}),ye(a,{children:ye(s.Positioner,{children:ye(s.Content,{style:{minWidth:0,padding:0},children:y.map((({label:e,startIcon:n,onClick:r,itemAriaLabel:o},a)=>ye(s.Item,{css:Mv,value:e||i||a.toString(),role:"menuitem",children:ye(Tv,{isExpanded:!1,icon:n,ariaLabel:o,label:"",onClick:r,showGap:!1,vertical:t})})))})})})]}),r&&!o&&!g&&ye(Tv,{isExpanded:u,ariaLabel:u?d.collapseAriaLabel:d.expandAriaLabel,icon:ye(u?Mg:Tg,{}),label:d.collapseLabel,onClick:()=>h(!u),showGap:!1,vertical:t})]})})},Av=({onZoomInClick:e,onZoomOutClick:t,onExpandClick:n,onShareClick:r,onPrintClick:o,onSettingsClick:i,onQuestionClick:s,vertical:a,expanded:l,showExpandedToggle:c,ariaLabel:d,labels:u})=>{const h=qm("MapControlsToolbar",u),p=[{icon:Y(dg,{}),label:h.zoomInLabel,ariaLabel:h.zoomInAriaLabel,onClick:e},{icon:Y(ug,{}),label:h.zoomOutLabel,ariaLabel:h.zoomOutAriaLabel,onClick:t,gap:!0},{icon:Y(hg,{}),label:h.expandLabel,ariaLabel:h.expandAriaLabel,onClick:n,gap:!0},{icon:Y(pg,{}),label:h.shareLabel,ariaLabel:h.shareAriaLabel,onClick:r,gap:!0},{icon:Y(fg,{}),label:h.printLabel,ariaLabel:h.printAriaLabel,onClick:o,gap:!0},{icon:Y(mg,{}),label:h.settingsLabel,ariaLabel:h.settingsAriaLabel,onClick:i,gap:!0},{icon:Y(gg,{}),label:h.helpLabel,ariaLabel:h.helpAriaLabel,onClick:s}];return Y(Lv,{items:p,vertical:a,expanded:l,showExpandedToggle:c,ariaLabel:d||h.toolbarAriaLabel})},Nv=$e`
515
+ `),"aria-label":t,disabled:a,onClick:l,mr:c&&!d?"1rem":"0",mb:c&&d?"1rem":"0",children:be(r,{display:"flex",overflow:"hidden",style:{justifyContent:"flex-end",alignItems:"center"},whiteSpace:"nowrap",transition:"max-width 0.3s ease, opacity 0.2s ease, margin-left 0.3s ease",maxWidth:e?"9.375rem":"2rem",padding:"0.5rem",margin:e?"0.5rem":"0",children:[o&&ye(r,{as:"span",mr:o&&e?"0.5rem":"0px",children:ye(Ug,{content:s,disabled:!s,children:o})}),i&&ye(r,{"aria-hidden":!e,overflow:"hidden",maxWidth:e?"9.375rem":"0px",whiteSpace:"nowrap",transition:"max-width 0.3s ease, opacity 0.2s ease, margin-left 0.3s ease",children:ye(Ug,{content:s,disabled:!s,children:i})})]})});var u},Ov=e=>{const t=Ee(e),n=parseFloat(getComputedStyle(document.documentElement).fontSize)||16;return t.endsWith("px")?parseFloat(t)/n:(t.endsWith("rem"),parseFloat(t))};const Lv=({items:e,vertical:t=!1,expanded:n=!1,showExpandedToggle:r,autoCollapse:o=!1,ariaLabel:i,defaultGaps:l,labels:c})=>{const d=qm("Toolbar",c),[u,h]=le(n),{containerRef:p,visibleNumberOfItems:f,shouldForceCollapse:g}=function({itemsCount:e,isExpanded:t,isVertical:n,collapsedWidth:r,expandedLabelWidth:o,gap:i=0,showExpandedToggle:s,autoCollapse:a}){const l=ae(null),[c,d]=le(0),[u,h]=le(e),[p,f]=le(!1);return de((()=>{if(!l.current)return;const e=new ResizeObserver((e=>{const t=e[0],n=parseFloat(getComputedStyle(document.documentElement).fontSize)||16;d(t.contentRect.width/n)}));return e.observe(l.current),()=>e.disconnect()}),[]),de((()=>{if(0===c)return;if(!a)return f(!1),void h(e);const l=Ov(r),d=Ov(o),u=Ov(i),p=c-(s?l+u:0),m=l+u;f(e*(t?d+u:m)-u>p),e>1&&!n&&h(Math.floor(p/m))}),[c,e,t,n,r,o,i,s,a]),{containerRef:l,visibleNumberOfItems:u,shouldForceCollapse:p}}({itemsCount:e.length,isExpanded:u,isVertical:t,collapsedWidth:"3rem",expandedLabelWidth:"6.25rem",gap:"1rem",showExpandedToggle:r,autoCollapse:o});de((()=>{h(n)}),[n]);const v=e.slice(0,f),b=e.slice(f,e.length),y=b.map((e=>({label:e.label,startIcon:e.icon,disabled:e.disabled,onClick:e.onClick,itemAriaLabel:e.ariaLabel}))),w=ye("div",{style:{position:"relative",display:"flex",width:"3rem"},children:ye(Tv,{isExpanded:u,ariaLabel:u?d.collapseAriaLabel:d.expandAriaLabel,icon:ye(ng,{}),showGap:!1,vertical:t})}),[C,x]=le(!1);return ye("div",{role:"toolbar","aria-label":i,css:Mv,children:be(m,{ref:p,orientation:t?"vertical":"horizontal",attached:!0,display:"grid",borderCollapse:"collapse",gridAutoFlow:t||1===e.length?"row":"column",children:[v.map((e=>{const n=l&&!1!==e.gap||!l&&!0===e.gap;return ye(Tv,{isExpanded:u&&!g,ariaLabel:e.ariaLabel,icon:e.icon,label:e.label,tooltip:e.tooltip,disabled:e.disabled,onClick:e.onClick,showGap:n,vertical:t},e.ariaLabel)})),g&&y.length>1&&be(s.Root,{onSelect:({value:e})=>(e=>{const t=b.find((t=>t.label===e));t&&t.onClick&&t.onClick()})(e),onOpenChange:({open:e})=>x(e),open:C,children:[ye(s.Trigger,{asChild:!0,children:w}),ye(a,{children:ye(s.Positioner,{children:ye(s.Content,{style:{minWidth:0,padding:0},children:y.map((({label:e,startIcon:n,onClick:r,itemAriaLabel:o},a)=>ye(s.Item,{css:Ev,value:e||i||a.toString(),role:"menuitem",children:ye(Tv,{isExpanded:!1,icon:n,ariaLabel:o,label:"",onClick:r,showGap:!1,vertical:t})})))})})})]}),r&&!o&&!g&&ye(Tv,{isExpanded:u,ariaLabel:u?d.collapseAriaLabel:d.expandAriaLabel,icon:ye(u?Eg:Tg,{}),label:u?d.collapseLabel:d.expandLabel,onClick:()=>h(!u),showGap:!1,vertical:t})]})})},Av=({onZoomInClick:e,onZoomOutClick:t,onExpandClick:n,onShareClick:r,onPrintClick:o,onSettingsClick:i,onQuestionClick:s,vertical:a,expanded:l,showExpandedToggle:c,ariaLabel:d,labels:u})=>{const h=qm("MapControlsToolbar",u),p=[{icon:Y(dg,{}),label:h.zoomInLabel,ariaLabel:h.zoomInAriaLabel,onClick:e},{icon:Y(ug,{}),label:h.zoomOutLabel,ariaLabel:h.zoomOutAriaLabel,onClick:t,gap:!0},{icon:Y(hg,{}),label:h.expandLabel,ariaLabel:h.expandAriaLabel,onClick:n,gap:!0},{icon:Y(pg,{}),label:h.shareLabel,ariaLabel:h.shareAriaLabel,onClick:r,gap:!0},{icon:Y(fg,{}),label:h.printLabel,ariaLabel:h.printAriaLabel,onClick:o,gap:!0},{icon:Y(mg,{}),label:h.settingsLabel,ariaLabel:h.settingsAriaLabel,onClick:i,gap:!0},{icon:Y(gg,{}),label:h.helpLabel,ariaLabel:h.helpAriaLabel,onClick:s}];return Y(Lv,{items:p,vertical:a,expanded:l,showExpandedToggle:c,ariaLabel:d||h.toolbarAriaLabel})},Rv=$e`
516
516
  width: 100%;
517
517
  max-width: 12.5rem;
518
518
  border: ${je(100)} solid ${ze("neutral",600)};
519
519
  border-radius: ${Be(300)};
520
520
  padding: ${He(200)};
521
- `,Rv=e=>$e`
521
+ `,Nv=e=>$e`
522
522
  &[data-state='open'] {
523
523
  background-color: ${"primary"===e?ze("primary",600):ze("neutral",200)} !important;
524
524
  border: ${je(100)} solid ${ze("primary",800)} !important;
@@ -537,7 +537,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
537
537
  &:focus-visible {
538
538
  outline-color: ${ze("primary",700)};
539
539
  }
540
- `,Iv={padding:He(300)},zv=ne.forwardRef(((e,t)=>{const{portalled:n=!0,portalRef:r,...o}=e;return ye(a,{disabled:!n,container:r,children:ye(s.Positioner,{children:ye(s.Content,{css:Nv,ref:t,...o})})})})),Vv=({variant:e="primary",size:t="default",mainActionLabel:n,mainActionOnClick:r=()=>{},otherActions:o=[],disabled:i,mainActionLeftIcon:a,mainActionRightIcon:l,...c})=>{const[d,u]=le(!1);return be(m,{css:Pv,attached:!0,tabIndex:i?0:void 0,"aria-disabled":i,"aria-label":i?`${n} action button with menu, disabled`:void 0,role:"group",children:[ye(Wm,{css:{},label:n,variant:e,size:t,onClick:r,disabled:i,leftIcon:a,rightIcon:l,...c}),be(s.Root,{onOpenChange:({open:e})=>u(e),positioning:{placement:"bottom-end"},children:[ye(s.Trigger,{css:Rv(e),"data-group-item":!0,"data-last":!0,asChild:!0,children:ye(Wm,{style:Iv,"aria-label":`Open ${n} options`,"aria-haspopup":"menu","aria-expanded":d,variant:e,size:t,leftIcon:ye(Qm,{"aria-hidden":"true",rotate:d?"180":"0",color:ze("accessible","text-on-primary-mids")||ze("primary",900)}),disabled:i})}),ye(zv,{children:o.map((({label:e,value:n,onClick:r})=>ye(s.Item,{css:Dv(t),onClick:r,value:n,children:e},n)))})]})]})},Hv=$e`
540
+ `,Iv={padding:He(300)},zv=ne.forwardRef(((e,t)=>{const{portalled:n=!0,portalRef:r,...o}=e;return ye(a,{disabled:!n,container:r,children:ye(s.Positioner,{children:ye(s.Content,{css:Rv,ref:t,...o})})})})),Vv=({variant:e="primary",size:t="default",mainActionLabel:n,mainActionOnClick:r=()=>{},otherActions:o=[],disabled:i,mainActionLeftIcon:a,mainActionRightIcon:l,...c})=>{const[d,u]=le(!1);return be(m,{css:Pv,attached:!0,tabIndex:i?0:void 0,"aria-disabled":i,"aria-label":i?`${n} action button with menu, disabled`:void 0,role:"group",children:[ye(Wm,{css:{},label:n,variant:e,size:t,onClick:r,disabled:i,leftIcon:a,rightIcon:l,...c}),be(s.Root,{onOpenChange:({open:e})=>u(e),positioning:{placement:"bottom-end"},children:[ye(s.Trigger,{css:Nv(e),"data-group-item":!0,"data-last":!0,asChild:!0,children:ye(Wm,{style:Iv,"aria-label":`Open ${n} options`,"aria-haspopup":"menu","aria-expanded":d,variant:e,size:t,leftIcon:ye(Qm,{"aria-hidden":"true",rotate:d?"180":"0",color:ze("accessible","text-on-primary-mids")||ze("primary",900)}),disabled:i})}),ye(zv,{children:o.map((({label:e,value:n,onClick:r})=>ye(s.Item,{css:Dv(t),onClick:r,value:n,children:e},n)))})]})]})},Hv=$e`
541
541
  position: relative;
542
542
  width: 100%;
543
543
  padding-left: 1.1875rem;
@@ -1168,7 +1168,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
1168
1168
  cursor: not-allowed;
1169
1169
  }
1170
1170
  }
1171
- `,Cb=({name:e,defaultChecked:t=!1,onChange:n,disabled:r=!1,isLabelOnLeft:o=!1,children:i,...s})=>ye("div",{style:{display:"flex",alignItems:"center"},children:be(k.Root,{css:wb,id:e,name:e,"aria-label":s["aria-label"]||e,defaultChecked:t,onCheckedChange:({checked:t})=>{n&&n(e,t)},disabled:r,...s,children:[o&&null!=i?ye(k.Label,{children:i}):null,ye(k.HiddenInput,{style:{width:"2.625rem",height:"1.625rem"}}),ye("div",{className:"chakra-switch__control-container",children:ye(k.Control,{children:ye(k.Thumb,{children:ye(k.ThumbIndicator,{display:"flex",children:ye(Jm,{})})})})}),o||null==i?null:ye(k.Label,{children:i})]})}),xb=$e`
1171
+ `,Cb=({name:e,defaultChecked:t=!1,onChange:n,disabled:r=!1,isLabelOnLeft:o=!1,children:i,labels:s,...a})=>{const l=qm("Switch",s);return ye("div",{style:{display:"flex",alignItems:"center"},children:be(k.Root,{css:wb,id:e,name:e,"aria-label":a["aria-label"]||l.defaultAriaLabel(e),defaultChecked:t,onCheckedChange:({checked:t})=>{n&&n(e,t)},disabled:r,...a,children:[o&&null!=i?ye(k.Label,{children:i}):null,ye(k.HiddenInput,{style:{width:"2.625rem",height:"1.625rem"}}),ye("div",{className:"chakra-switch__control-container",children:ye(k.Control,{children:ye(k.Thumb,{children:ye(k.ThumbIndicator,{display:"flex",children:ye(Jm,{})})})})}),o||null==i?null:ye(k.Label,{children:i})]})})},xb=$e`
1172
1172
  position: relative;
1173
1173
  height: 100%;
1174
1174
  width: 100%;
@@ -1202,14 +1202,14 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
1202
1202
  transition:
1203
1203
  max-height 250ms ease,
1204
1204
  opacity 200ms ease;
1205
- `,Eb=$e`
1205
+ `,Mb=$e`
1206
1206
  width: 0.1875rem;
1207
1207
  height: 100%;
1208
1208
  background-color: ${ze("error",900)};
1209
1209
  position: absolute;
1210
1210
  top: 0;
1211
1211
  left: 0;
1212
- `,Mb=$e`
1212
+ `,Eb=$e`
1213
1213
  font-size: ${Ve(300)};
1214
1214
  line-height: ${_e(500)};
1215
1215
  font-weight: 700;
@@ -1230,14 +1230,14 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
1230
1230
  > span {
1231
1231
  margin-left: 0.375rem;
1232
1232
  }
1233
- `,Lb=({label:e,caption:t,checkboxes:n,defaultValues:r,onCheckedChange:o,errorMessage:i,horizontal:s,required:a,hideCheckedCounter:l=!1,hideExpandToggle:c=!1,labels:d})=>{const u=qm("CheckboxList",d),h=Array.isArray(r)?r:[],p=ie((()=>new Set(h)),[h]),[f,g]=le((()=>n.filter((e=>e.name)).reduce(((e,t)=>{const n=t.name;return e[n]="boolean"==typeof t.checked?t.checked:p.has(n),e}),{}))),[v,b]=le(!0);de((()=>{g((e=>{const t=n.filter((e=>e.name)).reduce(((t,n)=>{const r=n.name;return t[r]="boolean"==typeof n.checked?n.checked:e[r]??p.has(r),t}),{});return Object.keys(e).length===Object.keys(t).length&&Object.entries(t).every((([t,n])=>e[t]===n))?e:t}))}),[n,p]);const y="string"!=typeof e,w=n.filter((e=>e.name)).reduce(((e,t)=>{const n=t.name;return e[n]="boolean"==typeof t.checked?t.checked:!!f[n],e}),{}),C=n.length>0&&n.every((e=>e.name&&w[e.name])),x=n.some((e=>e.name&&w[e.name]))&&!C,k=n.length,$=`${n.filter((e=>e?.name&&w[e.name])).length} / ${k}`,S=t?`${t}.`:"",E=a?u.requiredLabel:u.optionalLabel,M=i?`${u.errorPrefix} ${i}.`:"",T=`${y?e.label:e}. ${S} ${E} ${M} `;return be(m,{css:xb,"aria-label":T,children:[i?ye("div",{css:Eb}):null,be("div",{css:(O=!!i,$e`
1233
+ `,Lb=({label:e,caption:t,checkboxes:n,defaultValues:r,onCheckedChange:o,errorMessage:i,horizontal:s,required:a,hideCheckedCounter:l=!1,hideExpandToggle:c=!1,labels:d})=>{const u=qm("CheckboxList",d),h=Array.isArray(r)?r:[],p=ie((()=>new Set(h)),[h]),[f,g]=le((()=>n.filter((e=>e.name)).reduce(((e,t)=>{const n=t.name;return e[n]="boolean"==typeof t.checked?t.checked:p.has(n),e}),{}))),[v,b]=le(!0);de((()=>{g((e=>{const t=n.filter((e=>e.name)).reduce(((t,n)=>{const r=n.name;return t[r]="boolean"==typeof n.checked?n.checked:e[r]??p.has(r),t}),{});return Object.keys(e).length===Object.keys(t).length&&Object.entries(t).every((([t,n])=>e[t]===n))?e:t}))}),[n,p]);const y="string"!=typeof e,w=n.filter((e=>e.name)).reduce(((e,t)=>{const n=t.name;return e[n]="boolean"==typeof t.checked?t.checked:!!f[n],e}),{}),C=n.length>0&&n.every((e=>e.name&&w[e.name])),x=n.some((e=>e.name&&w[e.name]))&&!C,k=n.length,$=`${n.filter((e=>e?.name&&w[e.name])).length} / ${k}`,S=t?`${t}.`:"",M=a?u.requiredLabel:u.optionalLabel,E=i?`${u.errorPrefix} ${i}.`:"",T=`${y?e.label:e}. ${S} ${M} ${E} `;return be(m,{css:xb,"aria-label":T,children:[i?ye("div",{css:Mb}):null,be("div",{css:(O=!!i,$e`
1234
1234
  margin-left: ${O?"1.1875rem":"0"};
1235
1235
  width: 100%;
1236
- `),children:[ye("div",{css:kb,children:"string"==typeof e?be(we,{children:[a&&ye("span",{id:"required-symbol","aria-label":u.requiredSymbolLabel,children:"*"}),e]}):be("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[be(Wv,{checked:C,indeterminate:x,onCheckedChange:e=>(e=>{const t=n.filter((e=>void 0!==e.name)).reduce(((t,n)=>(t[n.name]=e,t)),{});g(t),o?.(t)})(!!e.checked),children:[e.label," ",!l&&ye("span",{"aria-hidden":"true",css:Tb,children:$})]}),!c&&be("button",{type:"button",onClick:()=>b((e=>!e)),"aria-expanded":v,"aria-controls":"checkbox-list",css:Ob,children:[v?u.hideLabel:u.expandLabel,ye("span",{"aria-hidden":"true",children:ye(Qm,v?{style:{transform:"rotate(180deg)"}}:{})})]})]})}),ye("p",{css:$b,"aria-label":t,children:t}),i?ye("p",{css:Mb,"aria-label":i,children:i}):null,ye("div",{id:"checkbox-list",css:Sb(s,v),children:n.map((e=>{const{onCheckedChange:t,...n}=e;return ye(Wv,{ms:y&&!s?"6":"",css:{},checked:!!e?.name&&!!w[e.name],onCheckedChange:({checked:n})=>{((e,t)=>{const n={...f};t&&(n[t]=e,g(n)),o&&o(n)})(n,e.name),t?.({checked:!!n})},...n},e.name)}))})]})]});var O},Ab=$e`
1236
+ `),children:[ye("div",{css:kb,children:"string"==typeof e?be(we,{children:[a&&ye("span",{id:"required-symbol","aria-label":u.requiredSymbolLabel,children:"*"}),e]}):be("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[be(Wv,{checked:C,indeterminate:x,onCheckedChange:e=>(e=>{const t=n.filter((e=>void 0!==e.name)).reduce(((t,n)=>(t[n.name]=e,t)),{});g(t),o?.(t)})(!!e.checked),children:[e.label," ",!l&&ye("span",{"aria-hidden":"true",css:Tb,children:$})]}),!c&&be("button",{type:"button",onClick:()=>b((e=>!e)),"aria-expanded":v,"aria-controls":"checkbox-list",css:Ob,children:[v?u.hideLabel:u.expandLabel,ye("span",{"aria-hidden":"true",children:ye(Qm,v?{style:{transform:"rotate(180deg)"}}:{})})]})]})}),ye("p",{css:$b,"aria-label":t,children:t}),i?ye("p",{css:Eb,"aria-label":i,children:i}):null,ye("div",{id:"checkbox-list",css:Sb(s,v),children:n.map((e=>{const{onCheckedChange:t,...n}=e;return ye(Wv,{ms:y&&!s?"6":"",css:{},checked:!!e?.name&&!!w[e.name],onCheckedChange:({checked:n})=>{((e,t)=>{const n={...f};t&&(n[t]=e,g(n)),o&&o(n)})(n,e.name),t?.({checked:!!n})},...n},e.name)}))})]})]});var O},Ab=$e`
1237
1237
  width: 100%;
1238
1238
  max-width: 23.125rem;
1239
1239
  position: relative;
1240
- `,Nb=e=>$e`
1240
+ `,Rb=e=>$e`
1241
1241
  font-size: ${Ve(400)};
1242
1242
  line-height: ${_e(600)};
1243
1243
  font-weight: 400;
@@ -1248,7 +1248,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
1248
1248
  color: ${e?ze("neutral",600):ze("error",500)};
1249
1249
  margin-right: 0.1875rem;
1250
1250
  }
1251
- `,Rb=e=>$e`
1251
+ `,Nb=e=>$e`
1252
1252
  font-size: ${Ve(300)};
1253
1253
  line-height: ${_e(500)};
1254
1254
  font-weight: 400;
@@ -1531,7 +1531,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
1531
1531
  background-color: ${ze("error",100)};
1532
1532
  border: ${je(100)} solid ${ze("error",300)};
1533
1533
  color: ${ze("error",900)};
1534
- `,iy=({label:e,size:t="default",variant:n,disabled:r,icon:o,onClose:i,closable:s,...a})=>{let l=ey;return"info-grey"===n?l=ty:"success"===n?l=ny:"warning"===n?l=ry:"error"===n&&(l=oy),be(S.Root,{css:[Qb(t),l],"data-disabled":r,...a,children:[o?ye(S.StartElement,{"aria-hidden":"true",children:o}):null,ye(S.Label,{"aria-label":e,children:e}),s&&!r&&"small"!==t?ye(S.EndElement,{children:ye("div",{className:"chakra-tag__closeTrigger",role:"button",tabIndex:0,onClick:i,onKeyDown:e=>{!i||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),i())},"aria-label":`${e} tag close button`,children:ye(tg,{})})}):null]})},sy=({placeholder:e,size:t,disabled:n})=>ye(_b,{placeholder:e,children:e=>{const{label:r,caption:o}=e[0];return be(p,{flexDirection:"column",alignItems:"flex-start",children:[ye("p",{css:Jb(t,n),children:r}),o?ye("p",{css:Xb(t,n),children:o}):null]})}}),ay=({placeholder:e,removeItem:t,disabled:n})=>ye(_b,{placeholder:e,children:e=>e.map((e=>ye(p,{flexDirection:"row",alignItems:"flex-start",children:ye(iy,{label:e.label,variant:"info-grey",disabled:n,onClose:()=>t(e.value),closable:!0},e.value)},e.value)))}),ly=({label:e,caption:t,placeholder:n="",items:o,size:i="default",required:s,disabled:a,onChange:l,errorMessage:c,multiple:d,labels:u,...h})=>{const p=qm("Select",u),[f,g]=le(h.defaultValue||[]),v=(e=>E({items:e}))(o),b=e=>{g(e),l&&l(e)},y=`${e||p.defaultAriaLabel}${s?p.requiredSuffix:""}${t?` ${t}.`:""}${a?p.disabledSuffix:""}`.trim();return be(m,{css:Fb(i),style:h.style,className:"ds-select-input-container",tabIndex:a?0:void 0,"aria-disabled":a,"aria-label":a?y:void 0,children:[c?ye("div",{css:qb}):null,be(Bb,{css:{},collection:v,disabled:a,required:s,multiple:d,"aria-label":h["aria-label"]||e,value:f,onValueChange:e=>b(e.value),style:{marginLeft:c?"1.1875rem":"0px"},...h,children:[e?be(jb,{css:Wb(i),children:[s?ye("span",{children:"*"}):null,e]}):null,t?ye("p",{css:Ub(i,a),children:t}):null,c&&ye("p",{css:Yb(i),children:c}),ye(zb,{css:Kb(i,f.length>0,!!c,d),"aria-label":h["aria-label"]||e||p.defaultAriaLabel,children:d?ye(ay,{placeholder:n,disabled:a,removeItem:e=>{const t=f.filter((t=>t!==e));b(t)}}):ye(sy,{placeholder:n,size:i,disabled:a})}),ye(Vb,{css:Zb,children:v.items.map((e=>be(Hb,{css:Gb,item:e,children:[be(r,{children:[ye("p",{css:Jb(i),children:e.label}),ye("p",{css:Xb(i),children:e.caption})]}),d?ye(Wv,{checked:f.some((t=>t===e.value)),"aria-label":`Select ${e.label}`}):null]},e.value)))})]})]})},cy=({label:e,caption:t,errorMessage:n,units:r,unitsPosition:o="end",defaultUnit:i="",defaultValue:s="",onChange:a,required:l,disabled:c})=>{const[d,u]=le(s),[h,p]=le(i?[i]:[r[0].value]),f=(e,t)=>{a&&a("end"===o?""+(t?`${d} ${e}`:`${e} ${h}`):""+(t?`${e} ${d}`:`${h} ${e}`))};return be("div",{css:Ab,children:[n?ye("div",{css:Db}):null,be("div",{style:{marginLeft:n?"1.1875rem":"0px"},children:[be("p",{css:Nb(c),"aria-label":e,children:[l?ye("span",{children:"*"}):null,e]}),ye("p",{css:Rb(c),"aria-label":t,children:t}),n?ye("p",{css:Pb,"aria-label":n,children:n}):null,be(m,{css:Ib(!!n,o),attached:!0,children:["start"===o?ye(ly,{placeholder:"","aria-label":`${e} unit`,value:h,items:r,disabled:c,onChange:e=>{p(e),f(e?.[0],!0)}}):null,ye(mv,{type:"number","aria-label":`${e} value`,value:d,disabled:c,onChange:e=>{u(e.target.value),f(e.target.value)}}),"end"===o?ye(ly,{placeholder:"","aria-label":`${e} unit`,value:h,items:r,disabled:c,onChange:e=>{p(e),f(e?.[0],!0)}}):null]})]})]})},dy=$e`
1534
+ `,iy=({label:e,size:t="default",variant:n,disabled:r,icon:o,onClose:i,closable:s,labels:a,...l})=>{const c=qm("Tag",a);let d=ey;return"info-grey"===n?d=ty:"success"===n?d=ny:"warning"===n?d=ry:"error"===n&&(d=oy),be(S.Root,{css:[Qb(t),d],"data-disabled":r,...l,children:[o?ye(S.StartElement,{"aria-hidden":"true",children:o}):null,ye(S.Label,{"aria-label":e,children:e}),s&&!r&&"small"!==t?ye(S.EndElement,{children:ye("div",{className:"chakra-tag__closeTrigger",role:"button",tabIndex:0,onClick:i,onKeyDown:e=>{!i||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),i())},"aria-label":c.closeButtonAriaLabel(e),children:ye(tg,{})})}):null]})},sy=({placeholder:e,size:t,disabled:n})=>ye(_b,{placeholder:e,children:e=>{const{label:r,caption:o}=e[0];return be(p,{flexDirection:"column",alignItems:"flex-start",children:[ye("p",{css:Jb(t,n),children:r}),o?ye("p",{css:Xb(t,n),children:o}):null]})}}),ay=({placeholder:e,removeItem:t,disabled:n})=>ye(_b,{placeholder:e,children:e=>e.map((e=>ye(p,{flexDirection:"row",alignItems:"flex-start",children:ye(iy,{label:e.label,variant:"info-grey",disabled:n,onClose:()=>t(e.value),closable:!0},e.value)},e.value)))}),ly=({label:e,caption:t,placeholder:n="",items:o,size:i="default",required:s,disabled:a,onChange:l,errorMessage:c,multiple:d,labels:u,...h})=>{const p=qm("Select",u),[f,g]=le(h.defaultValue||[]),v=(e=>M({items:e}))(o),b=e=>{g(e),l&&l(e)},y=`${e||p.defaultAriaLabel}${s?p.requiredSuffix:""}${t?` ${t}.`:""}${a?p.disabledSuffix:""}`.trim();return be(m,{css:Fb(i),style:h.style,className:"ds-select-input-container",tabIndex:a?0:void 0,"aria-disabled":a,"aria-label":a?y:void 0,children:[c?ye("div",{css:qb}):null,be(Bb,{css:{},collection:v,disabled:a,required:s,multiple:d,"aria-label":h["aria-label"]||e,value:f,onValueChange:e=>b(e.value),style:{marginLeft:c?"1.1875rem":"0px"},...h,children:[e?be(jb,{css:Wb(i),children:[s?ye("span",{children:"*"}):null,e]}):null,t?ye("p",{css:Ub(i,a),children:t}):null,c&&ye("p",{css:Yb(i),children:c}),ye(zb,{css:Kb(i,f.length>0,!!c,d),"aria-label":h["aria-label"]||e||p.defaultAriaLabel,children:d?ye(ay,{placeholder:n,disabled:a,removeItem:e=>{const t=f.filter((t=>t!==e));b(t)}}):ye(sy,{placeholder:n,size:i,disabled:a})}),ye(Vb,{css:Zb,children:v.items.map((e=>be(Hb,{css:Gb,item:e,children:[be(r,{children:[ye("p",{css:Jb(i),children:e.label}),ye("p",{css:Xb(i),children:e.caption})]}),d?ye(Wv,{checked:f.some((t=>t===e.value)),"aria-label":`Select ${e.label}`}):null]},e.value)))})]})]})},cy=({label:e,caption:t,errorMessage:n,units:r,unitsPosition:o="end",defaultUnit:i="",defaultValue:s="",onChange:a,required:l,disabled:c})=>{const[d,u]=le(s),[h,p]=le(i?[i]:[r[0].value]),f=(e,t)=>{a&&a("end"===o?""+(t?`${d} ${e}`:`${e} ${h}`):""+(t?`${e} ${d}`:`${h} ${e}`))};return be("div",{css:Ab,children:[n?ye("div",{css:Db}):null,be("div",{style:{marginLeft:n?"1.1875rem":"0px"},children:[be("p",{css:Rb(c),"aria-label":e,children:[l?ye("span",{children:"*"}):null,e]}),ye("p",{css:Nb(c),"aria-label":t,children:t}),n?ye("p",{css:Pb,"aria-label":n,children:n}):null,be(m,{css:Ib(!!n,o),attached:!0,children:["start"===o?ye(ly,{placeholder:"","aria-label":`${e} unit`,value:h,items:r,disabled:c,onChange:e=>{p(e),f(e?.[0],!0)}}):null,ye(mv,{type:"number","aria-label":`${e} value`,value:d,disabled:c,onChange:e=>{u(e.target.value),f(e.target.value)}}),"end"===o?ye(ly,{placeholder:"","aria-label":`${e} unit`,value:h,items:r,disabled:c,onChange:e=>{p(e),f(e?.[0],!0)}}):null]})]})]})},dy=$e`
1535
1535
  width: 100%;
1536
1536
  max-width: 30.375rem;
1537
1537
  `,uy=$e`
@@ -1660,7 +1660,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
1660
1660
  padding: ${He(300)};
1661
1661
  `,Sy=({label:e,caption:t,name:n,radios:r,defaultValue:o,onCheckedChange:i,errorMessage:s,horizontal:a,variant:l="default",required:c,labels:d})=>{const u=qm("RadioList",d),h=t?`${t}.`:"",p=c?u.requiredLabel:u.optionalLabel,f=s?`${u.errorPrefix} ${s}.`:"";return be(m,{css:by,"aria-roledescription":"group","aria-label":`${e}. ${h} ${p} ${f} `,children:[s?ye("div",{css:xy}):null,be("div",{css:(g=!!s,$e`
1662
1662
  margin-left: ${g?"1.1875rem":"0"};
1663
- `),children:[be("p",{css:yy,"aria-label":e,children:[c&&ye("span",{"aria-label":u.requiredSymbolLabel,children:"*"}),e]}),ye("p",{css:wy,"aria-label":t,children:t}),s?ye("p",{css:ky,"aria-label":s,children:s}):null,ye("div",{css:Cy,children:ye(db,{name:n,value:o,onChange:i,horizontal:a&&"card"!==l,children:r.map((e=>ye(cb,{css:"card"===l?$y:{},...e},e.value)))})})]})]});var g},Ey=e=>$e`
1663
+ `),children:[be("p",{css:yy,"aria-label":e,children:[c&&ye("span",{"aria-label":u.requiredSymbolLabel,children:"*"}),e]}),ye("p",{css:wy,"aria-label":t,children:t}),s?ye("p",{css:ky,"aria-label":s,children:s}):null,ye("div",{css:Cy,children:ye(db,{name:n,value:o,onChange:i,horizontal:a&&"card"!==l,children:r.map((e=>ye(cb,{css:"card"===l?$y:{},...e},e.value)))})})]})]});var g},My=e=>$e`
1664
1664
  font-size: ${Ve("small"===e?300:400)};
1665
1665
  line-height: ${_e("small"===e?500:600)};
1666
1666
  font-weight: 400;
@@ -1671,7 +1671,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
1671
1671
  color: ${ze("error",500)};
1672
1672
  margin-right: 0.1875rem;
1673
1673
  }
1674
- `,My=e=>$e`
1674
+ `,Ey=e=>$e`
1675
1675
  font-size: ${Ve("small"===e?200:300)};
1676
1676
  line-height: ${_e("small"===e?400:500)};
1677
1677
  font-weight: 400;
@@ -1698,7 +1698,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
1698
1698
  margin-top: 1.125rem;
1699
1699
  width: 100%;
1700
1700
  }
1701
- `,Oy=({label:e,caption:t,size:n="default",sliderItem:r,required:o,onChange:i})=>{const[s,a]=le(r.value||[]),l=(e,t)=>{const n=e.target.value,o=[...s];let i=n?parseInt(n,10):n;const l=r.min||0,c=r.max||100;i=Number.isNaN(i)?l:i,i=i<l?l:i,i=i>c?c:i,o[t]=i,a(o)},c=(e,t)=>{const n=e.target.value||"0",o=[...s];let l=parseInt(n,10);const c=r.min||0,d=r.max||100;if(l=Number.isNaN(l)?c:l,l=l<c?c:l,l=l>d?d:l,2===s?.length){l=Number.isNaN(l)?c:l;const e=s[0],n=s[1];0===t?(l=l<c?c:l,l=l>n?n:l):1===t&&(l=l<e?e:l,l=l>d?d:l)}o[t]=l,a(o),i&&i(o)};return be("div",{children:[be("p",{css:Ey(n),"aria-label":e,children:[o?ye("span",{children:"*"}):null,e]}),t?ye("p",{css:My(n),"aria-label":t,children:t}):null,be("div",{css:Ty,children:[r.step&&r.marks?ye(ly,{items:r.marks.map((e=>({label:`${e.label}`,value:`${e.value}`}))),placeholder:"",style:{width:"5.625rem"},value:[`${s?.[0]}`],onChange:e=>{const t=e.map((e=>parseInt(e,10)));a(t),i&&i(t)}}):ye(mv,{"aria-label":e,min:r.min,max:r.max,value:s?.[0],type:"number",onChange:e=>l(e,0),onBlur:e=>c(e,0),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}),ye(yb,{css:{},...r,value:s,"aria-label":2===s?.length?[`${e} minimum`,`${e} maximum`]:[e],onValueChangeEnd:e=>{a(e.value),i&&i(e.value)}}),2===s?.length?ye(mv,{"aria-label":e,min:r.min,max:r.max,value:s?.[1],type:"number",onChange:e=>l(e,1),onBlur:e=>c(e,1),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}):null]})]})},Ly=e=>$e`
1701
+ `,Oy=({label:e,caption:t,size:n="default",sliderItem:r,required:o,onChange:i})=>{const[s,a]=le(r.value||[]),l=(e,t)=>{const n=e.target.value,o=[...s];let i=n?parseInt(n,10):n;const l=r.min||0,c=r.max||100;i=Number.isNaN(i)?l:i,i=i<l?l:i,i=i>c?c:i,o[t]=i,a(o)},c=(e,t)=>{const n=e.target.value||"0",o=[...s];let l=parseInt(n,10);const c=r.min||0,d=r.max||100;if(l=Number.isNaN(l)?c:l,l=l<c?c:l,l=l>d?d:l,2===s?.length){l=Number.isNaN(l)?c:l;const e=s[0],n=s[1];0===t?(l=l<c?c:l,l=l>n?n:l):1===t&&(l=l<e?e:l,l=l>d?d:l)}o[t]=l,a(o),i&&i(o)};return be("div",{children:[be("p",{css:My(n),"aria-label":e,children:[o?ye("span",{children:"*"}):null,e]}),t?ye("p",{css:Ey(n),"aria-label":t,children:t}):null,be("div",{css:Ty,children:[r.step&&r.marks?ye(ly,{items:r.marks.map((e=>({label:`${e.label}`,value:`${e.value}`}))),placeholder:"",style:{width:"5.625rem"},value:[`${s?.[0]}`],onChange:e=>{const t=e.map((e=>parseInt(e,10)));a(t),i&&i(t)}}):ye(mv,{"aria-label":e,min:r.min,max:r.max,value:s?.[0],type:"number",onChange:e=>l(e,0),onBlur:e=>c(e,0),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}),ye(yb,{css:{},...r,value:s,"aria-label":2===s?.length?[`${e} minimum`,`${e} maximum`]:[e],onValueChangeEnd:e=>{a(e.value),i&&i(e.value)}}),2===s?.length?ye(mv,{"aria-label":e,min:r.min,max:r.max,value:s?.[1],type:"number",onChange:e=>l(e,1),onBlur:e=>c(e,1),className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}):null]})]})},Ly=e=>$e`
1702
1702
  position: relative;
1703
1703
  height: 100%;
1704
1704
  width: 100%;
@@ -1714,7 +1714,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
1714
1714
  position: absolute;
1715
1715
  top: 0;
1716
1716
  left: 0;
1717
- `,Ny=(e,t)=>$e`
1717
+ `,Ry=(e,t)=>$e`
1718
1718
  color: ${ze("neutral",t?600:900)};
1719
1719
  font-size: ${Ve("small"===e?300:400)};
1720
1720
  font-weight: 400;
@@ -1728,7 +1728,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
1728
1728
  .chakra-field__requiredIndicator {
1729
1729
  color: ${t?ze("neutral",600):ze("error",500)};
1730
1730
  }
1731
- `,Ry=(e,t)=>$e`
1731
+ `,Ny=(e,t)=>$e`
1732
1732
  color: ${ze("neutral",t?600:700)};
1733
1733
  font-size: ${Ve("small"===e?200:300)};
1734
1734
  font-weight: 400;
@@ -1783,7 +1783,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
1783
1783
  }
1784
1784
 
1785
1785
  ${t||n?`\n border: ${je(100)} solid ${ze("neutral",700)};\n `:""}
1786
- `,zy=({label:e,caption:t,placeholder:n,errorMessage:r,required:o,disabled:i,size:s="default",defaultValue:a="",onChange:l,minLength:d,maxLength:u,labels:h,...p})=>{const f=qm("Textarea",h),[m,g]=le(a),[v,b]=le(!1),[y,w]=le(!1),[C,x]=le(""),k=he(),$=he(),S=he();de((()=>{const{length:e}=a;d&&e<d&&e>0?(b(e<d),w(!1),x(f.enterAtLeastChars(d-e))):d&&0===e&&x(f.minChars(d)),u&&e>0?(b(!1),w(e>u),x(f.charsRemaining(u-e))):u&&0===e&&x(f.maxChars(u))}),[]);const E=!!r||v||y,T=[t?k:null,E?$:null,C?S:null].filter(Boolean).join(" ")||void 0;return be("div",{css:Ly(s),children:[E?ye("div",{css:Ay}):null,be(c.Root,{required:o,invalid:E,gap:"0",style:{marginLeft:E?"1.1875rem":"0px"},children:[e?be(c.Label,{css:Ny(s,i),"aria-label":e,children:[ye(c.RequiredIndicator,{"aria-label":f.requiredSymbolLabel}),e,o?"":ye("span",{children:f.optionalSuffix})]}):null,t?ye(c.HelperText,{id:k,css:Ry(s,i),children:t}):null,r?ye(c.ErrorText,{id:$,css:Py,"aria-label":`${f.errorPrefix} ${r}`,"aria-live":"polite",children:r}):null,ye(M,{placeholder:n,disabled:i,css:Iy(s,m,a),onChange:e=>{g(e.target.value);const{length:t}=e.target.value;d&&u?(b(t<d),w(t>u),x(f.charsRemaining(u-t))):d?(b(t<d),w(!1),x(t<d?f.enterAtLeastChars(d-t):"")):u&&(w(t>u),b(!1),x(f.charsRemaining(u-t))),l&&l(e)},value:m,"aria-label":e||n,"aria-describedby":T,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...p}),v&&d?ye(c.ErrorText,{id:$,css:Py,style:{marginTop:"0.5rem",fontSize:"0.75rem",lineHeight:"1rem"},"aria-live":"polite",children:f.needMoreChars(d-m.length)}):null,y&&u?ye(c.ErrorText,{id:$,css:Py,style:{marginTop:"0.5rem",fontSize:"0.75rem",lineHeight:"1rem"},"aria-live":"polite",children:f.tooManyChars(m.length-u)}):null,!C||y||v?null:ye(c.HelperText,{id:S,css:Dy,"aria-live":"polite",children:C})]})]})},Vy=({label:e,required:t,caption:n,errorMessage:r,size:o,disabled:i,placeholder:s,labels:l,noMarginBottom:d,initialItems:u=[],multiple:h=!1,showSelectedItems:p=!1})=>{const[f,m]=le([]),g=qm("TextInput",l),{contains:v}=T({sensitivity:"base"}),{collection:b,filter:y}=O({initialItems:u,filter:v});return be("div",{css:cv(o,d),className:"ds-text-input-container",children:[r?ye("div",{css:dv}):null,be(c.Root,{required:t,invalid:!!r,gap:"0",style:{marginLeft:r?"1.1875rem":"0px"},children:[e?be(c.Label,{css:uv(o,i),"aria-label":e,children:[ye(c.RequiredIndicator,{"aria-label":g.requiredSymbolLabel}),e,t?"":ye("span",{children:g.optionalSuffix})]}):null,n?ye(c.HelperText,{css:hv(o,i),"aria-label":n,children:n}):null,r?ye(c.ErrorText,{css:pv(o),"aria-label":r,children:r}):null,be(L.Root,{multiple:h,onValueChange:e=>{m(e.items.map((e=>({label:e.label,value:e.value}))))},value:f.map((e=>e.value)),collection:b,onInputValueChange:e=>y(e.inputValue),width:"20rem",size:"small"===o?"sm":"md",children:[be(L.Control,{children:[ye(L.Input,{placeholder:s,css:fv(o),disabled:i,"aria-label":e||s||"Combobox input"}),be(L.IndicatorGroup,{children:[ye(L.ClearTrigger,{"aria-label":"Clear selection"}),ye(L.Trigger,{"aria-label":"Toggle options"})]})]}),ye(a,{children:ye(L.Positioner,{children:be(L.Content,{children:[ye(L.Empty,{children:"No items found"}),b.items.map((e=>be(L.Item,{item:e,children:[e.label,ye(L.ItemIndicator,{})]},e.value)))]})})}),ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.25rem",paddingTop:"0.5rem"},children:p&&f.map((e=>ye(iy,{label:e.label,variant:"info-white",onClose:()=>m((t=>t.filter((t=>t.value!==e.value)))),closable:!0},e.value)))})]})]})]})},Hy=(e,t)=>$e`
1786
+ `,zy=({label:e,caption:t,placeholder:n,errorMessage:r,required:o,disabled:i,size:s="default",defaultValue:a="",onChange:l,minLength:d,maxLength:u,labels:h,...p})=>{const f=qm("Textarea",h),[m,g]=le(a),[v,b]=le(!1),[y,w]=le(!1),[C,x]=le(""),k=he(),$=he(),S=he();de((()=>{const{length:e}=a;d&&e<d&&e>0?(b(e<d),w(!1),x(f.enterAtLeastChars(d-e))):d&&0===e&&x(f.minChars(d)),u&&e>0?(b(!1),w(e>u),x(f.charsRemaining(u-e))):u&&0===e&&x(f.maxChars(u))}),[]);const M=!!r||v||y,T=[t?k:null,M?$:null,C?S:null].filter(Boolean).join(" ")||void 0;return be("div",{css:Ly(s),children:[M?ye("div",{css:Ay}):null,be(c.Root,{required:o,invalid:M,gap:"0",style:{marginLeft:M?"1.1875rem":"0px"},children:[e?be(c.Label,{css:Ry(s,i),"aria-label":e,children:[ye(c.RequiredIndicator,{"aria-label":f.requiredSymbolLabel}),e,o?"":ye("span",{children:f.optionalSuffix})]}):null,t?ye(c.HelperText,{id:k,css:Ny(s,i),children:t}):null,r?ye(c.ErrorText,{id:$,css:Py,"aria-label":`${f.errorPrefix} ${r}`,"aria-live":"polite",children:r}):null,ye(E,{placeholder:n,disabled:i,css:Iy(s,m,a),onChange:e=>{g(e.target.value);const{length:t}=e.target.value;d&&u?(b(t<d),w(t>u),x(f.charsRemaining(u-t))):d?(b(t<d),w(!1),x(t<d?f.enterAtLeastChars(d-t):"")):u&&(w(t>u),b(!1),x(f.charsRemaining(u-t))),l&&l(e)},value:m,"aria-label":e||n,"aria-describedby":T,_placeholder:{color:"var(--chakra-colors-neutral-500)"},...p}),v&&d?ye(c.ErrorText,{id:$,css:Py,style:{marginTop:"0.5rem",fontSize:"0.75rem",lineHeight:"1rem"},"aria-live":"polite",children:f.needMoreChars(d-m.length)}):null,y&&u?ye(c.ErrorText,{id:$,css:Py,style:{marginTop:"0.5rem",fontSize:"0.75rem",lineHeight:"1rem"},"aria-live":"polite",children:f.tooManyChars(m.length-u)}):null,!C||y||v?null:ye(c.HelperText,{id:S,css:Dy,"aria-live":"polite",children:C})]})]})},Vy=({label:e,required:t,caption:n,errorMessage:r,size:o,disabled:i,placeholder:s,labels:l,noMarginBottom:d,initialItems:u=[],multiple:h=!1,showSelectedItems:p=!1})=>{const[f,m]=le([]),g=qm("Combobox",l),{contains:v}=T({sensitivity:"base"}),{collection:b,filter:y}=O({initialItems:u,filter:v});return be("div",{css:cv(o,d),className:"ds-text-input-container",children:[r?ye("div",{css:dv}):null,be(c.Root,{required:t,invalid:!!r,gap:"0",style:{marginLeft:r?"1.1875rem":"0px"},children:[e?be(c.Label,{css:uv(o,i),"aria-label":e,children:[ye(c.RequiredIndicator,{"aria-label":g.requiredSymbolLabel}),e,t?"":ye("span",{children:g.optionalSuffix})]}):null,n?ye(c.HelperText,{css:hv(o,i),"aria-label":n,children:n}):null,r?ye(c.ErrorText,{css:pv(o),"aria-label":r,children:r}):null,be(L.Root,{multiple:h,onValueChange:e=>{m(e.items.map((e=>({label:e.label,value:e.value}))))},value:f.map((e=>e.value)),collection:b,onInputValueChange:e=>y(e.inputValue),width:"20rem",size:"small"===o?"sm":"md",children:[be(L.Control,{children:[ye(L.Input,{placeholder:s,css:fv(o),disabled:i,"aria-label":e||s||g.defaultInputAriaLabel}),be(L.IndicatorGroup,{children:[ye(L.ClearTrigger,{"aria-label":g.clearSelectionLabel}),ye(L.Trigger,{"aria-label":g.toggleOptionsLabel})]})]}),ye(a,{children:ye(L.Positioner,{children:be(L.Content,{children:[ye(L.Empty,{children:g.noItemsFoundLabel}),b.items.map((e=>be(L.Item,{item:e,children:[e.label,ye(L.ItemIndicator,{})]},e.value)))]})})}),ye("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.25rem",paddingTop:"0.5rem"},children:p&&f.map((e=>ye(iy,{label:e.label,variant:"info-white",onClose:()=>m((t=>t.filter((t=>t.value!==e.value)))),closable:!0},e.value)))})]})]})]})},Hy=(e,t)=>$e`
1787
1787
  height: ${e};
1788
1788
  width: ${t};
1789
1789
  border: ${je(100)} solid ${ze("neutral",300)};
@@ -1936,14 +1936,14 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
1936
1936
  height: 0.875rem;
1937
1937
  width: 0.875rem;
1938
1938
  }
1939
- `},Gy=se((({ariaLabel:e,icon:t,backgroundColor:n,onClick:r,showFocusState:o,count:i,mode:s,variant:a="icon"},l)=>{const c=i?(d=i)>=1e8?"99M+":d>=1e6?`${(d/1e6).toFixed(0)}M`:d>=1e5?`${(d/1e3).toFixed(0)}K`:d.toString():void 0;var d;return ye("div",{css:o?$e`
1939
+ `},Gy=se((({ariaLabel:e,icon:t,backgroundColor:n,onClick:r,showFocusState:o,count:i,mode:s,variant:a="icon",labels:l},c)=>{const d=qm("MapMarker",l),u=i?(h=i)>=1e8?"99M+":h>=1e6?`${(h/1e6).toFixed(0)}M`:h>=1e5?`${(h/1e3).toFixed(0)}K`:h.toString():void 0;var h;return ye("div",{css:o?$e`
1940
1940
  outline: ${je(200)} solid ${ze("primary",700)};
1941
1941
  outline-offset: ${He(50)};
1942
1942
  border-radius: 50%;
1943
1943
  box-shadow:
1944
1944
  0 0 0 0.125rem ${ze("neutral",100)},
1945
1945
  rgba(0, 0, 0, 0.05) 0 0.125rem 0.125rem 0.25rem;
1946
- `:"",children:be("button",{type:"button",css:Zy(n,!!r,!!t,s,i,a),"aria-label":e||(i?`Cluster of ${i} locations`:"simple-pin"===a?"Map pin location":"Map point"),ref:l,onClick:r,children:["cluster"===a&&c,"icon"===a&&t]})})})),Jy=({onClick:e,triggerRef:t,showFocusState:n,count:r,mode:o,variant:i="cluster"})=>Y(Gy,{count:r,mode:o,onClick:e,ref:t,showFocusState:n,variant:i}),Xy=({onClick:e,triggerRef:t,showFocusState:n,count:r,mode:o,variant:i="simple-pin"})=>Y(Gy,{count:r,mode:o,onClick:e,ref:t,showFocusState:n,variant:i}),Yy={Paper:({ariaLabel:e,onClick:t,triggerRef:n,showFocusState:r})=>Y(Gy,{ariaLabel:e||"paper icon",icon:Y(bg,{color:"#79022C"}),backgroundColor:"#FFBCD4",onClick:t,ref:n,showFocusState:r}),Drop:({ariaLabel:e,onClick:t,triggerRef:n,showFocusState:r})=>Y(Gy,{ariaLabel:e||"drop icon",icon:Y(yg,{color:"#7D2A03"}),backgroundColor:"#F3A078",onClick:t,ref:n,showFocusState:r}),Plant:({ariaLabel:e,onClick:t,triggerRef:n,showFocusState:r})=>Y(Gy,{ariaLabel:e||"plant icon",icon:Y(wg,{color:"#3B6402"}),backgroundColor:"#B7E578",onClick:t,ref:n,showFocusState:r}),Point:({ariaLabel:e,onClick:t,triggerRef:n,showFocusState:r})=>Y(Gy,{ariaLabel:e||"point icon",backgroundColor:ze("primary",500),onClick:t,ref:n,showFocusState:r})};function Qy(){return"undefined"!=typeof window}function ew(e){return rw(e)?(e.nodeName||"").toLowerCase():"#document"}function tw(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function nw(e){var t;return null==(t=(rw(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function rw(e){return!!Qy()&&(e instanceof Node||e instanceof tw(e).Node)}function ow(e){return!!Qy()&&(e instanceof Element||e instanceof tw(e).Element)}function iw(e){return!!Qy()&&(e instanceof HTMLElement||e instanceof tw(e).HTMLElement)}function sw(e){return!(!Qy()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof tw(e).ShadowRoot)}const aw=new Set(["inline","contents"]);function lw(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ww(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!aw.has(o)}const cw=new Set(["table","td","th"]);function dw(e){return cw.has(ew(e))}const uw=[":popover-open",":modal"];function hw(e){return uw.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}const pw=["transform","translate","scale","rotate","perspective"],fw=["transform","translate","scale","rotate","perspective","filter"],mw=["paint","layout","strict","content"];function gw(e){const t=vw(),n=ow(e)?ww(e):e;return pw.some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||fw.some((e=>(n.willChange||"").includes(e)))||mw.some((e=>(n.contain||"").includes(e)))}function vw(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const bw=new Set(["html","body","#document"]);function yw(e){return bw.has(ew(e))}function ww(e){return tw(e).getComputedStyle(e)}function Cw(e){return ow(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xw(e){if("html"===ew(e))return e;const t=e.assignedSlot||e.parentNode||sw(e)&&e.host||nw(e);return sw(t)?t.host:t}function kw(e){const t=xw(e);return yw(t)?e.ownerDocument?e.ownerDocument.body:e.body:iw(t)&&lw(t)?t:kw(t)}function $w(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=kw(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=tw(o);if(i){const e=Sw(s);return t.concat(s,s.visualViewport||[],lw(o)?o:[],e&&n?$w(e):[])}return t.concat(o,$w(o,[],n))}function Sw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Ew=Math.min,Mw=Math.max,Tw=Math.round,Ow=Math.floor,Lw=e=>({x:e,y:e}),Aw={left:"right",right:"left",bottom:"top",top:"bottom"},Nw={start:"end",end:"start"};function Rw(e,t,n){return Mw(e,Ew(t,n))}function Dw(e,t){return"function"==typeof e?e(t):e}function Pw(e){return e.split("-")[0]}function Iw(e){return e.split("-")[1]}function zw(e){return"x"===e?"y":"x"}function Vw(e){return"y"===e?"height":"width"}const Hw=new Set(["top","bottom"]);function _w(e){return Hw.has(Pw(e))?"y":"x"}function Bw(e){return zw(_w(e))}function jw(e){return e.replace(/start|end/g,(e=>Nw[e]))}const Fw=["left","right"],qw=["right","left"],Ww=["top","bottom"],Uw=["bottom","top"];function Kw(e,t,n,r){const o=Iw(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?qw:Fw:t?Fw:qw;case"left":case"right":return t?Ww:Uw;default:return[]}}(Pw(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(jw)))),i}function Zw(e){return e.replace(/left|right|bottom|top/g,(e=>Aw[e]))}function Gw(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Jw(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}const Xw="data-floating-ui-focusable";function Yw(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&sw(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Qw(e){return"composedPath"in e?e.composedPath()[0]:e.target}function eC(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function tC(e){return(null==e?void 0:e.ownerDocument)||document}function nC(e,t,n){void 0===n&&(n=!0);return e.filter((e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))})).flatMap((t=>[t,...nC(e,t.id,n)]))}var rC="undefined"!=typeof document?ue:function(){};const oC={...te}.useInsertionEffect||(e=>e());function iC(e){const t=te.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return oC((()=>{t.current=e})),te.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function sC(e,t,n){let{reference:r,floating:o}=e;const i=_w(t),s=Bw(t),a=Vw(s),l=Pw(t),c="y"===i,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(Iw(t)){case"start":p[s]-=h*(n&&c?-1:1);break;case"end":p[s]+=h*(n&&c?-1:1)}return p}async function aC(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=Dw(t,e),f=Gw(p),m=a[h?"floating"===u?"reference":"floating":u],g=Jw(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v="floating"===u?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),y=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},w=Jw(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-w.top+f.top)/y.y,bottom:(w.bottom-g.bottom+f.bottom)/y.y,left:(g.left-w.left+f.left)/y.x,right:(w.right-g.right+f.right)/y.x}}const lC=new Set(["left","top"]);function cC(e){const t=ww(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=iw(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Tw(n)!==i||Tw(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function dC(e){return ow(e)?e:e.contextElement}function uC(e){const t=dC(e);if(!iw(t))return Lw(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=cC(t);let s=(i?Tw(n.width):n.width)/r,a=(i?Tw(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const hC=Lw(0);function pC(e){const t=tw(e);return vw()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:hC}function fC(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=dC(e);let s=Lw(1);t&&(r?ow(r)&&(s=uC(r)):s=uC(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==tw(e))&&t}(i,n,r)?pC(i):Lw(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,u=o.height/s.y;if(i){const e=tw(i),t=r&&ow(r)?tw(r):r;let n=e,o=Sw(n);for(;o&&r&&t!==n;){const e=uC(o),t=o.getBoundingClientRect(),r=ww(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=i,c+=s,n=tw(o),o=Sw(n)}}return Jw({width:d,height:u,x:l,y:c})}function mC(e,t){const n=Cw(e).scrollLeft;return t?t.left+n:fC(nw(e)).left+n}function gC(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-mC(e,n),y:n.top+t.scrollTop}}const vC=new Set(["absolute","fixed"]);function bC(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=tw(e),r=nw(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=vw();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}const c=mC(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(r.clientWidth-t.clientWidth-o);s<=25&&(i-=s)}else c<=25&&(i+=c);return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=nw(e),n=Cw(e),r=e.ownerDocument.body,o=Mw(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Mw(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+mC(e);const a=-n.scrollTop;return"rtl"===ww(r).direction&&(s+=Mw(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(nw(e));else if(ow(t))r=function(e,t){const n=fC(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=iw(e)?uC(e):Lw(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=pC(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Jw(r)}function yC(e,t){const n=xw(e);return!(n===t||!ow(n)||yw(n))&&("fixed"===ww(n).position||yC(n,t))}function wC(e,t,n){const r=iw(t),o=nw(t),i="fixed"===n,s=fC(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Lw(0);function c(){l.x=mC(o)}if(r||!r&&!i)if(("body"!==ew(t)||lw(o))&&(a=Cw(t)),r){const e=fC(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const d=!o||r||i?Lw(0):gC(o,a);return{x:s.left+a.scrollLeft-l.x-d.x,y:s.top+a.scrollTop-l.y-d.y,width:s.width,height:s.height}}function CC(e){return"static"===ww(e).position}function xC(e,t){if(!iw(e)||"fixed"===ww(e).position)return null;if(t)return t(e);let n=e.offsetParent;return nw(e)===n&&(n=n.ownerDocument.body),n}function kC(e,t){const n=tw(e);if(hw(e))return n;if(!iw(e)){let t=xw(e);for(;t&&!yw(t);){if(ow(t)&&!CC(t))return t;t=xw(t)}return n}let r=xC(e,t);for(;r&&dw(r)&&CC(r);)r=xC(r,t);return r&&yw(r)&&CC(r)&&!gw(r)?n:r||function(e){let t=xw(e);for(;iw(t)&&!yw(t);){if(gw(t))return t;if(hw(t))return null;t=xw(t)}return null}(e)||n}const $C={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=nw(r),a=!!t&&hw(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Lw(1);const d=Lw(0),u=iw(r);if((u||!u&&!i)&&(("body"!==ew(r)||lw(s))&&(l=Cw(r)),iw(r))){const e=fC(r);c=uC(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const h=!s||u||i?Lw(0):gC(s,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}},getDocumentElement:nw,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?hw(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=$w(e,[],!1).filter((e=>ow(e)&&"body"!==ew(e))),o=null;const i="fixed"===ww(e).position;let s=i?xw(e):e;for(;ow(s)&&!yw(s);){const t=ww(s),n=gw(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&vC.has(o.position)||lw(s)&&!n&&yC(e,s))?r=r.filter((e=>e!==s)):o=t,s=xw(s)}return t.set(e,r),r}(t,this._c):[].concat(n),s=[...i,r],a=s[0],l=s.reduce(((e,n)=>{const r=bC(t,n,o);return e.top=Mw(r.top,e.top),e.right=Ew(r.right,e.right),e.bottom=Ew(r.bottom,e.bottom),e.left=Mw(r.left,e.left),e}),bC(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:kC,getElementRects:async function(e){const t=this.getOffsetParent||kC,n=this.getDimensions,r=await n(e.floating);return{reference:wC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=cC(e);return{width:t,height:n}},getScale:uC,isElement:ow,isRTL:function(e){return"rtl"===ww(e).direction}};function SC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function EC(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=dC(e),d=o||i?[...c?$w(c):[],...$w(t)]:[];d.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const u=c&&a?function(e,t){let n,r=null;const o=nw(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=c;if(a||t(),!h||!p)return;const f={rootMargin:-Ow(u)+"px "+-Ow(o.clientWidth-(d+h))+"px "+-Ow(o.clientHeight-(u+p))+"px "+-Ow(d)+"px",threshold:Mw(0,Ew(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return s();r?s(!1,r):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}1!==r||SC(c,e.getBoundingClientRect())||s(),m=!1}try{r=new IntersectionObserver(g,{...f,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,f)}r.observe(e)}(!0),i}(c,n):null;let h,p=-1,f=null;s&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),c&&!l&&f.observe(c),f.observe(t));let m=l?fC(e):null;return l&&function t(){const r=fC(e);m&&!SC(m,r)&&n();m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==u||u(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const MC=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=Pw(n),a=Iw(n),l="y"===_w(n),c=lC.has(s)?-1:1,d=i&&l?-1:1,u=Dw(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:f}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},TC=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Dw(e,t),c={x:n,y:r},d=await aC(t,l),u=_w(Pw(o)),h=zw(u);let p=c[h],f=c[u];if(i){const e="y"===h?"bottom":"right";p=Rw(p+d["y"===h?"top":"left"],p,p-d[e])}if(s){const e="y"===u?"bottom":"right";f=Rw(f+d["y"===u?"top":"left"],f,f-d[e])}const m=a.fn({...t,[h]:p,[u]:f});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:i,[u]:s}}}}}},OC=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=Dw(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Pw(o),b=_w(a),y=Pw(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),C=h||(y||!m?[Zw(a)]:function(e){const t=Zw(e);return[jw(e),t,jw(t)]}(a)),x="none"!==f;!h&&x&&C.push(...Kw(a,m,f,w));const k=[a,...C],$=await aC(t,g),S=[];let E=(null==(r=i.flip)?void 0:r.overflows)||[];if(d&&S.push($[v]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=Iw(e),o=Bw(e),i=Vw(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Zw(s)),[s,Zw(s)]}(o,s,w);S.push($[e[0]],$[e[1]])}if(E=[...E,{placement:o,overflows:S}],!S.every((e=>e<=0))){var M,T;const e=((null==(M=i.flip)?void 0:M.index)||0)+1,t=k[e];if(t){if(!("alignment"===u&&b!==_w(t))||E.every((e=>_w(e.placement)!==b||e.overflows[0]>0)))return{data:{index:e,overflows:E},reset:{placement:t}}}let n=null==(T=E.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(p){case"bestFit":{var O;const e=null==(O=E.filter((e=>{if(x){const t=_w(e.placement);return t===b||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},LC=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=Dw(e,t)||{};if(null==c)return{};const u=Gw(d),h={x:n,y:r},p=Bw(o),f=Vw(p),m=await s.getDimensions(c),g="y"===p,v=g?"top":"left",b=g?"bottom":"right",y=g?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[p]-h[p]-i.floating[f],C=h[p]-i.reference[p],x=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let k=x?x[y]:0;k&&await(null==s.isElement?void 0:s.isElement(x))||(k=a.floating[y]||i.floating[f]);const $=w/2-C/2,S=k/2-m[f]/2-1,E=Ew(u[v],S),M=Ew(u[b],S),T=E,O=k-m[f]-M,L=k/2-m[f]/2+$,A=Rw(T,L,O),N=!l.arrow&&null!=Iw(o)&&L!==A&&i.reference[f]/2-(L<T?E:M)-m[f]/2<0,R=N?L<T?L-T:L-O:0;return{[p]:h[p]+R,data:{[p]:A,centerOffset:L-A-R,...N&&{alignmentOffset:R}},reset:N}}}),AC=(e,t,n)=>{const r=new Map,o={platform:$C,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=sC(c,r,l),h=r,p={},f=0;for(let n=0;n<a.length;n++){const{name:i,fn:m}=a[n],{x:g,y:v,data:b,reset:y}=await m({x:d,y:u,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});d=null!=g?g:d,u=null!=v?v:u,p={...p,[i]:{...p[i],...b}},y&&f<=50&&(f++,"object"==typeof y&&(y.placement&&(h=y.placement),y.rects&&(c=!0===y.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:d,y:u}=sC(c,h,l))),n=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var NC="undefined"!=typeof document?ue:function(){};function RC(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!RC(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!RC(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function DC(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function PC(e,t){const n=DC(e);return Math.round(t*n)/n}function IC(e){const t=te.useRef(e);return NC((()=>{t.current=e})),t}const zC=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?LC({element:n.current,padding:r}).fn(t):{}:n?LC({element:n,padding:r}).fn(t):{};var o}}),VC=(e,t)=>({...MC(e),options:[e,t]}),HC=(e,t)=>({...TC(e),options:[e,t]}),_C=(e,t)=>({...zC(e),options:[e,t]}),BC="data-floating-ui-focusable",jC="active",FC="selected",qC={...te};let WC=!1,UC=0;const KC=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+UC++;const ZC=qC.useId||function(){const[e,t]=te.useState((()=>WC?KC():void 0));return rC((()=>{null==e&&t(KC())}),[]),te.useEffect((()=>{WC=!0}),[]),e};let GC;"production"!==process.env.NODE_ENV&&(GC=new Set);const JC=te.createContext(null),XC=te.createContext(null),YC=()=>{var e;return(null==(e=te.useContext(JC))?void 0:e.id)||null},QC=()=>te.useContext(XC);const ex={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},tx={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},nx=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function rx(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=ZC(),i=te.useRef({}),[s]=te.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}())),a=null!=YC();if("production"!==process.env.NODE_ENV){const e=r.reference;e&&!ow(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=GC)&&e.has(o)||(null==(i=GC)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=te.useState(r.reference),d=iC(((e,t,r)=>{i.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:r,nested:a}),null==n||n(e,t,r)})),u=te.useMemo((()=>({setPositionReference:c})),[]),h=te.useMemo((()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference})),[l,r.reference,r.floating]);return te.useMemo((()=>({dataRef:i,open:t,onOpenChange:d,elements:h,events:s,floatingId:o,refs:u})),[t,d,h,s,o,u])}function ox(e){void 0===e&&(e={});const{nodeId:t}=e,n=rx({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=te.useState(null),[a,l]=te.useState(null),c=(null==o?void 0:o.domReference)||i,d=te.useRef(null),u=QC();rC((()=>{c&&(d.current=c)}),[c]);const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=te.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=te.useState(r);RC(h,r)||p(r);const[f,m]=te.useState(null),[g,v]=te.useState(null),b=te.useCallback((e=>{e!==x.current&&(x.current=e,m(e))}),[]),y=te.useCallback((e=>{e!==k.current&&(k.current=e,v(e))}),[]),w=i||f,C=s||g,x=te.useRef(null),k=te.useRef(null),$=te.useRef(d),S=null!=l,E=IC(l),M=IC(o),T=IC(c),O=te.useCallback((()=>{if(!x.current||!k.current)return;const e={placement:t,strategy:n,middleware:h};M.current&&(e.platform=M.current),AC(x.current,k.current,e).then((e=>{const t={...e,isPositioned:!1!==T.current};L.current&&!RC($.current,t)&&($.current=t,Ce.flushSync((()=>{u(t)})))}))}),[h,t,n,M,T]);NC((()=>{!1===c&&$.current.isPositioned&&($.current.isPositioned=!1,u((e=>({...e,isPositioned:!1}))))}),[c]);const L=te.useRef(!1);NC((()=>(L.current=!0,()=>{L.current=!1})),[]),NC((()=>{if(w&&(x.current=w),C&&(k.current=C),w&&C){if(E.current)return E.current(w,C,O);O()}}),[w,C,O,E,S]);const A=te.useMemo((()=>({reference:x,floating:k,setReference:b,setFloating:y})),[b,y]),N=te.useMemo((()=>({reference:w,floating:C})),[w,C]),R=te.useMemo((()=>{const e={position:n,left:0,top:0};if(!N.floating)return e;const t=PC(N.floating,d.x),r=PC(N.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...DC(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,N.floating,d.x,d.y]);return te.useMemo((()=>({...d,update:O,refs:A,elements:N,floatingStyles:R})),[d,O,A,N,R])}({...e,elements:{...o,...a&&{reference:a}}}),p=te.useCallback((e=>{const t=ow(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;l(t),h.refs.setReference(t)}),[h.refs]),f=te.useCallback((e=>{(ow(e)||null===e)&&(d.current=e,s(e)),(ow(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!ow(e))&&h.refs.setReference(e)}),[h.refs]),m=te.useMemo((()=>({...h.refs,setReference:f,setPositionReference:p,domReference:d})),[h.refs,f,p]),g=te.useMemo((()=>({...h.elements,domReference:c})),[h.elements,c]),v=te.useMemo((()=>({...h,...r,refs:m,elements:g,nodeId:t})),[h,m,g,t,r]);return rC((()=>{r.dataRef.current.floatingContext=v;const e=null==u?void 0:u.nodesRef.current.find((e=>e.id===t));e&&(e.context=v)})),te.useMemo((()=>({...h,context:v,refs:m,elements:g})),[h,m,g,v])}function ix(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[jC]:t,[FC]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[BC]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var s;o&&[jC,FC].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(s=r.get(n))||s.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const sx=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function ax(e,t){var n,r;void 0===t&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,c=ZC(),d=(null==(n=i.domReference)?void 0:n.id)||c,u=te.useMemo((()=>{var e,t;return(null==(e=(t=i.floating)?t.hasAttribute(Xw)?t:t.querySelector("["+Xw+"]")||t:null)?void 0:e.id)||s}),[i.floating,s]),h=null!=(r=sx.get(l))?r:l,p=null!=YC(),f=te.useMemo((()=>"tooltip"===h||"label"===l?{["aria-"+("label"===l?"labelledby":"describedby")]:o?u:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===h?"dialog":h,"aria-controls":o?u:void 0,..."listbox"===h&&{role:"combobox"},..."menu"===h&&{id:d},..."menu"===h&&p&&{role:"menuitem"},..."select"===l&&{"aria-autocomplete":"none"},..."combobox"===l&&{"aria-autocomplete":"list"}}),[h,u,p,o,d,l]),m=te.useMemo((()=>{const e={id:u,...h&&{role:h}};return"tooltip"===h||"label"===l?e:{...e,..."menu"===h&&{"aria-labelledby":d}}}),[h,u,d,l]),g=te.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:u+"-fui-option"}};switch(l){case"select":case"combobox":return{...r,"aria-selected":n}}return{}}),[u,l]);return te.useMemo((()=>a?{reference:f,floating:m,item:g}:{}),[a,f,m,g])}const lx=$e`
1946
+ `:"",children:be("button",{type:"button",css:Zy(n,!!r,!!t,s,i,a),"aria-label":e||(i?d.clusterAriaLabel(i):"simple-pin"===a?d.pinAriaLabel:d.pointAriaLabel),ref:c,onClick:r,children:["cluster"===a&&u,"icon"===a&&t]})})})),Jy=({onClick:e,triggerRef:t,showFocusState:n,count:r,mode:o,variant:i="cluster"})=>Y(Gy,{count:r,mode:o,onClick:e,ref:t,showFocusState:n,variant:i}),Xy=({onClick:e,triggerRef:t,showFocusState:n,count:r,mode:o,variant:i="simple-pin"})=>Y(Gy,{count:r,mode:o,onClick:e,ref:t,showFocusState:n,variant:i}),Yy={Paper:({ariaLabel:e,onClick:t,triggerRef:n,showFocusState:r})=>Y(Gy,{ariaLabel:e||"paper icon",icon:Y(bg,{color:"#79022C"}),backgroundColor:"#FFBCD4",onClick:t,ref:n,showFocusState:r}),Drop:({ariaLabel:e,onClick:t,triggerRef:n,showFocusState:r})=>Y(Gy,{ariaLabel:e||"drop icon",icon:Y(yg,{color:"#7D2A03"}),backgroundColor:"#F3A078",onClick:t,ref:n,showFocusState:r}),Plant:({ariaLabel:e,onClick:t,triggerRef:n,showFocusState:r})=>Y(Gy,{ariaLabel:e||"plant icon",icon:Y(wg,{color:"#3B6402"}),backgroundColor:"#B7E578",onClick:t,ref:n,showFocusState:r}),Point:({ariaLabel:e,onClick:t,triggerRef:n,showFocusState:r})=>Y(Gy,{ariaLabel:e||"point icon",backgroundColor:ze("primary",500),onClick:t,ref:n,showFocusState:r})};function Qy(){return"undefined"!=typeof window}function ew(e){return rw(e)?(e.nodeName||"").toLowerCase():"#document"}function tw(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function nw(e){var t;return null==(t=(rw(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function rw(e){return!!Qy()&&(e instanceof Node||e instanceof tw(e).Node)}function ow(e){return!!Qy()&&(e instanceof Element||e instanceof tw(e).Element)}function iw(e){return!!Qy()&&(e instanceof HTMLElement||e instanceof tw(e).HTMLElement)}function sw(e){return!(!Qy()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof tw(e).ShadowRoot)}const aw=new Set(["inline","contents"]);function lw(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ww(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!aw.has(o)}const cw=new Set(["table","td","th"]);function dw(e){return cw.has(ew(e))}const uw=[":popover-open",":modal"];function hw(e){return uw.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}const pw=["transform","translate","scale","rotate","perspective"],fw=["transform","translate","scale","rotate","perspective","filter"],mw=["paint","layout","strict","content"];function gw(e){const t=vw(),n=ow(e)?ww(e):e;return pw.some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||fw.some((e=>(n.willChange||"").includes(e)))||mw.some((e=>(n.contain||"").includes(e)))}function vw(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const bw=new Set(["html","body","#document"]);function yw(e){return bw.has(ew(e))}function ww(e){return tw(e).getComputedStyle(e)}function Cw(e){return ow(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xw(e){if("html"===ew(e))return e;const t=e.assignedSlot||e.parentNode||sw(e)&&e.host||nw(e);return sw(t)?t.host:t}function kw(e){const t=xw(e);return yw(t)?e.ownerDocument?e.ownerDocument.body:e.body:iw(t)&&lw(t)?t:kw(t)}function $w(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=kw(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=tw(o);if(i){const e=Sw(s);return t.concat(s,s.visualViewport||[],lw(o)?o:[],e&&n?$w(e):[])}return t.concat(o,$w(o,[],n))}function Sw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Mw=Math.min,Ew=Math.max,Tw=Math.round,Ow=Math.floor,Lw=e=>({x:e,y:e}),Aw={left:"right",right:"left",bottom:"top",top:"bottom"},Rw={start:"end",end:"start"};function Nw(e,t,n){return Ew(e,Mw(t,n))}function Dw(e,t){return"function"==typeof e?e(t):e}function Pw(e){return e.split("-")[0]}function Iw(e){return e.split("-")[1]}function zw(e){return"x"===e?"y":"x"}function Vw(e){return"y"===e?"height":"width"}const Hw=new Set(["top","bottom"]);function _w(e){return Hw.has(Pw(e))?"y":"x"}function Bw(e){return zw(_w(e))}function jw(e){return e.replace(/start|end/g,(e=>Rw[e]))}const Fw=["left","right"],qw=["right","left"],Ww=["top","bottom"],Uw=["bottom","top"];function Kw(e,t,n,r){const o=Iw(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?qw:Fw:t?Fw:qw;case"left":case"right":return t?Ww:Uw;default:return[]}}(Pw(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(jw)))),i}function Zw(e){return e.replace(/left|right|bottom|top/g,(e=>Aw[e]))}function Gw(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Jw(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}const Xw="data-floating-ui-focusable";function Yw(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&sw(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Qw(e){return"composedPath"in e?e.composedPath()[0]:e.target}function eC(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function tC(e){return(null==e?void 0:e.ownerDocument)||document}function nC(e,t,n){void 0===n&&(n=!0);return e.filter((e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))})).flatMap((t=>[t,...nC(e,t.id,n)]))}var rC="undefined"!=typeof document?ue:function(){};const oC={...te}.useInsertionEffect||(e=>e());function iC(e){const t=te.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return oC((()=>{t.current=e})),te.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function sC(e,t,n){let{reference:r,floating:o}=e;const i=_w(t),s=Bw(t),a=Vw(s),l=Pw(t),c="y"===i,d=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(Iw(t)){case"start":p[s]-=h*(n&&c?-1:1);break;case"end":p[s]+=h*(n&&c?-1:1)}return p}async function aC(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=Dw(t,e),f=Gw(p),m=a[h?"floating"===u?"reference":"floating":u],g=Jw(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v="floating"===u?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),y=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},w=Jw(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-w.top+f.top)/y.y,bottom:(w.bottom-g.bottom+f.bottom)/y.y,left:(g.left-w.left+f.left)/y.x,right:(w.right-g.right+f.right)/y.x}}const lC=new Set(["left","top"]);function cC(e){const t=ww(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=iw(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Tw(n)!==i||Tw(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function dC(e){return ow(e)?e:e.contextElement}function uC(e){const t=dC(e);if(!iw(t))return Lw(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=cC(t);let s=(i?Tw(n.width):n.width)/r,a=(i?Tw(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const hC=Lw(0);function pC(e){const t=tw(e);return vw()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:hC}function fC(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=dC(e);let s=Lw(1);t&&(r?ow(r)&&(s=uC(r)):s=uC(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==tw(e))&&t}(i,n,r)?pC(i):Lw(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,u=o.height/s.y;if(i){const e=tw(i),t=r&&ow(r)?tw(r):r;let n=e,o=Sw(n);for(;o&&r&&t!==n;){const e=uC(o),t=o.getBoundingClientRect(),r=ww(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,d*=e.x,u*=e.y,l+=i,c+=s,n=tw(o),o=Sw(n)}}return Jw({width:d,height:u,x:l,y:c})}function mC(e,t){const n=Cw(e).scrollLeft;return t?t.left+n:fC(nw(e)).left+n}function gC(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-mC(e,n),y:n.top+t.scrollTop}}const vC=new Set(["absolute","fixed"]);function bC(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=tw(e),r=nw(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=vw();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}const c=mC(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(r.clientWidth-t.clientWidth-o);s<=25&&(i-=s)}else c<=25&&(i+=c);return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=nw(e),n=Cw(e),r=e.ownerDocument.body,o=Ew(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ew(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+mC(e);const a=-n.scrollTop;return"rtl"===ww(r).direction&&(s+=Ew(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(nw(e));else if(ow(t))r=function(e,t){const n=fC(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=iw(e)?uC(e):Lw(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=pC(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Jw(r)}function yC(e,t){const n=xw(e);return!(n===t||!ow(n)||yw(n))&&("fixed"===ww(n).position||yC(n,t))}function wC(e,t,n){const r=iw(t),o=nw(t),i="fixed"===n,s=fC(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Lw(0);function c(){l.x=mC(o)}if(r||!r&&!i)if(("body"!==ew(t)||lw(o))&&(a=Cw(t)),r){const e=fC(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const d=!o||r||i?Lw(0):gC(o,a);return{x:s.left+a.scrollLeft-l.x-d.x,y:s.top+a.scrollTop-l.y-d.y,width:s.width,height:s.height}}function CC(e){return"static"===ww(e).position}function xC(e,t){if(!iw(e)||"fixed"===ww(e).position)return null;if(t)return t(e);let n=e.offsetParent;return nw(e)===n&&(n=n.ownerDocument.body),n}function kC(e,t){const n=tw(e);if(hw(e))return n;if(!iw(e)){let t=xw(e);for(;t&&!yw(t);){if(ow(t)&&!CC(t))return t;t=xw(t)}return n}let r=xC(e,t);for(;r&&dw(r)&&CC(r);)r=xC(r,t);return r&&yw(r)&&CC(r)&&!gw(r)?n:r||function(e){let t=xw(e);for(;iw(t)&&!yw(t);){if(gw(t))return t;if(hw(t))return null;t=xw(t)}return null}(e)||n}const $C={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=nw(r),a=!!t&&hw(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Lw(1);const d=Lw(0),u=iw(r);if((u||!u&&!i)&&(("body"!==ew(r)||lw(s))&&(l=Cw(r)),iw(r))){const e=fC(r);c=uC(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const h=!s||u||i?Lw(0):gC(s,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}},getDocumentElement:nw,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?hw(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=$w(e,[],!1).filter((e=>ow(e)&&"body"!==ew(e))),o=null;const i="fixed"===ww(e).position;let s=i?xw(e):e;for(;ow(s)&&!yw(s);){const t=ww(s),n=gw(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&vC.has(o.position)||lw(s)&&!n&&yC(e,s))?r=r.filter((e=>e!==s)):o=t,s=xw(s)}return t.set(e,r),r}(t,this._c):[].concat(n),s=[...i,r],a=s[0],l=s.reduce(((e,n)=>{const r=bC(t,n,o);return e.top=Ew(r.top,e.top),e.right=Mw(r.right,e.right),e.bottom=Mw(r.bottom,e.bottom),e.left=Ew(r.left,e.left),e}),bC(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:kC,getElementRects:async function(e){const t=this.getOffsetParent||kC,n=this.getDimensions,r=await n(e.floating);return{reference:wC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=cC(e);return{width:t,height:n}},getScale:uC,isElement:ow,isRTL:function(e){return"rtl"===ww(e).direction}};function SC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function MC(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=dC(e),d=o||i?[...c?$w(c):[],...$w(t)]:[];d.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const u=c&&a?function(e,t){let n,r=null;const o=nw(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=c;if(a||t(),!h||!p)return;const f={rootMargin:-Ow(u)+"px "+-Ow(o.clientWidth-(d+h))+"px "+-Ow(o.clientHeight-(u+p))+"px "+-Ow(d)+"px",threshold:Ew(0,Mw(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return s();r?s(!1,r):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}1!==r||SC(c,e.getBoundingClientRect())||s(),m=!1}try{r=new IntersectionObserver(g,{...f,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,f)}r.observe(e)}(!0),i}(c,n):null;let h,p=-1,f=null;s&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),c&&!l&&f.observe(c),f.observe(t));let m=l?fC(e):null;return l&&function t(){const r=fC(e);m&&!SC(m,r)&&n();m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==u||u(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const EC=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=Pw(n),a=Iw(n),l="y"===_w(n),c=lC.has(s)?-1:1,d=i&&l?-1:1,u=Dw(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:f}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},TC=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Dw(e,t),c={x:n,y:r},d=await aC(t,l),u=_w(Pw(o)),h=zw(u);let p=c[h],f=c[u];if(i){const e="y"===h?"bottom":"right";p=Nw(p+d["y"===h?"top":"left"],p,p-d[e])}if(s){const e="y"===u?"bottom":"right";f=Nw(f+d["y"===u?"top":"left"],f,f-d[e])}const m=a.fn({...t,[h]:p,[u]:f});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:i,[u]:s}}}}}},OC=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=Dw(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=Pw(o),b=_w(a),y=Pw(a)===a,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),C=h||(y||!m?[Zw(a)]:function(e){const t=Zw(e);return[jw(e),t,jw(t)]}(a)),x="none"!==f;!h&&x&&C.push(...Kw(a,m,f,w));const k=[a,...C],$=await aC(t,g),S=[];let M=(null==(r=i.flip)?void 0:r.overflows)||[];if(d&&S.push($[v]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=Iw(e),o=Bw(e),i=Vw(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Zw(s)),[s,Zw(s)]}(o,s,w);S.push($[e[0]],$[e[1]])}if(M=[...M,{placement:o,overflows:S}],!S.every((e=>e<=0))){var E,T;const e=((null==(E=i.flip)?void 0:E.index)||0)+1,t=k[e];if(t){if(!("alignment"===u&&b!==_w(t))||M.every((e=>_w(e.placement)!==b||e.overflows[0]>0)))return{data:{index:e,overflows:M},reset:{placement:t}}}let n=null==(T=M.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(p){case"bestFit":{var O;const e=null==(O=M.filter((e=>{if(x){const t=_w(e.placement);return t===b||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},LC=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=Dw(e,t)||{};if(null==c)return{};const u=Gw(d),h={x:n,y:r},p=Bw(o),f=Vw(p),m=await s.getDimensions(c),g="y"===p,v=g?"top":"left",b=g?"bottom":"right",y=g?"clientHeight":"clientWidth",w=i.reference[f]+i.reference[p]-h[p]-i.floating[f],C=h[p]-i.reference[p],x=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let k=x?x[y]:0;k&&await(null==s.isElement?void 0:s.isElement(x))||(k=a.floating[y]||i.floating[f]);const $=w/2-C/2,S=k/2-m[f]/2-1,M=Mw(u[v],S),E=Mw(u[b],S),T=M,O=k-m[f]-E,L=k/2-m[f]/2+$,A=Nw(T,L,O),R=!l.arrow&&null!=Iw(o)&&L!==A&&i.reference[f]/2-(L<T?M:E)-m[f]/2<0,N=R?L<T?L-T:L-O:0;return{[p]:h[p]+N,data:{[p]:A,centerOffset:L-A-N,...R&&{alignmentOffset:N}},reset:R}}}),AC=(e,t,n)=>{const r=new Map,o={platform:$C,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=sC(c,r,l),h=r,p={},f=0;for(let n=0;n<a.length;n++){const{name:i,fn:m}=a[n],{x:g,y:v,data:b,reset:y}=await m({x:d,y:u,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});d=null!=g?g:d,u=null!=v?v:u,p={...p,[i]:{...p[i],...b}},y&&f<=50&&(f++,"object"==typeof y&&(y.placement&&(h=y.placement),y.rects&&(c=!0===y.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:d,y:u}=sC(c,h,l))),n=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var RC="undefined"!=typeof document?ue:function(){};function NC(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!NC(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!NC(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function DC(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function PC(e,t){const n=DC(e);return Math.round(t*n)/n}function IC(e){const t=te.useRef(e);return RC((()=>{t.current=e})),t}const zC=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?LC({element:n.current,padding:r}).fn(t):{}:n?LC({element:n,padding:r}).fn(t):{};var o}}),VC=(e,t)=>({...EC(e),options:[e,t]}),HC=(e,t)=>({...TC(e),options:[e,t]}),_C=(e,t)=>({...zC(e),options:[e,t]}),BC="data-floating-ui-focusable",jC="active",FC="selected",qC={...te};let WC=!1,UC=0;const KC=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+UC++;const ZC=qC.useId||function(){const[e,t]=te.useState((()=>WC?KC():void 0));return rC((()=>{null==e&&t(KC())}),[]),te.useEffect((()=>{WC=!0}),[]),e};let GC;"production"!==process.env.NODE_ENV&&(GC=new Set);const JC=te.createContext(null),XC=te.createContext(null),YC=()=>{var e;return(null==(e=te.useContext(JC))?void 0:e.id)||null},QC=()=>te.useContext(XC);const ex={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},tx={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},nx=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function rx(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=ZC(),i=te.useRef({}),[s]=te.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}())),a=null!=YC();if("production"!==process.env.NODE_ENV){const e=r.reference;e&&!ow(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=GC)&&e.has(o)||(null==(i=GC)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=te.useState(r.reference),d=iC(((e,t,r)=>{i.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:r,nested:a}),null==n||n(e,t,r)})),u=te.useMemo((()=>({setPositionReference:c})),[]),h=te.useMemo((()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference})),[l,r.reference,r.floating]);return te.useMemo((()=>({dataRef:i,open:t,onOpenChange:d,elements:h,events:s,floatingId:o,refs:u})),[t,d,h,s,o,u])}function ox(e){void 0===e&&(e={});const{nodeId:t}=e,n=rx({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=te.useState(null),[a,l]=te.useState(null),c=(null==o?void 0:o.domReference)||i,d=te.useRef(null),u=QC();rC((()=>{c&&(d.current=c)}),[c]);const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,u]=te.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=te.useState(r);NC(h,r)||p(r);const[f,m]=te.useState(null),[g,v]=te.useState(null),b=te.useCallback((e=>{e!==x.current&&(x.current=e,m(e))}),[]),y=te.useCallback((e=>{e!==k.current&&(k.current=e,v(e))}),[]),w=i||f,C=s||g,x=te.useRef(null),k=te.useRef(null),$=te.useRef(d),S=null!=l,M=IC(l),E=IC(o),T=IC(c),O=te.useCallback((()=>{if(!x.current||!k.current)return;const e={placement:t,strategy:n,middleware:h};E.current&&(e.platform=E.current),AC(x.current,k.current,e).then((e=>{const t={...e,isPositioned:!1!==T.current};L.current&&!NC($.current,t)&&($.current=t,Ce.flushSync((()=>{u(t)})))}))}),[h,t,n,E,T]);RC((()=>{!1===c&&$.current.isPositioned&&($.current.isPositioned=!1,u((e=>({...e,isPositioned:!1}))))}),[c]);const L=te.useRef(!1);RC((()=>(L.current=!0,()=>{L.current=!1})),[]),RC((()=>{if(w&&(x.current=w),C&&(k.current=C),w&&C){if(M.current)return M.current(w,C,O);O()}}),[w,C,O,M,S]);const A=te.useMemo((()=>({reference:x,floating:k,setReference:b,setFloating:y})),[b,y]),R=te.useMemo((()=>({reference:w,floating:C})),[w,C]),N=te.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=PC(R.floating,d.x),r=PC(R.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...DC(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,R.floating,d.x,d.y]);return te.useMemo((()=>({...d,update:O,refs:A,elements:R,floatingStyles:N})),[d,O,A,R,N])}({...e,elements:{...o,...a&&{reference:a}}}),p=te.useCallback((e=>{const t=ow(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;l(t),h.refs.setReference(t)}),[h.refs]),f=te.useCallback((e=>{(ow(e)||null===e)&&(d.current=e,s(e)),(ow(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!ow(e))&&h.refs.setReference(e)}),[h.refs]),m=te.useMemo((()=>({...h.refs,setReference:f,setPositionReference:p,domReference:d})),[h.refs,f,p]),g=te.useMemo((()=>({...h.elements,domReference:c})),[h.elements,c]),v=te.useMemo((()=>({...h,...r,refs:m,elements:g,nodeId:t})),[h,m,g,t,r]);return rC((()=>{r.dataRef.current.floatingContext=v;const e=null==u?void 0:u.nodesRef.current.find((e=>e.id===t));e&&(e.context=v)})),te.useMemo((()=>({...h,context:v,refs:m,elements:g})),[h,m,g,v])}function ix(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[jC]:t,[FC]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[BC]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var s;o&&[jC,FC].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(s=r.get(n))||s.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const sx=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function ax(e,t){var n,r;void 0===t&&(t={});const{open:o,elements:i,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,c=ZC(),d=(null==(n=i.domReference)?void 0:n.id)||c,u=te.useMemo((()=>{var e,t;return(null==(e=(t=i.floating)?t.hasAttribute(Xw)?t:t.querySelector("["+Xw+"]")||t:null)?void 0:e.id)||s}),[i.floating,s]),h=null!=(r=sx.get(l))?r:l,p=null!=YC(),f=te.useMemo((()=>"tooltip"===h||"label"===l?{["aria-"+("label"===l?"labelledby":"describedby")]:o?u:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===h?"dialog":h,"aria-controls":o?u:void 0,..."listbox"===h&&{role:"combobox"},..."menu"===h&&{id:d},..."menu"===h&&p&&{role:"menuitem"},..."select"===l&&{"aria-autocomplete":"none"},..."combobox"===l&&{"aria-autocomplete":"list"}}),[h,u,p,o,d,l]),m=te.useMemo((()=>{const e={id:u,...h&&{role:h}};return"tooltip"===h||"label"===l?e:{...e,..."menu"===h&&{"aria-labelledby":d}}}),[h,u,d,l]),g=te.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:u+"-fui-option"}};switch(l){case"select":case"combobox":return{...r,"aria-selected":n}}return{}}),[u,l]);return te.useMemo((()=>a?{reference:f,floating:m,item:g}:{}),[a,f,m,g])}const lx=$e`
1947
1947
  height: auto;
1948
1948
  max-height: 32rem;
1949
1949
  width: 100%;
@@ -1992,7 +1992,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
1992
1992
  ${`${o}: -${i-1}px`};
1993
1993
  background-color: ${ze("neutral",100)};
1994
1994
  border: ${je(100)} solid ${ze("neutral",300)};
1995
- `,px=({open:e,onOpenChange:t,anchorRef:n,header:r,content:o,footer:i,placement:s="bottom",offset:a=30,closeOnEscape:l=!0,closeOnOutsideClick:c=!1,labels:d})=>{const u=qm("MapPopUp",d),h=ae(null),{refs:p,floatingStyles:f,context:m,middlewareData:g,placement:v}=ox({open:e,onOpenChange:t,placement:s,whileElementsMounted:EC,middleware:[VC(a),(b={fallbackAxisSideDirection:"start"},{...OC(b),options:[b,y]}),HC({padding:8}),_C({element:h})]});var b,y;ne.useEffect((()=>{n?.current&&p.setReference(n.current)}),[n,p]);const w=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:u="pointerdown",ancestorScroll:h=!1,bubbles:p,capture:f}=t,m=QC(),g=iC("function"==typeof l?l:()=>!1),v="function"==typeof l?g:l,b=te.useRef(!1),{escapeKey:y,outsidePress:w}=nx(p),{escapeKey:C,outsidePress:x}=nx(f),k=te.useRef(!1),$=iC((e=>{var t;if(!n||!s||!a||"Escape"!==e.key)return;if(k.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,l=m?nC(m.nodesRef.current,o):[];if(!y&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),S=iC((e=>{var t;const n=()=>{var t;$(e),null==(t=Qw(e))||t.removeEventListener("keydown",n)};null==(t=Qw(e))||t.addEventListener("keydown",n)})),E=iC((e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const s=b.current;if(b.current=!1,"click"===c&&s)return;if(n)return;if("function"==typeof v&&!v(e))return;const a=Qw(e),l="[data-floating-ui-inert]",d=tC(o.floating).querySelectorAll(l);let u=ow(a)?a:null;for(;u&&!yw(u);){const e=xw(u);if(yw(e)||!ow(e))break;u=e}if(d.length&&ow(a)&&!a.matches("html,body")&&!Yw(a,o.floating)&&Array.from(d).every((e=>!Yw(u,e))))return;if(iw(a)&&O){const t=yw(a),n=ww(a),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),s=o&&a.clientWidth>0&&a.scrollWidth>a.clientWidth,l=i&&a.clientHeight>0&&a.scrollHeight>a.clientHeight,c="rtl"===n.direction,d=l&&(c?e.offsetX<=a.offsetWidth-a.clientWidth:e.offsetX>a.clientWidth),u=s&&e.offsetY>a.clientHeight;if(d||u)return}const h=null==(t=i.current.floatingContext)?void 0:t.nodeId,p=m&&nC(m.nodesRef.current,h).some((t=>{var n;return eC(e,null==(n=t.context)?void 0:n.elements.floating)}));if(eC(e,o.floating)||eC(e,o.domReference)||p)return;const f=m?nC(m.nodesRef.current,h):[];if(f.length>0){let e=!0;if(f.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),M=iC((e=>{var t;const n=()=>{var t;E(e),null==(t=Qw(e))||t.removeEventListener(c,n)};null==(t=Qw(e))||t.addEventListener(c,n)}));te.useEffect((()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=y,i.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),k.current=!0}function d(){e=window.setTimeout((()=>{k.current=!1}),vw()?5:0)}const u=tC(o.floating);a&&(u.addEventListener("keydown",C?S:$,C),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",d)),v&&u.addEventListener(c,x?M:E,x);let p=[];return h&&(ow(o.domReference)&&(p=$w(o.domReference)),ow(o.floating)&&(p=p.concat($w(o.floating))),!ow(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat($w(o.reference.contextElement)))),p=p.filter((e=>{var t;return e!==(null==(t=u.defaultView)?void 0:t.visualViewport)})),p.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{a&&(u.removeEventListener("keydown",C?S:$,C),u.removeEventListener("compositionstart",l),u.removeEventListener("compositionend",d)),v&&u.removeEventListener(c,x?M:E,x),p.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[i,o,a,v,c,n,r,h,s,y,w,$,C,S,E,x,M]),te.useEffect((()=>{i.current.insideReactTree=!1}),[i,v,c]);const T=te.useMemo((()=>({onKeyDown:$,...d&&{[ex[u]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==u&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[$,r,d,u]),O=te.useMemo((()=>({onKeyDown:$,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[tx[c]]:()=>{i.current.insideReactTree=!0}})),[$,c,i]);return te.useMemo((()=>s?{reference:T,floating:O}:{}),[s,T,O])}(m,{escapeKey:l,outsidePress:c}),C=ax(m,{role:"dialog"}),{getFloatingProps:x}=function(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),o=te.useCallback((t=>ix(t,e,"reference")),t),i=te.useCallback((t=>ix(t,e,"floating")),n),s=te.useCallback((t=>ix(t,e,"item")),r);return te.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s})),[o,i,s])}([w,C]),{x:k,y:$}=g.arrow??{x:null,y:null},S={top:"bottom",right:"left",bottom:"top",left:"right"}[v.split("-")[0]];if(!e)return null;let E=a-1,M=4;return"left"!==S&&"right"!==S||(E=4,M=a-1),be(we,{children:[be("div",{ref:p.setFloating,style:f,"aria-label":"Map popup dialog","aria-modal":!0,...x(),css:lx,children:[be("div",{css:cx,children:[r,ye(Sv,{onClick:()=>t(!1),className:"ds-map-pop-up-close-button","aria-label":u.closeLabel})]}),ye("div",{css:dx,children:o}),i?ye("div",{css:ux,children:i}):null,ye("div",{ref:h,css:hx(E,M,k,$,S,a)})]}),ye("div",{className:"fixed inset-0 z-[999] bg-black/20 backdrop-blur-[1px]",onClick:()=>c&&t(!1)})]})},fx=$e`
1995
+ `,px=({open:e,onOpenChange:t,anchorRef:n,header:r,content:o,footer:i,placement:s="bottom",offset:a=30,closeOnEscape:l=!0,closeOnOutsideClick:c=!1,labels:d})=>{const u=qm("MapPopUp",d),h=ae(null),{refs:p,floatingStyles:f,context:m,middlewareData:g,placement:v}=ox({open:e,onOpenChange:t,placement:s,whileElementsMounted:MC,middleware:[VC(a),(b={fallbackAxisSideDirection:"start"},{...OC(b),options:[b,y]}),HC({padding:8}),_C({element:h})]});var b,y;ne.useEffect((()=>{n?.current&&p.setReference(n.current)}),[n,p]);const w=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:d=!1,referencePressEvent:u="pointerdown",ancestorScroll:h=!1,bubbles:p,capture:f}=t,m=QC(),g=iC("function"==typeof l?l:()=>!1),v="function"==typeof l?g:l,b=te.useRef(!1),{escapeKey:y,outsidePress:w}=nx(p),{escapeKey:C,outsidePress:x}=nx(f),k=te.useRef(!1),$=iC((e=>{var t;if(!n||!s||!a||"Escape"!==e.key)return;if(k.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,l=m?nC(m.nodesRef.current,o):[];if(!y&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),S=iC((e=>{var t;const n=()=>{var t;$(e),null==(t=Qw(e))||t.removeEventListener("keydown",n)};null==(t=Qw(e))||t.addEventListener("keydown",n)})),M=iC((e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const s=b.current;if(b.current=!1,"click"===c&&s)return;if(n)return;if("function"==typeof v&&!v(e))return;const a=Qw(e),l="[data-floating-ui-inert]",d=tC(o.floating).querySelectorAll(l);let u=ow(a)?a:null;for(;u&&!yw(u);){const e=xw(u);if(yw(e)||!ow(e))break;u=e}if(d.length&&ow(a)&&!a.matches("html,body")&&!Yw(a,o.floating)&&Array.from(d).every((e=>!Yw(u,e))))return;if(iw(a)&&O){const t=yw(a),n=ww(a),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),s=o&&a.clientWidth>0&&a.scrollWidth>a.clientWidth,l=i&&a.clientHeight>0&&a.scrollHeight>a.clientHeight,c="rtl"===n.direction,d=l&&(c?e.offsetX<=a.offsetWidth-a.clientWidth:e.offsetX>a.clientWidth),u=s&&e.offsetY>a.clientHeight;if(d||u)return}const h=null==(t=i.current.floatingContext)?void 0:t.nodeId,p=m&&nC(m.nodesRef.current,h).some((t=>{var n;return eC(e,null==(n=t.context)?void 0:n.elements.floating)}));if(eC(e,o.floating)||eC(e,o.domReference)||p)return;const f=m?nC(m.nodesRef.current,h):[];if(f.length>0){let e=!0;if(f.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),E=iC((e=>{var t;const n=()=>{var t;M(e),null==(t=Qw(e))||t.removeEventListener(c,n)};null==(t=Qw(e))||t.addEventListener(c,n)}));te.useEffect((()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=y,i.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),k.current=!0}function d(){e=window.setTimeout((()=>{k.current=!1}),vw()?5:0)}const u=tC(o.floating);a&&(u.addEventListener("keydown",C?S:$,C),u.addEventListener("compositionstart",l),u.addEventListener("compositionend",d)),v&&u.addEventListener(c,x?E:M,x);let p=[];return h&&(ow(o.domReference)&&(p=$w(o.domReference)),ow(o.floating)&&(p=p.concat($w(o.floating))),!ow(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat($w(o.reference.contextElement)))),p=p.filter((e=>{var t;return e!==(null==(t=u.defaultView)?void 0:t.visualViewport)})),p.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{a&&(u.removeEventListener("keydown",C?S:$,C),u.removeEventListener("compositionstart",l),u.removeEventListener("compositionend",d)),v&&u.removeEventListener(c,x?E:M,x),p.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[i,o,a,v,c,n,r,h,s,y,w,$,C,S,M,x,E]),te.useEffect((()=>{i.current.insideReactTree=!1}),[i,v,c]);const T=te.useMemo((()=>({onKeyDown:$,...d&&{[ex[u]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==u&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[$,r,d,u]),O=te.useMemo((()=>({onKeyDown:$,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[tx[c]]:()=>{i.current.insideReactTree=!0}})),[$,c,i]);return te.useMemo((()=>s?{reference:T,floating:O}:{}),[s,T,O])}(m,{escapeKey:l,outsidePress:c}),C=ax(m,{role:"dialog"}),{getFloatingProps:x}=function(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),o=te.useCallback((t=>ix(t,e,"reference")),t),i=te.useCallback((t=>ix(t,e,"floating")),n),s=te.useCallback((t=>ix(t,e,"item")),r);return te.useMemo((()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s})),[o,i,s])}([w,C]),{x:k,y:$}=g.arrow??{x:null,y:null},S={top:"bottom",right:"left",bottom:"top",left:"right"}[v.split("-")[0]];if(!e)return null;let M=a-1,E=4;return"left"!==S&&"right"!==S||(M=4,E=a-1),be(we,{children:[be("div",{ref:p.setFloating,style:f,"aria-label":u.dialogAriaLabel,"aria-modal":!0,...x(),css:lx,children:[be("div",{css:cx,children:[r,ye(Sv,{onClick:()=>t(!1),className:"ds-map-pop-up-close-button","aria-label":u.closeLabel})]}),ye("div",{css:dx,children:o}),i?ye("div",{css:ux,children:i}):null,ye("div",{ref:h,css:hx(M,E,k,$,S,a)})]}),ye("div",{className:"fixed inset-0 z-[999] bg-black/20 backdrop-blur-[1px]",onClick:()=>c&&t(!1)})]})},fx=$e`
1996
1996
  background-color: ${ze("neutral",100)};
1997
1997
  `,mx=$e`
1998
1998
  padding: ${He(400)} ${He(400)} 0
@@ -2045,13 +2045,13 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
2045
2045
  line-height: ${_e(500)};
2046
2046
  text-align: left;
2047
2047
  color: ${ze("neutral",e?500:700)};
2048
- `,kx=({name:e,label:t,caption:n,showInfoButton:o=!0,infoButtonLabel:i="About data",variant:s="switch",disabled:a,onInfoClick:l,isDefaultSelected:c=!1,onChange:d})=>{const u="switch"===s;return be("div",{css:bx,children:[be("div",u?{css:yx,children:[be("div",{css:wx,children:[ye("p",{css:Cx(a),"aria-label":t,"aria-disabled":a,children:t}),ye("p",{"aria-label":n,css:xx(a),children:n})]}),ye(Cb,{"aria-label":`${t}, ${n}`,name:e,disabled:a,defaultChecked:c,onChange:d})]}:{style:{display:"flex",flexDirection:"column"},children:[ye(cb,{value:e,disabled:a,fontSize:"1rem",color:"var(--chakra-colors-neutral-800)",children:t}),ye("p",{style:{marginLeft:"1.75rem"},css:xx(a),children:n})]}),o?ye(r,{display:"flex",justifyContent:"flex-start",marginTop:"0.5rem",marginLeft:u?0:"1.75rem",children:ye(Wm,{variant:"secondary",label:i,rightIcon:ye(Ym,{}),size:"small",onClick:l,disabled:a})}):null]})},$x=({label:e,caption:t,value:n,layerItems:o,onChangeForRadioVariant:i,labels:s})=>{const a=qm("LayerGroup",s),[l,c]=le({}),[d]=le((e=>{const t=e.find((e=>"radio"===e.variant&&e.isDefaultSelected));return t?.name})(o));de((()=>{let t={...l};o.forEach((n=>{n.isDefaultSelected&&(t={...t,["radio"===n.variant?e:n.name]:n.isDefaultSelected})})),c(t)}),[]);const u=(e,t,n,r)=>{const o={...l,[e]:t};c(o),n&&n(e,t,r)},h=Object.values(l).filter((e=>!0===e)).length,p=a.groupAriaLabel(e,h,t);return be(A.Item,{value:n,width:"100%",children:[be(A.ItemTrigger,{css:mx,alignItems:"flex-start","aria-label":p,children:[be(r,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:[be("span",{css:gx,children:[e,ye(iy,{label:a.activeTagLabel(h),size:"small",variant:h>0?"success":"info-grey"})]}),ye("div",{css:vx,children:t})]}),ye(A.ItemIndicator,{display:"flex",children:ye(Qm,{color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]}),ye(A.ItemContent,{paddingLeft:"1rem",paddingRight:"1rem",children:ye(db,{name:e,value:d,customGap:"0",onChange:(e,t)=>u(e,!!t,i,t),children:o.map((e=>ye(kx,{...e,onChange:(t,n)=>u(t,n,e.onChange)},e.label)))})})]})},Sx=({children:e,defaultValue:t,...n})=>ye("div",{css:fx,style:{width:"100%"},children:ye(A.Root,{css:{},defaultValue:t,multiple:!0,...n,children:e})}),Ex=$e`
2048
+ `,kx=({name:e,label:t,caption:n,showInfoButton:o=!0,infoButtonLabel:i,variant:s="switch",disabled:a,onInfoClick:l,isDefaultSelected:c=!1,onChange:d,labels:u})=>{const h=qm("LayerItem",u),p="switch"===s;return be("div",{css:bx,children:[be("div",p?{css:yx,children:[be("div",{css:wx,children:[ye("p",{css:Cx(a),"aria-label":t,"aria-disabled":a,children:t}),ye("p",{"aria-label":n,css:xx(a),children:n})]}),ye(Cb,{"aria-label":`${t}, ${n}`,name:e,disabled:a,defaultChecked:c,onChange:d})]}:{style:{display:"flex",flexDirection:"column"},children:[ye(cb,{value:e,disabled:a,fontSize:"1rem",color:"var(--chakra-colors-neutral-800)",children:t}),ye("p",{style:{marginLeft:"1.75rem"},css:xx(a),children:n})]}),o?ye(r,{display:"flex",justifyContent:"flex-start",marginTop:"0.5rem",marginLeft:p?0:"1.75rem",children:ye(Wm,{variant:"secondary",label:i??h.aboutDataLabel,rightIcon:ye(Ym,{}),size:"small",onClick:l,disabled:a})}):null]})},$x=({label:e,caption:t,value:n,layerItems:o,onChangeForRadioVariant:i,labels:s})=>{const a=qm("LayerGroup",s),[l,c]=le({}),[d]=le((e=>{const t=e.find((e=>"radio"===e.variant&&e.isDefaultSelected));return t?.name})(o));de((()=>{let t={...l};o.forEach((n=>{n.isDefaultSelected&&(t={...t,["radio"===n.variant?e:n.name]:n.isDefaultSelected})})),c(t)}),[]);const u=(e,t,n,r)=>{const o={...l,[e]:t};c(o),n&&n(e,t,r)},h=Object.values(l).filter((e=>!0===e)).length,p=a.groupAriaLabel(e,h,t);return be(A.Item,{value:n,width:"100%",children:[be(A.ItemTrigger,{css:mx,alignItems:"flex-start","aria-label":p,children:[be(r,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:[be("span",{css:gx,children:[e,ye(iy,{label:a.activeTagLabel(h),size:"small",variant:h>0?"success":"info-grey"})]}),ye("div",{css:vx,children:t})]}),ye(A.ItemIndicator,{display:"flex",children:ye(Qm,{color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]}),ye(A.ItemContent,{paddingLeft:"1rem",paddingRight:"1rem",children:ye(db,{name:e,value:d,customGap:"0",onChange:(e,t)=>u(e,!!t,i,t),children:o.map((e=>ye(kx,{...e,onChange:(t,n)=>u(t,n,e.onChange)},e.label)))})})]})},Sx=({children:e,defaultValue:t,...n})=>ye("div",{css:fx,style:{width:"100%"},children:ye(A.Root,{css:{},defaultValue:t,multiple:!0,...n,children:e})}),Mx=$e`
2049
2049
  margin-bottom: ${He(400)};
2050
2050
  border: ${je(100)} solid ${ze("neutral",300)};
2051
2051
  border-radius: ${Be(300)};
2052
2052
  box-shadow: 0 1px 0.125rem 0 #0000000d;
2053
2053
  background-color: ${ze("neutral",100)};
2054
- `,Mx=$e`
2054
+ `,Ex=$e`
2055
2055
  padding: 0.375rem ${He(200)};
2056
2056
  align-items: center;
2057
2057
  background-color: ${ze("neutral",100)};
@@ -2097,7 +2097,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
2097
2097
  margin-bottom: 0;
2098
2098
  }
2099
2099
  }
2100
- `,Lx=({label:e,children:t,openedByDefault:n})=>ye("div",{children:ye(A.Root,{defaultValue:n?[e]:[],multiple:!0,children:be(A.Item,{css:Ex,value:e,children:[be(A.ItemTrigger,{css:Mx,children:[ye(r,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:ye("p",{css:Tx,children:e})}),ye(A.ItemIndicator,{display:"flex",children:ye(Qm,{color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]}),ye(A.ItemContent,{css:Ox,children:pe.map(t,(e=>ye("div",{className:"ds-layer-parameters-item-child",children:e})))})]})})}),Ax=$e`
2100
+ `,Lx=({label:e,children:t,openedByDefault:n})=>ye("div",{children:ye(A.Root,{defaultValue:n?[e]:[],multiple:!0,children:be(A.Item,{css:Mx,value:e,children:[be(A.ItemTrigger,{css:Ex,children:[ye(r,{width:"full",display:"flex",flexDirection:"column",alignItems:"flex-start",children:ye("p",{css:Tx,children:e})}),ye(A.ItemIndicator,{display:"flex",children:ye(Qm,{color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]}),ye(A.ItemContent,{css:Ox,children:pe.map(t,(e=>ye("div",{className:"ds-layer-parameters-item-child",children:e})))})]})})}),Ax=$e`
2101
2101
  padding: ${He(300)};
2102
2102
  padding-bottom: ${He(500)};
2103
2103
  display: flex;
@@ -2105,7 +2105,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
2105
2105
  border-bottom: ${je(100)} solid
2106
2106
  ${ze("neutral",300)};
2107
2107
  background-color: ${ze("neutral",100)};
2108
- `,Nx=$e`
2108
+ `,Rx=$e`
2109
2109
  display: flex;
2110
2110
  flex-direction: column;
2111
2111
 
@@ -2114,7 +2114,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
2114
2114
  fill: ${ze("neutral",700)} !important;
2115
2115
  }
2116
2116
  }
2117
- `,Rx=$e`
2117
+ `,Nx=$e`
2118
2118
  display: flex;
2119
2119
  align-items: flex-start;
2120
2120
  justify-content: space-between;
@@ -2172,7 +2172,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
2172
2172
  margin-top: 1.125rem;
2173
2173
  width: 100%;
2174
2174
  }
2175
- `,Bx=({defaultValue:e,onOpacityChanged:t,labels:n})=>{const r=qm("OpacityControl",n),[o,i]=le(e);return be(u.Root,{positioning:{placement:"bottom-end"},children:[ye(u.Trigger,{asChild:!0,children:ye(Wm,{label:r.opacityButtonLabel,size:"small",variant:"secondary",leftIcon:ye(Ym,{})})}),ye(u.Positioner,{children:ye(u.Content,{css:zx,children:be(u.Body,{css:Vx,children:[ye("p",{css:Hx,children:r.opacityHeading}),be("div",{css:_x,children:[be("div",{style:{position:"relative"},children:[ye(mv,{"aria-label":r.opacityAriaLabel,min:"0",max:"100",value:o,onChange:e=>{const n=e.target.value||"0";let r=parseInt(n,10);r=Number.isNaN(r)?0:r,r=r<0?0:r,r=r>100?100:r,i(r),t&&t(r)},className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}),ye("p",{style:{position:"absolute",top:"1.15625rem",right:"0.3125rem"},children:r.percentSuffix})]}),ye(yb,{min:0,max:100,value:[o],onValueChangeEnd:({value:e})=>{i(e[0]),t&&t(e[0])}})]})]})})})]})},jx=({layerName:e,dataUnit:t,onDrag:n,onUpClick:r,onDownClick:o,onRemoveClick:i,children:s,onInfoClick:a,onOpacityChanged:l,labels:c})=>{const d=qm("LegendItem",c);return be("div",{css:Ax,children:[ye("div",{css:Nx,children:be("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[ye(Km,{icon:ye(Qm,{rotate:"180"}),"aria-label":d.upLabel,onClick:r}),ye(Km,{icon:ye(Qm,{}),"aria-label":d.downLabel,onClick:o})]})}),be("div",{style:{width:"100%"},children:[be("div",{css:Rx,children:[be("div",{children:[ye("h3",{css:Dx,children:e}),ye("p",{css:Px,children:t})]}),ye(Wm,{label:d.removeLabel,size:"small",variant:"secondary",rightIcon:ye(tg,{}),onClick:i})]}),s,be("div",{css:Ix,children:[ye(Wm,{label:d.aboutDataLabel,size:"small",variant:"secondary",leftIcon:ye(Ym,{}),onClick:a}),ye(Bx,{defaultValue:80,onOpacityChanged:l})]})]})]})},Fx=e=>$e`
2175
+ `,Bx=({defaultValue:e,onOpacityChanged:t,labels:n})=>{const r=qm("OpacityControl",n),[o,i]=le(e);return be(u.Root,{positioning:{placement:"bottom-end"},children:[ye(u.Trigger,{asChild:!0,children:ye(Wm,{label:r.opacityButtonLabel,size:"small",variant:"secondary",leftIcon:ye(Ym,{})})}),ye(u.Positioner,{children:ye(u.Content,{css:zx,children:be(u.Body,{css:Vx,children:[ye("p",{css:Hx,children:r.opacityHeading}),be("div",{css:_x,children:[be("div",{style:{position:"relative"},children:[ye(mv,{"aria-label":r.opacityAriaLabel,min:"0",max:"100",value:o,onChange:e=>{const n=e.target.value||"0";let r=parseInt(n,10);r=Number.isNaN(r)?0:r,r=r<0?0:r,r=r>100?100:r,i(r),t&&t(r)},className:"ds-opacity-control-text-input",onClick:e=>e.target.select()}),ye("p",{style:{position:"absolute",top:"1.15625rem",right:"0.3125rem"},children:r.percentSuffix})]}),ye(yb,{min:0,max:100,value:[o],onValueChangeEnd:({value:e})=>{i(e[0]),t&&t(e[0])}})]})]})})})]})},jx=({layerName:e,dataUnit:t,onDrag:n,onUpClick:r,onDownClick:o,onRemoveClick:i,children:s,onInfoClick:a,onOpacityChanged:l,labels:c})=>{const d=qm("LegendItem",c);return be("div",{css:Ax,children:[ye("div",{css:Rx,children:be("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[ye(Km,{icon:ye(Qm,{rotate:"180"}),"aria-label":d.upLabel,onClick:r}),ye(Km,{icon:ye(Qm,{}),"aria-label":d.downLabel,onClick:o})]})}),be("div",{style:{width:"100%"},children:[be("div",{css:Nx,children:[be("div",{children:[ye("h3",{css:Dx,children:e}),ye("p",{css:Px,children:t})]}),ye(Wm,{label:d.removeLabel,size:"small",variant:"secondary",rightIcon:ye(tg,{}),onClick:i})]}),s,be("div",{css:Ix,children:[ye(Wm,{label:d.aboutDataLabel,size:"small",variant:"secondary",leftIcon:ye(Ym,{}),onClick:a}),ye(Bx,{defaultValue:80,onOpacityChanged:l})]})]})]})},Fx=e=>$e`
2176
2176
  width: ${He(500)};
2177
2177
  height: ${He(500)};
2178
2178
  border-radius: 50%;
@@ -2365,7 +2365,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
2365
2365
  &:disabled {
2366
2366
  background-color: ${ze("neutral",200)};
2367
2367
  }
2368
- `,gk=({id:e,label:t,caption:n,icon:o,value:s,variant:a="data",onItemClick:l,isExpanded:c=!1,ariaLabel:d,disabled:u=!1,isHighlighted:p=!1})=>{const f=("navigation"===a||"select"===a)&&!!l,m=f?N.button:N.div,g=d||("data"===a&&s?`${t}, ${s}`:t);return be(m,{id:e,css:["data"===a?fk:mk,p&&{backgroundColor:ze("neutral",200)}],onClick:f?l:void 0,tabIndex:f?0:void 0,onKeyDown:e=>{f&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),l?.()))},role:f?"button":void 0,"aria-expanded":f?c:void 0,"aria-label":g,disabled:u,"data-selected":p||void 0,"data-highlighted":p||void 0,children:[be(R,{gap:3,flex:"1",overflow:"hidden",children:[o,be(r,{flex:"1",minWidth:0,children:[ye(h,{fontWeight:"data"===a?"400":"700",css:dk(u),children:t}),n&&ye(h,{css:uk,children:n})]})]}),"data"===a&&s&&ye(h,{css:hk,children:s}),"navigation"===a&&ye(i,{as:eg,boxSize:4,"aria-hidden":"true",css:pk(u)})]})},vk=({items:e,noBorder:t,highlightedIndex:n})=>ye(r,{css:ck(t),children:e.map(((e,t)=>ye(gk,{id:e.id,icon:e.icon,label:e.label,caption:e.caption,value:e.value,variant:e.variant??"data",onItemClick:e.onItemClick,isHighlighted:t===n},e.id??e.label)))}),bk=$e`
2368
+ `,gk=({id:e,label:t,caption:n,icon:o,value:s,variant:a="data",onItemClick:l,isExpanded:c=!1,ariaLabel:d,disabled:u=!1,isHighlighted:p=!1})=>{const f=("navigation"===a||"select"===a)&&!!l,m=f?R.button:R.div,g=d||("data"===a&&s?`${t}, ${s}`:t);return be(m,{id:e,css:["data"===a?fk:mk,p&&{backgroundColor:ze("neutral",200)}],onClick:f?l:void 0,tabIndex:f?0:void 0,onKeyDown:e=>{f&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),l?.()))},role:f?"button":void 0,"aria-expanded":f?c:void 0,"aria-label":g,disabled:u,"data-selected":p||void 0,"data-highlighted":p||void 0,children:[be(N,{gap:3,flex:"1",overflow:"hidden",children:[o,be(r,{flex:"1",minWidth:0,children:[ye(h,{fontWeight:"data"===a?"400":"700",css:dk(u),children:t}),n&&ye(h,{css:uk,children:n})]})]}),"data"===a&&s&&ye(h,{css:hk,children:s}),"navigation"===a&&ye(i,{as:eg,boxSize:4,"aria-hidden":"true",css:pk(u)})]})},vk=({items:e,noBorder:t,highlightedIndex:n})=>ye(r,{css:ck(t),children:e.map(((e,t)=>ye(gk,{id:e.id,icon:e.icon,label:e.label,caption:e.caption,value:e.value,variant:e.variant??"data",onItemClick:e.onItemClick,isHighlighted:t===n},e.id??e.label)))}),bk=$e`
2369
2369
  background: transparent;
2370
2370
  svg {
2371
2371
  path {
@@ -2462,7 +2462,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
2462
2462
  color: ${ze("neutral",800)};
2463
2463
  display: flex;
2464
2464
  align-items: center;
2465
- `,Ek=$e`
2465
+ `,Mk=$e`
2466
2466
  height: ${_e(600)};
2467
2467
  width: 0.625rem;
2468
2468
  display: flex;
@@ -2484,7 +2484,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
2484
2484
  }
2485
2485
  }
2486
2486
  }
2487
- `,Mk=e=>$e`
2487
+ `,Ek=e=>$e`
2488
2488
  svg {
2489
2489
  path {
2490
2490
  fill: ${ze("accessible",e?"controls-on-neutral-lights":100)} !important;
@@ -2525,12 +2525,12 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
2525
2525
  overflow: auto;
2526
2526
  height: ${e};
2527
2527
  width: 100%;
2528
- `,Nk=$e`
2528
+ `,Rk=$e`
2529
2529
  height: 30rem;
2530
2530
  display: flex;
2531
2531
  align-items: center;
2532
2532
  justify-content: center;
2533
- `,Rk=(e,t)=>{const n=e[t]?.width;return n?{width:n,minWidth:n}:{}},Dk=(e,t,n)=>{const r=e[t];return void 0===r?{}:{"data-sticky":"start","data-sticky-last":t===n?"true":void 0,left:`${r}px`}},Pk=(e,t,n)=>{if(n||!t.key)return e;const{key:r,order:o}=t,i="asc"===o;return[...e].sort(((e,t)=>((e,t,n)=>{if(null==e&&null==t)return 0;if(null==e)return 1;if(null==t)return-1;if("string"==typeof e&&"string"==typeof t)return n?e.localeCompare(t):t.localeCompare(e);if("number"==typeof e&&"number"==typeof t)return n?e-t:t-e;const r=String(e),o=String(t);return n?r.localeCompare(o):o.localeCompare(r)})(e?.[r],t?.[r],i)))},Ik=({columns:e,data:t=[],renderRow:n,striped:r,stickyHeader:i,pagination:s,selectable:a,selectedRows:l,variant:c="default",onSortColumn:d,onPageSizeChange:u,onPageChange:h,onAllItemsSelected:p,onRowSelected:f,loading:m,height:g,labels:v})=>{const b=qm("Table",v),[y,w]=le({key:"",order:""}),C=ae({}),[x,k]=le({}),[$,S]=le([]),{totalItems:E=t.length,currentPage:M=1,pageSize:T=10,showItemCount:O,showItemCountText:L}=s||{},A=Boolean(d),N=ie((()=>Pk(t,y,A)),[t,A,y]),R=(e,t)=>{w({key:e,order:t}),d&&d({key:e,order:t})},D=l??$,P=N.length>0&&D.length===N.length,z=D.length>0&&D.length<N.length,V=ie((()=>(e=>e.reduce(((e,t)=>(e[t.key]=t,e)),{}))(e)),[e]),H=ie((()=>(e=>e.filter((e=>e.sticky)).map((e=>e.key)))(e)),[e]),_=(e=>e.length>0?e[e.length-1]:void 0)(H),B=fe((()=>{const t=((e,t)=>{const n={};let r=0;return e.filter((e=>e.sticky)).forEach((e=>{n[e.key]=r,r+=t[e.key]?.offsetWidth||0})),n})(e,C.current);k(t)}),[e]);de((()=>{B()}),[B,t.length]),de((()=>{const e=()=>{B()};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[B]),de((()=>{void 0===l&&S((e=>((e,t)=>{const n=e.filter((e=>t.some((t=>t.id===e.id)))),r=n.length===e.length&&n.every(((t,n)=>t.id===e[n]?.id));return r?e:n})(e,t)))}),[t,l]);const j=e=>Dk(x,e.key,_),F=e=>((e,t,n,r)=>({...Rk(e,n),...Dk(t,n,r)}))(V,x,e,_),q=e=>((e,t)=>e.some((e=>e.id===t.id)))(D,e),W=(({columns:e,selectable:t,isRowSelected:n,onRowSelected:r})=>(o,i)=>{const{id:s,name:a}=o;return Q(I.Row,{className:i?.className,children:[t?Y(I.Cell,{children:Y(Wv,{name:`checkbox-${s}`,"aria-label":`Select row ${a||s}`,checked:n(o),onCheckedChange:({checked:e})=>{r(o,e)}})}):null,e.map((e=>Y(I.Cell,{...i?.getCellProps(e.key),children:e.cell?e.cell(o):o?.[e.key]},e.key)))]})})({columns:e,selectable:a,isRowSelected:q,onRowSelected:(e,t)=>{void 0===l&&S((n=>((e,t,n)=>n?e.some((e=>e.id===t.id))?e:[...e,t]:e.filter((e=>e.id!==t.id)))(n,e,t))),f&&f(e,t)}}),U=n||W;return be("div",{children:[ye("div",{css:g?Ak(g):void 0,children:be(I.Root,{css:kk(c,i),striped:r,stickyHeader:i,interactive:!0,children:[ye(I.Header,{css:$k(c),children:be(I.Row,{children:[a?ye(I.ColumnHeader,{children:ye(Wv,{name:"header-checkbox","aria-label":"Select all rows",checked:P,indeterminate:z,onCheckedChange:({checked:e})=>{void 0===l&&S(e?N:[]),p&&p(e)}})}):null,e.map((e=>{return ye(I.ColumnHeader,{ref:t=>{C.current[e.key]=t},...(t=e.key,Rk(V,t)),role:e.sortable?"columnheader":void 0,"aria-sort":e.sortable&&"asc"===y.order?"ascending":e.sortable&&"desc"===y.order?"descending":void 0,...j(e),children:be("div",{css:Sk,children:[e.label,e.sortable?be("div",{css:Ek,children:[ye(Km,{css:Mk(y.key===e.key&&"asc"===y.order),icon:ye(Qm,{style:{transform:"rotate(180deg)"}}),onClick:()=>R(e.key,"asc"),"aria-label":b.ascendingLabel}),ye(Km,{css:Mk(y.key===e.key&&"desc"===y.order),icon:ye(Qm,{}),onClick:()=>R(e.key,"desc"),"aria-label":b.descendingLabel})]}):null]})},e.key);var t}))]})}),ye(I.Body,{css:Lk,children:N.map((e=>ye(ne.Fragment,{children:U(e,{className:q(e)?"selected":void 0,getCellProps:F})},e.id)))})]})}),m?ye("div",{css:Nk,children:ye(o,{size:"lg",color:ze("primary",500)})}):null,be("div",{css:Tk,children:[ye("div",{children:O?ye(lk,{pageSize:T,currentPage:M,totalItems:E,onPageSizeChange:u,showItemCountText:L}):null}),s?ye("div",{css:Ok,children:ye(xk,{totalItems:E,pageSize:T,currentPage:M,onPageChange:h})}):null]})]})},zk=I.Row,Vk=I.Cell,Hk=$e`
2533
+ `,Nk=(e,t)=>{const n=e[t]?.width;return n?{width:n,minWidth:n}:{}},Dk=(e,t,n)=>{const r=e[t];return void 0===r?{}:{"data-sticky":"start","data-sticky-last":t===n?"true":void 0,left:`${r}px`}},Pk=(e,t,n)=>{if(n||!t.key)return e;const{key:r,order:o}=t,i="asc"===o;return[...e].sort(((e,t)=>((e,t,n)=>{if(null==e&&null==t)return 0;if(null==e)return 1;if(null==t)return-1;if("string"==typeof e&&"string"==typeof t)return n?e.localeCompare(t):t.localeCompare(e);if("number"==typeof e&&"number"==typeof t)return n?e-t:t-e;const r=String(e),o=String(t);return n?r.localeCompare(o):o.localeCompare(r)})(e?.[r],t?.[r],i)))},Ik=({columns:e,data:t=[],renderRow:n,striped:r,stickyHeader:i,pagination:s,selectable:a,selectedRows:l,variant:c="default",onSortColumn:d,onPageSizeChange:u,onPageChange:h,onAllItemsSelected:p,onRowSelected:f,loading:m,height:g,labels:v})=>{const b=qm("Table",v),[y,w]=le({key:"",order:""}),C=ae({}),[x,k]=le({}),[$,S]=le([]),{totalItems:M=t.length,currentPage:E=1,pageSize:T=10,showItemCount:O,showItemCountText:L}=s||{},A=Boolean(d),R=ie((()=>Pk(t,y,A)),[t,A,y]),N=(e,t)=>{w({key:e,order:t}),d&&d({key:e,order:t})},D=l??$,P=R.length>0&&D.length===R.length,z=D.length>0&&D.length<R.length,V=ie((()=>(e=>e.reduce(((e,t)=>(e[t.key]=t,e)),{}))(e)),[e]),H=ie((()=>(e=>e.filter((e=>e.sticky)).map((e=>e.key)))(e)),[e]),_=(e=>e.length>0?e[e.length-1]:void 0)(H),B=fe((()=>{const t=((e,t)=>{const n={};let r=0;return e.filter((e=>e.sticky)).forEach((e=>{n[e.key]=r,r+=t[e.key]?.offsetWidth||0})),n})(e,C.current);k(t)}),[e]);de((()=>{B()}),[B,t.length]),de((()=>{const e=()=>{B()};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[B]),de((()=>{void 0===l&&S((e=>((e,t)=>{const n=e.filter((e=>t.some((t=>t.id===e.id)))),r=n.length===e.length&&n.every(((t,n)=>t.id===e[n]?.id));return r?e:n})(e,t)))}),[t,l]);const j=e=>Dk(x,e.key,_),F=e=>((e,t,n,r)=>({...Nk(e,n),...Dk(t,n,r)}))(V,x,e,_),q=e=>((e,t)=>e.some((e=>e.id===t.id)))(D,e),W=(({columns:e,selectable:t,isRowSelected:n,onRowSelected:r,getSelectRowLabel:o})=>(i,s)=>{const{id:a,name:l}=i;return Q(I.Row,{className:s?.className,children:[t?Y(I.Cell,{children:Y(Wv,{name:`checkbox-${a}`,"aria-label":o(l,a),checked:n(i),onCheckedChange:({checked:e})=>{r(i,e)}})}):null,e.map((e=>Y(I.Cell,{...s?.getCellProps(e.key),children:e.cell?e.cell(i):i?.[e.key]},e.key)))]})})({columns:e,selectable:a,isRowSelected:q,onRowSelected:(e,t)=>{void 0===l&&S((n=>((e,t,n)=>n?e.some((e=>e.id===t.id))?e:[...e,t]:e.filter((e=>e.id!==t.id)))(n,e,t))),f&&f(e,t)},getSelectRowLabel:(e,t)=>b.selectRowLabel(e,t)}),U=n||W;return be("div",{children:[ye("div",{css:g?Ak(g):void 0,children:be(I.Root,{css:kk(c,i),striped:r,stickyHeader:i,interactive:!0,children:[ye(I.Header,{css:$k(c),children:be(I.Row,{children:[a?ye(I.ColumnHeader,{children:ye(Wv,{name:"header-checkbox","aria-label":b.selectAllRowsLabel,checked:P,indeterminate:z,onCheckedChange:({checked:e})=>{void 0===l&&S(e?R:[]),p&&p(e)}})}):null,e.map((e=>{return ye(I.ColumnHeader,{ref:t=>{C.current[e.key]=t},...(t=e.key,Nk(V,t)),role:e.sortable?"columnheader":void 0,"aria-sort":e.sortable&&"asc"===y.order?"ascending":e.sortable&&"desc"===y.order?"descending":void 0,...j(e),children:be("div",{css:Sk,children:[e.label,e.sortable?be("div",{css:Mk,children:[ye(Km,{css:Ek(y.key===e.key&&"asc"===y.order),icon:ye(Qm,{style:{transform:"rotate(180deg)"}}),onClick:()=>N(e.key,"asc"),"aria-label":b.ascendingLabel}),ye(Km,{css:Ek(y.key===e.key&&"desc"===y.order),icon:ye(Qm,{}),onClick:()=>N(e.key,"desc"),"aria-label":b.descendingLabel})]}):null]})},e.key);var t}))]})}),ye(I.Body,{css:Lk,children:R.map((e=>ye(ne.Fragment,{children:U(e,{className:q(e)?"selected":void 0,getCellProps:F})},e.id)))})]})}),m?ye("div",{css:Rk,children:ye(o,{size:"lg",color:ze("primary",500)})}):null,be("div",{css:Tk,children:[ye("div",{children:O?ye(lk,{pageSize:T,currentPage:E,totalItems:M,onPageSizeChange:u,showItemCountText:L}):null}),s?ye("div",{css:Ok,children:ye(xk,{totalItems:M,pageSize:T,currentPage:E,onPageChange:h})}):null]})]})},zk=I.Row,Vk=I.Cell,Hk=$e`
2534
2534
  border: ${je(100)} solid ${ze("neutral",300)};
2535
2535
  `,_k=$e`
2536
2536
  padding: ${He(400)};
@@ -2547,7 +2547,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
2547
2547
  transparent
2548
2548
  );
2549
2549
  }
2550
- `,Bk=({children:e,header:t,footer:n})=>ye(r,{css:Hk,children:ye(A.Root,{multiple:!0,children:be(A.Item,{value:"extendable-card-item",children:[be(A.ItemTrigger,{css:_k,alignItems:"center",children:[ye(R,{gap:3,flex:"1",overflow:"hidden",alignItems:"center",children:t}),ye(A.ItemIndicator,{children:ye(Qm,{color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]}),be(A.ItemContent,{children:[e,n]})]})})}),jk=$e`
2550
+ `,Bk=({children:e,header:t,footer:n})=>ye(r,{css:Hk,children:ye(A.Root,{multiple:!0,children:be(A.Item,{value:"extendable-card-item",children:[be(A.ItemTrigger,{css:_k,alignItems:"center",children:[ye(N,{gap:3,flex:"1",overflow:"hidden",alignItems:"center",children:t}),ye(A.ItemIndicator,{children:ye(Qm,{color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]}),be(A.ItemContent,{children:[e,n]})]})})}),jk=$e`
2551
2551
  border: ${je(100)} solid ${ze("neutral",300)};
2552
2552
  `,Fk=$e`
2553
2553
  padding: ${He(400)};
@@ -2595,7 +2595,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
2595
2595
  `,Wk=$e`
2596
2596
  border-top: ${je(100)} solid
2597
2597
  ${ze("neutral",300)};
2598
- `,Uk=({children:e,header:t,footer:n,expanded:o=!0,collapsible:i=!0,actions:s,showFooterOnCollapsed:a=!1,labels:l})=>{qm("AnalysisWidget",l);const c="analysis-widget-item",[d,u]=le(o),h=`analysis-widget-header-${c}`;return ye(r,{as:"section","aria-labelledby":h,css:jk,children:be(A.Root,{multiple:!0,value:i?void 0:[c],defaultValue:o?[c]:[],children:[be(A.Item,{css:qk,value:c,children:[t&&ye(A.ItemTrigger,{id:h,"aria-expanded":d,css:Fk,pointerEvents:i?"auto":"none",onClick:i?()=>{u(!d)}:void 0,children:be(R,{gap:3,flex:"1",overflow:"hidden",alignItems:"top",justifyContent:"space-between",children:[t,s&&s.map((e=>ye(Wm,{variant:"secondary",size:"small",label:e.label,onClick:t=>{e.onClick(),t.preventDefault(),t.stopPropagation()},leftIcon:e?.icon},e.label))),i&&ye(A.ItemIndicator,{height:"1rem",marginTop:"0.5rem",display:"flex",children:ye(Qm,{"aria-hidden":"true",color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]})}),be("div",{className:d?"item-content-open":"item-content-closed","aria-hidden":!d,children:[e,!a&&n&&ye(r,{css:Wk,children:n})]})]}),a&&n&&ye(r,{css:Wk,children:n})]})})};var Kk,Zk={exports:{}},Gk={},Jk={exports:{}},Xk={exports:{}},Yk={};var Qk,e$,t$,n$,r$,o$,i$,s$,a$,l$,c$,d$,u$,h$={};
2598
+ `,Uk=({children:e,header:t,footer:n,expanded:o=!0,collapsible:i=!0,actions:s,showFooterOnCollapsed:a=!1,labels:l})=>{qm("AnalysisWidget",l);const c="analysis-widget-item",[d,u]=le(o),h=`analysis-widget-header-${c}`;return ye(r,{as:"section","aria-labelledby":h,css:jk,children:be(A.Root,{multiple:!0,value:i?void 0:[c],defaultValue:o?[c]:[],children:[be(A.Item,{css:qk,value:c,children:[t&&ye(A.ItemTrigger,{id:h,"aria-expanded":d,css:Fk,pointerEvents:i?"auto":"none",onClick:i?()=>{u(!d)}:void 0,children:be(N,{gap:3,flex:"1",overflow:"hidden",alignItems:"top",justifyContent:"space-between",children:[t,s&&s.map((e=>ye(Wm,{variant:"secondary",size:"small",label:e.label,onClick:t=>{e.onClick(),t.preventDefault(),t.stopPropagation()},leftIcon:e?.icon},e.label))),i&&ye(A.ItemIndicator,{height:"1rem",marginTop:"0.5rem",display:"flex",children:ye(Qm,{"aria-hidden":"true",color:"var(--chakra-colors-neutral-700)",height:"1rem",width:"1rem"})})]})}),be("div",{className:d?"item-content-open":"item-content-closed","aria-hidden":!d,children:[e,!a&&n&&ye(r,{css:Wk,children:n})]})]}),a&&n&&ye(r,{css:Wk,children:n})]})})};var Kk,Zk={exports:{}},Gk={},Jk={exports:{}},Xk={exports:{}},Yk={};var Qk,e$,t$,n$,r$,o$,i$,s$,a$,l$,c$,d$,u$,h$={};
2599
2599
  /** @license React v16.13.1
2600
2600
  * react-is.development.js
2601
2601
  *
@@ -2603,7 +2603,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
2603
2603
  *
2604
2604
  * This source code is licensed under the MIT license found in the
2605
2605
  * LICENSE file in the root directory of this source tree.
2606
- */function p$(){return e$||(e$=1,"production"===process.env.NODE_ENV?Xk.exports=function(){if(Kk)return Yk;Kk=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function y(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:switch(e=e.type){case l:case c:case r:case i:case o:case u:return e;default:switch(e=e&&e.$$typeof){case a:case d:case f:case p:case s:return e;default:return h}}case n:return h}}}function w(e){return y(e)===c}return Yk.AsyncMode=l,Yk.ConcurrentMode=c,Yk.ContextConsumer=a,Yk.ContextProvider=s,Yk.Element=t,Yk.ForwardRef=d,Yk.Fragment=r,Yk.Lazy=f,Yk.Memo=p,Yk.Portal=n,Yk.Profiler=i,Yk.StrictMode=o,Yk.Suspense=u,Yk.isAsyncMode=function(e){return w(e)||y(e)===l},Yk.isConcurrentMode=w,Yk.isContextConsumer=function(e){return y(e)===a},Yk.isContextProvider=function(e){return y(e)===s},Yk.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Yk.isForwardRef=function(e){return y(e)===d},Yk.isFragment=function(e){return y(e)===r},Yk.isLazy=function(e){return y(e)===f},Yk.isMemo=function(e){return y(e)===p},Yk.isPortal=function(e){return y(e)===n},Yk.isProfiler=function(e){return y(e)===i},Yk.isStrictMode=function(e){return y(e)===o},Yk.isSuspense=function(e){return y(e)===u},Yk.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===o||e===u||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===p||e.$$typeof===s||e.$$typeof===a||e.$$typeof===d||e.$$typeof===g||e.$$typeof===v||e.$$typeof===b||e.$$typeof===m)},Yk.typeOf=y,Yk}():Xk.exports=(Qk||(Qk=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function y(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:var m=e.type;switch(m){case l:case c:case r:case i:case o:case u:return m;default:var g=m&&m.$$typeof;switch(g){case a:case d:case f:case p:case s:return g;default:return h}}case n:return h}}}var w=l,C=c,x=a,k=s,$=t,S=d,E=r,M=f,T=p,O=n,L=i,A=o,N=u,R=!1;function D(e){return y(e)===c}h$.AsyncMode=w,h$.ConcurrentMode=C,h$.ContextConsumer=x,h$.ContextProvider=k,h$.Element=$,h$.ForwardRef=S,h$.Fragment=E,h$.Lazy=M,h$.Memo=T,h$.Portal=O,h$.Profiler=L,h$.StrictMode=A,h$.Suspense=N,h$.isAsyncMode=function(e){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),D(e)||y(e)===l},h$.isConcurrentMode=D,h$.isContextConsumer=function(e){return y(e)===a},h$.isContextProvider=function(e){return y(e)===s},h$.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},h$.isForwardRef=function(e){return y(e)===d},h$.isFragment=function(e){return y(e)===r},h$.isLazy=function(e){return y(e)===f},h$.isMemo=function(e){return y(e)===p},h$.isPortal=function(e){return y(e)===n},h$.isProfiler=function(e){return y(e)===i},h$.isStrictMode=function(e){return y(e)===o},h$.isSuspense=function(e){return y(e)===u},h$.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===o||e===u||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===p||e.$$typeof===s||e.$$typeof===a||e.$$typeof===d||e.$$typeof===g||e.$$typeof===v||e.$$typeof===b||e.$$typeof===m)},h$.typeOf=y}()),h$)),Xk.exports}function f$(){if(n$)return t$;n$=1;return t$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function m$(){return o$?r$:(o$=1,r$=Function.call.bind(Object.prototype.hasOwnProperty))}function g$(){if(l$)return a$;l$=1;var e=p$(),t=Se,n=f$(),r=m$(),o=function(){if(s$)return i$;s$=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=f$(),n={},r=m$();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,s,a,l){if("production"!==process.env.NODE_ENV)for(var c in o)if(r(o,c)){var d;try{if("function"!=typeof o[c]){var u=Error((a||"React class")+": "+s+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}d=o[c](i,c,a,s,null,t)}catch(e){d=e}if(!d||d instanceof Error||e((a||"React class")+": type specification of "+s+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var h=l?l():"";e("Failed "+s+" type: "+d.message+(null!=h?h:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},i$=o}(),i=function(){};function s(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),a$=function(a,l){var c="function"==typeof Symbol&&Symbol.iterator;var d="<<anonymous>>",u={array:m("array"),bigint:m("bigint"),bool:m("boolean"),func:m("function"),number:m("number"),object:m("object"),string:m("string"),symbol:m("symbol"),any:f(s),arrayOf:function(e){return f((function(t,r,o,i,s){if("function"!=typeof e)return new p("Property `"+s+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[r];if(!Array.isArray(a))return new p("Invalid "+i+" `"+s+"` of type `"+b(a)+"` supplied to `"+o+"`, expected an array.");for(var l=0;l<a.length;l++){var c=e(a,l,o,i,s+"["+l+"]",n);if(c instanceof Error)return c}return null}))},element:f((function(e,t,n,r,o){var i=e[t];return a(i)?null:new p("Invalid "+r+" `"+o+"` of type `"+b(i)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:f((function(t,n,r,o,i){var s=t[n];return e.isValidElementType(s)?null:new p("Invalid "+o+" `"+i+"` of type `"+b(s)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return f((function(t,n,r,o,i){if(!(t[n]instanceof e)){var s=e.name||d;return new p("Invalid "+o+" `"+i+"` of type `"+(((a=t[n]).constructor&&a.constructor.name?a.constructor.name:d)+"` supplied to `")+r+"`, expected instance of `"+s+"`.")}var a;return null}))},node:f((function(e,t,n,r,o){return v(e[t])?null:new p("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return f((function(t,o,i,s,a){if("function"!=typeof e)return new p("Property `"+a+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var l=t[o],c=b(l);if("object"!==c)return new p("Invalid "+s+" `"+a+"` of type `"+c+"` supplied to `"+i+"`, expected an object.");for(var d in l)if(r(l,d)){var u=e(l,d,i,s,a+"."+d,n);if(u instanceof Error)return u}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),s;return f((function(t,n,r,o,i){for(var s=t[n],a=0;a<e.length;a++)if(h(s,e[a]))return null;var l=JSON.stringify(e,(function(e,t){return"symbol"===y(t)?String(t):t}));return new p("Invalid "+o+" `"+i+"` of value `"+String(s)+"` supplied to `"+r+"`, expected one of "+l+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+t+"."),s}return f((function(t,o,i,s,a){for(var l=[],c=0;c<e.length;c++){var d=(0,e[c])(t,o,i,s,a,n);if(null==d)return null;d.data&&r(d.data,"expectedType")&&l.push(d.data.expectedType)}return new p("Invalid "+s+" `"+a+"` supplied to `"+i+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")}))},shape:function(e){return f((function(t,r,o,i,s){var a=t[r],l=b(a);if("object"!==l)return new p("Invalid "+i+" `"+s+"` of type `"+l+"` supplied to `"+o+"`, expected `object`.");for(var c in e){var d=e[c];if("function"!=typeof d)return g(o,i,s,c,y(d));var u=d(a,c,o,i,s+"."+c,n);if(u)return u}return null}))},exact:function(e){return f((function(o,i,s,a,l){var c=o[i],d=b(c);if("object"!==d)return new p("Invalid "+a+" `"+l+"` of type `"+d+"` supplied to `"+s+"`, expected `object`.");var u=t({},o[i],e);for(var h in u){var f=e[h];if(r(e,h)&&"function"!=typeof f)return g(s,a,l,h,y(f));if(!f)return new p("Invalid "+a+" `"+l+"` key `"+h+"` supplied to `"+s+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=f(c,h,s,a,l+"."+h,n);if(m)return m}return null}))}};function h(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function f(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,s,a,c,u,h,f){if(c=c||d,h=h||a,f!==n){if(l){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var g=c+":"+a;!t[g]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+h+"` prop on `"+c+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[g]=!0,r++)}}return null==s[a]?o?null===s[a]?new p("The "+u+" `"+h+"` is marked as required in `"+c+"`, but its value is `null`."):new p("The "+u+" `"+h+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(s,a,c,u,h)}var s=o.bind(null,!1);return s.isRequired=o.bind(null,!0),s}function m(e){return f((function(t,n,r,o,i,s){var a=t[n];return b(a)!==e?new p("Invalid "+o+" `"+i+"` of type `"+y(a)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function g(e,t,n,r,o){return new p((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function v(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(v);if(null===e||a(e))return!0;var t=function(e){var t=e&&(c&&e[c]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!v(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!v(o[1]))return!1}return!0;default:return!1}}function b(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function y(e){if(null==e)return""+e;var t=b(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(e){var t=y(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return p.prototype=Error.prototype,u.checkPropTypes=o,u.resetWarningCache=o.resetWarningCache,u.PropTypes=u,u},a$}function v$(){if(u$)return Jk.exports;if(u$=1,"production"!==process.env.NODE_ENV){var e=p$();Jk.exports=g$()(e.isElement,!0)}else Jk.exports=function(){if(d$)return c$;d$=1;var e=f$();function t(){}function n(){}return n.resetWarningCache=t,c$=function(){function r(t,n,r,o,i,s){if(s!==e){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},c$}()();return Jk.exports}var b$,y$={exports:{}};var w$,C$={},x$={};function k$(){if(w$)return x$;return w$=1,Object.defineProperty(x$,"__esModule",{value:!0}),x$.dontSetMe=function(e,t,n){if(e[t])return new Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)},x$.findInArray=function(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]},x$.int=function(e){return parseInt(e,10)},x$.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},x$.isNum=function(e){return"number"==typeof e&&!isNaN(e)},x$}var $$,S$,E$={};function M$(){if(S$)return C$;S$=1,Object.defineProperty(C$,"__esModule",{value:!0}),C$.addClassName=s,C$.addEvent=function(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},C$.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&s(e.body,"react-draggable-transparent-selection")},C$.createCSSTransform=function(e,n){const r=o(e,n,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:r}},C$.createSVGTransform=function(e,t){return o(e,t,"")},C$.getTouch=function(t,n){return t.targetTouches&&(0,e.findInArray)(t.targetTouches,(e=>n===e.identifier))||t.changedTouches&&(0,e.findInArray)(t.changedTouches,(e=>n===e.identifier))},C$.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},C$.getTranslation=o,C$.innerHeight=function(t){let n=t.clientHeight;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n-=(0,e.int)(r.paddingTop),n-=(0,e.int)(r.paddingBottom),n},C$.innerWidth=function(t){let n=t.clientWidth;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n-=(0,e.int)(r.paddingLeft),n-=(0,e.int)(r.paddingRight),n},C$.matchesSelector=r,C$.matchesSelectorAndParentsTo=function(e,t,n){let o=e;do{if(r(o,t))return!0;if(o===n)return!1;o=o.parentNode}while(o);return!1},C$.offsetXYFromParent=function(e,t,n){const r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-r.left)/n,i=(e.clientY+t.scrollTop-r.top)/n;return{x:o,y:i}},C$.outerHeight=function(t){let n=t.clientHeight;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n+=(0,e.int)(r.borderTopWidth),n+=(0,e.int)(r.borderBottomWidth),n},C$.outerWidth=function(t){let n=t.clientWidth;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n+=(0,e.int)(r.borderLeftWidth),n+=(0,e.int)(r.borderRightWidth),n},C$.removeClassName=a,C$.removeEvent=function(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},C$.scheduleRemoveUserSelectStyles=function(e){window.requestAnimationFrame?window.requestAnimationFrame((()=>{i(e)})):i(e)};var e=k$(),t=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,i,s={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return s;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,s)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?o(s,t,i):s[t]=e[t]);return s}(e,t)}(function(){if($$)return E$;$$=1,Object.defineProperty(E$,"__esModule",{value:!0}),E$.browserPrefixToKey=n,E$.browserPrefixToStyle=function(e,t){return t?`-${t.toLowerCase()}-${e}`:e},E$.default=void 0,E$.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";const r=window.document?.documentElement?.style;if(!r)return"";if(t in r)return"";for(let o=0;o<e.length;o++)if(n(t,e[o])in r)return e[o];return""}function n(e,t){return t?`${t}${function(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):"-"===e[r]?n=!0:t+=e[r];return t}(e)}`:e}return E$.default=t(),E$}());let n="";function r(t,r){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(n){return(0,e.isFunction)(t[n])}))),!!(0,e.isFunction)(t[n])&&t[n](r)}function o(e,t,n){let{x:r,y:o}=e,i=`translate(${r}${n},${o}${n})`;if(t){i=`translate(${`${"string"==typeof t.x?t.x:t.x+n}`}, ${`${"string"==typeof t.y?t.y:t.y+n}`})`+i}return i}function i(e){if(e)try{if(e.body&&a(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}}function s(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function a(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(`(?:^|\\s)${t}(?!\\S)`,"g"),"")}return C$}var T$,O$={};function L$(){if(T$)return O$;T$=1,Object.defineProperty(O$,"__esModule",{value:!0}),O$.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},O$.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},O$.createCoreData=function(t,r,o){const i=!(0,e.isNum)(t.lastX),s=n(t);return i?{node:s,deltaX:0,deltaY:0,lastX:r,lastY:o,x:r,y:o}:{node:s,deltaX:r-t.lastX,deltaY:o-t.lastY,lastX:t.lastX,lastY:t.lastY,x:r,y:o}},O$.createDraggableData=function(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}},O$.getBoundPosition=function(r,o,i){if(!r.props.bounds)return[o,i];let{bounds:s}=r.props;s="string"==typeof s?s:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(s);const a=n(r);if("string"==typeof s){const{ownerDocument:n}=a,r=n.defaultView;let o;if("parent"===s)o=a.parentNode;else{o=a.getRootNode().querySelector(s)}if(!(o instanceof r.HTMLElement))throw new Error('Bounds selector "'+s+'" could not find an element.');const i=o,l=r.getComputedStyle(a),c=r.getComputedStyle(i);s={left:-a.offsetLeft+(0,e.int)(c.paddingLeft)+(0,e.int)(l.marginLeft),top:-a.offsetTop+(0,e.int)(c.paddingTop)+(0,e.int)(l.marginTop),right:(0,t.innerWidth)(i)-(0,t.outerWidth)(a)-a.offsetLeft+(0,e.int)(c.paddingRight)-(0,e.int)(l.marginRight),bottom:(0,t.innerHeight)(i)-(0,t.outerHeight)(a)-a.offsetTop+(0,e.int)(c.paddingBottom)-(0,e.int)(l.marginBottom)}}(0,e.isNum)(s.right)&&(o=Math.min(o,s.right));(0,e.isNum)(s.bottom)&&(i=Math.min(i,s.bottom));(0,e.isNum)(s.left)&&(o=Math.max(o,s.left));(0,e.isNum)(s.top)&&(i=Math.max(i,s.top));return[o,i]},O$.getControlPosition=function(e,r,o){const i="number"==typeof r?(0,t.getTouch)(e,r):null;if("number"==typeof r&&!i)return null;const s=n(o),a=o.props.offsetParent||s.offsetParent||s.ownerDocument.body;return(0,t.offsetXYFromParent)(i||e,a,o.props.scale)},O$.snapToGrid=function(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]};var e=k$(),t=M$();function n(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}return O$}var A$,N$,R$,D$,P$={},I$={};function z$(){if(A$)return I$;return A$=1,Object.defineProperty(I$,"__esModule",{value:!0}),I$.default=function(){},I$}function V$(){if(N$)return P$;N$=1,Object.defineProperty(P$,"__esModule",{value:!0}),P$.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,i,s={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return s;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,s)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?o(s,t,i):s[t]=e[t]);return s}(e,t)}(ne),t=a(v$()),n=a(xe),r=M$(),o=L$(),i=k$(),s=a(z$());function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c={start:"touchstart",move:"touchmove",stop:"touchend"},d={start:"mousedown",move:"mousemove",stop:"mouseup"};let u=d,h=class extends e.Component{constructor(){super(...arguments),l(this,"dragging",!1),l(this,"lastX",NaN),l(this,"lastY",NaN),l(this,"touchIdentifier",null),l(this,"mounted",!1),l(this,"handleDragStart",(e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"!==e.type||this.props.allowMobileScroll||e.preventDefault();const i=(0,r.getTouchIdentifier)(e);this.touchIdentifier=i;const a=(0,o.getControlPosition)(e,i,this);if(null==a)return;const{x:l,y:c}=a,d=(0,o.createCoreData)(this,l,c);(0,s.default)("DraggableCore: handleDragStart: %j",d),(0,s.default)("calling",this.props.onStart);!1!==this.props.onStart(e,d)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(n),this.dragging=!0,this.lastX=l,this.lastY=c,(0,r.addEvent)(n,u.move,this.handleDrag),(0,r.addEvent)(n,u.stop,this.handleDragStop))})),l(this,"handleDrag",(e=>{const t=(0,o.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=(0,o.snapToGrid)(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}const i=(0,o.createCoreData)(this,n,r);(0,s.default)("DraggableCore: handleDrag: %j",i);if(!1!==this.props.onDrag(e,i)&&!1!==this.mounted)this.lastX=n,this.lastY=r;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(e){const t=document.createEvent("MouseEvents");t.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(t)}})),l(this,"handleDragStop",(e=>{if(!this.dragging)return;const t=(0,o.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:i}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=i-this.lastY||0;[e,t]=(0,o.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,i=this.lastY+t}const a=(0,o.createCoreData)(this,n,i);if(!1===this.props.onStop(e,a)||!1===this.mounted)return!1;const l=this.findDOMNode();l&&this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(l.ownerDocument),(0,s.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,l&&((0,s.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(l.ownerDocument,u.move,this.handleDrag),(0,r.removeEvent)(l.ownerDocument,u.stop,this.handleDragStop))})),l(this,"onMouseDown",(e=>(u=d,this.handleDragStart(e)))),l(this,"onMouseUp",(e=>(u=d,this.handleDragStop(e)))),l(this,"onTouchStart",(e=>(u=c,this.handleDragStart(e)))),l(this,"onTouchEnd",(e=>(u=c,this.handleDragStop(e))))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,r.addEvent)(e,c.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;(0,r.removeEvent)(t,d.move,this.handleDrag),(0,r.removeEvent)(t,c.move,this.handleDrag),(0,r.removeEvent)(t,d.stop,this.handleDragStop),(0,r.removeEvent)(t,c.stop,this.handleDragStop),(0,r.removeEvent)(e,c.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(t)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return P$.default=h,l(h,"displayName","DraggableCore"),l(h,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),l(h,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),P$}function H$(){return R$||(R$=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,i,s={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return s;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,s)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?o(s,t,i):s[t]=e[t]);return s}(e,t)}(ne),n=d(v$()),r=d(xe),o=function(){if(b$)return y$.exports;function e(t){var n,r,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var i=t.length;for(n=0;n<i;n++)t[n]&&(r=e(t[n]))&&(o&&(o+=" "),o+=r)}else for(r in t)t[r]&&(o&&(o+=" "),o+=r);return o}function t(){for(var t,n,r=0,o="",i=arguments.length;r<i;r++)(t=arguments[r])&&(n=e(t))&&(o&&(o+=" "),o+=n);return o}return b$=1,y$.exports=t,y$.exports.clsx=t,y$.exports}(),i=M$(),s=L$(),a=k$(),l=d(V$()),c=d(z$());function d(e){return e&&e.__esModule?e:{default:e}}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(null,arguments)}function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class p extends t.Component{static getDerivedStateFromProps(e,t){let{position:n}=e,{prevPropsPosition:r}=t;return!n||r&&n.x===r.x&&n.y===r.y?null:((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:{...n}})}constructor(e){super(e),h(this,"onDragStart",((e,t)=>{(0,c.default)("Draggable: onDragStart: %j",t);if(!1===this.props.onStart(e,(0,s.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})})),h(this,"onDrag",((e,t)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",t);const n=(0,s.createDraggableData)(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){const{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;const[o,i]=(0,s.getBoundPosition)(this,r.x,r.y);r.x=o,r.y=i,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(!1===this.props.onDrag(e,n))return!1;this.setState(r)})),h(this,"onDragStop",((e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,s.createDraggableData)(this,t)))return!1;(0,c.default)("Draggable: onDragStop: %j",t);const n={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)})),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??r.default.findDOMNode(this)}render(){const{axis:e,bounds:n,children:r,defaultPosition:a,defaultClassName:c,defaultClassNameDragging:d,defaultClassNameDragged:h,position:p,positionOffset:f,scale:m,...g}=this.props;let v={},b=null;const y=!Boolean(p)||this.state.dragging,w=p||a,C={x:(0,s.canDragX)(this)&&y?this.state.x:w.x,y:(0,s.canDragY)(this)&&y?this.state.y:w.y};this.state.isElementSVG?b=(0,i.createSVGTransform)(C,f):v=(0,i.createCSSTransform)(C,f);const x=(0,o.clsx)(r.props.className||"",c,{[d]:this.state.dragging,[h]:this.state.dragged});return t.createElement(l.default,u({},g,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(r),{className:x,style:{...r.props.style,...v},transform:b}))}}e.default=p,h(p,"displayName","Draggable"),h(p,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),h(p,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Gk)),Gk}var _$=function(){if(D$)return Zk.exports;D$=1;const{default:e,DraggableCore:t}=H$();return Zk.exports=e,Zk.exports.default=e,Zk.exports.DraggableCore=t,Zk.exports}(),B$=Ef(_$);const j$=(e="medium",t,n,r)=>{const o=t?Me(t):{xsmall:"15rem",small:"20rem",medium:"30rem",large:"40rem",xlarge:"60rem","full-width":"90%"}[e]||"15rem",i=r?Me(r):{xsmall:"35rem",small:"45rem",medium:"45rem",large:"45rem",xlarge:"45rem","full-width":"unset"}[e]||"35rem",s="unset"===i?"80vh":`min(${i}, 80vh)`;let a="auto";return n?a=Me(n):"full-width"===e&&(a="90%"),$e`
2606
+ */function p$(){return e$||(e$=1,"production"===process.env.NODE_ENV?Xk.exports=function(){if(Kk)return Yk;Kk=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function y(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:switch(e=e.type){case l:case c:case r:case i:case o:case u:return e;default:switch(e=e&&e.$$typeof){case a:case d:case f:case p:case s:return e;default:return h}}case n:return h}}}function w(e){return y(e)===c}return Yk.AsyncMode=l,Yk.ConcurrentMode=c,Yk.ContextConsumer=a,Yk.ContextProvider=s,Yk.Element=t,Yk.ForwardRef=d,Yk.Fragment=r,Yk.Lazy=f,Yk.Memo=p,Yk.Portal=n,Yk.Profiler=i,Yk.StrictMode=o,Yk.Suspense=u,Yk.isAsyncMode=function(e){return w(e)||y(e)===l},Yk.isConcurrentMode=w,Yk.isContextConsumer=function(e){return y(e)===a},Yk.isContextProvider=function(e){return y(e)===s},Yk.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Yk.isForwardRef=function(e){return y(e)===d},Yk.isFragment=function(e){return y(e)===r},Yk.isLazy=function(e){return y(e)===f},Yk.isMemo=function(e){return y(e)===p},Yk.isPortal=function(e){return y(e)===n},Yk.isProfiler=function(e){return y(e)===i},Yk.isStrictMode=function(e){return y(e)===o},Yk.isSuspense=function(e){return y(e)===u},Yk.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===o||e===u||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===p||e.$$typeof===s||e.$$typeof===a||e.$$typeof===d||e.$$typeof===g||e.$$typeof===v||e.$$typeof===b||e.$$typeof===m)},Yk.typeOf=y,Yk}():Xk.exports=(Qk||(Qk=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function y(e){if("object"==typeof e&&null!==e){var h=e.$$typeof;switch(h){case t:var m=e.type;switch(m){case l:case c:case r:case i:case o:case u:return m;default:var g=m&&m.$$typeof;switch(g){case a:case d:case f:case p:case s:return g;default:return h}}case n:return h}}}var w=l,C=c,x=a,k=s,$=t,S=d,M=r,E=f,T=p,O=n,L=i,A=o,R=u,N=!1;function D(e){return y(e)===c}h$.AsyncMode=w,h$.ConcurrentMode=C,h$.ContextConsumer=x,h$.ContextProvider=k,h$.Element=$,h$.ForwardRef=S,h$.Fragment=M,h$.Lazy=E,h$.Memo=T,h$.Portal=O,h$.Profiler=L,h$.StrictMode=A,h$.Suspense=R,h$.isAsyncMode=function(e){return N||(N=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),D(e)||y(e)===l},h$.isConcurrentMode=D,h$.isContextConsumer=function(e){return y(e)===a},h$.isContextProvider=function(e){return y(e)===s},h$.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},h$.isForwardRef=function(e){return y(e)===d},h$.isFragment=function(e){return y(e)===r},h$.isLazy=function(e){return y(e)===f},h$.isMemo=function(e){return y(e)===p},h$.isPortal=function(e){return y(e)===n},h$.isProfiler=function(e){return y(e)===i},h$.isStrictMode=function(e){return y(e)===o},h$.isSuspense=function(e){return y(e)===u},h$.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===i||e===o||e===u||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===p||e.$$typeof===s||e.$$typeof===a||e.$$typeof===d||e.$$typeof===g||e.$$typeof===v||e.$$typeof===b||e.$$typeof===m)},h$.typeOf=y}()),h$)),Xk.exports}function f$(){if(n$)return t$;n$=1;return t$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function m$(){return o$?r$:(o$=1,r$=Function.call.bind(Object.prototype.hasOwnProperty))}function g$(){if(l$)return a$;l$=1;var e=p$(),t=Se,n=f$(),r=m$(),o=function(){if(s$)return i$;s$=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=f$(),n={},r=m$();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,s,a,l){if("production"!==process.env.NODE_ENV)for(var c in o)if(r(o,c)){var d;try{if("function"!=typeof o[c]){var u=Error((a||"React class")+": "+s+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}d=o[c](i,c,a,s,null,t)}catch(e){d=e}if(!d||d instanceof Error||e((a||"React class")+": type specification of "+s+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var h=l?l():"";e("Failed "+s+" type: "+d.message+(null!=h?h:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},i$=o}(),i=function(){};function s(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),a$=function(a,l){var c="function"==typeof Symbol&&Symbol.iterator;var d="<<anonymous>>",u={array:m("array"),bigint:m("bigint"),bool:m("boolean"),func:m("function"),number:m("number"),object:m("object"),string:m("string"),symbol:m("symbol"),any:f(s),arrayOf:function(e){return f((function(t,r,o,i,s){if("function"!=typeof e)return new p("Property `"+s+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var a=t[r];if(!Array.isArray(a))return new p("Invalid "+i+" `"+s+"` of type `"+b(a)+"` supplied to `"+o+"`, expected an array.");for(var l=0;l<a.length;l++){var c=e(a,l,o,i,s+"["+l+"]",n);if(c instanceof Error)return c}return null}))},element:f((function(e,t,n,r,o){var i=e[t];return a(i)?null:new p("Invalid "+r+" `"+o+"` of type `"+b(i)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:f((function(t,n,r,o,i){var s=t[n];return e.isValidElementType(s)?null:new p("Invalid "+o+" `"+i+"` of type `"+b(s)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return f((function(t,n,r,o,i){if(!(t[n]instanceof e)){var s=e.name||d;return new p("Invalid "+o+" `"+i+"` of type `"+(((a=t[n]).constructor&&a.constructor.name?a.constructor.name:d)+"` supplied to `")+r+"`, expected instance of `"+s+"`.")}var a;return null}))},node:f((function(e,t,n,r,o){return v(e[t])?null:new p("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return f((function(t,o,i,s,a){if("function"!=typeof e)return new p("Property `"+a+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var l=t[o],c=b(l);if("object"!==c)return new p("Invalid "+s+" `"+a+"` of type `"+c+"` supplied to `"+i+"`, expected an object.");for(var d in l)if(r(l,d)){var u=e(l,d,i,s,a+"."+d,n);if(u instanceof Error)return u}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),s;return f((function(t,n,r,o,i){for(var s=t[n],a=0;a<e.length;a++)if(h(s,e[a]))return null;var l=JSON.stringify(e,(function(e,t){return"symbol"===y(t)?String(t):t}));return new p("Invalid "+o+" `"+i+"` of value `"+String(s)+"` supplied to `"+r+"`, expected one of "+l+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+w(o)+" at index "+t+"."),s}return f((function(t,o,i,s,a){for(var l=[],c=0;c<e.length;c++){var d=(0,e[c])(t,o,i,s,a,n);if(null==d)return null;d.data&&r(d.data,"expectedType")&&l.push(d.data.expectedType)}return new p("Invalid "+s+" `"+a+"` supplied to `"+i+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")}))},shape:function(e){return f((function(t,r,o,i,s){var a=t[r],l=b(a);if("object"!==l)return new p("Invalid "+i+" `"+s+"` of type `"+l+"` supplied to `"+o+"`, expected `object`.");for(var c in e){var d=e[c];if("function"!=typeof d)return g(o,i,s,c,y(d));var u=d(a,c,o,i,s+"."+c,n);if(u)return u}return null}))},exact:function(e){return f((function(o,i,s,a,l){var c=o[i],d=b(c);if("object"!==d)return new p("Invalid "+a+" `"+l+"` of type `"+d+"` supplied to `"+s+"`, expected `object`.");var u=t({},o[i],e);for(var h in u){var f=e[h];if(r(e,h)&&"function"!=typeof f)return g(s,a,l,h,y(f));if(!f)return new p("Invalid "+a+" `"+l+"` key `"+h+"` supplied to `"+s+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var m=f(c,h,s,a,l+"."+h,n);if(m)return m}return null}))}};function h(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function f(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,s,a,c,u,h,f){if(c=c||d,h=h||a,f!==n){if(l){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var g=c+":"+a;!t[g]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+h+"` prop on `"+c+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[g]=!0,r++)}}return null==s[a]?o?null===s[a]?new p("The "+u+" `"+h+"` is marked as required in `"+c+"`, but its value is `null`."):new p("The "+u+" `"+h+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(s,a,c,u,h)}var s=o.bind(null,!1);return s.isRequired=o.bind(null,!0),s}function m(e){return f((function(t,n,r,o,i,s){var a=t[n];return b(a)!==e?new p("Invalid "+o+" `"+i+"` of type `"+y(a)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function g(e,t,n,r,o){return new p((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function v(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(v);if(null===e||a(e))return!0;var t=function(e){var t=e&&(c&&e[c]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!v(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!v(o[1]))return!1}return!0;default:return!1}}function b(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function y(e){if(null==e)return""+e;var t=b(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(e){var t=y(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return p.prototype=Error.prototype,u.checkPropTypes=o,u.resetWarningCache=o.resetWarningCache,u.PropTypes=u,u},a$}function v$(){if(u$)return Jk.exports;if(u$=1,"production"!==process.env.NODE_ENV){var e=p$();Jk.exports=g$()(e.isElement,!0)}else Jk.exports=function(){if(d$)return c$;d$=1;var e=f$();function t(){}function n(){}return n.resetWarningCache=t,c$=function(){function r(t,n,r,o,i,s){if(s!==e){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},c$}()();return Jk.exports}var b$,y$={exports:{}};var w$,C$={},x$={};function k$(){if(w$)return x$;return w$=1,Object.defineProperty(x$,"__esModule",{value:!0}),x$.dontSetMe=function(e,t,n){if(e[t])return new Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)},x$.findInArray=function(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]},x$.int=function(e){return parseInt(e,10)},x$.isFunction=function(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)},x$.isNum=function(e){return"number"==typeof e&&!isNaN(e)},x$}var $$,S$,M$={};function E$(){if(S$)return C$;S$=1,Object.defineProperty(C$,"__esModule",{value:!0}),C$.addClassName=s,C$.addEvent=function(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},C$.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&s(e.body,"react-draggable-transparent-selection")},C$.createCSSTransform=function(e,n){const r=o(e,n,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:r}},C$.createSVGTransform=function(e,t){return o(e,t,"")},C$.getTouch=function(t,n){return t.targetTouches&&(0,e.findInArray)(t.targetTouches,(e=>n===e.identifier))||t.changedTouches&&(0,e.findInArray)(t.changedTouches,(e=>n===e.identifier))},C$.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},C$.getTranslation=o,C$.innerHeight=function(t){let n=t.clientHeight;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n-=(0,e.int)(r.paddingTop),n-=(0,e.int)(r.paddingBottom),n},C$.innerWidth=function(t){let n=t.clientWidth;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n-=(0,e.int)(r.paddingLeft),n-=(0,e.int)(r.paddingRight),n},C$.matchesSelector=r,C$.matchesSelectorAndParentsTo=function(e,t,n){let o=e;do{if(r(o,t))return!0;if(o===n)return!1;o=o.parentNode}while(o);return!1},C$.offsetXYFromParent=function(e,t,n){const r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-r.left)/n,i=(e.clientY+t.scrollTop-r.top)/n;return{x:o,y:i}},C$.outerHeight=function(t){let n=t.clientHeight;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n+=(0,e.int)(r.borderTopWidth),n+=(0,e.int)(r.borderBottomWidth),n},C$.outerWidth=function(t){let n=t.clientWidth;const r=t.ownerDocument.defaultView.getComputedStyle(t);return n+=(0,e.int)(r.borderLeftWidth),n+=(0,e.int)(r.borderRightWidth),n},C$.removeClassName=a,C$.removeEvent=function(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},C$.scheduleRemoveUserSelectStyles=function(e){window.requestAnimationFrame?window.requestAnimationFrame((()=>{i(e)})):i(e)};var e=k$(),t=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,i,s={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return s;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,s)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?o(s,t,i):s[t]=e[t]);return s}(e,t)}(function(){if($$)return M$;$$=1,Object.defineProperty(M$,"__esModule",{value:!0}),M$.browserPrefixToKey=n,M$.browserPrefixToStyle=function(e,t){return t?`-${t.toLowerCase()}-${e}`:e},M$.default=void 0,M$.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";const r=window.document?.documentElement?.style;if(!r)return"";if(t in r)return"";for(let o=0;o<e.length;o++)if(n(t,e[o])in r)return e[o];return""}function n(e,t){return t?`${t}${function(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):"-"===e[r]?n=!0:t+=e[r];return t}(e)}`:e}return M$.default=t(),M$}());let n="";function r(t,r){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(n){return(0,e.isFunction)(t[n])}))),!!(0,e.isFunction)(t[n])&&t[n](r)}function o(e,t,n){let{x:r,y:o}=e,i=`translate(${r}${n},${o}${n})`;if(t){i=`translate(${`${"string"==typeof t.x?t.x:t.x+n}`}, ${`${"string"==typeof t.y?t.y:t.y+n}`})`+i}return i}function i(e){if(e)try{if(e.body&&a(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}}function s(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function a(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(`(?:^|\\s)${t}(?!\\S)`,"g"),"")}return C$}var T$,O$={};function L$(){if(T$)return O$;T$=1,Object.defineProperty(O$,"__esModule",{value:!0}),O$.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},O$.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},O$.createCoreData=function(t,r,o){const i=!(0,e.isNum)(t.lastX),s=n(t);return i?{node:s,deltaX:0,deltaY:0,lastX:r,lastY:o,x:r,y:o}:{node:s,deltaX:r-t.lastX,deltaY:o-t.lastY,lastX:t.lastX,lastY:t.lastY,x:r,y:o}},O$.createDraggableData=function(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}},O$.getBoundPosition=function(r,o,i){if(!r.props.bounds)return[o,i];let{bounds:s}=r.props;s="string"==typeof s?s:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(s);const a=n(r);if("string"==typeof s){const{ownerDocument:n}=a,r=n.defaultView;let o;if("parent"===s)o=a.parentNode;else{o=a.getRootNode().querySelector(s)}if(!(o instanceof r.HTMLElement))throw new Error('Bounds selector "'+s+'" could not find an element.');const i=o,l=r.getComputedStyle(a),c=r.getComputedStyle(i);s={left:-a.offsetLeft+(0,e.int)(c.paddingLeft)+(0,e.int)(l.marginLeft),top:-a.offsetTop+(0,e.int)(c.paddingTop)+(0,e.int)(l.marginTop),right:(0,t.innerWidth)(i)-(0,t.outerWidth)(a)-a.offsetLeft+(0,e.int)(c.paddingRight)-(0,e.int)(l.marginRight),bottom:(0,t.innerHeight)(i)-(0,t.outerHeight)(a)-a.offsetTop+(0,e.int)(c.paddingBottom)-(0,e.int)(l.marginBottom)}}(0,e.isNum)(s.right)&&(o=Math.min(o,s.right));(0,e.isNum)(s.bottom)&&(i=Math.min(i,s.bottom));(0,e.isNum)(s.left)&&(o=Math.max(o,s.left));(0,e.isNum)(s.top)&&(i=Math.max(i,s.top));return[o,i]},O$.getControlPosition=function(e,r,o){const i="number"==typeof r?(0,t.getTouch)(e,r):null;if("number"==typeof r&&!i)return null;const s=n(o),a=o.props.offsetParent||s.offsetParent||s.ownerDocument.body;return(0,t.offsetXYFromParent)(i||e,a,o.props.scale)},O$.snapToGrid=function(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]};var e=k$(),t=E$();function n(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}return O$}var A$,R$,N$,D$,P$={},I$={};function z$(){if(A$)return I$;return A$=1,Object.defineProperty(I$,"__esModule",{value:!0}),I$.default=function(){},I$}function V$(){if(R$)return P$;R$=1,Object.defineProperty(P$,"__esModule",{value:!0}),P$.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,i,s={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return s;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,s)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?o(s,t,i):s[t]=e[t]);return s}(e,t)}(ne),t=a(v$()),n=a(xe),r=E$(),o=L$(),i=k$(),s=a(z$());function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const c={start:"touchstart",move:"touchmove",stop:"touchend"},d={start:"mousedown",move:"mousemove",stop:"mouseup"};let u=d,h=class extends e.Component{constructor(){super(...arguments),l(this,"dragging",!1),l(this,"lastX",NaN),l(this,"lastY",NaN),l(this,"touchIdentifier",null),l(this,"mounted",!1),l(this,"handleDragStart",(e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"!==e.type||this.props.allowMobileScroll||e.preventDefault();const i=(0,r.getTouchIdentifier)(e);this.touchIdentifier=i;const a=(0,o.getControlPosition)(e,i,this);if(null==a)return;const{x:l,y:c}=a,d=(0,o.createCoreData)(this,l,c);(0,s.default)("DraggableCore: handleDragStart: %j",d),(0,s.default)("calling",this.props.onStart);!1!==this.props.onStart(e,d)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(n),this.dragging=!0,this.lastX=l,this.lastY=c,(0,r.addEvent)(n,u.move,this.handleDrag),(0,r.addEvent)(n,u.stop,this.handleDragStop))})),l(this,"handleDrag",(e=>{const t=(0,o.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=(0,o.snapToGrid)(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}const i=(0,o.createCoreData)(this,n,r);(0,s.default)("DraggableCore: handleDrag: %j",i);if(!1!==this.props.onDrag(e,i)&&!1!==this.mounted)this.lastX=n,this.lastY=r;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(e){const t=document.createEvent("MouseEvents");t.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(t)}})),l(this,"handleDragStop",(e=>{if(!this.dragging)return;const t=(0,o.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:n,y:i}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=i-this.lastY||0;[e,t]=(0,o.snapToGrid)(this.props.grid,e,t),n=this.lastX+e,i=this.lastY+t}const a=(0,o.createCoreData)(this,n,i);if(!1===this.props.onStop(e,a)||!1===this.mounted)return!1;const l=this.findDOMNode();l&&this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(l.ownerDocument),(0,s.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,l&&((0,s.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(l.ownerDocument,u.move,this.handleDrag),(0,r.removeEvent)(l.ownerDocument,u.stop,this.handleDragStop))})),l(this,"onMouseDown",(e=>(u=d,this.handleDragStart(e)))),l(this,"onMouseUp",(e=>(u=d,this.handleDragStop(e)))),l(this,"onTouchStart",(e=>(u=c,this.handleDragStart(e)))),l(this,"onTouchEnd",(e=>(u=c,this.handleDragStop(e))))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,r.addEvent)(e,c.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;(0,r.removeEvent)(t,d.move,this.handleDrag),(0,r.removeEvent)(t,c.move,this.handleDrag),(0,r.removeEvent)(t,d.stop,this.handleDragStop),(0,r.removeEvent)(t,c.stop,this.handleDragStop),(0,r.removeEvent)(e,c.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(t)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return P$.default=h,l(h,"displayName","DraggableCore"),l(h,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),l(h,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),P$}function H$(){return N$||(N$=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,r=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var o,i,s={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return s;if(o=t?r:n){if(o.has(e))return o.get(e);o.set(e,s)}for(const t in e)"default"!==t&&{}.hasOwnProperty.call(e,t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(i.get||i.set)?o(s,t,i):s[t]=e[t]);return s}(e,t)}(ne),n=d(v$()),r=d(xe),o=function(){if(b$)return y$.exports;function e(t){var n,r,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var i=t.length;for(n=0;n<i;n++)t[n]&&(r=e(t[n]))&&(o&&(o+=" "),o+=r)}else for(r in t)t[r]&&(o&&(o+=" "),o+=r);return o}function t(){for(var t,n,r=0,o="",i=arguments.length;r<i;r++)(t=arguments[r])&&(n=e(t))&&(o&&(o+=" "),o+=n);return o}return b$=1,y$.exports=t,y$.exports.clsx=t,y$.exports}(),i=E$(),s=L$(),a=k$(),l=d(V$()),c=d(z$());function d(e){return e&&e.__esModule?e:{default:e}}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(null,arguments)}function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class p extends t.Component{static getDerivedStateFromProps(e,t){let{position:n}=e,{prevPropsPosition:r}=t;return!n||r&&n.x===r.x&&n.y===r.y?null:((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:n,prevPropsPosition:r}),{x:n.x,y:n.y,prevPropsPosition:{...n}})}constructor(e){super(e),h(this,"onDragStart",((e,t)=>{(0,c.default)("Draggable: onDragStart: %j",t);if(!1===this.props.onStart(e,(0,s.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})})),h(this,"onDrag",((e,t)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",t);const n=(0,s.createDraggableData)(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){const{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;const[o,i]=(0,s.getBoundPosition)(this,r.x,r.y);r.x=o,r.y=i,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(!1===this.props.onDrag(e,n))return!1;this.setState(r)})),h(this,"onDragStop",((e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,s.createDraggableData)(this,t)))return!1;(0,c.default)("Draggable: onDragStop: %j",t);const n={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)})),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??r.default.findDOMNode(this)}render(){const{axis:e,bounds:n,children:r,defaultPosition:a,defaultClassName:c,defaultClassNameDragging:d,defaultClassNameDragged:h,position:p,positionOffset:f,scale:m,...g}=this.props;let v={},b=null;const y=!Boolean(p)||this.state.dragging,w=p||a,C={x:(0,s.canDragX)(this)&&y?this.state.x:w.x,y:(0,s.canDragY)(this)&&y?this.state.y:w.y};this.state.isElementSVG?b=(0,i.createSVGTransform)(C,f):v=(0,i.createCSSTransform)(C,f);const x=(0,o.clsx)(r.props.className||"",c,{[d]:this.state.dragging,[h]:this.state.dragged});return t.createElement(l.default,u({},g,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(r),{className:x,style:{...r.props.style,...v},transform:b}))}}e.default=p,h(p,"displayName","Draggable"),h(p,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),h(p,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Gk)),Gk}var _$=function(){if(D$)return Zk.exports;D$=1;const{default:e,DraggableCore:t}=H$();return Zk.exports=e,Zk.exports.default=e,Zk.exports.DraggableCore=t,Zk.exports}(),B$=Mf(_$);const j$=(e="medium",t,n,r)=>{const o=t?Ee(t):{xsmall:"15rem",small:"20rem",medium:"30rem",large:"40rem",xlarge:"60rem","full-width":"90%"}[e]||"15rem",i=r?Ee(r):{xsmall:"35rem",small:"45rem",medium:"45rem",large:"45rem",xlarge:"45rem","full-width":"unset"}[e]||"35rem",s="unset"===i?"80vh":`min(${i}, 80vh)`;let a="auto";return n?a=Ee(n):"full-width"===e&&(a="90%"),$e`
2607
2607
  max-width: 100%;
2608
2608
  width: ${o};
2609
2609
  height: ${a};
@@ -2626,7 +2626,7 @@ import{createSystem as e,defaultConfig as t,Button as n,Box as r,Spinner as o,Ic
2626
2626
  top: ${He(300)};
2627
2627
  `,W$=$e`
2628
2628
  padding: ${He(300)};
2629
- `,U$=({header:e,content:t,footer:n,size:r="medium",width:o,height:i,maxHeight:s,draggable:l,blocking:c,open:d,onClose:u})=>{const h=ae(null);return d?ye(z.Root,{open:d,onOpenChange:u,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!l&&!c,preventScroll:!l&&!c,closeOnEscape:!c,defaultOpen:!0,children:be(a,{children:[l?null:ye(z.Backdrop,{css:{background:"rgba(0, 0, 0, 0.64)"}}),ye(B$,{disabled:!l,nodeRef:h,children:ye(z.Positioner,{ref:h,children:be(z.Content,{"aria-label":"Modal dialog",css:j$(r,o,i,s),children:[be(z.Header,{css:F$,children:[e,c?null:ye(z.CloseTrigger,{css:q$,asChild:!0,children:ye(Sv,{})})]}),ye(z.Body,{css:W$,children:t}),n?ye(z.Footer,{padding:"0.75rem",children:n}):null]})})})]})}):null},K$=e=>$e`
2629
+ `,U$=({header:e,content:t,footer:n,size:r="medium",width:o,height:i,maxHeight:s,draggable:l,blocking:c,open:d,onClose:u,labels:h})=>{const p=qm("Modal",h),f=ae(null);return d?ye(z.Root,{open:d,onOpenChange:u,placement:"center",scrollBehavior:"inside",closeOnInteractOutside:!l&&!c,preventScroll:!l&&!c,closeOnEscape:!c,defaultOpen:!0,children:be(a,{children:[l?null:ye(z.Backdrop,{css:{background:"rgba(0, 0, 0, 0.64)"}}),ye(B$,{disabled:!l,nodeRef:f,children:ye(z.Positioner,{ref:f,children:be(z.Content,{"aria-label":p.dialogAriaLabel,css:j$(r,o,i,s),children:[be(z.Header,{css:F$,children:[e,c?null:ye(z.CloseTrigger,{css:q$,asChild:!0,children:ye(Sv,{})})]}),ye(z.Body,{css:W$,children:t}),n?ye(z.Footer,{padding:"0.75rem",children:n}):null]})})})]})}):null},K$=e=>$e`
2630
2630
  height: 100%;
2631
2631
  width: ${e||"20rem"};
2632
2632
  background-color: ${ze("neutral",100)};
@@ -2677,16 +2677,16 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2677
2677
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2678
2678
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2679
2679
  PERFORMANCE OF THIS SOFTWARE.
2680
- ***************************************************************************** */var iS,sS,aS=function(){return aS=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},aS.apply(this,arguments)};function lS(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function cS(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function dS(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function uS(e,t,n){if(2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"}(iS||(iS={})),function(e){e.Parent="#_parent",e.Internal="#_internal"}(sS||(sS={}));var hS=iS.Start,pS=iS.Stop,fS=iS.Raise,mS=iS.Send,gS=iS.Cancel,vS=iS.NullEvent,bS=iS.Assign;iS.After,iS.DoneState;var yS=iS.Log,wS=iS.Init,CS=iS.Invoke;iS.ErrorExecution;var xS,kS=iS.ErrorPlatform,$S=iS.ErrorCustom,SS=iS.Update,ES=iS.Choose,MS=iS.Pure,TS={},OS="xstate.guard",LS="production"===process.env.NODE_ENV;function AS(e,t,n){void 0===n&&(n=".");var r=DS(e,n),o=DS(t,n);return JS(o)?!!JS(r)&&o===r:JS(r)?r in o:Object.keys(r).every((function(e){return e in o&&AS(r[e],o[e])}))}function NS(e){try{return JS(e)||"number"==typeof e?"".concat(e):e.type}catch(e){throw new Error("Events must be strings or objects with a string event.type property.")}}function RS(e,t){try{return ZS(e)?e:e.toString().split(t)}catch(t){throw new Error("'".concat(e,"' is not a valid state path."))}}function DS(e,t){return"object"==typeof(n=e)&&"value"in n&&"context"in n&&"event"in n&&"_event"in n?e.value:ZS(e)?PS(e):"string"!=typeof e?e:PS(RS(e,t));var n}function PS(e){if(1===e.length)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function IS(e,t){for(var n={},r=Object.keys(e),o=0;o<r.length;o++){var i=r[o];n[i]=t(e[i],i,e,o)}return n}function zS(e,t,n){var r,o,i={};try{for(var s=cS(Object.keys(e)),a=s.next();!a.done;a=s.next()){var l=a.value,c=e[l];n(c)&&(i[l]=t(c,l,e))}}catch(e){r={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return i}var VS=function(e){return function(t){var n,r,o=t;try{for(var i=cS(e),s=i.next();!s.done;s=i.next()){o=o[s.value]}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o}};function HS(e){return e?JS(e)?[[e]]:_S(Object.keys(e).map((function(t){var n=e[t];return"string"==typeof n||n&&Object.keys(n).length?HS(e[t]).map((function(e){return[t].concat(e)})):[[t]]}))):[[]]}function _S(e){var t;return(t=[]).concat.apply(t,uS([],dS(e),!1))}function BS(e){return ZS(e)?e:[e]}function jS(e){return void 0===e?[]:BS(e)}function FS(e,t,n){var r,o;if(GS(e))return e(t,n.data);var i={};try{for(var s=cS(Object.keys(e)),a=s.next();!a.done;a=s.next()){var l=a.value,c=e[l];GS(c)?i[l]=c(t,n.data):i[l]=c}}catch(e){r={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return i}function qS(e){return e instanceof Promise||!(null===e||!GS(e)&&"object"!=typeof e||!GS(e.then))}function WS(e,t){return IS(e.states,(function(e,n){if(e){var r=(JS(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:WS(e,r)}}}))}function US(e,t,n,r){LS||KS(!!e,"Attempting to update undefined context");var o=e?n.reduce((function(e,n){var o,i,s=n.assignment,a={state:r,action:n,_event:t},l={};if(GS(s))l=s(e,t.data,a);else try{for(var c=cS(Object.keys(s)),d=c.next();!d.done;d=c.next()){var u=d.value,h=s[u];l[u]=GS(h)?h(e,t.data,a):h}}catch(e){o={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}return Object.assign({},e,l)}),e):e;return o}var KS=function(){};function ZS(e){return Array.isArray(e)}function GS(e){return"function"==typeof e}function JS(e){return"string"==typeof e}function XS(e,t){if(e)return JS(e)?{type:OS,name:e,predicate:t?t[e]:void 0}:GS(e)?{type:OS,name:e.name,predicate:e}:e}LS||(KS=function(e,t){var n=e instanceof Error?e:void 0;if((n||!e)&&void 0!==console){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});var YS=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function QS(e){return!!e&&"__xstatenode"in e}function eE(e,t){return JS(e)||"number"==typeof e?aS({type:e},t):e}function tE(e,t){if(!JS(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=eE(e);return aS({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function nE(e,t){return BS(t).map((function(t){return void 0===t||"string"==typeof t||QS(t)?{target:t,event:e}:aS(aS({},t),{event:e})}))}function rE(e,t,n,r,o){var i=e.options.guards,s={state:o,cond:t,_event:r};if(t.type===OS)return((null==i?void 0:i[t.name])||t.predicate)(n,r.data,s);var a=null==i?void 0:i[t.type];if(!a)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return a(n,r.data,s)}function oE(e){return"string"==typeof e?{type:e}:e}function iE(e,t,n){var r=function(){},o="object"==typeof e,i=o?e:null;return{next:((o?e.next:e)||r).bind(i),error:((o?e.error:t)||r).bind(i),complete:((o?e.complete:n)||r).bind(i)}}function sE(e,t){return"".concat(e,":invocation[").concat(t,"]")}function aE(e){return(e.type===fS||e.type===mS&&e.to===sS.Internal)&&"number"!=typeof e.delay}(xS={})[YS]=function(){return this},xS[Symbol.observable]=function(){return this};var lE=tE({type:wS});function cE(e,t){return t&&t[e]||void 0}function dE(e,t){var n;if(JS(e)||"number"==typeof e)n=GS(r=cE(e,t))?{type:e,exec:r}:r||{type:e,exec:void 0};else if(GS(e))n={type:e.name||e.toString(),exec:e};else{var r;if(GS(r=cE(e.type,t)))n=aS(aS({},e),{exec:r});else if(r){var o=r.type||e.type;n=aS(aS(aS({},r),e),{type:o})}else n=e}return n}var uE=function(e,t){return e?(ZS(e)?e:[e]).map((function(e){return dE(e,t)})):[]};function hE(e){var t=dE(e);return aS(aS({id:JS(e)?e:t.id},t),{type:t.type})}function pE(e,t){var n="".concat(iS.DoneState,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function fE(e,t){var n="".concat(iS.DoneInvoke,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function mE(e,t){var n="".concat(iS.ErrorPlatform,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function gE(e,t,n,r,o,i,s){void 0===s&&(s=!1);var a=s?[]:function(e){var t,n,r=[];try{for(var o=cS(e),i=o.next();!i.done;i=o.next())for(var s=i.value,a=0;a<s.actions.length;)s.actions[a].type!==bS?a++:(r.push(s.actions[a]),s.actions.splice(a,1))}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}(o),l=a.length?US(n,r,a,t):n,c=s?[n]:void 0,d=[];function u(o,a){var u;switch(a.type){case fS:var h=function(e,t,n,r){var o,i={_event:n},s=tE(GS(e.event)?e.event(t,n.data,i):e.event);if(JS(e.delay)){var a=r&&r[e.delay];o=GS(a)?a(t,n.data,i):a}else o=GS(e.delay)?e.delay(t,n.data,i):e.delay;return aS(aS({},e),{type:fS,_event:s,delay:o})}(a,l,r,e.options.delays);return i&&"number"==typeof h.delay&&i(h,l,r),h;case mS:var p=function(e,t,n,r){var o,i={_event:n},s=tE(GS(e.event)?e.event(t,n.data,i):e.event);if(JS(e.delay)){var a=r&&r[e.delay];o=GS(a)?a(t,n.data,i):a}else o=GS(e.delay)?e.delay(t,n.data,i):e.delay;var l=GS(e.to)?e.to(t,n.data,i):e.to;return aS(aS({},e),{to:l,_event:s,event:s.data,delay:o})}(a,l,r,e.options.delays);if(!LS){var f=a.delay;KS(!JS(f)||"number"==typeof p.delay,"No delay reference for delay expression '".concat(f,"' was found on machine '").concat(e.id,"'"))}return i&&p.to!==sS.Internal&&("entry"===o?d.push(p):i(p,l,r)),p;case yS:var m=function(e,t,n){return aS(aS({},e),{value:JS(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})}(a,l,r);return null==i||i(m,l,r),m;case ES:if(!(y=null===(u=a.conds.find((function(n){var o=XS(n.cond,e.options.guards);return!o||rE(e,o,l,r,i?void 0:t)})))||void 0===u?void 0:u.actions))return[];var g=dS(gE(e,t,l,r,[{type:o,actions:uE(jS(y),e.options.actions)}],i,s),2),v=g[0],b=g[1];return l=b,null==c||c.push(l),v;case MS:var y;if(!(y=a.get(l,r.data)))return[];var w=dS(gE(e,t,l,r,[{type:o,actions:uE(jS(y),e.options.actions)}],i,s),2),C=w[0],x=w[1];return l=x,null==c||c.push(l),C;case pS:m=function(e,t,n){var r=GS(e.activity)?e.activity(t,n.data):e.activity,o="string"==typeof r?{id:r}:r;return{type:iS.Stop,activity:o}}(a,l,r);return null==i||i(m,n,r),m;case bS:l=US(l,r,[a],i?void 0:t),null==c||c.push(l);break;default:var k=dE(a,e.options.actions),$=k.exec;if(i)i(k,l,r);else if($&&c){var S=c.length-1,E=aS(aS({},k),{exec:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];$.apply(void 0,uS([c[S]],dS(t),!1))}});k=E}return k}}var h=_S(o.map((function(e){var t,n,o=[];try{for(var s=cS(e.actions),a=s.next();!a.done;a=s.next()){var c=a.value,h=u(e.type,c);h&&(o=o.concat(h))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return d.forEach((function(e){i(e,l,r)})),d.length=0,o})));return[h,l]}var vE=function(e,t){return t(e)};function bE(e){var t;return(t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}})[YS]=function(){return this},t}function yE(e,t,n){var r=bE(t);if(r.deferred=!0,QS(e)){var o=r.state=vE(void 0,(function(){return(n?e.withContext(n):e).initialState}));r.getSnapshot=function(){return o}}return r}var wE=function(e){return"atomic"===e.type||"final"===e.type};function CE(e){return Object.keys(e.states).map((function(t){return e.states[t]}))}function xE(e){return CE(e).filter((function(e){return"history"!==e.type}))}function kE(e){var t=[e];return wE(e)?t:t.concat(_S(xE(e).map(kE)))}function $E(e,t){var n,r,o,i,s,a,l,c,d=EE(new Set(e)),u=new Set(t);try{for(var h=cS(u),p=h.next();!p.done;p=h.next())for(var f=(k=p.value).parent;f&&!u.has(f);)u.add(f),f=f.parent}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var m=EE(u);try{for(var g=cS(u),v=g.next();!v.done;v=g.next()){if("compound"!==(k=v.value).type||m.get(k)&&m.get(k).length){if("parallel"===k.type)try{for(var b=(s=void 0,cS(xE(k))),y=b.next();!y.done;y=b.next()){var w=y.value;u.has(w)||(u.add(w),d.get(w)?d.get(w).forEach((function(e){return u.add(e)})):w.initialStateNodes.forEach((function(e){return u.add(e)})))}}catch(e){s={error:e}}finally{try{y&&!y.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}}else d.get(k)?d.get(k).forEach((function(e){return u.add(e)})):k.initialStateNodes.forEach((function(e){return u.add(e)}))}}catch(e){o={error:e}}finally{try{v&&!v.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}try{for(var C=cS(u),x=C.next();!x.done;x=C.next()){var k;for(f=(k=x.value).parent;f&&!u.has(f);)u.add(f),f=f.parent}}catch(e){l={error:e}}finally{try{x&&!x.done&&(c=C.return)&&c.call(C)}finally{if(l)throw l.error}}return u}function SE(e,t){var n=t.get(e);if(!n)return{};if("compound"===e.type){var r=n[0];if(!r)return{};if(wE(r))return r.key}var o={};return n.forEach((function(e){o[e.key]=SE(e,t)})),o}function EE(e){var t,n,r=new Map;try{for(var o=cS(e),i=o.next();!i.done;i=o.next()){var s=i.value;r.has(s)||r.set(s,[]),s.parent&&(r.has(s.parent)||r.set(s.parent,[]),r.get(s.parent).push(s))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}function ME(e,t){return SE(e,EE($E([e],t)))}function TE(e,t){return Array.isArray(e)?e.some((function(e){return e===t})):e instanceof Set&&e.has(t)}function OE(e,t){return"compound"===t.type?xE(t).some((function(t){return"final"===t.type&&TE(e,t)})):"parallel"===t.type&&xE(t).every((function(t){return OE(e,t)}))}function LE(e){return new Set(_S(e.map((function(e){return e.tags}))))}function AE(e,t){if(e===t)return!0;if(void 0===e||void 0===t)return!1;if(JS(e)||JS(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((function(n){return AE(e[n],t[n])}))}var NE=function(){function e(e){var t,n,r=this;this.actions=[],this.activities=TS,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||TS,this.meta=(void 0===(n=e.configuration)&&(n=[]),n.reduce((function(e,t){return void 0!==t.meta&&(e[t.id]=t.meta),e}),{})),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=null!==(t=Array.isArray(e.tags)?new Set(e.tags):e.tags)&&void 0!==t?t:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return function(e){return uS([],dS(new Set(_S(uS([],dS(e.map((function(e){return e.ownEvents}))),!1)))),!1)}(r.configuration)}})}return e.from=function(t,n){return t instanceof e?t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,events:[],configuration:[],transitions:[],children:{}}):t:new e({value:t,context:n,_event:lE,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=lE;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(e,t){var n=this;if(void 0===e&&(e=this.value),void 0===t&&(t="."),JS(e))return[e];var r=Object.keys(e);return r.concat.apply(r,uS([],dS(r.map((function(r){return n.toStrings(e[r],t).map((function(e){return r+t+e}))}))),!1))},e.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var t=e.tags;e.machine;var n=lS(e,["configuration","transitions","tags","machine"]);return aS(aS({},n),{tags:Array.from(t)})},e.prototype.matches=function(e){return AS(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){var t;LS&&KS(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var n=null===(t=this.machine)||void 0===t?void 0:t.getTransitionData(this,e);return!!(null==n?void 0:n.transitions.length)&&n.transitions.some((function(e){return void 0!==e.target||e.actions.length}))},e}(),RE={deferEvents:!1},DE=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=aS(aS({},RE),e)}return e.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents)return void this.schedule(e);this.process(e)}this.flushEvents()},e.prototype.schedule=function(e){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()}else this.queue.push(e)},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},e.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(e){throw this.clear(),e}finally{this.processingEvent=!1}},e}(),PE=new Map,IE=0,zE=function(){return"x:".concat(IE++)},VE=function(e,t){return PE.set(e,t),e},HE=function(e){return PE.get(e)},_E=function(e){PE.delete(e)};function BE(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void(LS||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}function jE(e){if(BE()){var t=function(){var e=BE();if(e&&"__xstate__"in e)return e.__xstate__}();t&&t.register(e)}}function FE(e,t){void 0===t&&(t={});var n=e.initialState,r=new Set,o=[],i=!1,s=function(e){var t;return aS(((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[YS]=function(){return this},t),e)}({id:t.id,send:function(t){o.push(t),function(){if(!i){for(i=!0;o.length>0;){var t=o.shift();n=e.transition(n,t,a),r.forEach((function(e){return e.next(n)}))}i=!1}}()},getSnapshot:function(){return n},subscribe:function(e,t,o){var i=iE(e,t,o);return r.add(i),i.next(n),{unsubscribe:function(){r.delete(i)}}}}),a={parent:t.parent,self:s,id:t.id||"anonymous",observers:r};return n=e.start?e.start(a):n,s}var qE,WE={sync:!1,autoForward:!1};!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(qE||(qE={}));var UE=function(){function e(t,n){void 0===n&&(n=e.defaultOptions);var r=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=qE.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(e,t){if(ZS(e))return r.batch(e),r.state;var n=tE(eE(e,t));if(r.status===qE.Stopped)return LS||KS(!1,'Event "'.concat(n.name,'" was sent to stopped service "').concat(r.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(n.data))),r.state;if(r.status!==qE.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(r.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(n.data)));return r.scheduler.schedule((function(){r.forward(n);var e=r._nextState(n);r.update(e,n)})),r._state},this.sendTo=function(e,t,n){var o,i=r.parent&&(t===sS.Parent||r.parent.id===t),s=i?r.parent:JS(t)?t===sS.Internal?r:r.children.get(t)||HE(t):(o=t)&&"function"==typeof o.send?t:void 0;if(s)if("machine"in s){if(r.status!==qE.Stopped||r.parent!==s||r.state.done){var a=aS(aS({},e),{name:e.name===$S?"".concat(mE(r.id)):e.name,origin:r.sessionId});!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([s,a]):s.send(a)}}else!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([s,e.data]):s.send(e.data);else{if(!i)throw new Error("Unable to send event to child '".concat(t,"' from service '").concat(r.id,"'."));LS||KS(!1,"Service '".concat(r.id,"' has no parent: unable to send event ").concat(e.type))}},this._exec=function(e,t,n,o){void 0===o&&(o=r.machine.options.actions);var i=e.exec||cE(e.type,o),s=GS(i)?i:i?i.exec:e.exec;if(s)try{return s(t,n.data,r.machine.config.predictableActionArguments?{action:e,_event:n}:{action:e,state:r.state,_event:n})}catch(e){throw r.parent&&r.parent.send({type:"xstate.error",data:e}),e}switch(e.type){case fS:var a=e;r.defer(a);break;case mS:var l=e;if("number"==typeof l.delay)return void r.defer(l);l.to?r.sendTo(l._event,l.to,n===lE):r.send(l._event);break;case gS:r.cancel(e.sendId);break;case hS:if(r.status!==qE.Running)return;var c=e.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[c.id||c.type])break;if(c.type===iS.Invoke){var d=oE(c.src),u=r.machine.options.services?r.machine.options.services[d.type]:void 0,h=c.id,p=c.data;LS||KS(!("forward"in c),"`forward` property is deprecated (found in invocation of '".concat(c.src,"' in in machine '").concat(r.machine.id,"'). ")+"Please use `autoForward` instead.");var f="autoForward"in c?c.autoForward:!!c.forward;if(!u)return void(LS||KS(!1,"No service found for invocation '".concat(c.src,"' in machine '").concat(r.machine.id,"'.")));var m=p?FS(p,t,n):void 0;if("string"==typeof u)return;var g=GS(u)?u(t,n.data,{data:m,src:d,meta:c.meta}):u;if(!g)return;var v=void 0;QS(g)&&(g=m?g.withContext(m):g,v={autoForward:f}),r.spawn(g,h,v)}else r.spawnActivity(c);break;case pS:r.stopChild(e.activity.id);break;case yS:var b=e,y=b.label,w=b.value;y?r.logger(y,w):r.logger(w);break;default:LS||KS(!1,"No implementation found for action type '".concat(e.type,"'"))}};var o=aS(aS({},e.defaultOptions),n),i=o.clock,s=o.logger,a=o.parent,l=o.id,c=void 0!==l?l:t.id;this.id=c,this.logger=s,this.clock=i,this.parent=a,this.options=o,this.scheduler=new DE({deferEvents:this.options.deferEvents}),this.sessionId=zE()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:vE(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return LS||KS(this.status!==qE.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,r;try{for(var o=cS(e.actions),i=o.next();!i.done;i=o.next()){var s=i.value;this.exec(s,e,t)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,r,o,i,s,a,l,c,d=this;if(e._sessionid=this.sessionId,this._state=e,this.machine.config.predictableActionArguments&&t!==lE||!this.options.execute)for(var u=void 0;u=this._outgoingQueue.shift();)u[0].send(u[1]);else this.execute(this.state);if(this.children.forEach((function(e){d.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var h=cS(this.eventListeners),p=h.next();!p.done;p=h.next()){(0,p.value)(e.event)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}try{for(var f=cS(this.listeners),m=f.next();!m.done;m=f.next()){(0,m.value)(e,e.event)}}catch(e){o={error:e}}finally{try{m&&!m.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}try{for(var g=cS(this.contextListeners),v=g.next();!v.done;v=g.next()){(0,v.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(e){s={error:e}}finally{try{v&&!v.done&&(a=g.return)&&a.call(g)}finally{if(s)throw s.error}}if(this.state.done){var b=e.configuration.find((function(e){return"final"===e.type&&e.parent===d.machine})),y=b&&b.doneData?FS(b.doneData,e.context,t):void 0;this._doneEvent=fE(this.id,y);try{for(var w=cS(this.doneListeners),C=w.next();!C.done;C=w.next()){(0,C.value)(this._doneEvent)}}catch(e){l={error:e}}finally{try{C&&!C.done&&(c=w.return)&&c.call(w)}finally{if(l)throw l.error}}this._stop(),this._stopChildren(),_E(this.sessionId)}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===qE.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,n){var r=this,o=iE(e,t,n);this.listeners.add(o.next),this.status!==qE.NotStarted&&o.next(this.state);var i=function(){r.doneListeners.delete(i),r.stopListeners.delete(i),o.complete()};return this.status===qE.Stopped?o.complete():(this.onDone(i),this.onStop(i)),{unsubscribe:function(){r.listeners.delete(o.next),r.doneListeners.delete(i),r.stopListeners.delete(i)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.status===qE.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var t=this;if(this.status===qE.Running)return this;this.machine._init(),VE(this.sessionId,this),this.initialized=!0,this.status=qE.Running;var n=void 0===e?this.initialState:vE(this,(function(){return"object"==typeof(n=e)&&null!==n&&"value"in n&&"_event"in n?t.machine.resolveState(e):t.machine.resolveState(NE.from(e,t.machine.context));var n}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){t.update(n,lE)})),this},e.prototype._stopChildren=function(){this.children.forEach((function(e){GS(e.stop)&&e.stop()})),this.children.clear()},e.prototype._stop=function(){var e,t,n,r,o,i,s,a,l,c;try{for(var d=cS(this.listeners),u=d.next();!u.done;u=d.next()){var h=u.value;this.listeners.delete(h)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}try{for(var p=cS(this.stopListeners),f=p.next();!f.done;f=p.next()){(h=f.value)(),this.stopListeners.delete(h)}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}try{for(var m=cS(this.contextListeners),g=m.next();!g.done;g=m.next()){h=g.value;this.contextListeners.delete(h)}}catch(e){o={error:e}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(o)throw o.error}}try{for(var v=cS(this.doneListeners),b=v.next();!b.done;b=v.next()){h=b.value;this.doneListeners.delete(h)}}catch(e){s={error:e}}finally{try{b&&!b.done&&(a=v.return)&&a.call(v)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=qE.Stopped,this._initialState=void 0;try{for(var y=cS(Object.keys(this.delayedEventsMap)),w=y.next();!w.done;w=y.next()){var C=w.value;this.clock.clearTimeout(this.delayedEventsMap[C])}}catch(e){l={error:e}}finally{try{w&&!w.done&&(c=y.return)&&c.call(y)}finally{if(l)throw l.error}}this.scheduler.clear(),this.scheduler=new DE({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var e=this,t=this.scheduler;return this._stop(),t.schedule((function(){var t;if(!(null===(t=e._state)||void 0===t?void 0:t.done)){var n=tE({type:"xstate.stop"}),r=vE(e,(function(){var t=_S(uS([],dS(e.state.configuration),!1).sort((function(e,t){return t.order-e.order})).map((function(t){return uE(t.onExit,e.machine.options.actions)}))),r=dS(gE(e.machine,e.state,e.state.context,n,[{type:"exit",actions:t}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),o=r[0],i=r[1],s=new NE({value:e.state.value,context:i,_event:n,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:o.filter((function(e){return!aE(e)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return s.changed=!0,s}));e.update(r,n),e._stopChildren(),_E(e.sessionId)}})),this},e.prototype.batch=function(e){var t=this;if(this.status===qE.NotStarted&&this.options.deferEvents)LS||KS(!1,"".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==qE.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(e.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var r,o,i=t.state,s=!1,a=[],l=function(e){var r=tE(e);t.forward(r),i=vE(t,(function(){return t.machine.transition(i,r,void 0,n||void 0)})),a.push.apply(a,uS([],dS(t.machine.config.predictableActionArguments?i.actions:i.actions.map((function(e){return function(e,t){var n=e.exec;return aS(aS({},e),{exec:void 0!==n?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0})}(e,i)}))),!1)),s=s||!!i.changed};try{for(var c=cS(e),d=c.next();!d.done;d=c.next()){l(d.value)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}i.changed=s,i.actions=a,t.update(i,tE(e[e.length-1]))}))}},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype._nextState=function(e,t){var n=this;void 0===t&&(t=!!this.machine.config.predictableActionArguments&&this._exec);var r=tE(e);if(0===r.name.indexOf(kS)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(kS)})))throw r.data.data;return vE(this,(function(){return n.machine.transition(n.state,r,void 0,t||void 0)}))},e.prototype.nextState=function(e){return this._nextState(e,!1)},e.prototype.forward=function(e){var t,n;try{for(var r=cS(this.forwardTo),o=r.next();!o.done;o=r.next()){var i=o.value,s=this.children.get(i);if(!s)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(i,"'."));s.send(e)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this,n=this.clock.setTimeout((function(){"to"in e&&e.to?t.sendTo(e._event,e.to,!0):t.send(e._event)}),e.delay);e.id&&(this.delayedEventsMap[e.id]=n)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,n){void 0===n&&(n=this.machine.options.actions),this._exec(e,t.context,t._event,n)},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),null===(t=this.state)||void 0===t||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);t&&(this.removeChild(e),GS(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,n){if(this.status!==qE.Running)return yE(e,t);if(qS(e))return this.spawnPromise(Promise.resolve(e),t);if(GS(e))return this.spawnCallback(e,t);if(function(e){try{return"function"==typeof e.send}catch(e){return!1}}(o=e)&&"id"in o)return this.spawnActor(e,t);if(function(e){try{return"subscribe"in e&&GS(e.subscribe)}catch(e){return!1}}(e))return this.spawnObservable(e,t);if(QS(e))return this.spawnMachine(e,aS(aS({},n),{id:t}));if(null!==(r=e)&&"object"==typeof r&&"transition"in r&&"function"==typeof r.transition)return this.spawnBehavior(e,t);throw new Error('Unable to spawn entity "'.concat(t,'" of type "').concat(typeof e,'".'));var r,o},e.prototype.spawnMachine=function(t,n){var r=this;void 0===n&&(n={});var o=new e(t,aS(aS({},this.options),{parent:this,id:n.id||t.id})),i=aS(aS({},WE),n);i.sync&&o.onTransition((function(e){r.send(SS,{state:e,id:o.id})}));var s=o;return this.children.set(o.id,s),i.autoForward&&this.forwardTo.add(o.id),o.onDone((function(e){r.removeChild(o.id),r.send(tE(e,{origin:o.id}))})).start(),s},e.prototype.spawnBehavior=function(e,t){var n=FE(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r,o=this,i=!1;e.then((function(e){i||(r=e,o.removeChild(t),o.send(tE(fE(t,e),{origin:t})))}),(function(e){if(!i){o.removeChild(t);var n=mE(t,e);try{o.send(tE(n,{origin:t}))}catch(r){!function(e,t,n){if(!LS){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var o=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(o))}}}(e,r,t),o.devTools&&o.devTools.send(n,o.state),o.machine.strict&&o.stop()}}}));var s=((n={id:t,send:function(){},subscribe:function(t,n,r){var o=iE(t,n,r),i=!1;return e.then((function(e){i||(o.next(e),i||o.complete())}),(function(e){i||o.error(e)})),{unsubscribe:function(){return i=!0}}},stop:function(){i=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[YS]=function(){return this},n);return this.children.set(t,s),s},e.prototype.spawnCallback=function(e,t){var n,r,o,i=this,s=!1,a=new Set,l=new Set;try{o=e((function(e){r=e,l.forEach((function(t){return t(e)})),s||i.send(tE(e,{origin:t}))}),(function(e){a.add(e)}))}catch(e){this.send(mE(t,e))}if(qS(o))return this.spawnPromise(o,t);var c=((n={id:t,send:function(e){return a.forEach((function(t){return t(e)}))},subscribe:function(e){var t=iE(e);return l.add(t.next),{unsubscribe:function(){l.delete(t.next)}}},stop:function(){s=!0,GS(o)&&o()},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[YS]=function(){return this},n);return this.children.set(t,c),c},e.prototype.spawnObservable=function(e,t){var n,r,o=this,i=e.subscribe((function(e){r=e,o.send(tE(e,{origin:t}))}),(function(e){o.removeChild(t),o.send(tE(mE(t,e),{origin:t}))}),(function(){o.removeChild(t),o.send(tE(fE(t),{origin:t}))})),s=((n={id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return i.unsubscribe()},getSnapshot:function(){return r},toJSON:function(){return{id:t}}})[YS]=function(){return this},n);return this.children.set(t,s),s},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var n=t(this.state.context,e);this.spawnEffect(e.id,n)}else LS||KS(!1,"No implementation found for activity '".concat(e.type,"'"))},e.prototype.spawnEffect=function(e,t){var n;this.children.set(e,((n={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}})[YS]=function(){return this},n))},e.prototype.attachDev=function(){var e=BE();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(aS(aS({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:aS({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}jE(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[YS]=function(){return this},e.prototype.getSnapshot=function(){return this.status===qE.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},e.interpret=KE,e}();function KE(e,t){return new UE(e,t)}function ZE(e){if("string"==typeof e){var t={type:e,toString:function(){return e}};return t}return e}function GE(e){return aS(aS({type:CS},e),{toJSON:function(){e.onDone,e.onError;var t=lS(e,["onDone","onError"]);return aS(aS({},t),{type:CS,src:ZE(e.src)})}})}var JE="",XE="*",YE={},QE=function(e){return"#"===e[0]},eM=function(){function e(t,n,r,o){void 0===r&&(r="context"in t?t.context:void 0);var i,s=this;this.config=t,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},n),this.parent=null==o?void 0:o.parent,this.key=this.config.key||(null==o?void 0:o.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:"."),this.id=this.config.id||uS([this.machine.key],dS(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(i=this.config.schema)&&void 0!==i?i:{},this.description=this.config.description,LS||KS(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?IS(this.config.states,(function(t,n){var r,o=new e(t,{},void 0,{parent:s,key:n});return Object.assign(s.idMap,aS(((r={})[o.id]=o,r),o.idMap)),o})):YE;var a=0;!function e(t){var n,r;t.order=a++;try{for(var o=cS(CE(t)),i=o.next();!i.done;i=o.next()){e(i.value)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(e){return e.event===JE})):JE in this.config.on),this.strict=!!this.config.strict,this.onEntry=jS(this.config.entry||this.config.onEntry).map((function(e){return dE(e)})),this.onExit=jS(this.config.exit||this.config.onExit).map((function(e){return dE(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=jS(this.config.invoke).map((function(e,t){var n,r;if(QS(e)){var o=sE(s.id,t);return s.machine.options.services=aS(((n={})[o]=e,n),s.machine.options.services),GE({src:o,id:o})}if(JS(e.src)){o=e.id||sE(s.id,t);return GE(aS(aS({},e),{id:o,src:e.src}))}if(QS(e.src)||GS(e.src)){o=e.id||sE(s.id,t);return s.machine.options.services=aS(((r={})[o]=e.src,r),s.machine.options.services),GE(aS(aS({id:o},e),{src:o}))}var i=e.src;return GE(aS(aS({id:sE(s.id,t)},e),{src:i}))})),this.activities=jS(this.config.activities).concat(this.invoke).map((function(e){return hE(e)})),this.transition=this.transition.bind(this),this.tags=jS(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||kE(this).forEach((function(e){return e.on}))},e.prototype.withConfig=function(t,n){var r=this.options,o=r.actions,i=r.activities,s=r.guards,a=r.services,l=r.delays;return new e(this.config,{actions:aS(aS({},o),t.actions),activities:aS(aS({},i),t.activities),guards:aS(aS({},s),t.guards),services:aS(aS({},a),t.services),delays:aS(aS({},l),t.delays)},null!=n?n:this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return GS(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:IS(this.states,(function(e){return e.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce((function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===JE,n=this.transitions.filter((function(n){var r=n.eventType===e;return t?r:r||n.eventType===XE}));return this.__cache.candidates[e]=n,n},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var n=function(t,n){var r=function(e,t){var n=t?"#".concat(t):"";return"".concat(iS.After,"(").concat(e,")").concat(n)}(GS(t)?"".concat(e.id,":delay[").concat(n,"]"):t,e.id);return e.onEntry.push(function(e,t){return{to:t?t.to:void 0,type:mS,event:GS(e)?e:eE(e),delay:t?t.delay:void 0,id:t&&void 0!==t.id?t.id:GS(e)?e.name:NS(e)}}(r,{delay:t})),e.onExit.push({type:gS,sendId:r}),r},r=ZS(t)?t.map((function(e,t){var r=n(e.delay,t);return aS(aS({},e),{event:r})})):_S(Object.keys(t).map((function(e,r){var o=t[e],i=JS(o)?{target:o}:o,s=isNaN(+e)?e:+e,a=n(s,r);return jS(i).map((function(e){return aS(aS({},e),{event:a,delay:s})}))})));return r.map((function(t){var n=t.delay;return aS(aS({},e.formatTransition(t)),{delay:n})}))},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var r=e instanceof NE?e.value:DS(e,this.delimiter);if(JS(r)){var o=this.getStateNode(r).initial;return void 0!==o?this.getStateNodes(((t={})[r]=o,t)):[this,this.states[r]]}var i=Object.keys(r),s=[this];return s.push.apply(s,uS([],dS(_S(i.map((function(e){return n.getStateNode(e).getStateNodes(r[e])})))),!1)),s},e.prototype.handles=function(e){var t=NS(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=e instanceof NE?e:NE.create(e),n=Array.from($E([],this.getStateNodes(t.value)));return new NE(aS(aS({},t),{value:this.resolve(t.value),configuration:n,done:OE(n,this),tags:LE(n),machine:this.machine}))},e.prototype.transitionLeafNode=function(e,t,n){var r=this.getStateNode(e).next(t,n);return r&&r.transitions.length?r:this.next(t,n)},e.prototype.transitionCompoundNode=function(e,t,n){var r=Object.keys(e),o=this.getStateNode(r[0])._transition(e[r[0]],t,n);return o&&o.transitions.length?o:this.next(t,n)},e.prototype.transitionParallelNode=function(e,t,n){var r,o,i={};try{for(var s=cS(Object.keys(e)),a=s.next();!a.done;a=s.next()){var l=a.value,c=e[l];if(c){var d=this.getStateNode(l)._transition(c,t,n);d&&(i[l]=d)}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}var u=Object.keys(i).map((function(e){return i[e]})),h=_S(u.map((function(e){return e.transitions})));if(!u.some((function(e){return e.transitions.length>0})))return this.next(t,n);var p=_S(Object.keys(i).map((function(e){return i[e].configuration})));return{transitions:h,exitSet:_S(u.map((function(e){return e.exitSet}))),configuration:p,source:t,actions:_S(Object.keys(i).map((function(e){return i[e].actions})))}},e.prototype._transition=function(e,t,n){return JS(e)?this.transitionLeafNode(e,t,n):1===Object.keys(e).length?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.getTransitionData=function(e,t){return this._transition(e.value,e,tE(t))},e.prototype.next=function(e,t){var n,r,o,i=this,s=t.name,a=[],l=[];try{for(var c=cS(this.getCandidates(s)),d=c.next();!d.done;d=c.next()){var u=d.value,h=u.cond,p=u.in,f=e.context,m=!p||(JS(p)&&QE(p)?e.matches(DS(this.getStateNodeById(p).path,this.delimiter)):AS(DS(p,this.delimiter),VS(this.path.slice(0,-2))(e.value))),g=!1;try{g=!h||rE(this.machine,h,f,t,e)}catch(e){throw new Error("Unable to evaluate guard '".concat(h.name||h.type,"' in transition for event '").concat(s,"' in state node '").concat(this.id,"':\n").concat(e.message))}if(g&&m){void 0!==u.target&&(l=u.target),a.push.apply(a,uS([],dS(u.actions),!1)),o=u;break}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(o){if(!l.length)return{transitions:[o],exitSet:[],configuration:e.value?[this]:[],source:e,actions:a};var v=_S(l.map((function(t){return i.getRelativeStateNodes(t,e.historyValue)})));return{transitions:[o],exitSet:!!o.internal?[]:_S(l.map((function(e){return i.getPotentiallyReenteringNodes(e)}))),configuration:v,source:e,actions:a}}},e.prototype.getPotentiallyReenteringNodes=function(e){if(this.order<e.order)return[this];for(var t=[],n=this,r=e;n&&n!==r;)t.push(n),n=n.parent;return n!==r?[]:(t.push(r),t)},e.prototype.getActions=function(e,t,n,r,o,i,s){var a,l,c,d,u=this,h=i?$E([],this.getStateNodes(i.value)):[],p=new Set;try{for(var f=cS(Array.from(e).sort((function(e,t){return e.order-t.order}))),m=f.next();!m.done;m=f.next()){(!TE(h,b=m.value)||TE(n.exitSet,b)||b.parent&&p.has(b.parent))&&p.add(b)}}catch(e){a={error:e}}finally{try{m&&!m.done&&(l=f.return)&&l.call(f)}finally{if(a)throw a.error}}try{for(var g=cS(h),v=g.next();!v.done;v=g.next()){var b;TE(e,b=v.value)&&!TE(n.exitSet,b.parent)||n.exitSet.push(b)}}catch(e){c={error:e}}finally{try{v&&!v.done&&(d=g.return)&&d.call(g)}finally{if(c)throw c.error}}n.exitSet.sort((function(e,t){return t.order-e.order}));var y=Array.from(p).sort((function(e,t){return e.order-t.order})),w=new Set(n.exitSet),C=_S(y.map((function(e){var t=[];if("final"!==e.type)return t;var i=e.parent;if(!i.parent)return t;t.push(pE(e.id,e.doneData),pE(i.id,e.doneData?FS(e.doneData,r,o):void 0));var s=i.parent;return"parallel"===s.type&&xE(s).every((function(e){return OE(n.configuration,e)}))&&t.push(pE(s.id)),t}))),x=y.map((function(e){var t=e.onEntry,n=e.activities.map((function(e){return function(e){var t=hE(e);return{type:iS.Start,activity:t,exec:void 0}}(e)}));return{type:"entry",actions:uE(s?uS(uS([],dS(t),!1),dS(n),!1):uS(uS([],dS(n),!1),dS(t),!1),u.machine.options.actions)}})).concat({type:"state_done",actions:C.map((function(e){return function(e,t){return{type:fS,event:"function"==typeof e?e:eE(e),delay:t?t.delay:void 0,id:null==t?void 0:t.id}}(e)}))}),k=Array.from(w).map((function(e){return{type:"exit",actions:uE(uS(uS([],dS(e.onExit),!1),dS(e.activities.map((function(e){return function(e){var t=GS(e)?e:hE(e);return{type:iS.Stop,activity:t,exec:void 0}}(e)}))),!1),u.machine.options.actions)}})).concat({type:"transition",actions:uE(n.actions,this.machine.options.actions)}).concat(x);if(t){var $=uE(_S(uS([],dS(e),!1).sort((function(e,t){return t.order-e.order})).map((function(e){return e.onExit}))),this.machine.options.actions).filter((function(e){return!aE(e)}));return k.concat({type:"stop",actions:$})}return k},e.prototype.transition=function(e,t,n,r){void 0===e&&(e=this.initialState);var o,i,s=tE(t);if(e instanceof NE)o=void 0===n?e:this.resolveState(NE.from(e,n));else{var a=JS(e)?this.resolve(PS(this.getResolvedPath(e))):this.resolve(e),l=null!=n?n:this.machine.context;o=this.resolveState(NE.from(a,l))}if(!LS&&s.name===XE)throw new Error("An event cannot have the wildcard type ('".concat(XE,"')"));if(this.strict&&!this.events.includes(s.name)&&(i=s.name,!/^(done|error)\./.test(i)))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(s.name,"'"));var c=this._transition(o.value,o,s)||{transitions:[],configuration:[],exitSet:[],source:o,actions:[]},d=$E([],this.getStateNodes(o.value)),u=c.configuration.length?$E(d,c.configuration):d;return c.configuration=uS([],dS(u),!1),this.resolveTransition(c,o,o.context,r,s)},e.prototype.resolveRaisedTransition=function(e,t,n,r){var o,i=e.actions;return(e=this.transition(e,t,void 0,r))._event=n,e.event=n.data,(o=e.actions).unshift.apply(o,uS([],dS(i),!1)),e},e.prototype.resolveTransition=function(e,t,n,r,o){var i,s,a,l,c=this;void 0===o&&(o=lE);var d=e.configuration,u=!t||e.transitions.length>0,h=u?e.configuration:t?t.configuration:[],p=OE(h,this),f=u?ME(this.machine,d):void 0,m=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,g=this.getActions(new Set(h),p,e,n,o,t,r),v=t?aS({},t.activities):{};try{for(var b=cS(g),y=b.next();!y.done;y=b.next()){var w=y.value;try{for(var C=(a=void 0,cS(w.actions)),x=C.next();!x.done;x=C.next()){var k=x.value;k.type===hS?v[k.activity.id||k.activity.type]=k:k.type===pS&&(v[k.activity.id||k.activity.type]=!1)}}catch(e){a={error:e}}finally{try{x&&!x.done&&(l=C.return)&&l.call(C)}finally{if(a)throw a.error}}}}catch(e){i={error:e}}finally{try{y&&!y.done&&(s=b.return)&&s.call(b)}finally{if(i)throw i.error}}var $,S,E=dS(gE(this,t,n,o,g,r,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),M=E[0],T=E[1],O=dS(function(e,t){var n,r,o=dS([[],[]],2),i=o[0],s=o[1];try{for(var a=cS(e),l=a.next();!l.done;l=a.next()){var c=l.value;t(c)?i.push(c):s.push(c)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return[i,s]}(M,aE),2),L=O[0],A=O[1],N=M.filter((function(e){var t;return e.type===hS&&(null===(t=e.activity)||void 0===t?void 0:t.type)===CS})),R=N.reduce((function(e,t){return e[t.activity.id]=function(e,t,n,r){var o,i=oE(e.src),s=null===(o=null==t?void 0:t.options.services)||void 0===o?void 0:o[i.type],a=e.data?FS(e.data,n,r):void 0,l=s?yE(s,e.id,a):bE(e.id);return l.meta=e,l}(t.activity,c.machine,T,o),e}),t?aS({},t.children):{}),D=new NE({value:f||t.value,context:T,_event:o,_sessionid:t?t._sessionid:null,historyValue:f?m?($=m,S=f,{current:S,states:WS($,S)}):void 0:t?t.historyValue:void 0,history:!f||e.source?t:void 0,actions:f?A:[],activities:f?v:t?t.activities:{},events:[],configuration:h,transitions:e.transitions,children:R,done:p,tags:LE(h),machine:this}),P=n!==T;D.changed=o.name===SS||P;var I=D.history;I&&delete I.history;var z=!p&&(this._transient||d.some((function(e){return e._transient})));if(!(u||z&&o.name!==JE))return D;var V=D;if(!p)for(z&&(V=this.resolveRaisedTransition(V,{type:vS},o,r));L.length;){var H=L.shift();V=this.resolveRaisedTransition(V,H._event,o,r)}var _=V.changed||(I?!!V.actions.length||P||typeof I.value!=typeof V.value||!AE(V.value,I.value):void 0);return V.changed=_,V.history=I,V},e.prototype.getStateNode=function(e){if(QE(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var t=this.states[e];if(!t)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return t},e.prototype.getStateNodeById=function(e){var t=QE(e)?e.slice(1):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw new Error("Child state node '#".concat(t,"' does not exist on machine '").concat(this.id,"'"));return n},e.prototype.getStateNodeByPath=function(e){if("string"==typeof e&&QE(e))try{return this.getStateNodeById(e.slice(1))}catch(e){}for(var t=RS(e,this.delimiter).slice(),n=this;t.length;){var r=t.shift();if(!r.length)break;n=n.getStateNode(r)}return n},e.prototype.resolve=function(e){var t,n=this;if(!e)return this.initialStateValue||YE;switch(this.type){case"parallel":return IS(this.initialStateValue,(function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):YE}));case"compound":if(JS(e)){var r=this.getStateNode(e);return"parallel"===r.type||"compound"===r.type?((t={})[e]=r.initialStateValue,t):e}return Object.keys(e).length?IS(e,(function(e,t){return e?n.getStateNode(t).resolve(e):YE})):this.initialStateValue||{};default:return e||YE}},e.prototype.getResolvedPath=function(e){if(QE(e)){var t=this.machine.idMap[e.slice(1)];if(!t)throw new Error("Unable to find state node '".concat(e,"'"));return t.path}return RS(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e,t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)t=zS(this.states,(function(e){return e.initialStateValue||YE}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));t=wE(this.states[this.initial])?this.initial:((e={})[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){this._init();var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=t?t:this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if("history"===this.type){var t=this.config;e=JS(t.target)&&QE(t.target)?PS(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,n){return void 0===n&&(n=!0),n?"history"===e.type?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;return wE(this)?[this]:"compound"!==this.type||this.initial?_S(HS(this.initialStateValue).map((function(t){return e.getFromRelativePath(t)}))):(LS||KS(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this])},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=dS(e),n=t[0],r=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var o=this.getStateNode(n);if("history"===o.type)return o.resolveHistory();if(!this.states[n])throw new Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(r)},e.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:zS(this.states,(function(t,n){if(!e)return t.historyValue();var r=JS(e)?void 0:e[n];return t.historyValue(r||t.initialStateValue)}),(function(e){return!e.history}))}},e.prototype.resolveHistory=function(e){var t=this;if("history"!==this.type)return[this];var n=this.parent;if(!e){var r=this.target;return r?_S(HS(r).map((function(e){return n.getFromRelativePath(e)}))):n.initialStateNodes}var o,i,s=(o=n.path,i="states",function(e){var t,n,r=e;try{for(var s=cS(o),a=s.next();!a.done;a=s.next()){var l=a.value;r=r[i][l]}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return r})(e).current;return JS(s)?[n.getStateNode(s)]:_S(HS(s).map((function(e){return"deep"===t.history?n.getFromRelativePath(e):[n.states[e[0]]]})))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=_S(Object.keys(this.states).map((function(t){return e.states[t].stateIds})));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,n,r;if(this.__cache.events)return this.__cache.events;var o=this.states,i=new Set(this.ownEvents);if(o)try{for(var s=cS(Object.keys(o)),a=s.next();!a.done;a=s.next()){var l=o[a.value];if(l.states)try{for(var c=(n=void 0,cS(l.events)),d=c.next();!d.done;d=c.next()){var u=d.value;i.add("".concat(u))}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(i)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter((function(e){return!(!e.target&&!e.actions.length&&e.internal)})).map((function(e){return e.eventType})));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(void 0!==e)return e.map((function(e){if(!JS(e))return e;var n=e[0]===t.delimiter;if(n&&!t.parent)return t.getStateNodeByPath(e.slice(1));var r=n?t.key+e:e;if(!t.parent)return t.getStateNodeByPath(r);try{return t.parent.getStateNodeByPath(r)}catch(e){throw new Error("Invalid transition definition for state node '".concat(t.id,"':\n").concat(e.message))}}))},e.prototype.formatTransition=function(e){var t=this,n=function(e){if(void 0!==e&&""!==e)return jS(e)}(e.target),r="internal"in e?e.internal:!n||n.some((function(e){return JS(e)&&e[0]===t.delimiter})),o=this.machine.options.guards,i=this.resolveTarget(n),s=aS(aS({},e),{actions:uE(jS(e.actions)),cond:XS(e.cond,o),target:i,source:this,internal:r,eventType:e.event,toJSON:function(){return aS(aS({},s),{target:s.target?s.target.map((function(e){return"#".concat(e.id)})):void 0,source:"#".concat(t.id)})}});return s},e.prototype.formatTransitions=function(){var e,t,n,r=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var o=this.config.on,i=XE,s=o[i],a=void 0===s?[]:s,l=lS(o,["*"]);n=_S(Object.keys(l).map((function(e){LS||e!==JE||KS(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(r.id,'".'));var t=nE(e,l[e]);return LS||function(e,t,n){var r=n.slice(0,-1).some((function(e){return!("cond"in e)&&!("in"in e)&&(JS(e.target)||QS(e.target))})),o=t===JE?"the transient event":"event '".concat(t,"'");KS(!r,"One or more transitions for ".concat(o," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")}(r,e,t),t})).concat(nE(XE,a)))}else n=[];var c=this.config.always?nE("",this.config.always):[],d=this.config.onDone?nE(String(pE(this.id)),this.config.onDone):[];LS||KS(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var u=_S(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,uS([],dS(nE(String(fE(e.id)),e.onDone)),!1)),e.onError&&t.push.apply(t,uS([],dS(nE(String(mE(e.id)),e.onError)),!1)),t}))),h=this.after,p=_S(uS(uS(uS(uS([],dS(d),!1),dS(u),!1),dS(n),!1),dS(c),!1).map((function(e){return jS(e).map((function(e){return r.formatTransition(e)}))})));try{for(var f=cS(h),m=f.next();!m.done;m=f.next()){var g=m.value;p.push(g)}}catch(t){e={error:t}}finally{try{m&&!m.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}return p},e}();var tM,nM=function(e){return{type:bS,assignment:e}};!function(e){e[e.Effect=1]="Effect",e[e.LayoutEffect=2]="LayoutEffect"}(tM||(tM={}));var rM="undefined"!=typeof document?ue:function(){};function oM(e){var t=te.useRef();return t.current||(t.current={v:e()}),t.current.v}var iM=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},sM=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};var aM=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},lM=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function cM(e,t){(0,e.exec)(t.context,t._event.data,{action:e,state:t,_event:t._event})()}function dM(e){var t=ae([]),n=ae([]);rM((function(){var r=e.subscribe((function(e){var r,o;if(e.actions.length){var i=e.actions.filter((function(e){return"function"==typeof e.exec&&"__effect"in e.exec})),s=aM(function(e,t){var n,r,o=iM([[],[]],2),i=o[0],s=o[1];try{for(var a=sM(e),l=a.next();!l.done;l=a.next()){var c=l.value;t(c)?i.push(c):s.push(c)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return[i,s]}(i,(function(e){return e.exec.__effect===tM.Effect})),2),a=s[0],l=s[1];(r=t.current).push.apply(r,lM([],aM(a.map((function(t){return[t,e]}))),!1)),(o=n.current).push.apply(o,lM([],aM(l.map((function(t){return[t,e]}))),!1))}}));return function(){r.unsubscribe()}}),[]),rM((function(){for(;n.current.length;){var e=aM(n.current.shift(),2);cM(e[0],e[1])}})),de((function(){for(;t.current.length;){var e=aM(t.current.shift(),2);cM(e[0],e[1])}}))}var uM=function(){return uM=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},uM.apply(this,arguments)},hM=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},pM=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s};var fM=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s};function mM(e,t){void 0===t&&(t={});var n=fe((function(e){var t=void 0===e.changed&&Object.keys(e.children).length;(e.changed||t)&&s(e)}),[]),r=function(e,t,n){void 0===t&&(t={});var r=oM((function(){return"function"==typeof e?e():e}));if("production"!==process.env.NODE_ENV&&"function"!=typeof e){var o=pM(le(r),1)[0];e!==o&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var i=t.context,s=t.guards,a=t.actions,l=t.activities,c=t.services,d=t.delays,u=t.state,h=hM(t,["context","guards","actions","activities","services","delays","state"]),p=oM((function(){var e={context:i,guards:s,actions:a,activities:l,services:c,delays:d};return KE(r.withConfig(e,(function(){return uM(uM({},r.context),i)})),uM({deferEvents:!0},h))}));return rM((function(){var e;return n&&(e=p.subscribe(function(e){if("object"==typeof e)return e;var t=function(){};return{next:e,error:void 0||t,complete:void 0||t}}(n))),function(){null==e||e.unsubscribe()}}),[n]),rM((function(){return p.start(u?NE.create(u):void 0),function(){p.stop()}}),[]),rM((function(){Object.assign(p.machine.options.actions,a),Object.assign(p.machine.options.guards,s),Object.assign(p.machine.options.activities,l),Object.assign(p.machine.options.services,c),Object.assign(p.machine.options.delays,d)}),[a,s,l,c,d]),dM(p),p}(e,t,n),o=fM(le((function(){var e=r.machine.initialState;return t.state?NE.create(t.state):e})),2),i=o[0],s=o[1];return[i,r.send,r]}function gM(){return gM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gM.apply(null,arguments)}function vM(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}const bM={arr:Array.isArray,obj:e=>"[object Object]"===Object.prototype.toString.call(e),fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e,nul:e=>null===e,set:e=>e instanceof Set,map:e=>e instanceof Map,equ(e,t){if(typeof e!=typeof t)return!1;if(bM.str(e)||bM.num(e))return e===t;if(bM.obj(e)&&bM.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;let n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!bM.und(n)||e===t}};function yM(e,t){return bM.und(e)||bM.nul(e)?t:e}function wM(e){return bM.und(e)?[]:bM.arr(e)?e:[e]}function CM(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return bM.fun(e)?e(...n):e}function xM(e){const t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,vM(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(bM.und(t))return gM({to:t},e);const n=Object.keys(e).reduce(((n,r)=>bM.und(t[r])?gM({},n,{[r]:e[r]}):n),{});return gM({to:t},n)}class kM{constructor(){this.payload=void 0,this.children=[]}getAnimatedValue(){return this.getValue()}getPayload(){return this.payload||this}attach(){}detach(){}getChildren(){return this.children}addChild(e){0===this.children.length&&this.attach(),this.children.push(e)}removeChild(e){const t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()}}class $M extends kM{constructor(){super(...arguments),this.payload=[],this.attach=()=>this.payload.forEach((e=>e instanceof kM&&e.addChild(this))),this.detach=()=>this.payload.forEach((e=>e instanceof kM&&e.removeChild(this)))}}class SM extends kM{constructor(){super(...arguments),this.payload={},this.attach=()=>Object.values(this.payload).forEach((e=>e instanceof kM&&e.addChild(this))),this.detach=()=>Object.values(this.payload).forEach((e=>e instanceof kM&&e.removeChild(this)))}getValue(e){void 0===e&&(e=!1);const t={};for(const n in this.payload){const r=this.payload[n];(!e||r instanceof kM)&&(t[n]=r instanceof kM?r[e?"getAnimatedValue":"getValue"]():r)}return t}getAnimatedValue(){return this.getValue(!0)}}let EM,MM;let TM,OM=e=>"undefined"!=typeof window?window.requestAnimationFrame(e):-1;let LM,AM=()=>Date.now();class NM extends SM{constructor(e,t){super(),this.update=void 0,this.payload=e.style?gM({},e,{style:LM(e.style)}):e,this.update=t,this.attach()}}let RM=!1;const DM=new Set,PM=()=>{if(!RM)return!1;let e=AM();for(let t of DM){let n=!1;for(let r=0;r<t.configs.length;r++){let o,i,s=t.configs[r];for(let t=0;t<s.animatedValues.length;t++){let r=s.animatedValues[t];if(r.done)continue;let a=s.fromValues[t],l=s.toValues[t],c=r.lastPosition,d=l instanceof kM,u=Array.isArray(s.initialVelocity)?s.initialVelocity[t]:s.initialVelocity;if(d&&(l=l.getValue()),s.immediate)r.setValue(l),r.done=!0;else if("string"!=typeof a&&"string"!=typeof l){if(void 0!==s.duration)c=a+s.easing((e-r.startTime)/s.duration)*(l-a),o=e>=r.startTime+s.duration;else if(s.decay)c=a+u/(1-.998)*(1-Math.exp(-.0020000000000000018*(e-r.startTime))),o=Math.abs(r.lastPosition-c)<.1,o&&(l=c);else{i=void 0!==r.lastTime?r.lastTime:e,u=void 0!==r.lastVelocity?r.lastVelocity:s.initialVelocity,e>i+64&&(i=e);let t=Math.floor(e-i);for(let e=0;e<t;++e){u+=1*((-s.tension*(c-l)+-s.friction*u)/s.mass)/1e3,c+=1*u/1e3}let n=!(!s.clamp||0===s.tension)&&(a<l?c>l:c<l),d=Math.abs(u)<=s.precision,h=0===s.tension||Math.abs(l-c)<=s.precision;o=n||d&&h,r.lastVelocity=u,r.lastTime=e}d&&!s.toValues[t].done&&(o=!1),o?(r.value!==l&&(c=l),r.done=!0):n=!0,r.setValue(c),r.lastPosition=c}else r.setValue(l),r.done=!0}t.props.onFrame&&(t.values[s.name]=s.interpolation.getValue())}t.props.onFrame&&t.props.onFrame(t.values),n||(DM.delete(t),t.stop(!0))}return DM.size?OM(PM):RM=!1,RM};function IM(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return IM({range:e,output:t,extrapolate:n});if(TM&&"string"==typeof e.output[0])return TM(e);const r=e,o=r.output,i=r.range||[0,1],s=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,i);return function(e,t,n,r,o,i,s,a,l){let c=l?l(e):e;if(c<t){if("identity"===s)return c;"clamp"===s&&(c=t)}if(c>n){if("identity"===a)return c;"clamp"===a&&(c=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t);c=i(c),r===-1/0?c=-c:o===1/0?c+=r:c=c*(o-r)+r;return c}(e,i[t],i[t+1],o[t],o[t+1],l,s,a,r.map)}}class zM extends $M{constructor(e,t,n,r){super(),this.calc=void 0,this.payload=e instanceof $M&&!(e instanceof zM)?e.getPayload():Array.isArray(e)?e:[e],this.calc=IM(t,n,r)}getValue(){return this.calc(...this.payload.map((e=>e.getValue())))}updateConfig(e,t,n){this.calc=IM(e,t,n)}interpolate(e,t,n){return new zM(this,e,t,n)}}const VM=(e,t,n)=>e&&new zM(e,t,n);function HM(e,t){"update"in e?t.add(e):e.getChildren().forEach((e=>HM(e,t)))}class _M extends kM{constructor(e){var t;super(),t=this,this.animatedStyles=new Set,this.value=void 0,this.startPosition=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.startTime=void 0,this.lastTime=void 0,this.done=!1,this.setValue=function(e,n){void 0===n&&(n=!0),t.value=e,n&&t.flush()},this.value=e,this.startPosition=e,this.lastPosition=e}flush(){0===this.animatedStyles.size&&HM(this,this.animatedStyles),this.animatedStyles.forEach((e=>e.update()))}clearStyles(){this.animatedStyles.clear()}getValue(){return this.value}interpolate(e,t,n){return new zM(this,e,t,n)}}class BM extends $M{constructor(e){super(),this.payload=e.map((e=>new _M(e)))}setValue(e,t){void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach(((e,n)=>this.payload[n].setValue(e,t))):this.payload.forEach((n=>n.setValue(e,t)))}getValue(){return this.payload.map((e=>e.getValue()))}interpolate(e,t){return new zM(this,e,t)}}let jM=0,FM=class{constructor(){this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=()=>this.interpolations,this.id=jM++}update(e){if(!e)return this;const t=xM(e),n=t.delay,r=void 0===n?0:n,o=t.to,i=vM(t,["delay","to"]);if(bM.arr(o)||bM.fun(o))this.queue.push(gM({},i,{delay:r,to:o}));else if(o){let e={};Object.entries(o).forEach((t=>{let n=t[0],o=t[1];const s=gM({to:{[n]:o},delay:CM(r,n)},i),a=e[s.delay]&&e[s.delay].to;e[s.delay]=gM({},e[s.delay],s,{to:gM({},a,s.to)})})),this.queue=Object.values(e)}return this.queue=this.queue.sort(((e,t)=>e.delay-t.delay)),this.diff(i),this}start(e){if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((e=>{let t=e.from,n=void 0===t?{}:t,r=e.to,o=void 0===r?{}:r;bM.obj(n)&&(this.merged=gM({},n,this.merged)),bM.obj(o)&&(this.merged=gM({},this.merged,o))}));const t=this.local=++this.guid,n=this.localQueue=this.queue;this.queue=[],n.forEach(((r,o)=>{let i=r.delay,s=vM(r,["delay"]);const a=r=>{o===n.length-1&&t===this.guid&&r&&(this.idle=!0,this.props.onRest&&this.props.onRest(this.merged)),e&&e()};let l=bM.arr(s.to)||bM.fun(s.to);i?setTimeout((()=>{t===this.guid&&(l?this.runAsync(s,a):this.diff(s).start(a))}),i):l?this.runAsync(s,a):this.diff(s).start(a)}))}else bM.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,DM.has(t)||DM.add(t),RM||(RM=!0,OM(PM));var t;return this}stop(e){return this.listeners.forEach((t=>t(e))),this.listeners=[],this}pause(e){var t;return this.stop(!0),e&&(t=this,DM.has(t)&&DM.delete(t)),this}runAsync(e,t){var n=this;e.delay;let r=vM(e,["delay"]);const o=this.local;let i=Promise.resolve(void 0);if(bM.arr(r.to))for(let e=0;e<r.to.length;e++){const t=e,n=gM({},r,xM(r.to[t]));bM.arr(n.config)&&(n.config=n.config[t]),i=i.then((()=>{if(o===this.guid)return new Promise((e=>this.diff(n).start(e)))}))}else if(bM.fun(r.to)){let e,t=0;i=i.then((()=>r.to((n=>{const i=gM({},r,xM(n));if(bM.arr(i.config)&&(i.config=i.config[t]),t++,o===this.guid)return e=new Promise((e=>this.diff(i).start(e)))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((()=>e))))}i.then(t)}diff(e){this.props=gM({},this.props,e);let t=this.props,n=t.from,r=void 0===n?{}:n,o=t.to,i=void 0===o?{}:o,s=t.config,a=void 0===s?{}:s,l=t.reverse,c=t.attach,d=t.reset,u=t.immediate;if(l){var h=[i,r];r=h[0],i=h[1]}this.merged=gM({},r,this.merged,i),this.hasChanged=!1;let p=c&&c(this);if(this.animations=Object.entries(this.merged).reduce(((e,t)=>{let n=t[0],o=t[1],i=e[n]||{};const s=bM.num(o),l=bM.str(o)&&!o.startsWith("#")&&!/\d/.test(o)&&!MM[o],c=bM.arr(o),h=!s&&!c&&!l;let f=bM.und(r[n])?o:r[n],m=s||c||l?o:1,g=CM(a,n);p&&(m=p.animations[n].parent);let v,b=i.parent,y=i.interpolation,w=wM(p?m.getPayload():m),C=o;h&&(C=TM({range:[0,1],output:[o,o]})(1));let x=y&&y.getValue();const k=!bM.und(b)&&i.animatedValues.some((e=>!e.done)),$=!bM.equ(C,x),S=!bM.equ(C,i.previous),E=!bM.equ(g,i.config);if(d||S&&$||E){if(s||l)b=y=i.parent||new _M(f);else if(c)b=y=i.parent||new BM(f);else if(h){let e=i.interpolation&&i.interpolation.calc(i.parent.value);e=void 0===e||d?f:e,i.parent?(b=i.parent,b.setValue(0,!1)):b=new _M(0);const t={output:[e,o]};i.interpolation?(y=i.interpolation,i.interpolation.updateConfig(t)):y=b.interpolate(t)}return w=wM(p?m.getPayload():m),v=wM(b.getPayload()),d&&!h&&b.setValue(f,!1),this.hasChanged=!0,v.forEach((e=>{e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=k?e.lastVelocity:void 0,e.lastTime=k?e.lastTime:void 0,e.startTime=AM(),e.done=!1,e.animatedStyles.clear()})),CM(u,n)&&b.setValue(h?m:o,!1),gM({},e,{[n]:gM({},i,{name:n,parent:b,interpolation:y,animatedValues:v,toValues:w,previous:C,config:g,fromValues:wM(b.getValue()),immediate:CM(u,n),initialVelocity:yM(g.velocity,0),clamp:yM(g.clamp,!1),precision:yM(g.precision,.01),tension:yM(g.tension,170),friction:yM(g.friction,26),mass:yM(g.mass,1),duration:g.duration,easing:yM(g.easing,(e=>e)),decay:g.decay})})}return $?e:(h&&(b.setValue(1,!1),y.updateConfig({output:[C,C]})),b.done=!0,this.hasChanged=!0,gM({},e,{[n]:gM({},e[n],{previous:C})}))}),this.animations),this.hasChanged){this.configs=Object.values(this.animations),this.values={},this.interpolations={};for(let e in this.animations)this.interpolations[e]=this.animations[e].interpolation,this.values[e]=this.animations[e].interpolation.getValue()}return this}destroy(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0}};const qM=e=>{const t=bM.fun(e),n=((e,t)=>{const n=ae(!1),r=ae(),o=bM.fun(t),i=ie((()=>{let n;return r.current&&(r.current.map((e=>e.destroy())),r.current=void 0),[new Array(e).fill().map(((e,r)=>{const i=new FM,s=o?CM(t,r,i):t[r];return 0===r&&(n=s.ref),i.update(s),n||i.start(),i})),n]}),[e]),s=i[0],a=i[1];r.current=s,ge(a,(()=>({start:()=>Promise.all(r.current.map((e=>new Promise((t=>e.start(t)))))),stop:e=>r.current.forEach((t=>t.stop(e))),get controllers(){return r.current}})));const l=ie((()=>e=>r.current.map(((t,n)=>{t.update(o?CM(e,n,t):e[n]),a||t.start()}))),[e]);de((()=>{n.current?o||l(t):a||r.current.forEach((e=>e.start()))})),de((()=>(n.current=!0,()=>r.current.forEach((e=>e.destroy())))),[]);const c=r.current.map((e=>e.getValues()));return o?[c,l,e=>r.current.forEach((t=>t.pause(e)))]:c})(1,t?e:[e]),r=n[0],o=n[1],i=n[2];return t?[r[0],o,i]:r};class WM extends SM{constructor(e){void 0===e&&(e={}),super(),!e.transform||e.transform instanceof kM||(e=EM.transform(e)),this.payload=e}}const UM={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},KM="[-+]?\\d*\\.?\\d+",ZM=KM+"%";function GM(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}const JM=new RegExp("rgb"+GM(KM,KM,KM)),XM=new RegExp("rgba"+GM(KM,KM,KM,KM)),YM=new RegExp("hsl"+GM(KM,ZM,ZM)),QM=new RegExp("hsla"+GM(KM,ZM,ZM,KM)),eT=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,tT=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,nT=/^#([0-9a-fA-F]{6})$/,rT=/^#([0-9a-fA-F]{8})$/;function oT(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function iT(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=oT(o,r,e+1/3),s=oT(o,r,e),a=oT(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*s)<<16|Math.round(255*a)<<8}function sT(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function aT(e){return(parseFloat(e)%360+360)%360/360}function lT(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function cT(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function dT(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=nT.exec(e))?parseInt(t[1]+"ff",16)>>>0:UM.hasOwnProperty(e)?UM[e]:(t=JM.exec(e))?(sT(t[1])<<24|sT(t[2])<<16|sT(t[3])<<8|255)>>>0:(t=XM.exec(e))?(sT(t[1])<<24|sT(t[2])<<16|sT(t[3])<<8|lT(t[4]))>>>0:(t=eT.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=rT.exec(e))?parseInt(t[1],16)>>>0:(t=tT.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=YM.exec(e))?(255|iT(aT(t[1]),cT(t[2]),cT(t[3])))>>>0:(t=QM.exec(e))?(iT(aT(t[1]),cT(t[2]),cT(t[3]))|lT(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const uT=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,hT=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,pT=new RegExp(`(${Object.keys(UM).join("|")})`,"g");let fT={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const mT=["Webkit","Ms","Moz","O"];function gT(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||fT.hasOwnProperty(e)&&fT[e]?(""+t).trim():t+"px"}fT=Object.keys(fT).reduce(((e,t)=>(mT.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),fT);const vT={};var bT,yT;bT=e=>new WM(e),LM=bT,yT=e=>{const t=e.output.map((e=>e.replace(hT,dT))).map((e=>e.replace(pT,dT))),n=t[0].match(uT).map((()=>[]));t.forEach((e=>{e.match(uT).forEach(((e,t)=>n[t].push(+e)))}));const r=t[0].match(uT).map(((t,r)=>IM(gM({},e,{output:n[r]}))));return e=>{let n=0;return t[0].replace(uT,(()=>r[n++](e))).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,((e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`))}},TM=yT,MM=UM,function(e,t){EM={fn:e,transform:t}}(((e,t)=>{if(!e.nodeType||void 0===e.setAttribute)return!1;{const o=t.style,i=t.children,s=t.scrollTop,a=t.scrollLeft,l=vM(t,["style","children","scrollTop","scrollLeft"]),c="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;void 0!==s&&(e.scrollTop=s),void 0!==a&&(e.scrollLeft=a),void 0!==i&&(e.textContent=i);for(let t in o)if(o.hasOwnProperty(t)){var n=0===t.indexOf("--"),r=gT(t,o[t],n);"float"===t&&(t="cssFloat"),n?e.style.setProperty(t,r):e.style[t]=r}for(let t in l){const n=c?t:vT[t]||(vT[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())));void 0!==e.getAttribute(n)&&e.setAttribute(n,l[t])}}}),(e=>e));var wT;const CT=(wT=e=>se(((t,n)=>{const r=function(){const e=le(!1)[1];return fe((()=>e((e=>!e))),[])}(),o=ae(!0),i=ae(null),s=ae(null),a=fe((e=>{const t=i.current;i.current=new NM(e,(()=>{let e=!1;s.current&&(e=EM.fn(s.current,i.current.getAnimatedValue())),s.current&&!1!==e||r()})),t&&t.detach()}),[]);de((()=>()=>{o.current=!1,i.current&&i.current.detach()}),[]),ge(n,(()=>(e=>e.current)(s))),a(t);const l=i.current.getValue();l.scrollTop,l.scrollLeft;const c=vM(l,["scrollTop","scrollLeft"]),d=(u=e,!bM.fun(u)||u.prototype instanceof ne.Component?e=>s.current=function(e,t){return t&&(bM.fun(t)?t(e):bM.obj(t)&&(t.current=e)),e}(e,n):void 0);var u;return ne.createElement(e,gM({},c,{ref:d}))})),e=>(bM.arr(e)?e:Object.keys(e)).reduce(((e,t)=>{const n=t;return e[n]=wT(n),e}),wT))(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);function xT(e,t){return e.map((function(e,n){return e+t[n]}))}function kT(e,t){return e.map((function(e,n){return e-t[n]}))}function $T(e){return Math.hypot.apply(Math,e)}function ST(e){return Math.sign?Math.sign(e):Number(e>0)-Number(e<0)||+e}function ET(e,t,n){return 0===t||Math.abs(t)===1/0?function(e,t){return Math.pow(e,5*t)}(e,n):e*t*n/(t+n*e)}function MT(e,t,n,r){return void 0===r&&(r=.15),0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-ET(t-e,n-t,r)+t:e>n?+ET(e-n,n-t,r)+n:e}function TT(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function OT(){return OT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OT.apply(this,arguments)}function LT(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function AT(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function RT(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return NT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?NT(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function DT(){}function PT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?DT:1===t.length?t[0]:function(){for(var e,n,r=RT(t);!(n=r()).done;){e=n.value.apply(this,arguments)||e}return e}}function IT(e,t){if(void 0===e){if(void 0===t)throw new Error("Must define fallback value if undefined is expected");e=t}return Array.isArray(e)?e:[e,e]}function zT(e){if("function"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}return e}function VT(e,t){void 0===e&&(e={});for(var n={},r=0,o=Object.entries(t);r<o.length;r++){var i=o[r],s=i[0],a=i[1];switch(typeof a){case"function":n[s]=a.call(n,e[s],s,e);break;case"object":n[s]=VT(e[s],a);break;case"boolean":a&&(n[s]=e[s])}}return n}var HT=OT({},{threshold:function(e){return void 0===e&&(e=0),IT(e)},rubberband:function(e){switch(void 0===e&&(e=0),e){case!0:return IT(.15);case!1:return IT(0);default:return IT(e)}},enabled:function(e){return void 0===e&&(e=!0),e},triggerAllEvents:function(e){return void 0===e&&(e=!1),e},initial:function(e){return void 0===e&&(e=0),"function"==typeof e?e:IT(e)}},{axis:!0,lockDirection:function(e){return void 0===e&&(e=!1),e},bounds:function(e){if(void 0===e&&(e={}),"function"==typeof e)return function(t){return HT.bounds(e(t))};var t=e,n=t.left,r=void 0===n?-1/0:n,o=t.right,i=void 0===o?1/0:o,s=t.top,a=void 0===s?-1/0:s,l=t.bottom;return[[r,i],[a,void 0===l?1/0:l]]}}),_T="undefined"!=typeof window&&window.document&&window.document.createElement,BT={enabled:function(e){return void 0===e&&(e=!0),e},domTarget:!0,window:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return void 0===e&&(e=_T?window:void 0),e})),eventOptions:function(e){var t=void 0===e?{}:e,n=t.passive,r=void 0===n||n,o=t.capture;return{passive:r,capture:void 0!==o&&o}}},jT=OT({},HT,{threshold:function(e,t,n){var r=n.filterTaps,o=void 0!==r&&r,i=n.lockDirection,s=void 0!==i&&i,a=n.axis,l=IT(e,o?3:s||(void 0===a?void 0:a)?1:0);return this.filterTaps=o||l[0]+l[1]>0,l},swipeVelocity:function(e){return void 0===e&&(e=.5),IT(e)},swipeDistance:function(e){return void 0===e&&(e=60),IT(e)},delay:function(e){switch(void 0===e&&(e=0),e){case!0:return 180;case!1:return 0;default:return e}}});function FT(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["domTarget","eventOptions","window","enabled"]),s=function(e){return void 0===e&&(e={}),VT(e,BT)}({domTarget:t,eventOptions:n,window:r,enabled:o});return s.drag=function(e){return void 0===e&&(e={}),VT(e,jT)}(i),s}function qT(e){return OT({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-1/0,1/0],[-1/0,1/0]],_lastEventType:void 0,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:DT,canceled:!1,memo:void 0,args:void 0},e)}function WT(){return{shared:{hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1},drag:qT({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,_isTap:!0,_delayedEvent:!1,_pointerId:void 0,tap:!1,swipe:[0,0]}),pinch:qT({da:[0,0],vdva:[0,0],origin:void 0,turns:0}),wheel:qT({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),move:qT({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),scroll:qT({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0})}}var UT=new Map,KT=function(){function e(e,t){var n=this;void 0===t&&(t=[]),this.controller=e,this.args=t,this.debounced=!0,this.setTimeout=function(e,t){var r;void 0===t&&(t=140),clearTimeout(n.controller.timeouts[n.stateKey]);for(var o=arguments.length,i=new Array(o>2?o-2:0),s=2;s<o;s++)i[s-2]=arguments[s];n.controller.timeouts[n.stateKey]=(r=window).setTimeout.apply(r,[e,t].concat(i))},this.clearTimeout=function(){clearTimeout(n.controller.timeouts[n.stateKey])},this.fireGestureHandler=function(e){if(void 0===e&&(e=!1),n.state._blocked)return n.debounced||(n.state._active=!1,n.clean()),null;if(!e&&!n.state.intentional&&!n.config.triggerAllEvents)return null;if(n.state.intentional){var t=n.state.active,r=n.state._active;n.state.active=r,n.state.first=r&&!t,n.state.last=t&&!r,n.controller.state.shared[n.ingKey]=r}var o=OT({},n.controller.state.shared,n.state,n.mapStateValues(n.state)),i=n.handler(o);return n.state.memo=void 0!==i?i:n.state.memo,n.state._active||n.clean(),o}}var t=e.prototype;return t.updateSharedState=function(e){Object.assign(this.controller.state.shared,e)},t.updateGestureState=function(e){Object.assign(this.state,e)},t.checkIntentionality=function(e,t){return{_intentional:e,_blocked:!1}},t.getMovement=function(e){var t=this.config,n=t.initial,r=t.bounds,o=t.rubberband,i=t.threshold,s=this.state,a=s._bounds,l=s._initial,c=s._active,d=s._intentional,u=s.lastOffset,h=s.movement,p=this.getInternalMovement(e,this.state),f=!1===d[0]?ZT(p[0],i[0]):d[0],m=!1===d[1]?ZT(p[1],i[1]):d[1],g=this.checkIntentionality([f,m],p);if(g._blocked)return OT({},g,{_movement:p,delta:[0,0]});var v,b,y,w,C=g._intentional,x=p;(!1!==C[0]&&!1===d[0]&&(b=zT(n,this.state),v=zT(r,this.state),l[0]=b[0],a[0]=v[0]),!1!==C[1]&&!1===d[1])&&(b=null!=(y=b)?y:zT(n,this.state),v=null!=(w=v)?w:zT(r,this.state),l[1]=b[1],a[1]=v[1]);var k=[!1!==C[0]?p[0]-C[0]:l[0],!1!==C[1]?p[1]-C[1]:l[1]],$=xT(k,u),S=c?o:[0,0];return k=GT(a,xT(k,l),S),OT({},g,{intentional:!1!==C[0]||!1!==C[1],_initial:l,_movement:x,movement:k,values:e,offset:GT(a,$,S),delta:kT(k,h)})},t.clean=function(){this.clearTimeout()},TT(e,[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}}]),e}();function ZT(e,t){return Math.abs(e)>=t&&ST(e)*t}function GT(e,t,n){var r=t[0],o=t[1],i=n[0],s=n[1],a=e[0],l=a[0],c=a[1],d=e[1],u=d[0],h=d[1];return[MT(r,l,c,i),MT(o,u,h,s)]}function JT(e,t,n){var r=e.state,o=e.args,i=t.timeStamp,s=t.type,a=r.values;return{_lastEventType:s,event:t,timeStamp:i,elapsedTime:n?0:i-r.startTime,args:o,previous:a}}function XT(e,t){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return e.call.apply(e,[this,OT({},t,{event:n})].concat(o))}}var YT=function(e){var t=this;this.classes=e,this.bind=function(){for(var e={},n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];for(var i,s=RT(t.classes);!(i=s()).done;){new(0,i.value)(t,r).addBindings(e)}for(var a=0,l=Object.entries(t.nativeRefs);a<l.length;a++){var c=l[a];tO(e,c[0],XT(c[1],OT({},t.state.shared,{args:r})))}return t.config.domTarget?function(e,t){var n=e.config,r=e.domListeners,o=eO(n);if(!o)throw new Error("domTarget must be defined");var i=n.eventOptions;rO(o,QT(r),i);for(var s=0,a=Object.entries(t);s<a.length;s++){var l=a[s],c=l[0],d=l[1],u=c.slice(2).toLowerCase();r.push([u,PT.apply(void 0,d)])}nO(o,r,i)}(t,e):function(e,t){for(var n=e.config,r={},o=n.eventOptions.capture?"Capture":"",i=0,s=Object.entries(t);i<s.length;i++){var a=s[i],l=a[0],c=a[1],d=Array.isArray(c)?c:[c];r[l+o]=PT.apply(void 0,d)}return r}(t,e)},this.effect=function(){return t.config.domTarget&&t.bind(),t.clean},this.clean=function(){var e=eO(t.config),n=t.config.eventOptions;e&&rO(e,QT(t.domListeners),n),Object.values(t.timeouts).forEach(clearTimeout),function(e){var t=e.config,n=t.window,r=t.eventOptions,o=e.windowListeners;if(!n)return;for(var i in o){rO(n,o[i],r)}e.windowListeners={}}(t)},this.state=WT(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function QT(e){return void 0===e&&(e=[]),e.splice(0,e.length)}function eO(e){var t=e.domTarget;return t&&"current"in t?t.current:t}function tO(e,t,n){e[t]||(e[t]=[]),e[t].push(n)}function nO(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=RT(t);!(r=o()).done;){var i=r.value,s=i[0],a=i[1];e.addEventListener(s,a,n)}}function rO(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=RT(t);!(r=o()).done;){var i=r.value,s=i[0],a=i[1];e.removeEventListener(s,a,n)}}function oO(e,t,n){void 0===n&&(n={});var r=function(e){var t=new Set;e.drag&&t.add(UT.get("drag"));e.wheel&&t.add(UT.get("wheel"));e.scroll&&t.add(UT.get("scroll"));e.move&&t.add(UT.get("move"));e.pinch&&t.add(UT.get("pinch"));e.hover&&t.add(UT.get("hover"));return t}(e),o=ne.useMemo((function(){return new YT(r)}),[]);return o.config=t,o.handlers=e,o.nativeRefs=n,ne.useEffect(o.effect,[]),o.config.domTarget?iO:o.bind}function iO(){"development"===process.env.NODE_ENV&&console.warn("Deprecation notice: When the `domTarget` option is specified, you don't need to write `useEffect(bind, [bind])` anymore: event binding is now made handled internally to this lib.\n\nNext version won't return anything when `domTarget` is provided, therefore your code will break if you try to call `useEffect`.")}var sO=function(e){function t(){return e.apply(this,arguments)||this}LT(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){return kT(e,t.initial)},n.checkIntentionality=function(e,t){if(!1===e[0]&&!1===e[1])return{_intentional:e,axis:this.state.axis};var n=t.map(Math.abs),r=n[0],o=n[1],i=this.state.axis||(r>o?"x":r<o?"y":void 0);return this.config.axis||this.config.lockDirection?i?this.config.axis&&i!==this.config.axis?{_intentional:e,_blocked:!0,axis:i}:(e["x"===i?1:0]=!1,{_intentional:e,_blocked:!1,axis:i}):{_intentional:[!1,!1],_blocked:!1,axis:i}:{_intentional:e,_blocked:!1,axis:i}},n.getKinematics=function(e,t){var n=this.getMovement(e);if(!n._blocked){var r=t.timeStamp-this.state.timeStamp;Object.assign(n,function(e,t,n){var r=$T(t),o=0===r?0:1/r,i=0===n?0:1/n,s=i*r,a=t.map((function(e){return i*e})),l=t.map((function(e){return o*e}));return{velocities:a,velocity:s,distance:$T(e),direction:l}}(n.movement,n.delta,r))}return n},n.mapStateValues=function(e){return{xy:e.values,vxvy:e.velocities}},t}(KT);function aO(e){if("touches"in e){var t=e.targetTouches,n=e.changedTouches;return t.length>0?t:n}return null}function lO(e){var t="buttons"in e?e.buttons:0,n=aO(e),r=n&&n.length||0;return{touches:r,down:r>0||t>0,buttons:t,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey}}function cO(e){var t=aO(e),n=t?t[0]:e;return[n.clientX,n.clientY]}var dO=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="dragging",t.stateKey="drag",t.onDragStart=function(e){t.enabled&&!t.state._active&&(!function(e,t,n){var r=e.config,o=e.windowListeners;void 0===n&&(n=[]),r.window&&(rO(r.window,o[t],r.eventOptions),nO(r.window,o[t]=n,r.eventOptions))}(t.controller,t.stateKey,[["pointermove",t.onDragChange],["pointerup",t.onDragEnd],["pointercancel",t.onDragEnd]]),t.updateGestureState({_pointerId:e.pointerId}),t.config.delay>0?(t.state._delayedEvent=!0,"persist"in e&&"function"==typeof e.persist&&e.persist(),t.setTimeout(t.startDrag.bind(AT(t)),t.config.delay,e)):t.startDrag(e))},t.onDragChange=function(e){if(!t.state.canceled&&e.pointerId===t.state._pointerId)if(t.state._active){var n=lO(e);if(n.down){t.updateSharedState(n);var r=cO(e),o=t.getKinematics(r,e),i=JT(AT(t),e),s=t.state._isTap,a=$T(o._movement);s&&a>=3&&(s=!1),t.updateGestureState(OT({},i,o,{_isTap:s})),t.fireGestureHandler()}else t.onDragEnd(e)}else t.state._delayedEvent&&(t.clearTimeout(),t.startDrag(e))},t.onDragEnd=function(e){if(e.pointerId===t.state._pointerId){t.state._active=!1,t.updateSharedState({down:!1,buttons:0,touches:0});var n=t.state._isTap,r=t.state.velocities,o=r[0],i=r[1],s=t.state.movement,a=s[0],l=s[1],c=t.state._intentional,d=c[0],u=c[1],h=t.config.swipeVelocity,p=h[0],f=h[1],m=t.config.swipeDistance,g=m[0],v=m[1],b=OT({},JT(AT(t),e),t.getMovement(t.state.values)),y=[0,0];b.elapsedTime<220&&(!1!==d&&Math.abs(o)>p&&Math.abs(a)>g&&(y[0]=ST(o)),!1!==u&&Math.abs(i)>f&&Math.abs(l)>v&&(y[1]=ST(i))),t.updateGestureState(OT({},b,{tap:n,swipe:y})),t.fireGestureHandler(!0===n)}},t.clean=function(){e.prototype.clean.call(AT(t)),t.state._delayedEvent=!1,function(e,t){var n=e.config,r=e.windowListeners;n.window&&(rO(n.window,r[t],n.eventOptions),delete r[t])}(t.controller,t.stateKey)},t.onCancel=function(){t.state.canceled||(t.updateGestureState({canceled:!0}),t.state._active=!1,t.updateSharedState({down:!1,buttons:0,touches:0}),requestAnimationFrame((function(){return t.fireGestureHandler()})))},t.onClick=function(e){t.state._isTap||e.stopPropagation()},t}LT(t,e);var n=t.prototype;return n.startDrag=function(e){var t=cO(e);this.updateSharedState(lO(e)),this.updateGestureState(OT({},function(e,t,n){var r=e.state.offset,o=n.timeStamp;return OT({},WT()[e.stateKey],{_active:!0,values:t,initial:t,offset:r,lastOffset:r,startTime:o})}(this,t,e),JT(this,e,!0),{_pointerId:e.pointerId,cancel:this.onCancel})),this.updateGestureState(this.getMovement(t)),this.fireGestureHandler()},n.addBindings=function(e){(tO(e,"onPointerDown",this.onDragStart),this.config.filterTaps)&&tO(e,this.controller.config.eventOptions.capture?"onClick":"onClickCapture",this.onClick)},t}(sO);function uO(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,r,o,i;if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!uO(e[r],t[r]))return!1;return!0}if("function"==typeof Map&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!uO(r.value[1],t.get(r.value[0])))return!1;return!0}if("function"==typeof Set&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if("undefined"!=typeof Element&&e instanceof Element)return!1;for(r=n;0!=r--;)if(!("_owner"===o[r]&&e.$$typeof||uO(e[o[r]],t[o[r]])))return!1;return!0}return e!=e&&t!=t}function hO(e,t){try{return uO(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}function pO(e,t){void 0===t&&(t={}),UT.set("drag",dO);var n=ae();return n.current||(n.current=function(e,t){var n,r,o=[],i=!1;return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return i&&n===this&&t(a,o)||(r=e.apply(this,a),i=!0,n=this,o=a),r}}(FT,hO)),oO({drag:e},n.current(t))}
2680
+ ***************************************************************************** */var iS,sS,aS=function(){return aS=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},aS.apply(this,arguments)};function lS(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function cS(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function dS(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function uS(e,t,n){if(2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"}(iS||(iS={})),function(e){e.Parent="#_parent",e.Internal="#_internal"}(sS||(sS={}));var hS=iS.Start,pS=iS.Stop,fS=iS.Raise,mS=iS.Send,gS=iS.Cancel,vS=iS.NullEvent,bS=iS.Assign;iS.After,iS.DoneState;var yS=iS.Log,wS=iS.Init,CS=iS.Invoke;iS.ErrorExecution;var xS,kS=iS.ErrorPlatform,$S=iS.ErrorCustom,SS=iS.Update,MS=iS.Choose,ES=iS.Pure,TS={},OS="xstate.guard",LS="production"===process.env.NODE_ENV;function AS(e,t,n){void 0===n&&(n=".");var r=DS(e,n),o=DS(t,n);return JS(o)?!!JS(r)&&o===r:JS(r)?r in o:Object.keys(r).every((function(e){return e in o&&AS(r[e],o[e])}))}function RS(e){try{return JS(e)||"number"==typeof e?"".concat(e):e.type}catch(e){throw new Error("Events must be strings or objects with a string event.type property.")}}function NS(e,t){try{return ZS(e)?e:e.toString().split(t)}catch(t){throw new Error("'".concat(e,"' is not a valid state path."))}}function DS(e,t){return"object"==typeof(n=e)&&"value"in n&&"context"in n&&"event"in n&&"_event"in n?e.value:ZS(e)?PS(e):"string"!=typeof e?e:PS(NS(e,t));var n}function PS(e){if(1===e.length)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function IS(e,t){for(var n={},r=Object.keys(e),o=0;o<r.length;o++){var i=r[o];n[i]=t(e[i],i,e,o)}return n}function zS(e,t,n){var r,o,i={};try{for(var s=cS(Object.keys(e)),a=s.next();!a.done;a=s.next()){var l=a.value,c=e[l];n(c)&&(i[l]=t(c,l,e))}}catch(e){r={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return i}var VS=function(e){return function(t){var n,r,o=t;try{for(var i=cS(e),s=i.next();!s.done;s=i.next()){o=o[s.value]}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o}};function HS(e){return e?JS(e)?[[e]]:_S(Object.keys(e).map((function(t){var n=e[t];return"string"==typeof n||n&&Object.keys(n).length?HS(e[t]).map((function(e){return[t].concat(e)})):[[t]]}))):[[]]}function _S(e){var t;return(t=[]).concat.apply(t,uS([],dS(e),!1))}function BS(e){return ZS(e)?e:[e]}function jS(e){return void 0===e?[]:BS(e)}function FS(e,t,n){var r,o;if(GS(e))return e(t,n.data);var i={};try{for(var s=cS(Object.keys(e)),a=s.next();!a.done;a=s.next()){var l=a.value,c=e[l];GS(c)?i[l]=c(t,n.data):i[l]=c}}catch(e){r={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return i}function qS(e){return e instanceof Promise||!(null===e||!GS(e)&&"object"!=typeof e||!GS(e.then))}function WS(e,t){return IS(e.states,(function(e,n){if(e){var r=(JS(t)?void 0:t[n])||(e?e.current:void 0);if(r)return{current:r,states:WS(e,r)}}}))}function US(e,t,n,r){LS||KS(!!e,"Attempting to update undefined context");var o=e?n.reduce((function(e,n){var o,i,s=n.assignment,a={state:r,action:n,_event:t},l={};if(GS(s))l=s(e,t.data,a);else try{for(var c=cS(Object.keys(s)),d=c.next();!d.done;d=c.next()){var u=d.value,h=s[u];l[u]=GS(h)?h(e,t.data,a):h}}catch(e){o={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}return Object.assign({},e,l)}),e):e;return o}var KS=function(){};function ZS(e){return Array.isArray(e)}function GS(e){return"function"==typeof e}function JS(e){return"string"==typeof e}function XS(e,t){if(e)return JS(e)?{type:OS,name:e,predicate:t?t[e]:void 0}:GS(e)?{type:OS,name:e.name,predicate:e}:e}LS||(KS=function(e,t){var n=e instanceof Error?e:void 0;if((n||!e)&&void 0!==console){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});var YS=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function QS(e){return!!e&&"__xstatenode"in e}function eM(e,t){return JS(e)||"number"==typeof e?aS({type:e},t):e}function tM(e,t){if(!JS(e)&&"$$type"in e&&"scxml"===e.$$type)return e;var n=eM(e);return aS({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function nM(e,t){return BS(t).map((function(t){return void 0===t||"string"==typeof t||QS(t)?{target:t,event:e}:aS(aS({},t),{event:e})}))}function rM(e,t,n,r,o){var i=e.options.guards,s={state:o,cond:t,_event:r};if(t.type===OS)return((null==i?void 0:i[t.name])||t.predicate)(n,r.data,s);var a=null==i?void 0:i[t.type];if(!a)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return a(n,r.data,s)}function oM(e){return"string"==typeof e?{type:e}:e}function iM(e,t,n){var r=function(){},o="object"==typeof e,i=o?e:null;return{next:((o?e.next:e)||r).bind(i),error:((o?e.error:t)||r).bind(i),complete:((o?e.complete:n)||r).bind(i)}}function sM(e,t){return"".concat(e,":invocation[").concat(t,"]")}function aM(e){return(e.type===fS||e.type===mS&&e.to===sS.Internal)&&"number"!=typeof e.delay}(xS={})[YS]=function(){return this},xS[Symbol.observable]=function(){return this};var lM=tM({type:wS});function cM(e,t){return t&&t[e]||void 0}function dM(e,t){var n;if(JS(e)||"number"==typeof e)n=GS(r=cM(e,t))?{type:e,exec:r}:r||{type:e,exec:void 0};else if(GS(e))n={type:e.name||e.toString(),exec:e};else{var r;if(GS(r=cM(e.type,t)))n=aS(aS({},e),{exec:r});else if(r){var o=r.type||e.type;n=aS(aS(aS({},r),e),{type:o})}else n=e}return n}var uM=function(e,t){return e?(ZS(e)?e:[e]).map((function(e){return dM(e,t)})):[]};function hM(e){var t=dM(e);return aS(aS({id:JS(e)?e:t.id},t),{type:t.type})}function pM(e,t){var n="".concat(iS.DoneState,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function fM(e,t){var n="".concat(iS.DoneInvoke,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function mM(e,t){var n="".concat(iS.ErrorPlatform,".").concat(e),r={type:n,data:t,toString:function(){return n}};return r}function gM(e,t,n,r,o,i,s){void 0===s&&(s=!1);var a=s?[]:function(e){var t,n,r=[];try{for(var o=cS(e),i=o.next();!i.done;i=o.next())for(var s=i.value,a=0;a<s.actions.length;)s.actions[a].type!==bS?a++:(r.push(s.actions[a]),s.actions.splice(a,1))}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}(o),l=a.length?US(n,r,a,t):n,c=s?[n]:void 0,d=[];function u(o,a){var u;switch(a.type){case fS:var h=function(e,t,n,r){var o,i={_event:n},s=tM(GS(e.event)?e.event(t,n.data,i):e.event);if(JS(e.delay)){var a=r&&r[e.delay];o=GS(a)?a(t,n.data,i):a}else o=GS(e.delay)?e.delay(t,n.data,i):e.delay;return aS(aS({},e),{type:fS,_event:s,delay:o})}(a,l,r,e.options.delays);return i&&"number"==typeof h.delay&&i(h,l,r),h;case mS:var p=function(e,t,n,r){var o,i={_event:n},s=tM(GS(e.event)?e.event(t,n.data,i):e.event);if(JS(e.delay)){var a=r&&r[e.delay];o=GS(a)?a(t,n.data,i):a}else o=GS(e.delay)?e.delay(t,n.data,i):e.delay;var l=GS(e.to)?e.to(t,n.data,i):e.to;return aS(aS({},e),{to:l,_event:s,event:s.data,delay:o})}(a,l,r,e.options.delays);if(!LS){var f=a.delay;KS(!JS(f)||"number"==typeof p.delay,"No delay reference for delay expression '".concat(f,"' was found on machine '").concat(e.id,"'"))}return i&&p.to!==sS.Internal&&("entry"===o?d.push(p):i(p,l,r)),p;case yS:var m=function(e,t,n){return aS(aS({},e),{value:JS(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})}(a,l,r);return null==i||i(m,l,r),m;case MS:if(!(y=null===(u=a.conds.find((function(n){var o=XS(n.cond,e.options.guards);return!o||rM(e,o,l,r,i?void 0:t)})))||void 0===u?void 0:u.actions))return[];var g=dS(gM(e,t,l,r,[{type:o,actions:uM(jS(y),e.options.actions)}],i,s),2),v=g[0],b=g[1];return l=b,null==c||c.push(l),v;case ES:var y;if(!(y=a.get(l,r.data)))return[];var w=dS(gM(e,t,l,r,[{type:o,actions:uM(jS(y),e.options.actions)}],i,s),2),C=w[0],x=w[1];return l=x,null==c||c.push(l),C;case pS:m=function(e,t,n){var r=GS(e.activity)?e.activity(t,n.data):e.activity,o="string"==typeof r?{id:r}:r;return{type:iS.Stop,activity:o}}(a,l,r);return null==i||i(m,n,r),m;case bS:l=US(l,r,[a],i?void 0:t),null==c||c.push(l);break;default:var k=dM(a,e.options.actions),$=k.exec;if(i)i(k,l,r);else if($&&c){var S=c.length-1,M=aS(aS({},k),{exec:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];$.apply(void 0,uS([c[S]],dS(t),!1))}});k=M}return k}}var h=_S(o.map((function(e){var t,n,o=[];try{for(var s=cS(e.actions),a=s.next();!a.done;a=s.next()){var c=a.value,h=u(e.type,c);h&&(o=o.concat(h))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return d.forEach((function(e){i(e,l,r)})),d.length=0,o})));return[h,l]}var vM=function(e,t){return t(e)};function bM(e){var t;return(t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}})[YS]=function(){return this},t}function yM(e,t,n){var r=bM(t);if(r.deferred=!0,QS(e)){var o=r.state=vM(void 0,(function(){return(n?e.withContext(n):e).initialState}));r.getSnapshot=function(){return o}}return r}var wM=function(e){return"atomic"===e.type||"final"===e.type};function CM(e){return Object.keys(e.states).map((function(t){return e.states[t]}))}function xM(e){return CM(e).filter((function(e){return"history"!==e.type}))}function kM(e){var t=[e];return wM(e)?t:t.concat(_S(xM(e).map(kM)))}function $M(e,t){var n,r,o,i,s,a,l,c,d=MM(new Set(e)),u=new Set(t);try{for(var h=cS(u),p=h.next();!p.done;p=h.next())for(var f=(k=p.value).parent;f&&!u.has(f);)u.add(f),f=f.parent}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var m=MM(u);try{for(var g=cS(u),v=g.next();!v.done;v=g.next()){if("compound"!==(k=v.value).type||m.get(k)&&m.get(k).length){if("parallel"===k.type)try{for(var b=(s=void 0,cS(xM(k))),y=b.next();!y.done;y=b.next()){var w=y.value;u.has(w)||(u.add(w),d.get(w)?d.get(w).forEach((function(e){return u.add(e)})):w.initialStateNodes.forEach((function(e){return u.add(e)})))}}catch(e){s={error:e}}finally{try{y&&!y.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}}else d.get(k)?d.get(k).forEach((function(e){return u.add(e)})):k.initialStateNodes.forEach((function(e){return u.add(e)}))}}catch(e){o={error:e}}finally{try{v&&!v.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}try{for(var C=cS(u),x=C.next();!x.done;x=C.next()){var k;for(f=(k=x.value).parent;f&&!u.has(f);)u.add(f),f=f.parent}}catch(e){l={error:e}}finally{try{x&&!x.done&&(c=C.return)&&c.call(C)}finally{if(l)throw l.error}}return u}function SM(e,t){var n=t.get(e);if(!n)return{};if("compound"===e.type){var r=n[0];if(!r)return{};if(wM(r))return r.key}var o={};return n.forEach((function(e){o[e.key]=SM(e,t)})),o}function MM(e){var t,n,r=new Map;try{for(var o=cS(e),i=o.next();!i.done;i=o.next()){var s=i.value;r.has(s)||r.set(s,[]),s.parent&&(r.has(s.parent)||r.set(s.parent,[]),r.get(s.parent).push(s))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}function EM(e,t){return SM(e,MM($M([e],t)))}function TM(e,t){return Array.isArray(e)?e.some((function(e){return e===t})):e instanceof Set&&e.has(t)}function OM(e,t){return"compound"===t.type?xM(t).some((function(t){return"final"===t.type&&TM(e,t)})):"parallel"===t.type&&xM(t).every((function(t){return OM(e,t)}))}function LM(e){return new Set(_S(e.map((function(e){return e.tags}))))}function AM(e,t){if(e===t)return!0;if(void 0===e||void 0===t)return!1;if(JS(e)||JS(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((function(n){return AM(e[n],t[n])}))}var RM=function(){function e(e){var t,n,r=this;this.actions=[],this.activities=TS,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||TS,this.meta=(void 0===(n=e.configuration)&&(n=[]),n.reduce((function(e,t){return void 0!==t.meta&&(e[t.id]=t.meta),e}),{})),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=null!==(t=Array.isArray(e.tags)?new Set(e.tags):e.tags)&&void 0!==t?t:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return function(e){return uS([],dS(new Set(_S(uS([],dS(e.map((function(e){return e.ownEvents}))),!1)))),!1)}(r.configuration)}})}return e.from=function(t,n){return t instanceof e?t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,events:[],configuration:[],transitions:[],children:{}}):t:new e({value:t,context:n,_event:lM,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=lM;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(e,t){var n=this;if(void 0===e&&(e=this.value),void 0===t&&(t="."),JS(e))return[e];var r=Object.keys(e);return r.concat.apply(r,uS([],dS(r.map((function(r){return n.toStrings(e[r],t).map((function(e){return r+t+e}))}))),!1))},e.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var t=e.tags;e.machine;var n=lS(e,["configuration","transitions","tags","machine"]);return aS(aS({},n),{tags:Array.from(t)})},e.prototype.matches=function(e){return AS(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){var t;LS&&KS(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var n=null===(t=this.machine)||void 0===t?void 0:t.getTransitionData(this,e);return!!(null==n?void 0:n.transitions.length)&&n.transitions.some((function(e){return void 0!==e.target||e.actions.length}))},e}(),NM={deferEvents:!1},DM=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=aS(aS({},NM),e)}return e.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents)return void this.schedule(e);this.process(e)}this.flushEvents()},e.prototype.schedule=function(e){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()}else this.queue.push(e)},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},e.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(e){throw this.clear(),e}finally{this.processingEvent=!1}},e}(),PM=new Map,IM=0,zM=function(){return"x:".concat(IM++)},VM=function(e,t){return PM.set(e,t),e},HM=function(e){return PM.get(e)},_M=function(e){PM.delete(e)};function BM(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void(LS||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}function jM(e){if(BM()){var t=function(){var e=BM();if(e&&"__xstate__"in e)return e.__xstate__}();t&&t.register(e)}}function FM(e,t){void 0===t&&(t={});var n=e.initialState,r=new Set,o=[],i=!1,s=function(e){var t;return aS(((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[YS]=function(){return this},t),e)}({id:t.id,send:function(t){o.push(t),function(){if(!i){for(i=!0;o.length>0;){var t=o.shift();n=e.transition(n,t,a),r.forEach((function(e){return e.next(n)}))}i=!1}}()},getSnapshot:function(){return n},subscribe:function(e,t,o){var i=iM(e,t,o);return r.add(i),i.next(n),{unsubscribe:function(){r.delete(i)}}}}),a={parent:t.parent,self:s,id:t.id||"anonymous",observers:r};return n=e.start?e.start(a):n,s}var qM,WM={sync:!1,autoForward:!1};!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(qM||(qM={}));var UM=function(){function e(t,n){void 0===n&&(n=e.defaultOptions);var r=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=qM.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(e,t){if(ZS(e))return r.batch(e),r.state;var n=tM(eM(e,t));if(r.status===qM.Stopped)return LS||KS(!1,'Event "'.concat(n.name,'" was sent to stopped service "').concat(r.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(n.data))),r.state;if(r.status!==qM.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(n.name,'" was sent to uninitialized service "').concat(r.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(n.data)));return r.scheduler.schedule((function(){r.forward(n);var e=r._nextState(n);r.update(e,n)})),r._state},this.sendTo=function(e,t,n){var o,i=r.parent&&(t===sS.Parent||r.parent.id===t),s=i?r.parent:JS(t)?t===sS.Internal?r:r.children.get(t)||HM(t):(o=t)&&"function"==typeof o.send?t:void 0;if(s)if("machine"in s){if(r.status!==qM.Stopped||r.parent!==s||r.state.done){var a=aS(aS({},e),{name:e.name===$S?"".concat(mM(r.id)):e.name,origin:r.sessionId});!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([s,a]):s.send(a)}}else!n&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([s,e.data]):s.send(e.data);else{if(!i)throw new Error("Unable to send event to child '".concat(t,"' from service '").concat(r.id,"'."));LS||KS(!1,"Service '".concat(r.id,"' has no parent: unable to send event ").concat(e.type))}},this._exec=function(e,t,n,o){void 0===o&&(o=r.machine.options.actions);var i=e.exec||cM(e.type,o),s=GS(i)?i:i?i.exec:e.exec;if(s)try{return s(t,n.data,r.machine.config.predictableActionArguments?{action:e,_event:n}:{action:e,state:r.state,_event:n})}catch(e){throw r.parent&&r.parent.send({type:"xstate.error",data:e}),e}switch(e.type){case fS:var a=e;r.defer(a);break;case mS:var l=e;if("number"==typeof l.delay)return void r.defer(l);l.to?r.sendTo(l._event,l.to,n===lM):r.send(l._event);break;case gS:r.cancel(e.sendId);break;case hS:if(r.status!==qM.Running)return;var c=e.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[c.id||c.type])break;if(c.type===iS.Invoke){var d=oM(c.src),u=r.machine.options.services?r.machine.options.services[d.type]:void 0,h=c.id,p=c.data;LS||KS(!("forward"in c),"`forward` property is deprecated (found in invocation of '".concat(c.src,"' in in machine '").concat(r.machine.id,"'). ")+"Please use `autoForward` instead.");var f="autoForward"in c?c.autoForward:!!c.forward;if(!u)return void(LS||KS(!1,"No service found for invocation '".concat(c.src,"' in machine '").concat(r.machine.id,"'.")));var m=p?FS(p,t,n):void 0;if("string"==typeof u)return;var g=GS(u)?u(t,n.data,{data:m,src:d,meta:c.meta}):u;if(!g)return;var v=void 0;QS(g)&&(g=m?g.withContext(m):g,v={autoForward:f}),r.spawn(g,h,v)}else r.spawnActivity(c);break;case pS:r.stopChild(e.activity.id);break;case yS:var b=e,y=b.label,w=b.value;y?r.logger(y,w):r.logger(w);break;default:LS||KS(!1,"No implementation found for action type '".concat(e.type,"'"))}};var o=aS(aS({},e.defaultOptions),n),i=o.clock,s=o.logger,a=o.parent,l=o.id,c=void 0!==l?l:t.id;this.id=c,this.logger=s,this.clock=i,this.parent=a,this.options=o,this.scheduler=new DM({deferEvents:this.options.deferEvents}),this.sessionId=zM()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:vM(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return LS||KS(this.status!==qM.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var n,r;try{for(var o=cS(e.actions),i=o.next();!i.done;i=o.next()){var s=i.value;this.exec(s,e,t)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype.update=function(e,t){var n,r,o,i,s,a,l,c,d=this;if(e._sessionid=this.sessionId,this._state=e,this.machine.config.predictableActionArguments&&t!==lM||!this.options.execute)for(var u=void 0;u=this._outgoingQueue.shift();)u[0].send(u[1]);else this.execute(this.state);if(this.children.forEach((function(e){d.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var h=cS(this.eventListeners),p=h.next();!p.done;p=h.next()){(0,p.value)(e.event)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}try{for(var f=cS(this.listeners),m=f.next();!m.done;m=f.next()){(0,m.value)(e,e.event)}}catch(e){o={error:e}}finally{try{m&&!m.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}try{for(var g=cS(this.contextListeners),v=g.next();!v.done;v=g.next()){(0,v.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(e){s={error:e}}finally{try{v&&!v.done&&(a=g.return)&&a.call(g)}finally{if(s)throw s.error}}if(this.state.done){var b=e.configuration.find((function(e){return"final"===e.type&&e.parent===d.machine})),y=b&&b.doneData?FS(b.doneData,e.context,t):void 0;this._doneEvent=fM(this.id,y);try{for(var w=cS(this.doneListeners),C=w.next();!C.done;C=w.next()){(0,C.value)(this._doneEvent)}}catch(e){l={error:e}}finally{try{C&&!C.done&&(c=w.return)&&c.call(w)}finally{if(l)throw l.error}}this._stop(),this._stopChildren(),_M(this.sessionId)}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===qM.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,n){var r=this,o=iM(e,t,n);this.listeners.add(o.next),this.status!==qM.NotStarted&&o.next(this.state);var i=function(){r.doneListeners.delete(i),r.stopListeners.delete(i),o.complete()};return this.status===qM.Stopped?o.complete():(this.onDone(i),this.onStop(i)),{unsubscribe:function(){r.listeners.delete(o.next),r.doneListeners.delete(i),r.stopListeners.delete(i)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.status===qM.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var t=this;if(this.status===qM.Running)return this;this.machine._init(),VM(this.sessionId,this),this.initialized=!0,this.status=qM.Running;var n=void 0===e?this.initialState:vM(this,(function(){return"object"==typeof(n=e)&&null!==n&&"value"in n&&"_event"in n?t.machine.resolveState(e):t.machine.resolveState(RM.from(e,t.machine.context));var n}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){t.update(n,lM)})),this},e.prototype._stopChildren=function(){this.children.forEach((function(e){GS(e.stop)&&e.stop()})),this.children.clear()},e.prototype._stop=function(){var e,t,n,r,o,i,s,a,l,c;try{for(var d=cS(this.listeners),u=d.next();!u.done;u=d.next()){var h=u.value;this.listeners.delete(h)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(t=d.return)&&t.call(d)}finally{if(e)throw e.error}}try{for(var p=cS(this.stopListeners),f=p.next();!f.done;f=p.next()){(h=f.value)(),this.stopListeners.delete(h)}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}try{for(var m=cS(this.contextListeners),g=m.next();!g.done;g=m.next()){h=g.value;this.contextListeners.delete(h)}}catch(e){o={error:e}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(o)throw o.error}}try{for(var v=cS(this.doneListeners),b=v.next();!b.done;b=v.next()){h=b.value;this.doneListeners.delete(h)}}catch(e){s={error:e}}finally{try{b&&!b.done&&(a=v.return)&&a.call(v)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=qM.Stopped,this._initialState=void 0;try{for(var y=cS(Object.keys(this.delayedEventsMap)),w=y.next();!w.done;w=y.next()){var C=w.value;this.clock.clearTimeout(this.delayedEventsMap[C])}}catch(e){l={error:e}}finally{try{w&&!w.done&&(c=y.return)&&c.call(y)}finally{if(l)throw l.error}}this.scheduler.clear(),this.scheduler=new DM({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var e=this,t=this.scheduler;return this._stop(),t.schedule((function(){var t;if(!(null===(t=e._state)||void 0===t?void 0:t.done)){var n=tM({type:"xstate.stop"}),r=vM(e,(function(){var t=_S(uS([],dS(e.state.configuration),!1).sort((function(e,t){return t.order-e.order})).map((function(t){return uM(t.onExit,e.machine.options.actions)}))),r=dS(gM(e.machine,e.state,e.state.context,n,[{type:"exit",actions:t}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),o=r[0],i=r[1],s=new RM({value:e.state.value,context:i,_event:n,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:o.filter((function(e){return!aM(e)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return s.changed=!0,s}));e.update(r,n),e._stopChildren(),_M(e.sessionId)}})),this},e.prototype.batch=function(e){var t=this;if(this.status===qM.NotStarted&&this.options.deferEvents)LS||KS(!1,"".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==qM.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(e.length){var n=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var r,o,i=t.state,s=!1,a=[],l=function(e){var r=tM(e);t.forward(r),i=vM(t,(function(){return t.machine.transition(i,r,void 0,n||void 0)})),a.push.apply(a,uS([],dS(t.machine.config.predictableActionArguments?i.actions:i.actions.map((function(e){return function(e,t){var n=e.exec;return aS(aS({},e),{exec:void 0!==n?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0})}(e,i)}))),!1)),s=s||!!i.changed};try{for(var c=cS(e),d=c.next();!d.done;d=c.next()){l(d.value)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}i.changed=s,i.actions=a,t.update(i,tM(e[e.length-1]))}))}},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype._nextState=function(e,t){var n=this;void 0===t&&(t=!!this.machine.config.predictableActionArguments&&this._exec);var r=tM(e);if(0===r.name.indexOf(kS)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(kS)})))throw r.data.data;return vM(this,(function(){return n.machine.transition(n.state,r,void 0,t||void 0)}))},e.prototype.nextState=function(e){return this._nextState(e,!1)},e.prototype.forward=function(e){var t,n;try{for(var r=cS(this.forwardTo),o=r.next();!o.done;o=r.next()){var i=o.value,s=this.children.get(i);if(!s)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(i,"'."));s.send(e)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this,n=this.clock.setTimeout((function(){"to"in e&&e.to?t.sendTo(e._event,e.to,!0):t.send(e._event)}),e.delay);e.id&&(this.delayedEventsMap[e.id]=n)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,n){void 0===n&&(n=this.machine.options.actions),this._exec(e,t.context,t._event,n)},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),null===(t=this.state)||void 0===t||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);t&&(this.removeChild(e),GS(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,n){if(this.status!==qM.Running)return yM(e,t);if(qS(e))return this.spawnPromise(Promise.resolve(e),t);if(GS(e))return this.spawnCallback(e,t);if(function(e){try{return"function"==typeof e.send}catch(e){return!1}}(o=e)&&"id"in o)return this.spawnActor(e,t);if(function(e){try{return"subscribe"in e&&GS(e.subscribe)}catch(e){return!1}}(e))return this.spawnObservable(e,t);if(QS(e))return this.spawnMachine(e,aS(aS({},n),{id:t}));if(null!==(r=e)&&"object"==typeof r&&"transition"in r&&"function"==typeof r.transition)return this.spawnBehavior(e,t);throw new Error('Unable to spawn entity "'.concat(t,'" of type "').concat(typeof e,'".'));var r,o},e.prototype.spawnMachine=function(t,n){var r=this;void 0===n&&(n={});var o=new e(t,aS(aS({},this.options),{parent:this,id:n.id||t.id})),i=aS(aS({},WM),n);i.sync&&o.onTransition((function(e){r.send(SS,{state:e,id:o.id})}));var s=o;return this.children.set(o.id,s),i.autoForward&&this.forwardTo.add(o.id),o.onDone((function(e){r.removeChild(o.id),r.send(tM(e,{origin:o.id}))})).start(),s},e.prototype.spawnBehavior=function(e,t){var n=FM(e,{id:t,parent:this});return this.children.set(t,n),n},e.prototype.spawnPromise=function(e,t){var n,r,o=this,i=!1;e.then((function(e){i||(r=e,o.removeChild(t),o.send(tM(fM(t,e),{origin:t})))}),(function(e){if(!i){o.removeChild(t);var n=mM(t,e);try{o.send(tM(n,{origin:t}))}catch(r){!function(e,t,n){if(!LS){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var o=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(o))}}}(e,r,t),o.devTools&&o.devTools.send(n,o.state),o.machine.strict&&o.stop()}}}));var s=((n={id:t,send:function(){},subscribe:function(t,n,r){var o=iM(t,n,r),i=!1;return e.then((function(e){i||(o.next(e),i||o.complete())}),(function(e){i||o.error(e)})),{unsubscribe:function(){return i=!0}}},stop:function(){i=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[YS]=function(){return this},n);return this.children.set(t,s),s},e.prototype.spawnCallback=function(e,t){var n,r,o,i=this,s=!1,a=new Set,l=new Set;try{o=e((function(e){r=e,l.forEach((function(t){return t(e)})),s||i.send(tM(e,{origin:t}))}),(function(e){a.add(e)}))}catch(e){this.send(mM(t,e))}if(qS(o))return this.spawnPromise(o,t);var c=((n={id:t,send:function(e){return a.forEach((function(t){return t(e)}))},subscribe:function(e){var t=iM(e);return l.add(t.next),{unsubscribe:function(){l.delete(t.next)}}},stop:function(){s=!0,GS(o)&&o()},toJSON:function(){return{id:t}},getSnapshot:function(){return r}})[YS]=function(){return this},n);return this.children.set(t,c),c},e.prototype.spawnObservable=function(e,t){var n,r,o=this,i=e.subscribe((function(e){r=e,o.send(tM(e,{origin:t}))}),(function(e){o.removeChild(t),o.send(tM(mM(t,e),{origin:t}))}),(function(){o.removeChild(t),o.send(tM(fM(t),{origin:t}))})),s=((n={id:t,send:function(){},subscribe:function(t,n,r){return e.subscribe(t,n,r)},stop:function(){return i.unsubscribe()},getSnapshot:function(){return r},toJSON:function(){return{id:t}}})[YS]=function(){return this},n);return this.children.set(t,s),s},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var n=t(this.state.context,e);this.spawnEffect(e.id,n)}else LS||KS(!1,"No implementation found for activity '".concat(e.type,"'"))},e.prototype.spawnEffect=function(e,t){var n;this.children.set(e,((n={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}})[YS]=function(){return this},n))},e.prototype.attachDev=function(){var e=BM();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(aS(aS({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:aS({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}jM(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[YS]=function(){return this},e.prototype.getSnapshot=function(){return this.status===qM.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},e.interpret=KM,e}();function KM(e,t){return new UM(e,t)}function ZM(e){if("string"==typeof e){var t={type:e,toString:function(){return e}};return t}return e}function GM(e){return aS(aS({type:CS},e),{toJSON:function(){e.onDone,e.onError;var t=lS(e,["onDone","onError"]);return aS(aS({},t),{type:CS,src:ZM(e.src)})}})}var JM="",XM="*",YM={},QM=function(e){return"#"===e[0]},eE=function(){function e(t,n,r,o){void 0===r&&(r="context"in t?t.context:void 0);var i,s=this;this.config=t,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},n),this.parent=null==o?void 0:o.parent,this.key=this.config.key||(null==o?void 0:o.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:"."),this.id=this.config.id||uS([this.machine.key],dS(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(i=this.config.schema)&&void 0!==i?i:{},this.description=this.config.description,LS||KS(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?IS(this.config.states,(function(t,n){var r,o=new e(t,{},void 0,{parent:s,key:n});return Object.assign(s.idMap,aS(((r={})[o.id]=o,r),o.idMap)),o})):YM;var a=0;!function e(t){var n,r;t.order=a++;try{for(var o=cS(CM(t)),i=o.next();!i.done;i=o.next()){e(i.value)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(e){return e.event===JM})):JM in this.config.on),this.strict=!!this.config.strict,this.onEntry=jS(this.config.entry||this.config.onEntry).map((function(e){return dM(e)})),this.onExit=jS(this.config.exit||this.config.onExit).map((function(e){return dM(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=jS(this.config.invoke).map((function(e,t){var n,r;if(QS(e)){var o=sM(s.id,t);return s.machine.options.services=aS(((n={})[o]=e,n),s.machine.options.services),GM({src:o,id:o})}if(JS(e.src)){o=e.id||sM(s.id,t);return GM(aS(aS({},e),{id:o,src:e.src}))}if(QS(e.src)||GS(e.src)){o=e.id||sM(s.id,t);return s.machine.options.services=aS(((r={})[o]=e.src,r),s.machine.options.services),GM(aS(aS({id:o},e),{src:o}))}var i=e.src;return GM(aS(aS({id:sM(s.id,t)},e),{src:i}))})),this.activities=jS(this.config.activities).concat(this.invoke).map((function(e){return hM(e)})),this.transition=this.transition.bind(this),this.tags=jS(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||kM(this).forEach((function(e){return e.on}))},e.prototype.withConfig=function(t,n){var r=this.options,o=r.actions,i=r.activities,s=r.guards,a=r.services,l=r.delays;return new e(this.config,{actions:aS(aS({},o),t.actions),activities:aS(aS({},i),t.activities),guards:aS(aS({},s),t.guards),services:aS(aS({},a),t.services),delays:aS(aS({},l),t.delays)},null!=n?n:this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return GS(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:IS(this.states,(function(e){return e.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce((function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===JM,n=this.transitions.filter((function(n){var r=n.eventType===e;return t?r:r||n.eventType===XM}));return this.__cache.candidates[e]=n,n},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var n=function(t,n){var r=function(e,t){var n=t?"#".concat(t):"";return"".concat(iS.After,"(").concat(e,")").concat(n)}(GS(t)?"".concat(e.id,":delay[").concat(n,"]"):t,e.id);return e.onEntry.push(function(e,t){return{to:t?t.to:void 0,type:mS,event:GS(e)?e:eM(e),delay:t?t.delay:void 0,id:t&&void 0!==t.id?t.id:GS(e)?e.name:RS(e)}}(r,{delay:t})),e.onExit.push({type:gS,sendId:r}),r},r=ZS(t)?t.map((function(e,t){var r=n(e.delay,t);return aS(aS({},e),{event:r})})):_S(Object.keys(t).map((function(e,r){var o=t[e],i=JS(o)?{target:o}:o,s=isNaN(+e)?e:+e,a=n(s,r);return jS(i).map((function(e){return aS(aS({},e),{event:a,delay:s})}))})));return r.map((function(t){var n=t.delay;return aS(aS({},e.formatTransition(t)),{delay:n})}))},e.prototype.getStateNodes=function(e){var t,n=this;if(!e)return[];var r=e instanceof RM?e.value:DS(e,this.delimiter);if(JS(r)){var o=this.getStateNode(r).initial;return void 0!==o?this.getStateNodes(((t={})[r]=o,t)):[this,this.states[r]]}var i=Object.keys(r),s=[this];return s.push.apply(s,uS([],dS(_S(i.map((function(e){return n.getStateNode(e).getStateNodes(r[e])})))),!1)),s},e.prototype.handles=function(e){var t=RS(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=e instanceof RM?e:RM.create(e),n=Array.from($M([],this.getStateNodes(t.value)));return new RM(aS(aS({},t),{value:this.resolve(t.value),configuration:n,done:OM(n,this),tags:LM(n),machine:this.machine}))},e.prototype.transitionLeafNode=function(e,t,n){var r=this.getStateNode(e).next(t,n);return r&&r.transitions.length?r:this.next(t,n)},e.prototype.transitionCompoundNode=function(e,t,n){var r=Object.keys(e),o=this.getStateNode(r[0])._transition(e[r[0]],t,n);return o&&o.transitions.length?o:this.next(t,n)},e.prototype.transitionParallelNode=function(e,t,n){var r,o,i={};try{for(var s=cS(Object.keys(e)),a=s.next();!a.done;a=s.next()){var l=a.value,c=e[l];if(c){var d=this.getStateNode(l)._transition(c,t,n);d&&(i[l]=d)}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}var u=Object.keys(i).map((function(e){return i[e]})),h=_S(u.map((function(e){return e.transitions})));if(!u.some((function(e){return e.transitions.length>0})))return this.next(t,n);var p=_S(Object.keys(i).map((function(e){return i[e].configuration})));return{transitions:h,exitSet:_S(u.map((function(e){return e.exitSet}))),configuration:p,source:t,actions:_S(Object.keys(i).map((function(e){return i[e].actions})))}},e.prototype._transition=function(e,t,n){return JS(e)?this.transitionLeafNode(e,t,n):1===Object.keys(e).length?this.transitionCompoundNode(e,t,n):this.transitionParallelNode(e,t,n)},e.prototype.getTransitionData=function(e,t){return this._transition(e.value,e,tM(t))},e.prototype.next=function(e,t){var n,r,o,i=this,s=t.name,a=[],l=[];try{for(var c=cS(this.getCandidates(s)),d=c.next();!d.done;d=c.next()){var u=d.value,h=u.cond,p=u.in,f=e.context,m=!p||(JS(p)&&QM(p)?e.matches(DS(this.getStateNodeById(p).path,this.delimiter)):AS(DS(p,this.delimiter),VS(this.path.slice(0,-2))(e.value))),g=!1;try{g=!h||rM(this.machine,h,f,t,e)}catch(e){throw new Error("Unable to evaluate guard '".concat(h.name||h.type,"' in transition for event '").concat(s,"' in state node '").concat(this.id,"':\n").concat(e.message))}if(g&&m){void 0!==u.target&&(l=u.target),a.push.apply(a,uS([],dS(u.actions),!1)),o=u;break}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}if(o){if(!l.length)return{transitions:[o],exitSet:[],configuration:e.value?[this]:[],source:e,actions:a};var v=_S(l.map((function(t){return i.getRelativeStateNodes(t,e.historyValue)})));return{transitions:[o],exitSet:!!o.internal?[]:_S(l.map((function(e){return i.getPotentiallyReenteringNodes(e)}))),configuration:v,source:e,actions:a}}},e.prototype.getPotentiallyReenteringNodes=function(e){if(this.order<e.order)return[this];for(var t=[],n=this,r=e;n&&n!==r;)t.push(n),n=n.parent;return n!==r?[]:(t.push(r),t)},e.prototype.getActions=function(e,t,n,r,o,i,s){var a,l,c,d,u=this,h=i?$M([],this.getStateNodes(i.value)):[],p=new Set;try{for(var f=cS(Array.from(e).sort((function(e,t){return e.order-t.order}))),m=f.next();!m.done;m=f.next()){(!TM(h,b=m.value)||TM(n.exitSet,b)||b.parent&&p.has(b.parent))&&p.add(b)}}catch(e){a={error:e}}finally{try{m&&!m.done&&(l=f.return)&&l.call(f)}finally{if(a)throw a.error}}try{for(var g=cS(h),v=g.next();!v.done;v=g.next()){var b;TM(e,b=v.value)&&!TM(n.exitSet,b.parent)||n.exitSet.push(b)}}catch(e){c={error:e}}finally{try{v&&!v.done&&(d=g.return)&&d.call(g)}finally{if(c)throw c.error}}n.exitSet.sort((function(e,t){return t.order-e.order}));var y=Array.from(p).sort((function(e,t){return e.order-t.order})),w=new Set(n.exitSet),C=_S(y.map((function(e){var t=[];if("final"!==e.type)return t;var i=e.parent;if(!i.parent)return t;t.push(pM(e.id,e.doneData),pM(i.id,e.doneData?FS(e.doneData,r,o):void 0));var s=i.parent;return"parallel"===s.type&&xM(s).every((function(e){return OM(n.configuration,e)}))&&t.push(pM(s.id)),t}))),x=y.map((function(e){var t=e.onEntry,n=e.activities.map((function(e){return function(e){var t=hM(e);return{type:iS.Start,activity:t,exec:void 0}}(e)}));return{type:"entry",actions:uM(s?uS(uS([],dS(t),!1),dS(n),!1):uS(uS([],dS(n),!1),dS(t),!1),u.machine.options.actions)}})).concat({type:"state_done",actions:C.map((function(e){return function(e,t){return{type:fS,event:"function"==typeof e?e:eM(e),delay:t?t.delay:void 0,id:null==t?void 0:t.id}}(e)}))}),k=Array.from(w).map((function(e){return{type:"exit",actions:uM(uS(uS([],dS(e.onExit),!1),dS(e.activities.map((function(e){return function(e){var t=GS(e)?e:hM(e);return{type:iS.Stop,activity:t,exec:void 0}}(e)}))),!1),u.machine.options.actions)}})).concat({type:"transition",actions:uM(n.actions,this.machine.options.actions)}).concat(x);if(t){var $=uM(_S(uS([],dS(e),!1).sort((function(e,t){return t.order-e.order})).map((function(e){return e.onExit}))),this.machine.options.actions).filter((function(e){return!aM(e)}));return k.concat({type:"stop",actions:$})}return k},e.prototype.transition=function(e,t,n,r){void 0===e&&(e=this.initialState);var o,i,s=tM(t);if(e instanceof RM)o=void 0===n?e:this.resolveState(RM.from(e,n));else{var a=JS(e)?this.resolve(PS(this.getResolvedPath(e))):this.resolve(e),l=null!=n?n:this.machine.context;o=this.resolveState(RM.from(a,l))}if(!LS&&s.name===XM)throw new Error("An event cannot have the wildcard type ('".concat(XM,"')"));if(this.strict&&!this.events.includes(s.name)&&(i=s.name,!/^(done|error)\./.test(i)))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(s.name,"'"));var c=this._transition(o.value,o,s)||{transitions:[],configuration:[],exitSet:[],source:o,actions:[]},d=$M([],this.getStateNodes(o.value)),u=c.configuration.length?$M(d,c.configuration):d;return c.configuration=uS([],dS(u),!1),this.resolveTransition(c,o,o.context,r,s)},e.prototype.resolveRaisedTransition=function(e,t,n,r){var o,i=e.actions;return(e=this.transition(e,t,void 0,r))._event=n,e.event=n.data,(o=e.actions).unshift.apply(o,uS([],dS(i),!1)),e},e.prototype.resolveTransition=function(e,t,n,r,o){var i,s,a,l,c=this;void 0===o&&(o=lM);var d=e.configuration,u=!t||e.transitions.length>0,h=u?e.configuration:t?t.configuration:[],p=OM(h,this),f=u?EM(this.machine,d):void 0,m=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,g=this.getActions(new Set(h),p,e,n,o,t,r),v=t?aS({},t.activities):{};try{for(var b=cS(g),y=b.next();!y.done;y=b.next()){var w=y.value;try{for(var C=(a=void 0,cS(w.actions)),x=C.next();!x.done;x=C.next()){var k=x.value;k.type===hS?v[k.activity.id||k.activity.type]=k:k.type===pS&&(v[k.activity.id||k.activity.type]=!1)}}catch(e){a={error:e}}finally{try{x&&!x.done&&(l=C.return)&&l.call(C)}finally{if(a)throw a.error}}}}catch(e){i={error:e}}finally{try{y&&!y.done&&(s=b.return)&&s.call(b)}finally{if(i)throw i.error}}var $,S,M=dS(gM(this,t,n,o,g,r,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),E=M[0],T=M[1],O=dS(function(e,t){var n,r,o=dS([[],[]],2),i=o[0],s=o[1];try{for(var a=cS(e),l=a.next();!l.done;l=a.next()){var c=l.value;t(c)?i.push(c):s.push(c)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return[i,s]}(E,aM),2),L=O[0],A=O[1],R=E.filter((function(e){var t;return e.type===hS&&(null===(t=e.activity)||void 0===t?void 0:t.type)===CS})),N=R.reduce((function(e,t){return e[t.activity.id]=function(e,t,n,r){var o,i=oM(e.src),s=null===(o=null==t?void 0:t.options.services)||void 0===o?void 0:o[i.type],a=e.data?FS(e.data,n,r):void 0,l=s?yM(s,e.id,a):bM(e.id);return l.meta=e,l}(t.activity,c.machine,T,o),e}),t?aS({},t.children):{}),D=new RM({value:f||t.value,context:T,_event:o,_sessionid:t?t._sessionid:null,historyValue:f?m?($=m,S=f,{current:S,states:WS($,S)}):void 0:t?t.historyValue:void 0,history:!f||e.source?t:void 0,actions:f?A:[],activities:f?v:t?t.activities:{},events:[],configuration:h,transitions:e.transitions,children:N,done:p,tags:LM(h),machine:this}),P=n!==T;D.changed=o.name===SS||P;var I=D.history;I&&delete I.history;var z=!p&&(this._transient||d.some((function(e){return e._transient})));if(!(u||z&&o.name!==JM))return D;var V=D;if(!p)for(z&&(V=this.resolveRaisedTransition(V,{type:vS},o,r));L.length;){var H=L.shift();V=this.resolveRaisedTransition(V,H._event,o,r)}var _=V.changed||(I?!!V.actions.length||P||typeof I.value!=typeof V.value||!AM(V.value,I.value):void 0);return V.changed=_,V.history=I,V},e.prototype.getStateNode=function(e){if(QM(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var t=this.states[e];if(!t)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return t},e.prototype.getStateNodeById=function(e){var t=QM(e)?e.slice(1):e;if(t===this.id)return this;var n=this.machine.idMap[t];if(!n)throw new Error("Child state node '#".concat(t,"' does not exist on machine '").concat(this.id,"'"));return n},e.prototype.getStateNodeByPath=function(e){if("string"==typeof e&&QM(e))try{return this.getStateNodeById(e.slice(1))}catch(e){}for(var t=NS(e,this.delimiter).slice(),n=this;t.length;){var r=t.shift();if(!r.length)break;n=n.getStateNode(r)}return n},e.prototype.resolve=function(e){var t,n=this;if(!e)return this.initialStateValue||YM;switch(this.type){case"parallel":return IS(this.initialStateValue,(function(t,r){return t?n.getStateNode(r).resolve(e[r]||t):YM}));case"compound":if(JS(e)){var r=this.getStateNode(e);return"parallel"===r.type||"compound"===r.type?((t={})[e]=r.initialStateValue,t):e}return Object.keys(e).length?IS(e,(function(e,t){return e?n.getStateNode(t).resolve(e):YM})):this.initialStateValue||{};default:return e||YM}},e.prototype.getResolvedPath=function(e){if(QM(e)){var t=this.machine.idMap[e.slice(1)];if(!t)throw new Error("Unable to find state node '".concat(e,"'"));return t.path}return NS(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e,t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)t=zS(this.states,(function(e){return e.initialStateValue||YM}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));t=wM(this.states[this.initial])?this.initial:((e={})[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){this._init();var n=this.getStateNodes(e);return this.resolveTransition({configuration:n,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=t?t:this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if("history"===this.type){var t=this.config;e=JS(t.target)&&QM(t.target)?PS(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,n){return void 0===n&&(n=!0),n?"history"===e.type?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;return wM(this)?[this]:"compound"!==this.type||this.initial?_S(HS(this.initialStateValue).map((function(t){return e.getFromRelativePath(t)}))):(LS||KS(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this])},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=dS(e),n=t[0],r=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(n,"' from node with no states"));var o=this.getStateNode(n);if("history"===o.type)return o.resolveHistory();if(!this.states[n])throw new Error("Child state '".concat(n,"' does not exist on '").concat(this.id,"'"));return this.states[n].getFromRelativePath(r)},e.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:zS(this.states,(function(t,n){if(!e)return t.historyValue();var r=JS(e)?void 0:e[n];return t.historyValue(r||t.initialStateValue)}),(function(e){return!e.history}))}},e.prototype.resolveHistory=function(e){var t=this;if("history"!==this.type)return[this];var n=this.parent;if(!e){var r=this.target;return r?_S(HS(r).map((function(e){return n.getFromRelativePath(e)}))):n.initialStateNodes}var o,i,s=(o=n.path,i="states",function(e){var t,n,r=e;try{for(var s=cS(o),a=s.next();!a.done;a=s.next()){var l=a.value;r=r[i][l]}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return r})(e).current;return JS(s)?[n.getStateNode(s)]:_S(HS(s).map((function(e){return"deep"===t.history?n.getFromRelativePath(e):[n.states[e[0]]]})))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=_S(Object.keys(this.states).map((function(t){return e.states[t].stateIds})));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,n,r;if(this.__cache.events)return this.__cache.events;var o=this.states,i=new Set(this.ownEvents);if(o)try{for(var s=cS(Object.keys(o)),a=s.next();!a.done;a=s.next()){var l=o[a.value];if(l.states)try{for(var c=(n=void 0,cS(l.events)),d=c.next();!d.done;d=c.next()){var u=d.value;i.add("".concat(u))}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(i)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter((function(e){return!(!e.target&&!e.actions.length&&e.internal)})).map((function(e){return e.eventType})));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(void 0!==e)return e.map((function(e){if(!JS(e))return e;var n=e[0]===t.delimiter;if(n&&!t.parent)return t.getStateNodeByPath(e.slice(1));var r=n?t.key+e:e;if(!t.parent)return t.getStateNodeByPath(r);try{return t.parent.getStateNodeByPath(r)}catch(e){throw new Error("Invalid transition definition for state node '".concat(t.id,"':\n").concat(e.message))}}))},e.prototype.formatTransition=function(e){var t=this,n=function(e){if(void 0!==e&&""!==e)return jS(e)}(e.target),r="internal"in e?e.internal:!n||n.some((function(e){return JS(e)&&e[0]===t.delimiter})),o=this.machine.options.guards,i=this.resolveTarget(n),s=aS(aS({},e),{actions:uM(jS(e.actions)),cond:XS(e.cond,o),target:i,source:this,internal:r,eventType:e.event,toJSON:function(){return aS(aS({},s),{target:s.target?s.target.map((function(e){return"#".concat(e.id)})):void 0,source:"#".concat(t.id)})}});return s},e.prototype.formatTransitions=function(){var e,t,n,r=this;if(this.config.on)if(Array.isArray(this.config.on))n=this.config.on;else{var o=this.config.on,i=XM,s=o[i],a=void 0===s?[]:s,l=lS(o,["*"]);n=_S(Object.keys(l).map((function(e){LS||e!==JM||KS(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(r.id,'".'));var t=nM(e,l[e]);return LS||function(e,t,n){var r=n.slice(0,-1).some((function(e){return!("cond"in e)&&!("in"in e)&&(JS(e.target)||QS(e.target))})),o=t===JM?"the transient event":"event '".concat(t,"'");KS(!r,"One or more transitions for ".concat(o," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")}(r,e,t),t})).concat(nM(XM,a)))}else n=[];var c=this.config.always?nM("",this.config.always):[],d=this.config.onDone?nM(String(pM(this.id)),this.config.onDone):[];LS||KS(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var u=_S(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,uS([],dS(nM(String(fM(e.id)),e.onDone)),!1)),e.onError&&t.push.apply(t,uS([],dS(nM(String(mM(e.id)),e.onError)),!1)),t}))),h=this.after,p=_S(uS(uS(uS(uS([],dS(d),!1),dS(u),!1),dS(n),!1),dS(c),!1).map((function(e){return jS(e).map((function(e){return r.formatTransition(e)}))})));try{for(var f=cS(h),m=f.next();!m.done;m=f.next()){var g=m.value;p.push(g)}}catch(t){e={error:t}}finally{try{m&&!m.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}return p},e}();var tE,nE=function(e){return{type:bS,assignment:e}};!function(e){e[e.Effect=1]="Effect",e[e.LayoutEffect=2]="LayoutEffect"}(tE||(tE={}));var rE="undefined"!=typeof document?ue:function(){};function oE(e){var t=te.useRef();return t.current||(t.current={v:e()}),t.current.v}var iE=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},sE=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};var aE=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},lE=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function cE(e,t){(0,e.exec)(t.context,t._event.data,{action:e,state:t,_event:t._event})()}function dE(e){var t=ae([]),n=ae([]);rE((function(){var r=e.subscribe((function(e){var r,o;if(e.actions.length){var i=e.actions.filter((function(e){return"function"==typeof e.exec&&"__effect"in e.exec})),s=aE(function(e,t){var n,r,o=iE([[],[]],2),i=o[0],s=o[1];try{for(var a=sE(e),l=a.next();!l.done;l=a.next()){var c=l.value;t(c)?i.push(c):s.push(c)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return[i,s]}(i,(function(e){return e.exec.__effect===tE.Effect})),2),a=s[0],l=s[1];(r=t.current).push.apply(r,lE([],aE(a.map((function(t){return[t,e]}))),!1)),(o=n.current).push.apply(o,lE([],aE(l.map((function(t){return[t,e]}))),!1))}}));return function(){r.unsubscribe()}}),[]),rE((function(){for(;n.current.length;){var e=aE(n.current.shift(),2);cE(e[0],e[1])}})),de((function(){for(;t.current.length;){var e=aE(t.current.shift(),2);cE(e[0],e[1])}}))}var uE=function(){return uE=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},uE.apply(this,arguments)},hE=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},pE=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s};var fE=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s};function mE(e,t){void 0===t&&(t={});var n=fe((function(e){var t=void 0===e.changed&&Object.keys(e.children).length;(e.changed||t)&&s(e)}),[]),r=function(e,t,n){void 0===t&&(t={});var r=oE((function(){return"function"==typeof e?e():e}));if("production"!==process.env.NODE_ENV&&"function"!=typeof e){var o=pE(le(r),1)[0];e!==o&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var i=t.context,s=t.guards,a=t.actions,l=t.activities,c=t.services,d=t.delays,u=t.state,h=hE(t,["context","guards","actions","activities","services","delays","state"]),p=oE((function(){var e={context:i,guards:s,actions:a,activities:l,services:c,delays:d};return KM(r.withConfig(e,(function(){return uE(uE({},r.context),i)})),uE({deferEvents:!0},h))}));return rE((function(){var e;return n&&(e=p.subscribe(function(e){if("object"==typeof e)return e;var t=function(){};return{next:e,error:void 0||t,complete:void 0||t}}(n))),function(){null==e||e.unsubscribe()}}),[n]),rE((function(){return p.start(u?RM.create(u):void 0),function(){p.stop()}}),[]),rE((function(){Object.assign(p.machine.options.actions,a),Object.assign(p.machine.options.guards,s),Object.assign(p.machine.options.activities,l),Object.assign(p.machine.options.services,c),Object.assign(p.machine.options.delays,d)}),[a,s,l,c,d]),dE(p),p}(e,t,n),o=fE(le((function(){var e=r.machine.initialState;return t.state?RM.create(t.state):e})),2),i=o[0],s=o[1];return[i,r.send,r]}function gE(){return gE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gE.apply(null,arguments)}function vE(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}const bE={arr:Array.isArray,obj:e=>"[object Object]"===Object.prototype.toString.call(e),fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e,nul:e=>null===e,set:e=>e instanceof Set,map:e=>e instanceof Map,equ(e,t){if(typeof e!=typeof t)return!1;if(bE.str(e)||bE.num(e))return e===t;if(bE.obj(e)&&bE.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;let n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!bE.und(n)||e===t}};function yE(e,t){return bE.und(e)||bE.nul(e)?t:e}function wE(e){return bE.und(e)?[]:bE.arr(e)?e:[e]}function CE(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return bE.fun(e)?e(...n):e}function xE(e){const t=function(e){return e.to,e.from,e.config,e.onStart,e.onRest,e.onFrame,e.children,e.reset,e.reverse,e.force,e.immediate,e.delay,e.attach,e.destroyed,e.interpolateTo,e.ref,e.lazy,vE(e,["to","from","config","onStart","onRest","onFrame","children","reset","reverse","force","immediate","delay","attach","destroyed","interpolateTo","ref","lazy"])}(e);if(bE.und(t))return gE({to:t},e);const n=Object.keys(e).reduce(((n,r)=>bE.und(t[r])?gE({},n,{[r]:e[r]}):n),{});return gE({to:t},n)}class kE{constructor(){this.payload=void 0,this.children=[]}getAnimatedValue(){return this.getValue()}getPayload(){return this.payload||this}attach(){}detach(){}getChildren(){return this.children}addChild(e){0===this.children.length&&this.attach(),this.children.push(e)}removeChild(e){const t=this.children.indexOf(e);this.children.splice(t,1),0===this.children.length&&this.detach()}}class $E extends kE{constructor(){super(...arguments),this.payload=[],this.attach=()=>this.payload.forEach((e=>e instanceof kE&&e.addChild(this))),this.detach=()=>this.payload.forEach((e=>e instanceof kE&&e.removeChild(this)))}}class SE extends kE{constructor(){super(...arguments),this.payload={},this.attach=()=>Object.values(this.payload).forEach((e=>e instanceof kE&&e.addChild(this))),this.detach=()=>Object.values(this.payload).forEach((e=>e instanceof kE&&e.removeChild(this)))}getValue(e){void 0===e&&(e=!1);const t={};for(const n in this.payload){const r=this.payload[n];(!e||r instanceof kE)&&(t[n]=r instanceof kE?r[e?"getAnimatedValue":"getValue"]():r)}return t}getAnimatedValue(){return this.getValue(!0)}}let ME,EE;let TE,OE=e=>"undefined"!=typeof window?window.requestAnimationFrame(e):-1;let LE,AE=()=>Date.now();class RE extends SE{constructor(e,t){super(),this.update=void 0,this.payload=e.style?gE({},e,{style:LE(e.style)}):e,this.update=t,this.attach()}}let NE=!1;const DE=new Set,PE=()=>{if(!NE)return!1;let e=AE();for(let t of DE){let n=!1;for(let r=0;r<t.configs.length;r++){let o,i,s=t.configs[r];for(let t=0;t<s.animatedValues.length;t++){let r=s.animatedValues[t];if(r.done)continue;let a=s.fromValues[t],l=s.toValues[t],c=r.lastPosition,d=l instanceof kE,u=Array.isArray(s.initialVelocity)?s.initialVelocity[t]:s.initialVelocity;if(d&&(l=l.getValue()),s.immediate)r.setValue(l),r.done=!0;else if("string"!=typeof a&&"string"!=typeof l){if(void 0!==s.duration)c=a+s.easing((e-r.startTime)/s.duration)*(l-a),o=e>=r.startTime+s.duration;else if(s.decay)c=a+u/(1-.998)*(1-Math.exp(-.0020000000000000018*(e-r.startTime))),o=Math.abs(r.lastPosition-c)<.1,o&&(l=c);else{i=void 0!==r.lastTime?r.lastTime:e,u=void 0!==r.lastVelocity?r.lastVelocity:s.initialVelocity,e>i+64&&(i=e);let t=Math.floor(e-i);for(let e=0;e<t;++e){u+=1*((-s.tension*(c-l)+-s.friction*u)/s.mass)/1e3,c+=1*u/1e3}let n=!(!s.clamp||0===s.tension)&&(a<l?c>l:c<l),d=Math.abs(u)<=s.precision,h=0===s.tension||Math.abs(l-c)<=s.precision;o=n||d&&h,r.lastVelocity=u,r.lastTime=e}d&&!s.toValues[t].done&&(o=!1),o?(r.value!==l&&(c=l),r.done=!0):n=!0,r.setValue(c),r.lastPosition=c}else r.setValue(l),r.done=!0}t.props.onFrame&&(t.values[s.name]=s.interpolation.getValue())}t.props.onFrame&&t.props.onFrame(t.values),n||(DE.delete(t),t.stop(!0))}return DE.size?OE(PE):NE=!1,NE};function IE(e,t,n){if("function"==typeof e)return e;if(Array.isArray(e))return IE({range:e,output:t,extrapolate:n});if(TE&&"string"==typeof e.output[0])return TE(e);const r=e,o=r.output,i=r.range||[0,1],s=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",l=r.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,i);return function(e,t,n,r,o,i,s,a,l){let c=l?l(e):e;if(c<t){if("identity"===s)return c;"clamp"===s&&(c=t)}if(c>n){if("identity"===a)return c;"clamp"===a&&(c=n)}if(r===o)return r;if(t===n)return e<=t?r:o;t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t);c=i(c),r===-1/0?c=-c:o===1/0?c+=r:c=c*(o-r)+r;return c}(e,i[t],i[t+1],o[t],o[t+1],l,s,a,r.map)}}class zE extends $E{constructor(e,t,n,r){super(),this.calc=void 0,this.payload=e instanceof $E&&!(e instanceof zE)?e.getPayload():Array.isArray(e)?e:[e],this.calc=IE(t,n,r)}getValue(){return this.calc(...this.payload.map((e=>e.getValue())))}updateConfig(e,t,n){this.calc=IE(e,t,n)}interpolate(e,t,n){return new zE(this,e,t,n)}}const VE=(e,t,n)=>e&&new zE(e,t,n);function HE(e,t){"update"in e?t.add(e):e.getChildren().forEach((e=>HE(e,t)))}class _E extends kE{constructor(e){var t;super(),t=this,this.animatedStyles=new Set,this.value=void 0,this.startPosition=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.startTime=void 0,this.lastTime=void 0,this.done=!1,this.setValue=function(e,n){void 0===n&&(n=!0),t.value=e,n&&t.flush()},this.value=e,this.startPosition=e,this.lastPosition=e}flush(){0===this.animatedStyles.size&&HE(this,this.animatedStyles),this.animatedStyles.forEach((e=>e.update()))}clearStyles(){this.animatedStyles.clear()}getValue(){return this.value}interpolate(e,t,n){return new zE(this,e,t,n)}}class BE extends $E{constructor(e){super(),this.payload=e.map((e=>new _E(e)))}setValue(e,t){void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach(((e,n)=>this.payload[n].setValue(e,t))):this.payload.forEach((n=>n.setValue(e,t)))}getValue(){return this.payload.map((e=>e.getValue()))}interpolate(e,t){return new zE(this,e,t)}}let jE=0,FE=class{constructor(){this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=()=>this.interpolations,this.id=jE++}update(e){if(!e)return this;const t=xE(e),n=t.delay,r=void 0===n?0:n,o=t.to,i=vE(t,["delay","to"]);if(bE.arr(o)||bE.fun(o))this.queue.push(gE({},i,{delay:r,to:o}));else if(o){let e={};Object.entries(o).forEach((t=>{let n=t[0],o=t[1];const s=gE({to:{[n]:o},delay:CE(r,n)},i),a=e[s.delay]&&e[s.delay].to;e[s.delay]=gE({},e[s.delay],s,{to:gE({},a,s.to)})})),this.queue=Object.values(e)}return this.queue=this.queue.sort(((e,t)=>e.delay-t.delay)),this.diff(i),this}start(e){if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((e=>{let t=e.from,n=void 0===t?{}:t,r=e.to,o=void 0===r?{}:r;bE.obj(n)&&(this.merged=gE({},n,this.merged)),bE.obj(o)&&(this.merged=gE({},this.merged,o))}));const t=this.local=++this.guid,n=this.localQueue=this.queue;this.queue=[],n.forEach(((r,o)=>{let i=r.delay,s=vE(r,["delay"]);const a=r=>{o===n.length-1&&t===this.guid&&r&&(this.idle=!0,this.props.onRest&&this.props.onRest(this.merged)),e&&e()};let l=bE.arr(s.to)||bE.fun(s.to);i?setTimeout((()=>{t===this.guid&&(l?this.runAsync(s,a):this.diff(s).start(a))}),i):l?this.runAsync(s,a):this.diff(s).start(a)}))}else bE.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,DE.has(t)||DE.add(t),NE||(NE=!0,OE(PE));var t;return this}stop(e){return this.listeners.forEach((t=>t(e))),this.listeners=[],this}pause(e){var t;return this.stop(!0),e&&(t=this,DE.has(t)&&DE.delete(t)),this}runAsync(e,t){var n=this;e.delay;let r=vE(e,["delay"]);const o=this.local;let i=Promise.resolve(void 0);if(bE.arr(r.to))for(let e=0;e<r.to.length;e++){const t=e,n=gE({},r,xE(r.to[t]));bE.arr(n.config)&&(n.config=n.config[t]),i=i.then((()=>{if(o===this.guid)return new Promise((e=>this.diff(n).start(e)))}))}else if(bE.fun(r.to)){let e,t=0;i=i.then((()=>r.to((n=>{const i=gE({},r,xE(n));if(bE.arr(i.config)&&(i.config=i.config[t]),t++,o===this.guid)return e=new Promise((e=>this.diff(i).start(e)))}),(function(e){return void 0===e&&(e=!0),n.stop(e)})).then((()=>e))))}i.then(t)}diff(e){this.props=gE({},this.props,e);let t=this.props,n=t.from,r=void 0===n?{}:n,o=t.to,i=void 0===o?{}:o,s=t.config,a=void 0===s?{}:s,l=t.reverse,c=t.attach,d=t.reset,u=t.immediate;if(l){var h=[i,r];r=h[0],i=h[1]}this.merged=gE({},r,this.merged,i),this.hasChanged=!1;let p=c&&c(this);if(this.animations=Object.entries(this.merged).reduce(((e,t)=>{let n=t[0],o=t[1],i=e[n]||{};const s=bE.num(o),l=bE.str(o)&&!o.startsWith("#")&&!/\d/.test(o)&&!EE[o],c=bE.arr(o),h=!s&&!c&&!l;let f=bE.und(r[n])?o:r[n],m=s||c||l?o:1,g=CE(a,n);p&&(m=p.animations[n].parent);let v,b=i.parent,y=i.interpolation,w=wE(p?m.getPayload():m),C=o;h&&(C=TE({range:[0,1],output:[o,o]})(1));let x=y&&y.getValue();const k=!bE.und(b)&&i.animatedValues.some((e=>!e.done)),$=!bE.equ(C,x),S=!bE.equ(C,i.previous),M=!bE.equ(g,i.config);if(d||S&&$||M){if(s||l)b=y=i.parent||new _E(f);else if(c)b=y=i.parent||new BE(f);else if(h){let e=i.interpolation&&i.interpolation.calc(i.parent.value);e=void 0===e||d?f:e,i.parent?(b=i.parent,b.setValue(0,!1)):b=new _E(0);const t={output:[e,o]};i.interpolation?(y=i.interpolation,i.interpolation.updateConfig(t)):y=b.interpolate(t)}return w=wE(p?m.getPayload():m),v=wE(b.getPayload()),d&&!h&&b.setValue(f,!1),this.hasChanged=!0,v.forEach((e=>{e.startPosition=e.value,e.lastPosition=e.value,e.lastVelocity=k?e.lastVelocity:void 0,e.lastTime=k?e.lastTime:void 0,e.startTime=AE(),e.done=!1,e.animatedStyles.clear()})),CE(u,n)&&b.setValue(h?m:o,!1),gE({},e,{[n]:gE({},i,{name:n,parent:b,interpolation:y,animatedValues:v,toValues:w,previous:C,config:g,fromValues:wE(b.getValue()),immediate:CE(u,n),initialVelocity:yE(g.velocity,0),clamp:yE(g.clamp,!1),precision:yE(g.precision,.01),tension:yE(g.tension,170),friction:yE(g.friction,26),mass:yE(g.mass,1),duration:g.duration,easing:yE(g.easing,(e=>e)),decay:g.decay})})}return $?e:(h&&(b.setValue(1,!1),y.updateConfig({output:[C,C]})),b.done=!0,this.hasChanged=!0,gE({},e,{[n]:gE({},e[n],{previous:C})}))}),this.animations),this.hasChanged){this.configs=Object.values(this.animations),this.values={},this.interpolations={};for(let e in this.animations)this.interpolations[e]=this.animations[e].interpolation,this.values[e]=this.animations[e].interpolation.getValue()}return this}destroy(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0}};const qE=e=>{const t=bE.fun(e),n=((e,t)=>{const n=ae(!1),r=ae(),o=bE.fun(t),i=ie((()=>{let n;return r.current&&(r.current.map((e=>e.destroy())),r.current=void 0),[new Array(e).fill().map(((e,r)=>{const i=new FE,s=o?CE(t,r,i):t[r];return 0===r&&(n=s.ref),i.update(s),n||i.start(),i})),n]}),[e]),s=i[0],a=i[1];r.current=s,ge(a,(()=>({start:()=>Promise.all(r.current.map((e=>new Promise((t=>e.start(t)))))),stop:e=>r.current.forEach((t=>t.stop(e))),get controllers(){return r.current}})));const l=ie((()=>e=>r.current.map(((t,n)=>{t.update(o?CE(e,n,t):e[n]),a||t.start()}))),[e]);de((()=>{n.current?o||l(t):a||r.current.forEach((e=>e.start()))})),de((()=>(n.current=!0,()=>r.current.forEach((e=>e.destroy())))),[]);const c=r.current.map((e=>e.getValues()));return o?[c,l,e=>r.current.forEach((t=>t.pause(e)))]:c})(1,t?e:[e]),r=n[0],o=n[1],i=n[2];return t?[r[0],o,i]:r};class WE extends SE{constructor(e){void 0===e&&(e={}),super(),!e.transform||e.transform instanceof kE||(e=ME.transform(e)),this.payload=e}}const UE={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},KE="[-+]?\\d*\\.?\\d+",ZE=KE+"%";function GE(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}const JE=new RegExp("rgb"+GE(KE,KE,KE)),XE=new RegExp("rgba"+GE(KE,KE,KE,KE)),YE=new RegExp("hsl"+GE(KE,ZE,ZE)),QE=new RegExp("hsla"+GE(KE,ZE,ZE,KE)),eT=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,tT=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,nT=/^#([0-9a-fA-F]{6})$/,rT=/^#([0-9a-fA-F]{8})$/;function oT(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function iT(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=oT(o,r,e+1/3),s=oT(o,r,e),a=oT(o,r,e-1/3);return Math.round(255*i)<<24|Math.round(255*s)<<16|Math.round(255*a)<<8}function sT(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function aT(e){return(parseFloat(e)%360+360)%360/360}function lT(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function cT(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function dT(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=nT.exec(e))?parseInt(t[1]+"ff",16)>>>0:UE.hasOwnProperty(e)?UE[e]:(t=JE.exec(e))?(sT(t[1])<<24|sT(t[2])<<16|sT(t[3])<<8|255)>>>0:(t=XE.exec(e))?(sT(t[1])<<24|sT(t[2])<<16|sT(t[3])<<8|lT(t[4]))>>>0:(t=eT.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=rT.exec(e))?parseInt(t[1],16)>>>0:(t=tT.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=YE.exec(e))?(255|iT(aT(t[1]),cT(t[2]),cT(t[3])))>>>0:(t=QE.exec(e))?(iT(aT(t[1]),cT(t[2]),cT(t[3]))|lT(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const uT=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,hT=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,pT=new RegExp(`(${Object.keys(UE).join("|")})`,"g");let fT={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const mT=["Webkit","Ms","Moz","O"];function gT(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||fT.hasOwnProperty(e)&&fT[e]?(""+t).trim():t+"px"}fT=Object.keys(fT).reduce(((e,t)=>(mT.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),fT);const vT={};var bT,yT;bT=e=>new WE(e),LE=bT,yT=e=>{const t=e.output.map((e=>e.replace(hT,dT))).map((e=>e.replace(pT,dT))),n=t[0].match(uT).map((()=>[]));t.forEach((e=>{e.match(uT).forEach(((e,t)=>n[t].push(+e)))}));const r=t[0].match(uT).map(((t,r)=>IE(gE({},e,{output:n[r]}))));return e=>{let n=0;return t[0].replace(uT,(()=>r[n++](e))).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,((e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`))}},TE=yT,EE=UE,function(e,t){ME={fn:e,transform:t}}(((e,t)=>{if(!e.nodeType||void 0===e.setAttribute)return!1;{const o=t.style,i=t.children,s=t.scrollTop,a=t.scrollLeft,l=vE(t,["style","children","scrollTop","scrollLeft"]),c="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;void 0!==s&&(e.scrollTop=s),void 0!==a&&(e.scrollLeft=a),void 0!==i&&(e.textContent=i);for(let t in o)if(o.hasOwnProperty(t)){var n=0===t.indexOf("--"),r=gT(t,o[t],n);"float"===t&&(t="cssFloat"),n?e.style.setProperty(t,r):e.style[t]=r}for(let t in l){const n=c?t:vT[t]||(vT[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())));void 0!==e.getAttribute(n)&&e.setAttribute(n,l[t])}}}),(e=>e));var wT;const CT=(wT=e=>se(((t,n)=>{const r=function(){const e=le(!1)[1];return fe((()=>e((e=>!e))),[])}(),o=ae(!0),i=ae(null),s=ae(null),a=fe((e=>{const t=i.current;i.current=new RE(e,(()=>{let e=!1;s.current&&(e=ME.fn(s.current,i.current.getAnimatedValue())),s.current&&!1!==e||r()})),t&&t.detach()}),[]);de((()=>()=>{o.current=!1,i.current&&i.current.detach()}),[]),ge(n,(()=>(e=>e.current)(s))),a(t);const l=i.current.getValue();l.scrollTop,l.scrollLeft;const c=vE(l,["scrollTop","scrollLeft"]),d=(u=e,!bE.fun(u)||u.prototype instanceof ne.Component?e=>s.current=function(e,t){return t&&(bE.fun(t)?t(e):bE.obj(t)&&(t.current=e)),e}(e,n):void 0);var u;return ne.createElement(e,gE({},c,{ref:d}))})),e=>(bE.arr(e)?e:Object.keys(e)).reduce(((e,t)=>{const n=t;return e[n]=wT(n),e}),wT))(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]);function xT(e,t){return e.map((function(e,n){return e+t[n]}))}function kT(e,t){return e.map((function(e,n){return e-t[n]}))}function $T(e){return Math.hypot.apply(Math,e)}function ST(e){return Math.sign?Math.sign(e):Number(e>0)-Number(e<0)||+e}function MT(e,t,n){return 0===t||Math.abs(t)===1/0?function(e,t){return Math.pow(e,5*t)}(e,n):e*t*n/(t+n*e)}function ET(e,t,n,r){return void 0===r&&(r=.15),0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-MT(t-e,n-t,r)+t:e>n?+MT(e-n,n-t,r)+n:e}function TT(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function OT(){return OT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OT.apply(this,arguments)}function LT(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function AT(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NT(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return RT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?RT(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function DT(){}function PT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?DT:1===t.length?t[0]:function(){for(var e,n,r=NT(t);!(n=r()).done;){e=n.value.apply(this,arguments)||e}return e}}function IT(e,t){if(void 0===e){if(void 0===t)throw new Error("Must define fallback value if undefined is expected");e=t}return Array.isArray(e)?e:[e,e]}function zT(e){if("function"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(void 0,n)}return e}function VT(e,t){void 0===e&&(e={});for(var n={},r=0,o=Object.entries(t);r<o.length;r++){var i=o[r],s=i[0],a=i[1];switch(typeof a){case"function":n[s]=a.call(n,e[s],s,e);break;case"object":n[s]=VT(e[s],a);break;case"boolean":a&&(n[s]=e[s])}}return n}var HT=OT({},{threshold:function(e){return void 0===e&&(e=0),IT(e)},rubberband:function(e){switch(void 0===e&&(e=0),e){case!0:return IT(.15);case!1:return IT(0);default:return IT(e)}},enabled:function(e){return void 0===e&&(e=!0),e},triggerAllEvents:function(e){return void 0===e&&(e=!1),e},initial:function(e){return void 0===e&&(e=0),"function"==typeof e?e:IT(e)}},{axis:!0,lockDirection:function(e){return void 0===e&&(e=!1),e},bounds:function(e){if(void 0===e&&(e={}),"function"==typeof e)return function(t){return HT.bounds(e(t))};var t=e,n=t.left,r=void 0===n?-1/0:n,o=t.right,i=void 0===o?1/0:o,s=t.top,a=void 0===s?-1/0:s,l=t.bottom;return[[r,i],[a,void 0===l?1/0:l]]}}),_T="undefined"!=typeof window&&window.document&&window.document.createElement,BT={enabled:function(e){return void 0===e&&(e=!0),e},domTarget:!0,window:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return void 0===e&&(e=_T?window:void 0),e})),eventOptions:function(e){var t=void 0===e?{}:e,n=t.passive,r=void 0===n||n,o=t.capture;return{passive:r,capture:void 0!==o&&o}}},jT=OT({},HT,{threshold:function(e,t,n){var r=n.filterTaps,o=void 0!==r&&r,i=n.lockDirection,s=void 0!==i&&i,a=n.axis,l=IT(e,o?3:s||(void 0===a?void 0:a)?1:0);return this.filterTaps=o||l[0]+l[1]>0,l},swipeVelocity:function(e){return void 0===e&&(e=.5),IT(e)},swipeDistance:function(e){return void 0===e&&(e=60),IT(e)},delay:function(e){switch(void 0===e&&(e=0),e){case!0:return 180;case!1:return 0;default:return e}}});function FT(e){var t=e.domTarget,n=e.eventOptions,r=e.window,o=e.enabled,i=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,["domTarget","eventOptions","window","enabled"]),s=function(e){return void 0===e&&(e={}),VT(e,BT)}({domTarget:t,eventOptions:n,window:r,enabled:o});return s.drag=function(e){return void 0===e&&(e={}),VT(e,jT)}(i),s}function qT(e){return OT({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-1/0,1/0],[-1/0,1/0]],_lastEventType:void 0,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:DT,canceled:!1,memo:void 0,args:void 0},e)}function WT(){return{shared:{hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1},drag:qT({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,_isTap:!0,_delayedEvent:!1,_pointerId:void 0,tap:!1,swipe:[0,0]}),pinch:qT({da:[0,0],vdva:[0,0],origin:void 0,turns:0}),wheel:qT({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),move:qT({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),scroll:qT({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0})}}var UT=new Map,KT=function(){function e(e,t){var n=this;void 0===t&&(t=[]),this.controller=e,this.args=t,this.debounced=!0,this.setTimeout=function(e,t){var r;void 0===t&&(t=140),clearTimeout(n.controller.timeouts[n.stateKey]);for(var o=arguments.length,i=new Array(o>2?o-2:0),s=2;s<o;s++)i[s-2]=arguments[s];n.controller.timeouts[n.stateKey]=(r=window).setTimeout.apply(r,[e,t].concat(i))},this.clearTimeout=function(){clearTimeout(n.controller.timeouts[n.stateKey])},this.fireGestureHandler=function(e){if(void 0===e&&(e=!1),n.state._blocked)return n.debounced||(n.state._active=!1,n.clean()),null;if(!e&&!n.state.intentional&&!n.config.triggerAllEvents)return null;if(n.state.intentional){var t=n.state.active,r=n.state._active;n.state.active=r,n.state.first=r&&!t,n.state.last=t&&!r,n.controller.state.shared[n.ingKey]=r}var o=OT({},n.controller.state.shared,n.state,n.mapStateValues(n.state)),i=n.handler(o);return n.state.memo=void 0!==i?i:n.state.memo,n.state._active||n.clean(),o}}var t=e.prototype;return t.updateSharedState=function(e){Object.assign(this.controller.state.shared,e)},t.updateGestureState=function(e){Object.assign(this.state,e)},t.checkIntentionality=function(e,t){return{_intentional:e,_blocked:!1}},t.getMovement=function(e){var t=this.config,n=t.initial,r=t.bounds,o=t.rubberband,i=t.threshold,s=this.state,a=s._bounds,l=s._initial,c=s._active,d=s._intentional,u=s.lastOffset,h=s.movement,p=this.getInternalMovement(e,this.state),f=!1===d[0]?ZT(p[0],i[0]):d[0],m=!1===d[1]?ZT(p[1],i[1]):d[1],g=this.checkIntentionality([f,m],p);if(g._blocked)return OT({},g,{_movement:p,delta:[0,0]});var v,b,y,w,C=g._intentional,x=p;(!1!==C[0]&&!1===d[0]&&(b=zT(n,this.state),v=zT(r,this.state),l[0]=b[0],a[0]=v[0]),!1!==C[1]&&!1===d[1])&&(b=null!=(y=b)?y:zT(n,this.state),v=null!=(w=v)?w:zT(r,this.state),l[1]=b[1],a[1]=v[1]);var k=[!1!==C[0]?p[0]-C[0]:l[0],!1!==C[1]?p[1]-C[1]:l[1]],$=xT(k,u),S=c?o:[0,0];return k=GT(a,xT(k,l),S),OT({},g,{intentional:!1!==C[0]||!1!==C[1],_initial:l,_movement:x,movement:k,values:e,offset:GT(a,$,S),delta:kT(k,h)})},t.clean=function(){this.clearTimeout()},TT(e,[{key:"config",get:function(){return this.controller.config[this.stateKey]}},{key:"enabled",get:function(){return this.controller.config.enabled&&this.config.enabled}},{key:"state",get:function(){return this.controller.state[this.stateKey]}},{key:"handler",get:function(){return this.controller.handlers[this.stateKey]}}]),e}();function ZT(e,t){return Math.abs(e)>=t&&ST(e)*t}function GT(e,t,n){var r=t[0],o=t[1],i=n[0],s=n[1],a=e[0],l=a[0],c=a[1],d=e[1],u=d[0],h=d[1];return[ET(r,l,c,i),ET(o,u,h,s)]}function JT(e,t,n){var r=e.state,o=e.args,i=t.timeStamp,s=t.type,a=r.values;return{_lastEventType:s,event:t,timeStamp:i,elapsedTime:n?0:i-r.startTime,args:o,previous:a}}function XT(e,t){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return e.call.apply(e,[this,OT({},t,{event:n})].concat(o))}}var YT=function(e){var t=this;this.classes=e,this.bind=function(){for(var e={},n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];for(var i,s=NT(t.classes);!(i=s()).done;){new(0,i.value)(t,r).addBindings(e)}for(var a=0,l=Object.entries(t.nativeRefs);a<l.length;a++){var c=l[a];tO(e,c[0],XT(c[1],OT({},t.state.shared,{args:r})))}return t.config.domTarget?function(e,t){var n=e.config,r=e.domListeners,o=eO(n);if(!o)throw new Error("domTarget must be defined");var i=n.eventOptions;rO(o,QT(r),i);for(var s=0,a=Object.entries(t);s<a.length;s++){var l=a[s],c=l[0],d=l[1],u=c.slice(2).toLowerCase();r.push([u,PT.apply(void 0,d)])}nO(o,r,i)}(t,e):function(e,t){for(var n=e.config,r={},o=n.eventOptions.capture?"Capture":"",i=0,s=Object.entries(t);i<s.length;i++){var a=s[i],l=a[0],c=a[1],d=Array.isArray(c)?c:[c];r[l+o]=PT.apply(void 0,d)}return r}(t,e)},this.effect=function(){return t.config.domTarget&&t.bind(),t.clean},this.clean=function(){var e=eO(t.config),n=t.config.eventOptions;e&&rO(e,QT(t.domListeners),n),Object.values(t.timeouts).forEach(clearTimeout),function(e){var t=e.config,n=t.window,r=t.eventOptions,o=e.windowListeners;if(!n)return;for(var i in o){rO(n,o[i],r)}e.windowListeners={}}(t)},this.state=WT(),this.timeouts={},this.domListeners=[],this.windowListeners={}};function QT(e){return void 0===e&&(e=[]),e.splice(0,e.length)}function eO(e){var t=e.domTarget;return t&&"current"in t?t.current:t}function tO(e,t,n){e[t]||(e[t]=[]),e[t].push(n)}function nO(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=NT(t);!(r=o()).done;){var i=r.value,s=i[0],a=i[1];e.addEventListener(s,a,n)}}function rO(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={});for(var r,o=NT(t);!(r=o()).done;){var i=r.value,s=i[0],a=i[1];e.removeEventListener(s,a,n)}}function oO(e,t,n){void 0===n&&(n={});var r=function(e){var t=new Set;e.drag&&t.add(UT.get("drag"));e.wheel&&t.add(UT.get("wheel"));e.scroll&&t.add(UT.get("scroll"));e.move&&t.add(UT.get("move"));e.pinch&&t.add(UT.get("pinch"));e.hover&&t.add(UT.get("hover"));return t}(e),o=ne.useMemo((function(){return new YT(r)}),[]);return o.config=t,o.handlers=e,o.nativeRefs=n,ne.useEffect(o.effect,[]),o.config.domTarget?iO:o.bind}function iO(){"development"===process.env.NODE_ENV&&console.warn("Deprecation notice: When the `domTarget` option is specified, you don't need to write `useEffect(bind, [bind])` anymore: event binding is now made handled internally to this lib.\n\nNext version won't return anything when `domTarget` is provided, therefore your code will break if you try to call `useEffect`.")}var sO=function(e){function t(){return e.apply(this,arguments)||this}LT(t,e);var n=t.prototype;return n.getInternalMovement=function(e,t){return kT(e,t.initial)},n.checkIntentionality=function(e,t){if(!1===e[0]&&!1===e[1])return{_intentional:e,axis:this.state.axis};var n=t.map(Math.abs),r=n[0],o=n[1],i=this.state.axis||(r>o?"x":r<o?"y":void 0);return this.config.axis||this.config.lockDirection?i?this.config.axis&&i!==this.config.axis?{_intentional:e,_blocked:!0,axis:i}:(e["x"===i?1:0]=!1,{_intentional:e,_blocked:!1,axis:i}):{_intentional:[!1,!1],_blocked:!1,axis:i}:{_intentional:e,_blocked:!1,axis:i}},n.getKinematics=function(e,t){var n=this.getMovement(e);if(!n._blocked){var r=t.timeStamp-this.state.timeStamp;Object.assign(n,function(e,t,n){var r=$T(t),o=0===r?0:1/r,i=0===n?0:1/n,s=i*r,a=t.map((function(e){return i*e})),l=t.map((function(e){return o*e}));return{velocities:a,velocity:s,distance:$T(e),direction:l}}(n.movement,n.delta,r))}return n},n.mapStateValues=function(e){return{xy:e.values,vxvy:e.velocities}},t}(KT);function aO(e){if("touches"in e){var t=e.targetTouches,n=e.changedTouches;return t.length>0?t:n}return null}function lO(e){var t="buttons"in e?e.buttons:0,n=aO(e),r=n&&n.length||0;return{touches:r,down:r>0||t>0,buttons:t,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey}}function cO(e){var t=aO(e),n=t?t[0]:e;return[n.clientX,n.clientY]}var dO=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).ingKey="dragging",t.stateKey="drag",t.onDragStart=function(e){t.enabled&&!t.state._active&&(!function(e,t,n){var r=e.config,o=e.windowListeners;void 0===n&&(n=[]),r.window&&(rO(r.window,o[t],r.eventOptions),nO(r.window,o[t]=n,r.eventOptions))}(t.controller,t.stateKey,[["pointermove",t.onDragChange],["pointerup",t.onDragEnd],["pointercancel",t.onDragEnd]]),t.updateGestureState({_pointerId:e.pointerId}),t.config.delay>0?(t.state._delayedEvent=!0,"persist"in e&&"function"==typeof e.persist&&e.persist(),t.setTimeout(t.startDrag.bind(AT(t)),t.config.delay,e)):t.startDrag(e))},t.onDragChange=function(e){if(!t.state.canceled&&e.pointerId===t.state._pointerId)if(t.state._active){var n=lO(e);if(n.down){t.updateSharedState(n);var r=cO(e),o=t.getKinematics(r,e),i=JT(AT(t),e),s=t.state._isTap,a=$T(o._movement);s&&a>=3&&(s=!1),t.updateGestureState(OT({},i,o,{_isTap:s})),t.fireGestureHandler()}else t.onDragEnd(e)}else t.state._delayedEvent&&(t.clearTimeout(),t.startDrag(e))},t.onDragEnd=function(e){if(e.pointerId===t.state._pointerId){t.state._active=!1,t.updateSharedState({down:!1,buttons:0,touches:0});var n=t.state._isTap,r=t.state.velocities,o=r[0],i=r[1],s=t.state.movement,a=s[0],l=s[1],c=t.state._intentional,d=c[0],u=c[1],h=t.config.swipeVelocity,p=h[0],f=h[1],m=t.config.swipeDistance,g=m[0],v=m[1],b=OT({},JT(AT(t),e),t.getMovement(t.state.values)),y=[0,0];b.elapsedTime<220&&(!1!==d&&Math.abs(o)>p&&Math.abs(a)>g&&(y[0]=ST(o)),!1!==u&&Math.abs(i)>f&&Math.abs(l)>v&&(y[1]=ST(i))),t.updateGestureState(OT({},b,{tap:n,swipe:y})),t.fireGestureHandler(!0===n)}},t.clean=function(){e.prototype.clean.call(AT(t)),t.state._delayedEvent=!1,function(e,t){var n=e.config,r=e.windowListeners;n.window&&(rO(n.window,r[t],n.eventOptions),delete r[t])}(t.controller,t.stateKey)},t.onCancel=function(){t.state.canceled||(t.updateGestureState({canceled:!0}),t.state._active=!1,t.updateSharedState({down:!1,buttons:0,touches:0}),requestAnimationFrame((function(){return t.fireGestureHandler()})))},t.onClick=function(e){t.state._isTap||e.stopPropagation()},t}LT(t,e);var n=t.prototype;return n.startDrag=function(e){var t=cO(e);this.updateSharedState(lO(e)),this.updateGestureState(OT({},function(e,t,n){var r=e.state.offset,o=n.timeStamp;return OT({},WT()[e.stateKey],{_active:!0,values:t,initial:t,offset:r,lastOffset:r,startTime:o})}(this,t,e),JT(this,e,!0),{_pointerId:e.pointerId,cancel:this.onCancel})),this.updateGestureState(this.getMovement(t)),this.fireGestureHandler()},n.addBindings=function(e){(tO(e,"onPointerDown",this.onDragStart),this.config.filterTaps)&&tO(e,this.controller.config.eventOptions.capture?"onClick":"onClickCapture",this.onClick)},t}(sO);function uO(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var n,r,o,i;if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!uO(e[r],t[r]))return!1;return!0}if("function"==typeof Map&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!uO(r.value[1],t.get(r.value[0])))return!1;return!0}if("function"==typeof Set&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if("undefined"!=typeof Element&&e instanceof Element)return!1;for(r=n;0!=r--;)if(!("_owner"===o[r]&&e.$$typeof||uO(e[o[r]],t[o[r]])))return!1;return!0}return e!=e&&t!=t}function hO(e,t){try{return uO(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}function pO(e,t){void 0===t&&(t={}),UT.set("drag",dO);var n=ae();return n.current||(n.current=function(e,t){var n,r,o=[],i=!1;return function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return i&&n===this&&t(a,o)||(r=e.apply(this,a),i=!0,n=this,o=a),r}}(FT,hO)),oO({drag:e},n.current(t))}
2681
2681
  /*!
2682
2682
  * tabbable 5.3.3
2683
2683
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
2684
- */var fO=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],mO=fO.join(","),gO="undefined"==typeof Element,vO=gO?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,bO=!gO&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},yO=function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(mO));return t&&vO.call(e,mO)&&r.unshift(e),r=r.filter(n)},wO=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if("SLOT"===s.tagName){var a=s.assignedElements(),l=e(a.length?a:s.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scope:s,candidates:l})}else{vO.call(s,mO)&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var c=s.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(s),d=!r.shadowRootFilter||r.shadowRootFilter(s);if(c&&d){var u=e(!0===c?s.children:c.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scope:s,candidates:u})}else i.unshift.apply(i,s.children)}}return o},CO=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},xO=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},kO=function(e){return"INPUT"===e.tagName},$O=function(e){return function(e){return kO(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||bO(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},SO=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},EO=function(e,t){return!(t.disabled||function(e){return kO(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=vO.call(e,"details>summary:first-of-type")?e.parentElement:e;if(vO.call(o,"details:not([open]) *"))return!0;var i=bO(e).host,s=(null==i?void 0:i.ownerDocument.contains(i))||e.ownerDocument.contains(e);if(n&&"full"!==n){if("non-zero-area"===n)return SO(e)}else{if("function"==typeof r){for(var a=e;e;){var l=e.parentElement,c=bO(e);if(l&&!l.shadowRoot&&!0===r(l))return SO(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=a}if(s)return!e.getClientRects().length}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!vO.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},MO=function(e,t){return!($O(t)||CO(t)<0||!EO(e,t))},TO=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},OO=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scope,s=i?t.scope:t,a=CO(s,i),l=i?e(t.candidates):s;0===a?i?n.push.apply(n,l):n.push(s):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:l})})),r.sort(xO).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},LO=function(e,t){var n;return n=(t=t||{}).getShadowRoot?wO([e],t.includeContainer,{filter:MO.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:TO}):yO(e,t.includeContainer,MO.bind(null,t)),OO(n)},AO=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==vO.call(e,mO)&&MO(t,e)},NO=fO.concat("iframe").join(","),RO=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==vO.call(e,NO)&&EO(t,e)};
2684
+ */var fO=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],mO=fO.join(","),gO="undefined"==typeof Element,vO=gO?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,bO=!gO&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},yO=function(e,t,n){var r=Array.prototype.slice.apply(e.querySelectorAll(mO));return t&&vO.call(e,mO)&&r.unshift(e),r=r.filter(n)},wO=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if("SLOT"===s.tagName){var a=s.assignedElements(),l=e(a.length?a:s.children,!0,r);r.flatten?o.push.apply(o,l):o.push({scope:s,candidates:l})}else{vO.call(s,mO)&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var c=s.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(s),d=!r.shadowRootFilter||r.shadowRootFilter(s);if(c&&d){var u=e(!0===c?s.children:c.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scope:s,candidates:u})}else i.unshift.apply(i,s.children)}}return o},CO=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},xO=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},kO=function(e){return"INPUT"===e.tagName},$O=function(e){return function(e){return kO(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||bO(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},SO=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},MO=function(e,t){return!(t.disabled||function(e){return kO(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=vO.call(e,"details>summary:first-of-type")?e.parentElement:e;if(vO.call(o,"details:not([open]) *"))return!0;var i=bO(e).host,s=(null==i?void 0:i.ownerDocument.contains(i))||e.ownerDocument.contains(e);if(n&&"full"!==n){if("non-zero-area"===n)return SO(e)}else{if("function"==typeof r){for(var a=e;e;){var l=e.parentElement,c=bO(e);if(l&&!l.shadowRoot&&!0===r(l))return SO(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=a}if(s)return!e.getClientRects().length}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!vO.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},EO=function(e,t){return!($O(t)||CO(t)<0||!MO(e,t))},TO=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},OO=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scope,s=i?t.scope:t,a=CO(s,i),l=i?e(t.candidates):s;0===a?i?n.push.apply(n,l):n.push(s):r.push({documentOrder:o,tabIndex:a,item:t,isScope:i,content:l})})),r.sort(xO).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},LO=function(e,t){var n;return n=(t=t||{}).getShadowRoot?wO([e],t.includeContainer,{filter:EO.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:TO}):yO(e,t.includeContainer,EO.bind(null,t)),OO(n)},AO=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==vO.call(e,mO)&&EO(t,e)},RO=fO.concat("iframe").join(","),NO=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==vO.call(e,RO)&&MO(t,e)};
2685
2685
  /*!
2686
2686
  * focus-trap 6.9.4
2687
2687
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
2688
2688
  */
2689
- function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function PO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DO(Object(n),!0).forEach((function(t){IO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DO(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function IO(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zO,VO=(zO=[],{activateTrap:function(e){if(zO.length>0){var t=zO[zO.length-1];t!==e&&t.pause()}var n=zO.indexOf(e);-1===n||zO.splice(n,1),zO.push(e)},deactivateTrap:function(e){var t=zO.indexOf(e);-1!==t&&zO.splice(t,1),zO.length>0&&zO[zO.length-1].unpause()}}),HO=function(e){return setTimeout(e,0)},_O=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},BO=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},jO=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},FO=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=PO({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},t),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:o[n||t]},a=function(e){return i.containerGroups.findIndex((function(t){var n=t.container,r=t.tabbableNodes;return n.contains(e)||r.find((function(t){return t===e}))}))},l=function(e){var t=o[e];if("function"==typeof t){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];t=t.apply(void 0,i)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var a=t;if("string"==typeof t&&!(a=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return a},c=function(){var e=l("initialFocus");if(!1===e)return!1;if(void 0===e)if(a(r.activeElement)>=0)e=r.activeElement;else{var t=i.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(i.containerGroups=i.containers.map((function(e){var t,n,r=LO(e,o.tabbableOptions),i=(t=e,(n=(n=o.tabbableOptions)||{}).getShadowRoot?wO([t],n.includeContainer,{filter:EO.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):yO(t,n.includeContainer,EO.bind(null,n)));return{container:e,tabbableNodes:r,focusableNodes:i,firstTabbableNode:r.length>0?r[0]:null,lastTabbableNode:r.length>0?r[r.length-1]:null,nextTabbableNode:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=i.findIndex((function(t){return t===e}));if(!(n<0))return t?i.slice(n+1).find((function(e){return AO(e,o.tabbableOptions)})):i.slice(0,n).reverse().find((function(e){return AO(e,o.tabbableOptions)}))}}})),i.tabbableGroups=i.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),i.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},u=function e(t){!1!==t&&t!==r.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!o.preventScroll}),i.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(c()))},h=function(e){var t=l("setReturnFocus",e);return t||!1!==t&&e},p=function(e){var t=jO(e);a(t)>=0||(BO(o.clickOutsideDeactivates,e)?n.deactivate({returnFocus:o.returnFocusOnDeactivate&&!RO(t,o.tabbableOptions)}):BO(o.allowOutsideClick,e)||e.preventDefault())},f=function(e){var t=jO(e),n=a(t)>=0;n||t instanceof Document?n&&(i.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),u(i.mostRecentlyFocusedNode||c()))},m=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==BO(o.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var t=jO(e);d();var n=null;if(i.tabbableGroups.length>0){var r=a(t),s=r>=0?i.containerGroups[r]:void 0;if(r<0)n=e.shiftKey?i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:i.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var c=_O(i.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(c<0&&(s.container===t||RO(t,o.tabbableOptions)&&!AO(t,o.tabbableOptions)&&!s.nextTabbableNode(t,!1))&&(c=r),c>=0){var h=0===c?i.tabbableGroups.length-1:c-1;n=i.tabbableGroups[h].lastTabbableNode}}else{var p=_O(i.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(p<0&&(s.container===t||RO(t,o.tabbableOptions)&&!AO(t,o.tabbableOptions)&&!s.nextTabbableNode(t))&&(p=r),p>=0){var f=p===i.tabbableGroups.length-1?0:p+1;n=i.tabbableGroups[f].firstTabbableNode}}}else n=l("fallbackFocus");n&&(e.preventDefault(),u(n))}(e)},g=function(e){var t=jO(e);a(t)>=0||BO(o.clickOutsideDeactivates,e)||BO(o.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},v=function(){if(i.active)return VO.activateTrap(n),i.delayInitialFocusTimer=o.delayInitialFocus?HO((function(){u(c())})):u(c()),r.addEventListener("focusin",f,!0),r.addEventListener("mousedown",p,{capture:!0,passive:!1}),r.addEventListener("touchstart",p,{capture:!0,passive:!1}),r.addEventListener("click",g,{capture:!0,passive:!1}),r.addEventListener("keydown",m,{capture:!0,passive:!1}),n},b=function(){if(i.active)return r.removeEventListener("focusin",f,!0),r.removeEventListener("mousedown",p,!0),r.removeEventListener("touchstart",p,!0),r.removeEventListener("click",g,!0),r.removeEventListener("keydown",m,!0),n};return(n={get active(){return i.active},get paused(){return i.paused},activate:function(e){if(i.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),o=s(e,"checkCanFocusTrap");o||d(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,t&&t();var a=function(){o&&d(),v(),n&&n()};return o?(o(i.containers.concat()).then(a,a),this):(a(),this)},deactivate:function(e){if(!i.active)return this;var t=PO({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},e);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,b(),i.active=!1,i.paused=!1,VO.deactivateTrap(n);var r=s(t,"onDeactivate"),a=s(t,"onPostDeactivate"),l=s(t,"checkCanReturnFocus"),c=s(t,"returnFocus","returnFocusOnDeactivate");r&&r();var d=function(){HO((function(){c&&u(h(i.nodeFocusedBeforeActivation)),a&&a()}))};return c&&l?(l(h(i.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(){return i.paused||!i.active||(i.paused=!0,b()),this},unpause:function(){return i.paused&&i.active?(i.paused=!1,d(),v(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return i.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),i.active&&d(),this}}).updateContainerElements(e),n};var qO=!1;if("undefined"!=typeof window){var WO={get passive(){qO=!0}};window.addEventListener("testPassive",null,WO),window.removeEventListener("testPassive",null,WO)}var UO,KO="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),ZO=[],GO=!1,JO=-1,XO=void 0,YO=void 0,QO=function(e){return ZO.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},eL=function(e){var t=e||window.event;return!!QO(t.target)||(t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1))},tL=function(e,t){if(e){if(!ZO.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:t||{}};ZO=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(ZO),[n]),KO?(e.ontouchstart=function(e){1===e.targetTouches.length&&(JO=e.targetTouches[0].clientY)},e.ontouchmove=function(t){1===t.targetTouches.length&&function(e,t){var n=e.targetTouches[0].clientY-JO;!QO(e.target)&&(t&&0===t.scrollTop&&n>0||function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight}(t)&&n<0?eL(e):e.stopPropagation())}(t,e)},GO||(document.addEventListener("touchmove",eL,qO?{passive:!1}:void 0),GO=!0)):function(e){if(void 0===YO){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;t&&n>0&&(YO=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===XO&&(XO=document.body.style.overflow,document.body.style.overflow="hidden")}(t)}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},nL=function(e){e?(ZO=ZO.filter((function(t){return t.targetElement!==e})),KO?(e.ontouchstart=null,e.ontouchmove=null,GO&&0===ZO.length&&(document.removeEventListener("touchmove",eL,qO?{passive:!1}:void 0),GO=!1)):ZO.length||(void 0!==YO&&(document.body.style.paddingRight=YO,YO=void 0),void 0!==XO&&(document.body.style.overflow=XO,XO=void 0))):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.")},rL=[],oL="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(UO||(UO={}));var iL,sL=function(e){return Object.freeze(e)},aL=function(e,t){this.inlineSize=e,this.blockSize=t,sL(this)},lL=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,sL(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),cL=function(e){return e instanceof SVGElement&&"getBBox"in e},dL=function(e){if(cL(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,i=o.offsetWidth,s=o.offsetHeight;return!(i||s||e.getClientRects().length)},uL=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},hL="undefined"!=typeof window?window:{},pL=new WeakMap,fL=/auto|scroll/,mL=/^tb|vertical/,gL=/msie|trident/i.test(hL.navigator&&hL.navigator.userAgent),vL=function(e){return parseFloat(e||"0")},bL=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new aL((n?t:e)||0,(n?e:t)||0)},yL=sL({devicePixelContentBoxSize:bL(),borderBoxSize:bL(),contentBoxSize:bL(),contentRect:new lL(0,0,0,0)}),wL=function(e,t){if(void 0===t&&(t=!1),pL.has(e)&&!t)return pL.get(e);if(dL(e))return pL.set(e,yL),yL;var n=getComputedStyle(e),r=cL(e)&&e.ownerSVGElement&&e.getBBox(),o=!gL&&"border-box"===n.boxSizing,i=mL.test(n.writingMode||""),s=!r&&fL.test(n.overflowY||""),a=!r&&fL.test(n.overflowX||""),l=r?0:vL(n.paddingTop),c=r?0:vL(n.paddingRight),d=r?0:vL(n.paddingBottom),u=r?0:vL(n.paddingLeft),h=r?0:vL(n.borderTopWidth),p=r?0:vL(n.borderRightWidth),f=r?0:vL(n.borderBottomWidth),m=u+c,g=l+d,v=(r?0:vL(n.borderLeftWidth))+p,b=h+f,y=a?e.offsetHeight-b-e.clientHeight:0,w=s?e.offsetWidth-v-e.clientWidth:0,C=o?m+v:0,x=o?g+b:0,k=r?r.width:vL(n.width)-C-w,$=r?r.height:vL(n.height)-x-y,S=k+m+w+v,E=$+g+y+b,M=sL({devicePixelContentBoxSize:bL(Math.round(k*devicePixelRatio),Math.round($*devicePixelRatio),i),borderBoxSize:bL(S,E,i),contentBoxSize:bL(k,$,i),contentRect:new lL(u,l,k,$)});return pL.set(e,M),M},CL=function(e,t,n){var r=wL(e,n),o=r.borderBoxSize,i=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(t){case UO.DEVICE_PIXEL_CONTENT_BOX:return s;case UO.BORDER_BOX:return o;default:return i}},xL=function(e){var t=wL(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=sL([t.borderBoxSize]),this.contentBoxSize=sL([t.contentBoxSize]),this.devicePixelContentBoxSize=sL([t.devicePixelContentBoxSize])},kL=function(e){if(dL(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},$L=function(){var e=1/0,t=[];rL.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new xL(t.target),o=kL(t.target);r.push(n),t.lastReportedSize=CL(t.target,t.observedBox),o<e&&(e=o)})),t.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=t;n<r.length;n++){(0,r[n])()}return e},SL=function(e){rL.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(n){n.isActive()&&(kL(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},EL=function(){var e=0;for(SL(e);rL.some((function(e){return e.activeTargets.length>0}));)e=$L(),SL(e);return rL.some((function(e){return e.skippedTargets.length>0}))&&function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:oL}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=oL),window.dispatchEvent(e)}(),e>0},ML=[],TL=function(e){if(!iL){var t=0,n=document.createTextNode("");new MutationObserver((function(){return ML.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),iL=function(){n.textContent="".concat(t?t--:t++)}}ML.push(e),iL()},OL=0,LL={attributes:!0,characterData:!0,childList:!0,subtree:!0},AL=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],NL=function(e){return void 0===e&&(e=0),Date.now()+e},RL=!1,DL=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!RL){RL=!0;var n,r=NL(e);n=function(){var n=!1;try{n=EL()}finally{if(RL=!1,e=r-NL(),!OL)return;n?t.run(1e3):e>0?t.run(e):t.start()}},TL((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,LL)};document.body?t():hL.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),AL.forEach((function(t){return hL.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),AL.forEach((function(t){return hL.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),PL=function(e){!OL&&e>0&&DL.start(),!(OL+=e)&&DL.stop()},IL=function(){function e(e,t){this.target=e,this.observedBox=t||UO.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=CL(this.target,this.observedBox,!0);return function(e){return!cL(e)&&!function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)&&"inline"===getComputedStyle(e).display}(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),zL=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},VL=new WeakMap,HL=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},_L=function(){function e(){}return e.connect=function(e,t){var n=new zL(e,t);VL.set(e,n)},e.observe=function(e,t,n){var r=VL.get(e),o=0===r.observationTargets.length;HL(r.observationTargets,t)<0&&(o&&rL.push(r),r.observationTargets.push(new IL(t,n&&n.box)),PL(1),DL.schedule())},e.unobserve=function(e,t){var n=VL.get(e),r=HL(n.observationTargets,t),o=1===n.observationTargets.length;r>=0&&(o&&rL.splice(rL.indexOf(n),1),n.observationTargets.splice(r,1),PL(-1))},e.disconnect=function(e){var t=this,n=VL.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),BL=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");_L.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!uL(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");_L.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!uL(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");_L.unobserve(this,e)},e.prototype.disconnect=function(){_L.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();function jL(){return jL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jL.apply(this,arguments)}function FL(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}var qL="undefined"!=typeof window?ue:de;function WL(e,t,n){return t=(t=+t)==t?t:0,n=(n=+n)==n?n:0,(e=+e)==e&&(e=(e=e<=n?e:n)>=t?e:t),e}function UL(e){var t=Math.round(e);if(Number.isNaN(e))throw new TypeError("Found a NaN! Check your snapPoints / defaultSnap / snapTo ");return t}var KL={box:"border-box"};function ZL(e,t){var n=t.label,r=t.enabled,o=t.resizeSourceRef,i=le(0),s=i[0],a=i[1];ce(n+": "+s);var l=fe((function(e){a(e[0].borderBoxSize[0].blockSize),o.current="element"}),[o]);return qL((function(){if(e.current&&r){var t=new BL(l);return t.observe(e.current,KL),function(){t.disconnect()}}}),[e,l,r]),r?s:0}function GL(e){return void 0===e&&(e=1e3),new Promise((function(t){return setTimeout(t,e)}))}var JL={DRAG:{target:"#overlay.dragging",actions:"onOpenEnd"}},XL={RESIZE:{target:"#overlay.resizing",actions:"onOpenEnd"}},YL=function(e,t,n){return void 0===n&&(n=e.context),new eM(e,t,n)}({id:"overlay",initial:"closed",context:{initialState:"CLOSED"},states:{closed:{on:{OPEN:"opening",CLOSE:void 0}},opening:{initial:"start",states:{start:{invoke:{src:"onOpenStart",onDone:"transition"}},transition:{always:[{target:"immediately",cond:"initiallyOpen"},{target:"smoothly",cond:"initiallyClosed"}]},immediately:{initial:"open",states:{open:{invoke:{src:"openImmediately",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"#overlay.opening.end"},on:jL({},JL,XL)}}},smoothly:{initial:"visuallyHidden",states:{visuallyHidden:{invoke:{src:"renderVisuallyHidden",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"open"}},open:{invoke:{src:"openSmoothly",onDone:"#overlay.opening.end"},on:jL({},JL,XL)}}},end:{invoke:{src:"onOpenEnd",onDone:"done"},on:{CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:jL({},{CLOSE:{target:"#overlay.closing",actions:"onOpenCancel"}}),onDone:"open"},open:{on:{DRAG:"#overlay.dragging",SNAP:"snapping",RESIZE:"resizing"}},dragging:{on:{SNAP:"snapping"}},snapping:{initial:"start",states:{start:{invoke:{src:"onSnapStart",onDone:"snappingSmoothly"},entry:[nM({y:function(e,t){return t.payload.y},velocity:function(e,t){return t.payload.velocity},snapSource:function(e,t){var n=t.payload.source;return void 0===n?"custom":n}})]},snappingSmoothly:{invoke:{src:"snapSmoothly",onDone:"end"}},end:{invoke:{src:"onSnapEnd",onDone:"done"},on:{RESIZE:"#overlay.resizing",SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{SNAP:{target:"snapping",actions:"onSnapEnd"},RESIZE:{target:"#overlay.resizing",actions:"onSnapCancel"},DRAG:{target:"#overlay.dragging",actions:"onSnapCancel"},CLOSE:{target:"#overlay.closing",actions:"onSnapCancel"}},onDone:"open"},resizing:{initial:"start",states:{start:{invoke:{src:"onResizeStart",onDone:"resizingSmoothly"}},resizingSmoothly:{invoke:{src:"resizeSmoothly",onDone:"end"}},end:{invoke:{src:"onResizeEnd",onDone:"done"},on:{SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{RESIZE:{target:"resizing",actions:"onResizeEnd"},SNAP:{target:"snapping",actions:"onResizeCancel"},DRAG:{target:"#overlay.dragging",actions:"onResizeCancel"},CLOSE:{target:"#overlay.closing",actions:"onResizeCancel"}},onDone:"open"},closing:{initial:"start",states:{start:{invoke:{src:"onCloseStart",onDone:"deactivating"},on:{OPEN:{target:"#overlay.open",actions:"onCloseCancel"}}},deactivating:{invoke:{src:"deactivate",onDone:"closingSmoothly"}},closingSmoothly:{invoke:{src:"closeSmoothly",onDone:"end"}},end:{invoke:{src:"onCloseEnd",onDone:"done"},on:{OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}}},done:{type:"final"}},on:{CLOSE:void 0,OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}},onDone:"closed"}},on:{CLOSE:"closing"}},{actions:{onOpenCancel:function(e,t){},onSnapCancel:function(e,t){},onResizeCancel:function(e,t){},onCloseCancel:function(e,t){},onOpenEnd:function(e,t){},onSnapEnd:function(e,t){},onRezizeEnd:function(e,t){}},services:{onSnapStart:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},onOpenStart:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},onCloseStart:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},onResizeStart:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},onSnapEnd:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},onOpenEnd:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},onCloseEnd:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},onResizeEnd:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},renderVisuallyHidden:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},activate:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},deactivate:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},openSmoothly:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},openImmediately:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},snapSmoothly:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},resizeSmoothly:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},closeSmoothly:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}}},guards:{initiallyClosed:function(e){return"CLOSED"===e.initialState},initiallyOpen:function(e){return"OPEN"===e.initialState}}}),QL=["children","sibling","className","footer","header","open","initialState","lastSnapRef","initialFocusRef","onDismiss","maxHeight","defaultSnap","snapPoints","blocking","scrollLocking","style","onSpringStart","onSpringCancel","onSpringEnd","reserveScrollBarGap","expandOnContentDrag"],eA=["velocity"],tA=["onRest","config"],nA={tension:170,friction:26},rA=nA.tension,oA=nA.friction,iA=ne.forwardRef((function(e,t){var n=e.children,r=e.sibling,o=e.className,i=e.footer,s=e.header,a=e.open,l=e.initialState,c=e.lastSnapRef,d=e.initialFocusRef,u=e.onDismiss,h=e.maxHeight,p=e.defaultSnap,f=void 0===p?aA:p,m=e.snapPoints,g=void 0===m?lA:m,v=e.blocking,b=void 0===v||v,y=e.scrollLocking,w=void 0===y||y,C=e.style,x=e.onSpringStart,k=e.onSpringCancel,$=e.onSpringEnd,S=e.reserveScrollBarGap,E=void 0===S?b:S,M=e.expandOnContentDrag,T=void 0!==M&&M,O=FL(e,QL),L=function(){var e=le(!1),t=e[0],n=e[1],r=le({}),o=r[0],i=r[1],s=fe((function(e){return i((function(t){var n;return jL({},t,((n={})[e]=!1,n))})),function(){i((function(t){var n;return jL({},t,((n={})[e]=!0,n))}))}}),[]);return de((function(){var e=Object.values(o);0!==e.length&&e.every(Boolean)&&n(!0)}),[o]),{ready:t,registerReady:s}}(),A=L.ready,N=L.registerReady,R=ae(!1),D=ae(x),P=ae(k),I=ae($);de((function(){D.current=x,P.current=k,I.current=$}),[k,x,$]);var z,V,H=qM((function(){return{y:0,ready:0,maxHeight:0,minSnap:0,maxSnap:0}})),_=H[0],B=H[1],j=ae(null),F=ae(null),q=ae(null),W=ae(null),U=ae(null),K=ae(null),Z=ae(0),G=ae(),J=ae(!1),X=(z=ie((function(){return"undefined"!=typeof window?window.matchMedia("(prefers-reduced-motion: reduce)"):null}),[]),V=ae(null==z?void 0:z.matches),ce(V.current?"reduce":"no-preference"),de((function(){var e=function(e){V.current=e.matches};return null==z||z.addListener(e),function(){return null==z?void 0:z.removeListener(e)}}),[z]),V),Y=function(e){var t=e.targetRef,n=e.enabled,r=e.reserveScrollBarGap,o=ae({activate:function(){throw new TypeError("Tried to activate scroll lock too early")},deactivate:function(){}});return ce(n?"Enabled":"Disabled"),de((function(){if(!n)return o.current.deactivate(),void(o.current={activate:function(){},deactivate:function(){}});var e=t.current,i=!1;o.current={activate:function(){i||(i=!0,tL(e,{allowTouchMove:function(e){return e.closest("[data-body-scroll-lock-ignore]")},reserveScrollBarGap:r}))},deactivate:function(){i&&(i=!1,nL(e))}}}),[n,t,r]),o}({targetRef:F,enabled:A&&w,reserveScrollBarGap:E}),Q=function(e){var t=e.targetRef,n=e.enabled,r=ae({activate:function(){throw new TypeError("Tried to activate aria hider too early")},deactivate:function(){}});return ce(n?"Enabled":"Disabled"),de((function(){if(!n)return r.current.deactivate(),void(r.current={activate:function(){},deactivate:function(){}});var e=t.current,o=!1,i=[],s=[];r.current={activate:function(){if(!o){o=!0;var t=e.parentNode;document.querySelectorAll("body > *").forEach((function(e){if(e!==t){var n=e.getAttribute("aria-hidden");null!==n&&"false"!==n||(i.push(n),s.push(e),e.setAttribute("aria-hidden","true"))}}))}},deactivate:function(){o&&(o=!1,s.forEach((function(e,t){var n=i[t];null===n?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n)})),i=[],s=[])}}}),[t,n]),r}({targetRef:j,enabled:A&&b}),ee=function(e){var t=e.targetRef,n=e.fallbackRef,r=e.initialFocusRef,o=e.enabled,i=ae({activate:function(){throw new TypeError("Tried to activate focus trap too early")},deactivate:function(){}});return ce(o?"Enabled":"Disabled"),de((function(){if(!o)return i.current.deactivate(),void(i.current={activate:function(){},deactivate:function(){}});var e=n.current,s=FO(t.current,{onActivate:void 0,initialFocus:r?function(){return(null==r?void 0:r.current)||e}:void 0,fallbackFocus:e,escapeDeactivates:!1,clickOutsideDeactivates:!1}),a=!1;i.current={activate:function(){try{return a?Promise.resolve():(a=!0,Promise.resolve(s.activate()).then((function(){return Promise.resolve(new Promise((function(e){return setTimeout((function(){return e(void 0)}),0)}))).then((function(){}))})))}catch(e){return Promise.reject(e)}},deactivate:function(){a&&(a=!1,s.deactivate())}}}),[o,n,r,t]),i}({targetRef:j,fallbackRef:K,initialFocusRef:d||void 0,enabled:A&&b&&!1!==d}),te=function(e){var t=e.getSnapPoints,n=e.heightRef,r=e.lastSnapRef,o=e.ready,i=function(e){var t=e.contentRef,n=e.controlledMaxHeight,r=e.footerEnabled,o=e.footerRef,i=e.headerEnabled,s=e.headerRef,a=e.registerReady,l=e.resizeSourceRef,c=ie((function(){return a("contentHeight")}),[a]),d=function(e,t,n){var r=ie((function(){return t("maxHeight")}),[t]),o=le((function(){return UL(e)||"undefined"!=typeof window?window.innerHeight:0})),i=o[0],s=o[1],a=i>0,l=ae(0);return ce(e?"controlled":"auto"),de((function(){a&&r()}),[a,r]),qL((function(){if(e)return s(UL(e)),void(n.current="maxheightprop");var t=function(){l.current||(l.current=requestAnimationFrame((function(){s(window.innerHeight),n.current="window",l.current=0})))};return window.addEventListener("resize",t),s(window.innerHeight),n.current="window",r(),function(){window.removeEventListener("resize",t),cancelAnimationFrame(l.current)}}),[e,r,n]),i}(n,a,l),u=ZL(s,{label:"headerHeight",enabled:i,resizeSourceRef:l}),h=ZL(t,{label:"contentHeight",enabled:!0,resizeSourceRef:l}),p=ZL(o,{label:"footerHeight",enabled:r,resizeSourceRef:l}),f=Math.min(d-u-p,h)+u+p;ce("minHeight: "+f);var m=h>0;return de((function(){m&&c()}),[m,c]),{maxHeight:d,minHeight:f,headerHeight:u,footerHeight:p}}({contentRef:e.contentRef,controlledMaxHeight:e.controlledMaxHeight,footerEnabled:e.footerEnabled,footerRef:e.footerRef,headerEnabled:e.headerEnabled,headerRef:e.headerRef,registerReady:e.registerReady,resizeSourceRef:e.resizeSourceRef}),s=i.maxHeight,a=i.minHeight,l=i.headerHeight,c=i.footerHeight,d=function(e,t){var n=[].concat(e).map(UL).reduce((function(e,n){return e.add(WL(n,0,t)),e}),new Set),r=Array.from(n),o=Math.min.apply(Math,r);if(Number.isNaN(o))throw new TypeError("minSnap is NaN");var i=Math.max.apply(Math,r);if(Number.isNaN(i))throw new TypeError("maxSnap is NaN");return{snapPoints:r,minSnap:o,maxSnap:i}}(o?t({height:n.current,footerHeight:c,headerHeight:l,minHeight:a,maxHeight:s}):[0],s),u=d.snapPoints,h=d.minSnap,p=d.maxSnap;return ce("minSnap: "+h+", maxSnap:"+p),{minSnap:h,maxSnap:p,findSnap:function(e){var t=UL("function"==typeof e?e({footerHeight:c,headerHeight:l,height:n.current,minHeight:a,maxHeight:s,snapPoints:u,lastSnap:r.current}):e);return u.reduce((function(e,n){return Math.abs(n-t)<Math.abs(e-t)?n:e}),h)},maxHeight:s}}({contentRef:q,controlledMaxHeight:h,footerEnabled:!!i,footerRef:U,getSnapPoints:g,headerEnabled:!1!==s,headerRef:W,heightRef:Z,lastSnapRef:c,ready:A,registerReady:N,resizeSourceRef:G}),re=te.minSnap,oe=te.maxSnap,se=te.maxHeight,ue=te.findSnap,he=ae(se),pe=ae(re),me=ae(oe),ve=ae(ue),be=ae(0);qL((function(){he.current=se,me.current=oe,pe.current=re,ve.current=ue,be.current=ue(f)}),[ue,f,se,oe,re]);var ye=fe((function(e){var t=e.onRest,n=e.config,r=(n=void 0===n?{}:n).velocity,o=void 0===r?1:r,i=FL(n,eA),s=FL(e,tA);return new Promise((function(e){return B(jL({},s,{config:jL({velocity:o},i,{mass:1,tension:rA,friction:Math.max(oA,oA+(oA-oA*o))}),onRest:function(){var n=[].slice.call(arguments);e.apply(void 0,n),null==t||t.apply(void 0,n)}}))}))}),[B]),we=mM(YL,{devTools:!1,actions:{onOpenCancel:fe((function(){return null==P.current?void 0:P.current({type:"OPEN"})}),[]),onSnapCancel:fe((function(e){return null==P.current?void 0:P.current({type:"SNAP",source:e.snapSource})}),[]),onCloseCancel:fe((function(){return null==P.current?void 0:P.current({type:"CLOSE"})}),[]),onResizeCancel:fe((function(){return null==P.current?void 0:P.current({type:"RESIZE",source:G.current})}),[]),onOpenEnd:fe((function(){return null==I.current?void 0:I.current({type:"OPEN"})}),[]),onSnapEnd:fe((function(e,t){return null==I.current?void 0:I.current({type:"SNAP",source:e.snapSource})}),[]),onResizeEnd:fe((function(){return null==I.current?void 0:I.current({type:"RESIZE",source:G.current})}),[])},context:{initialState:l},services:{onSnapStart:fe((function(e,t){try{return Promise.resolve(null==D.current?void 0:D.current({type:"SNAP",source:t.payload.source||"custom"}))}catch(e){return Promise.reject(e)}}),[]),onOpenStart:fe((function(){try{return Promise.resolve(null==D.current?void 0:D.current({type:"OPEN"}))}catch(e){return Promise.reject(e)}}),[]),onCloseStart:fe((function(){try{return Promise.resolve(null==D.current?void 0:D.current({type:"CLOSE"}))}catch(e){return Promise.reject(e)}}),[]),onResizeStart:fe((function(){try{return Promise.resolve(null==D.current?void 0:D.current({type:"RESIZE",source:G.current}))}catch(e){return Promise.reject(e)}}),[]),onSnapEnd:fe((function(e,t){try{return Promise.resolve(null==I.current?void 0:I.current({type:"SNAP",source:e.snapSource}))}catch(e){return Promise.reject(e)}}),[]),onOpenEnd:fe((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"OPEN"}))}catch(e){return Promise.reject(e)}}),[]),onCloseEnd:fe((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"CLOSE"}))}catch(e){return Promise.reject(e)}}),[]),onResizeEnd:fe((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"RESIZE",source:G.current}))}catch(e){return Promise.reject(e)}}),[]),renderVisuallyHidden:fe((function(e,t){try{return Promise.resolve(ye({y:be.current,ready:0,maxHeight:he.current,maxSnap:me.current,minSnap:be.current,immediate:!0})).then((function(){}))}catch(e){return Promise.reject(e)}}),[ye]),activate:fe((function(e,t){try{return R.current=!0,Promise.resolve(Promise.all([Y.current.activate(),ee.current.activate(),Q.current.activate()])).then((function(){}))}catch(e){return Promise.reject(e)}}),[Q,ee,Y]),deactivate:fe((function(){try{return Y.current.deactivate(),ee.current.deactivate(),Q.current.deactivate(),R.current=!1,Promise.resolve()}catch(e){return Promise.reject(e)}}),[Q,ee,Y]),openImmediately:fe((function(){try{return Z.current=be.current,Promise.resolve(ye({y:be.current,ready:1,maxHeight:he.current,maxSnap:me.current,minSnap:be.current,immediate:!0})).then((function(){}))}catch(e){return Promise.reject(e)}}),[ye]),openSmoothly:fe((function(){try{return Promise.resolve(ye({y:0,ready:1,maxHeight:he.current,maxSnap:me.current,minSnap:be.current,immediate:!0})).then((function(){return Z.current=be.current,Promise.resolve(ye({y:be.current,ready:1,maxHeight:he.current,maxSnap:me.current,minSnap:be.current,immediate:X.current})).then((function(){}))}))}catch(e){return Promise.reject(e)}}),[ye,X]),snapSmoothly:fe((function(e,t){try{var n=ve.current(e.y);return Z.current=n,c.current=n,Promise.resolve(ye({y:n,ready:1,maxHeight:he.current,maxSnap:me.current,minSnap:pe.current,immediate:X.current,config:{velocity:e.velocity}})).then((function(){}))}catch(e){return Promise.reject(e)}}),[ye,c,X]),resizeSmoothly:fe((function(){try{var e=ve.current(Z.current);return Z.current=e,c.current=e,Promise.resolve(ye({y:e,ready:1,maxHeight:he.current,maxSnap:me.current,minSnap:pe.current,immediate:"element"!==G.current||X.current})).then((function(){}))}catch(e){return Promise.reject(e)}}),[ye,c,X]),closeSmoothly:fe((function(e,t){try{return ye({minSnap:Z.current,immediate:!0}),Z.current=0,Promise.resolve(ye({y:0,maxHeight:he.current,maxSnap:me.current,immediate:X.current})).then((function(){return Promise.resolve(ye({ready:0,immediate:!0})).then((function(){}))}))}catch(e){return Promise.reject(e)}}),[ye,X])}}),Ce=we[0],xe=we[1];de((function(){A&&xe(a?"OPEN":"CLOSE")}),[a,xe,A]),qL((function(){(se||oe||re)&&xe("RESIZE")}),[se,oe,re,xe]),de((function(){return function(){Y.current.deactivate(),ee.current.deactivate(),Q.current.deactivate()}}),[Q,ee,Y]),ge(t,(function(){return{snapTo:function(e,t){var n=void 0===t?{}:t,r=n.velocity,o=void 0===r?1:r,i=n.source,s=void 0===i?"custom":i;xe("SNAP",{payload:{y:ve.current(e),velocity:o,source:s}})},get height(){return Z.current}}}),[xe]),de((function(){var e=F.current,t=function(e){J.current&&e.preventDefault()},n=function(t){e.scrollTop<0&&(requestAnimationFrame((function(){e.style.overflow="hidden",e.scrollTop=0,e.style.removeProperty("overflow")})),t.preventDefault())};return T&&(e.addEventListener("scroll",t),e.addEventListener("touchmove",t),e.addEventListener("touchstart",n)),function(){e.removeEventListener("scroll",t),e.removeEventListener("touchmove",t),e.removeEventListener("touchstart",n)}}),[T,F]);var ke=pO((function(e){var t=e.args,n=(t=void 0===t?[]:t)[0],r=(n=void 0===n?{}:n).closeOnTap,o=void 0!==r&&r,i=n.isContentDragging,s=void 0!==i&&i,a=e.cancel,l=e.direction[1],c=e.down,d=e.first,h=e.last,p=e.memo,f=void 0===p?_.y.getValue():p,m=e.tap,g=e.velocity,v=-1*e.movement[1];if(!R.current)return a(),f;if(u&&o&&m)return a(),setTimeout((function(){return u()}),0),f;if(m)return f;var b=f+v,y=v*g,w=Math.max(pe.current,Math.min(me.current,b+2*y));if(!c&&u&&l>0&&b+y<pe.current/2)return a(),u(),f;var C=c?u||pe.current!==me.current?MT(b,u?0:pe.current,me.current,.55):b<pe.current?MT(b,pe.current,2*me.current,.55):MT(b,pe.current/2,me.current,.55):w;return T&&s?(C>=me.current&&(C=me.current),f===me.current&&F.current.scrollTop>0&&(C=me.current),J.current=C<me.current):J.current=!1,d&&xe("DRAG"),h?(xe("SNAP",{payload:{y:C,velocity:g>.05?g:1,source:"dragging"}}),f):(B({y:C,ready:1,maxHeight:he.current,maxSnap:me.current,minSnap:pe.current,immediate:!0,config:{velocity:g}}),f)}),{filterTaps:!0});if(Number.isNaN(me.current))throw new TypeError("maxSnapRef is NaN!!");if(Number.isNaN(pe.current))throw new TypeError("minSnapRef is NaN!!");var $e=function(e){var t,n=e.spring,r=VM([n.y,n.maxHeight],(function(e,t){return Math.round(WL(t-e,0,16))+"px"})),o=VM([n.y,n.minSnap,n.maxSnap],(function(e,t,n){return WL(e,t,n)+"px"})),i=VM([n.y,n.minSnap,n.maxSnap],(function(e,t,n){return e<t?t-e+"px":e>n?n-e+"px":"0px"})),s=VM([n.y,n.maxSnap],(function(e,t){return e>=t?Math.ceil(e-t):0})),a=VM([n.y,n.minSnap],(function(e,t){if(!t)return 0;var n=Math.max(t/2-45,0);return WL((e-n)*(1/(Math.min(t/2+45,t)-n)+0),0,1)})),l=VM([n.y,n.minSnap],(function(e,t){return t?WL(e/t,0,1):0}));return(t={})["--rsbs-content-opacity"]=a,t["--rsbs-backdrop-opacity"]=l,t["--rsbs-antigap-scale-y"]=s,t["--rsbs-overlay-translate-y"]=i,t["--rsbs-overlay-rounded"]=r,t["--rsbs-overlay-h"]=o,t}({spring:_});return ne.createElement(CT.div,jL({},O,{"data-rsbs-root":!0,"data-rsbs-state":sA.find(Ce.matches),"data-rsbs-is-blocking":b,"data-rsbs-is-dismissable":!!u,"data-rsbs-has-header":!!s,"data-rsbs-has-footer":!!i,className:o,ref:j,style:jL({},$e,C,{opacity:_.ready})}),r,b&&ne.createElement("div",jL({key:"backdrop","data-rsbs-backdrop":!0},ke({closeOnTap:!0}))),ne.createElement("div",{key:"overlay","aria-modal":"true",role:"dialog","data-rsbs-overlay":!0,tabIndex:-1,ref:K,onKeyDown:function(e){"Escape"===e.key&&(e.stopPropagation(),u&&u())}},!1!==s&&ne.createElement("div",jL({key:"header","data-rsbs-header":!0,ref:W},ke()),s),ne.createElement("div",jL({key:"scroll","data-rsbs-scroll":!0,ref:F},T?ke({isContentDragging:!0}):{}),ne.createElement("div",{"data-rsbs-content":!0,ref:q},n)),i&&ne.createElement("div",jL({key:"footer",ref:U,"data-rsbs-footer":!0},ke()),i)))})),sA=["closed","opening","open","closing","dragging","snapping","resizing"];function aA(e){var t=e.lastSnap;return null!=t?t:Math.min.apply(Math,e.snapPoints)}function lA(e){return e.minHeight}var cA=["onSpringStart","onSpringEnd","skipInitialTransition"],dA=se((function(e,t){var n=e.onSpringStart,r=e.onSpringEnd,o=e.skipInitialTransition,i=FL(e,cA),s=le(!1),a=s[0],l=s[1],c=ae(),d=ae(null),u=ae(o&&i.open?"OPEN":"CLOSED");qL((function(){if(i.open)return cancelAnimationFrame(c.current),l(!0),function(){u.current="CLOSED"}}),[i.open]);var h=fe((function(e){return Promise.resolve(null==n?void 0:n(e)).then((function(){"OPEN"===e.type&&cancelAnimationFrame(c.current)}))}),[n]),p=fe((function(e){return Promise.resolve(null==r?void 0:r(e)).then((function(){"CLOSE"===e.type&&(c.current=requestAnimationFrame((function(){return l(!1)})))}))}),[r]);return a?ne.createElement(oS,{"data-rsbs-portal":!0},ne.createElement(iA,jL({},i,{lastSnapRef:d,ref:t,initialState:u.current,onSpringStart:h,onSpringEnd:p}))):null}));const uA=$e`
2689
+ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function PO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DO(Object(n),!0).forEach((function(t){IO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DO(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function IO(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zO,VO=(zO=[],{activateTrap:function(e){if(zO.length>0){var t=zO[zO.length-1];t!==e&&t.pause()}var n=zO.indexOf(e);-1===n||zO.splice(n,1),zO.push(e)},deactivateTrap:function(e){var t=zO.indexOf(e);-1!==t&&zO.splice(t,1),zO.length>0&&zO[zO.length-1].unpause()}}),HO=function(e){return setTimeout(e,0)},_O=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},BO=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},jO=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},FO=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=PO({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},t),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:o[n||t]},a=function(e){return i.containerGroups.findIndex((function(t){var n=t.container,r=t.tabbableNodes;return n.contains(e)||r.find((function(t){return t===e}))}))},l=function(e){var t=o[e];if("function"==typeof t){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];t=t.apply(void 0,i)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var a=t;if("string"==typeof t&&!(a=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return a},c=function(){var e=l("initialFocus");if(!1===e)return!1;if(void 0===e)if(a(r.activeElement)>=0)e=r.activeElement;else{var t=i.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(i.containerGroups=i.containers.map((function(e){var t,n,r=LO(e,o.tabbableOptions),i=(t=e,(n=(n=o.tabbableOptions)||{}).getShadowRoot?wO([t],n.includeContainer,{filter:MO.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):yO(t,n.includeContainer,MO.bind(null,n)));return{container:e,tabbableNodes:r,focusableNodes:i,firstTabbableNode:r.length>0?r[0]:null,lastTabbableNode:r.length>0?r[r.length-1]:null,nextTabbableNode:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=i.findIndex((function(t){return t===e}));if(!(n<0))return t?i.slice(n+1).find((function(e){return AO(e,o.tabbableOptions)})):i.slice(0,n).reverse().find((function(e){return AO(e,o.tabbableOptions)}))}}})),i.tabbableGroups=i.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),i.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},u=function e(t){!1!==t&&t!==r.activeElement&&(t&&t.focus?(t.focus({preventScroll:!!o.preventScroll}),i.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(c()))},h=function(e){var t=l("setReturnFocus",e);return t||!1!==t&&e},p=function(e){var t=jO(e);a(t)>=0||(BO(o.clickOutsideDeactivates,e)?n.deactivate({returnFocus:o.returnFocusOnDeactivate&&!NO(t,o.tabbableOptions)}):BO(o.allowOutsideClick,e)||e.preventDefault())},f=function(e){var t=jO(e),n=a(t)>=0;n||t instanceof Document?n&&(i.mostRecentlyFocusedNode=t):(e.stopImmediatePropagation(),u(i.mostRecentlyFocusedNode||c()))},m=function(e){if(function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e)&&!1!==BO(o.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){var t=jO(e);d();var n=null;if(i.tabbableGroups.length>0){var r=a(t),s=r>=0?i.containerGroups[r]:void 0;if(r<0)n=e.shiftKey?i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:i.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var c=_O(i.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(c<0&&(s.container===t||NO(t,o.tabbableOptions)&&!AO(t,o.tabbableOptions)&&!s.nextTabbableNode(t,!1))&&(c=r),c>=0){var h=0===c?i.tabbableGroups.length-1:c-1;n=i.tabbableGroups[h].lastTabbableNode}}else{var p=_O(i.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(p<0&&(s.container===t||NO(t,o.tabbableOptions)&&!AO(t,o.tabbableOptions)&&!s.nextTabbableNode(t))&&(p=r),p>=0){var f=p===i.tabbableGroups.length-1?0:p+1;n=i.tabbableGroups[f].firstTabbableNode}}}else n=l("fallbackFocus");n&&(e.preventDefault(),u(n))}(e)},g=function(e){var t=jO(e);a(t)>=0||BO(o.clickOutsideDeactivates,e)||BO(o.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},v=function(){if(i.active)return VO.activateTrap(n),i.delayInitialFocusTimer=o.delayInitialFocus?HO((function(){u(c())})):u(c()),r.addEventListener("focusin",f,!0),r.addEventListener("mousedown",p,{capture:!0,passive:!1}),r.addEventListener("touchstart",p,{capture:!0,passive:!1}),r.addEventListener("click",g,{capture:!0,passive:!1}),r.addEventListener("keydown",m,{capture:!0,passive:!1}),n},b=function(){if(i.active)return r.removeEventListener("focusin",f,!0),r.removeEventListener("mousedown",p,!0),r.removeEventListener("touchstart",p,!0),r.removeEventListener("click",g,!0),r.removeEventListener("keydown",m,!0),n};return(n={get active(){return i.active},get paused(){return i.paused},activate:function(e){if(i.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),o=s(e,"checkCanFocusTrap");o||d(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=r.activeElement,t&&t();var a=function(){o&&d(),v(),n&&n()};return o?(o(i.containers.concat()).then(a,a),this):(a(),this)},deactivate:function(e){if(!i.active)return this;var t=PO({onDeactivate:o.onDeactivate,onPostDeactivate:o.onPostDeactivate,checkCanReturnFocus:o.checkCanReturnFocus},e);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,b(),i.active=!1,i.paused=!1,VO.deactivateTrap(n);var r=s(t,"onDeactivate"),a=s(t,"onPostDeactivate"),l=s(t,"checkCanReturnFocus"),c=s(t,"returnFocus","returnFocusOnDeactivate");r&&r();var d=function(){HO((function(){c&&u(h(i.nodeFocusedBeforeActivation)),a&&a()}))};return c&&l?(l(h(i.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(){return i.paused||!i.active||(i.paused=!0,b()),this},unpause:function(){return i.paused&&i.active?(i.paused=!1,d(),v(),this):this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return i.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),i.active&&d(),this}}).updateContainerElements(e),n};var qO=!1;if("undefined"!=typeof window){var WO={get passive(){qO=!0}};window.addEventListener("testPassive",null,WO),window.removeEventListener("testPassive",null,WO)}var UO,KO="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),ZO=[],GO=!1,JO=-1,XO=void 0,YO=void 0,QO=function(e){return ZO.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},eL=function(e){var t=e||window.event;return!!QO(t.target)||(t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1))},tL=function(e,t){if(e){if(!ZO.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:t||{}};ZO=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(ZO),[n]),KO?(e.ontouchstart=function(e){1===e.targetTouches.length&&(JO=e.targetTouches[0].clientY)},e.ontouchmove=function(t){1===t.targetTouches.length&&function(e,t){var n=e.targetTouches[0].clientY-JO;!QO(e.target)&&(t&&0===t.scrollTop&&n>0||function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight}(t)&&n<0?eL(e):e.stopPropagation())}(t,e)},GO||(document.addEventListener("touchmove",eL,qO?{passive:!1}:void 0),GO=!0)):function(e){if(void 0===YO){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;t&&n>0&&(YO=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===XO&&(XO=document.body.style.overflow,document.body.style.overflow="hidden")}(t)}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},nL=function(e){e?(ZO=ZO.filter((function(t){return t.targetElement!==e})),KO?(e.ontouchstart=null,e.ontouchmove=null,GO&&0===ZO.length&&(document.removeEventListener("touchmove",eL,qO?{passive:!1}:void 0),GO=!1)):ZO.length||(void 0!==YO&&(document.body.style.paddingRight=YO,YO=void 0),void 0!==XO&&(document.body.style.overflow=XO,XO=void 0))):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.")},rL=[],oL="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(UO||(UO={}));var iL,sL=function(e){return Object.freeze(e)},aL=function(e,t){this.inlineSize=e,this.blockSize=t,sL(this)},lL=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,sL(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),cL=function(e){return e instanceof SVGElement&&"getBBox"in e},dL=function(e){if(cL(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var o=e,i=o.offsetWidth,s=o.offsetHeight;return!(i||s||e.getClientRects().length)},uL=function(e){var t;if(e instanceof Element)return!0;var n=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},hL="undefined"!=typeof window?window:{},pL=new WeakMap,fL=/auto|scroll/,mL=/^tb|vertical/,gL=/msie|trident/i.test(hL.navigator&&hL.navigator.userAgent),vL=function(e){return parseFloat(e||"0")},bL=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new aL((n?t:e)||0,(n?e:t)||0)},yL=sL({devicePixelContentBoxSize:bL(),borderBoxSize:bL(),contentBoxSize:bL(),contentRect:new lL(0,0,0,0)}),wL=function(e,t){if(void 0===t&&(t=!1),pL.has(e)&&!t)return pL.get(e);if(dL(e))return pL.set(e,yL),yL;var n=getComputedStyle(e),r=cL(e)&&e.ownerSVGElement&&e.getBBox(),o=!gL&&"border-box"===n.boxSizing,i=mL.test(n.writingMode||""),s=!r&&fL.test(n.overflowY||""),a=!r&&fL.test(n.overflowX||""),l=r?0:vL(n.paddingTop),c=r?0:vL(n.paddingRight),d=r?0:vL(n.paddingBottom),u=r?0:vL(n.paddingLeft),h=r?0:vL(n.borderTopWidth),p=r?0:vL(n.borderRightWidth),f=r?0:vL(n.borderBottomWidth),m=u+c,g=l+d,v=(r?0:vL(n.borderLeftWidth))+p,b=h+f,y=a?e.offsetHeight-b-e.clientHeight:0,w=s?e.offsetWidth-v-e.clientWidth:0,C=o?m+v:0,x=o?g+b:0,k=r?r.width:vL(n.width)-C-w,$=r?r.height:vL(n.height)-x-y,S=k+m+w+v,M=$+g+y+b,E=sL({devicePixelContentBoxSize:bL(Math.round(k*devicePixelRatio),Math.round($*devicePixelRatio),i),borderBoxSize:bL(S,M,i),contentBoxSize:bL(k,$,i),contentRect:new lL(u,l,k,$)});return pL.set(e,E),E},CL=function(e,t,n){var r=wL(e,n),o=r.borderBoxSize,i=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(t){case UO.DEVICE_PIXEL_CONTENT_BOX:return s;case UO.BORDER_BOX:return o;default:return i}},xL=function(e){var t=wL(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=sL([t.borderBoxSize]),this.contentBoxSize=sL([t.contentBoxSize]),this.devicePixelContentBoxSize=sL([t.devicePixelContentBoxSize])},kL=function(e){if(dL(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},$L=function(){var e=1/0,t=[];rL.forEach((function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach((function(t){var n=new xL(t.target),o=kL(t.target);r.push(n),t.lastReportedSize=CL(t.target,t.observedBox),o<e&&(e=o)})),t.push((function(){n.callback.call(n.observer,r,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,r=t;n<r.length;n++){(0,r[n])()}return e},SL=function(e){rL.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(n){n.isActive()&&(kL(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},ML=function(){var e=0;for(SL(e);rL.some((function(e){return e.activeTargets.length>0}));)e=$L(),SL(e);return rL.some((function(e){return e.skippedTargets.length>0}))&&function(){var e;"function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:oL}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=oL),window.dispatchEvent(e)}(),e>0},EL=[],TL=function(e){if(!iL){var t=0,n=document.createTextNode("");new MutationObserver((function(){return EL.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),iL=function(){n.textContent="".concat(t?t--:t++)}}EL.push(e),iL()},OL=0,LL={attributes:!0,characterData:!0,childList:!0,subtree:!0},AL=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],RL=function(e){return void 0===e&&(e=0),Date.now()+e},NL=!1,DL=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!NL){NL=!0;var n,r=RL(e);n=function(){var n=!1;try{n=ML()}finally{if(NL=!1,e=r-RL(),!OL)return;n?t.run(1e3):e>0?t.run(e):t.start()}},TL((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,LL)};document.body?t():hL.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),AL.forEach((function(t){return hL.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),AL.forEach((function(t){return hL.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),PL=function(e){!OL&&e>0&&DL.start(),!(OL+=e)&&DL.stop()},IL=function(){function e(e,t){this.target=e,this.observedBox=t||UO.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=CL(this.target,this.observedBox,!0);return function(e){return!cL(e)&&!function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)&&"inline"===getComputedStyle(e).display}(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),zL=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},VL=new WeakMap,HL=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},_L=function(){function e(){}return e.connect=function(e,t){var n=new zL(e,t);VL.set(e,n)},e.observe=function(e,t,n){var r=VL.get(e),o=0===r.observationTargets.length;HL(r.observationTargets,t)<0&&(o&&rL.push(r),r.observationTargets.push(new IL(t,n&&n.box)),PL(1),DL.schedule())},e.unobserve=function(e,t){var n=VL.get(e),r=HL(n.observationTargets,t),o=1===n.observationTargets.length;r>=0&&(o&&rL.splice(rL.indexOf(n),1),n.observationTargets.splice(r,1),PL(-1))},e.disconnect=function(e){var t=this,n=VL.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),BL=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");_L.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!uL(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");_L.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!uL(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");_L.unobserve(this,e)},e.prototype.disconnect=function(){_L.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();function jL(){return jL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jL.apply(this,arguments)}function FL(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}var qL="undefined"!=typeof window?ue:de;function WL(e,t,n){return t=(t=+t)==t?t:0,n=(n=+n)==n?n:0,(e=+e)==e&&(e=(e=e<=n?e:n)>=t?e:t),e}function UL(e){var t=Math.round(e);if(Number.isNaN(e))throw new TypeError("Found a NaN! Check your snapPoints / defaultSnap / snapTo ");return t}var KL={box:"border-box"};function ZL(e,t){var n=t.label,r=t.enabled,o=t.resizeSourceRef,i=le(0),s=i[0],a=i[1];ce(n+": "+s);var l=fe((function(e){a(e[0].borderBoxSize[0].blockSize),o.current="element"}),[o]);return qL((function(){if(e.current&&r){var t=new BL(l);return t.observe(e.current,KL),function(){t.disconnect()}}}),[e,l,r]),r?s:0}function GL(e){return void 0===e&&(e=1e3),new Promise((function(t){return setTimeout(t,e)}))}var JL={DRAG:{target:"#overlay.dragging",actions:"onOpenEnd"}},XL={RESIZE:{target:"#overlay.resizing",actions:"onOpenEnd"}},YL=function(e,t,n){return void 0===n&&(n=e.context),new eE(e,t,n)}({id:"overlay",initial:"closed",context:{initialState:"CLOSED"},states:{closed:{on:{OPEN:"opening",CLOSE:void 0}},opening:{initial:"start",states:{start:{invoke:{src:"onOpenStart",onDone:"transition"}},transition:{always:[{target:"immediately",cond:"initiallyOpen"},{target:"smoothly",cond:"initiallyClosed"}]},immediately:{initial:"open",states:{open:{invoke:{src:"openImmediately",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"#overlay.opening.end"},on:jL({},JL,XL)}}},smoothly:{initial:"visuallyHidden",states:{visuallyHidden:{invoke:{src:"renderVisuallyHidden",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"open"}},open:{invoke:{src:"openSmoothly",onDone:"#overlay.opening.end"},on:jL({},JL,XL)}}},end:{invoke:{src:"onOpenEnd",onDone:"done"},on:{CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:jL({},{CLOSE:{target:"#overlay.closing",actions:"onOpenCancel"}}),onDone:"open"},open:{on:{DRAG:"#overlay.dragging",SNAP:"snapping",RESIZE:"resizing"}},dragging:{on:{SNAP:"snapping"}},snapping:{initial:"start",states:{start:{invoke:{src:"onSnapStart",onDone:"snappingSmoothly"},entry:[nE({y:function(e,t){return t.payload.y},velocity:function(e,t){return t.payload.velocity},snapSource:function(e,t){var n=t.payload.source;return void 0===n?"custom":n}})]},snappingSmoothly:{invoke:{src:"snapSmoothly",onDone:"end"}},end:{invoke:{src:"onSnapEnd",onDone:"done"},on:{RESIZE:"#overlay.resizing",SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{SNAP:{target:"snapping",actions:"onSnapEnd"},RESIZE:{target:"#overlay.resizing",actions:"onSnapCancel"},DRAG:{target:"#overlay.dragging",actions:"onSnapCancel"},CLOSE:{target:"#overlay.closing",actions:"onSnapCancel"}},onDone:"open"},resizing:{initial:"start",states:{start:{invoke:{src:"onResizeStart",onDone:"resizingSmoothly"}},resizingSmoothly:{invoke:{src:"resizeSmoothly",onDone:"end"}},end:{invoke:{src:"onResizeEnd",onDone:"done"},on:{SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{RESIZE:{target:"resizing",actions:"onResizeEnd"},SNAP:{target:"snapping",actions:"onResizeCancel"},DRAG:{target:"#overlay.dragging",actions:"onResizeCancel"},CLOSE:{target:"#overlay.closing",actions:"onResizeCancel"}},onDone:"open"},closing:{initial:"start",states:{start:{invoke:{src:"onCloseStart",onDone:"deactivating"},on:{OPEN:{target:"#overlay.open",actions:"onCloseCancel"}}},deactivating:{invoke:{src:"deactivate",onDone:"closingSmoothly"}},closingSmoothly:{invoke:{src:"closeSmoothly",onDone:"end"}},end:{invoke:{src:"onCloseEnd",onDone:"done"},on:{OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}}},done:{type:"final"}},on:{CLOSE:void 0,OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}},onDone:"closed"}},on:{CLOSE:"closing"}},{actions:{onOpenCancel:function(e,t){},onSnapCancel:function(e,t){},onResizeCancel:function(e,t){},onCloseCancel:function(e,t){},onOpenEnd:function(e,t){},onSnapEnd:function(e,t){},onRezizeEnd:function(e,t){}},services:{onSnapStart:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},onOpenStart:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},onCloseStart:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},onResizeStart:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},onSnapEnd:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},onOpenEnd:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},onCloseEnd:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},onResizeEnd:function(){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},renderVisuallyHidden:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},activate:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},deactivate:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},openSmoothly:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},openImmediately:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},snapSmoothly:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},resizeSmoothly:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}},closeSmoothly:function(e,t){try{return Promise.resolve(GL()).then((function(){}))}catch(e){return Promise.reject(e)}}},guards:{initiallyClosed:function(e){return"CLOSED"===e.initialState},initiallyOpen:function(e){return"OPEN"===e.initialState}}}),QL=["children","sibling","className","footer","header","open","initialState","lastSnapRef","initialFocusRef","onDismiss","maxHeight","defaultSnap","snapPoints","blocking","scrollLocking","style","onSpringStart","onSpringCancel","onSpringEnd","reserveScrollBarGap","expandOnContentDrag"],eA=["velocity"],tA=["onRest","config"],nA={tension:170,friction:26},rA=nA.tension,oA=nA.friction,iA=ne.forwardRef((function(e,t){var n=e.children,r=e.sibling,o=e.className,i=e.footer,s=e.header,a=e.open,l=e.initialState,c=e.lastSnapRef,d=e.initialFocusRef,u=e.onDismiss,h=e.maxHeight,p=e.defaultSnap,f=void 0===p?aA:p,m=e.snapPoints,g=void 0===m?lA:m,v=e.blocking,b=void 0===v||v,y=e.scrollLocking,w=void 0===y||y,C=e.style,x=e.onSpringStart,k=e.onSpringCancel,$=e.onSpringEnd,S=e.reserveScrollBarGap,M=void 0===S?b:S,E=e.expandOnContentDrag,T=void 0!==E&&E,O=FL(e,QL),L=function(){var e=le(!1),t=e[0],n=e[1],r=le({}),o=r[0],i=r[1],s=fe((function(e){return i((function(t){var n;return jL({},t,((n={})[e]=!1,n))})),function(){i((function(t){var n;return jL({},t,((n={})[e]=!0,n))}))}}),[]);return de((function(){var e=Object.values(o);0!==e.length&&e.every(Boolean)&&n(!0)}),[o]),{ready:t,registerReady:s}}(),A=L.ready,R=L.registerReady,N=ae(!1),D=ae(x),P=ae(k),I=ae($);de((function(){D.current=x,P.current=k,I.current=$}),[k,x,$]);var z,V,H=qE((function(){return{y:0,ready:0,maxHeight:0,minSnap:0,maxSnap:0}})),_=H[0],B=H[1],j=ae(null),F=ae(null),q=ae(null),W=ae(null),U=ae(null),K=ae(null),Z=ae(0),G=ae(),J=ae(!1),X=(z=ie((function(){return"undefined"!=typeof window?window.matchMedia("(prefers-reduced-motion: reduce)"):null}),[]),V=ae(null==z?void 0:z.matches),ce(V.current?"reduce":"no-preference"),de((function(){var e=function(e){V.current=e.matches};return null==z||z.addListener(e),function(){return null==z?void 0:z.removeListener(e)}}),[z]),V),Y=function(e){var t=e.targetRef,n=e.enabled,r=e.reserveScrollBarGap,o=ae({activate:function(){throw new TypeError("Tried to activate scroll lock too early")},deactivate:function(){}});return ce(n?"Enabled":"Disabled"),de((function(){if(!n)return o.current.deactivate(),void(o.current={activate:function(){},deactivate:function(){}});var e=t.current,i=!1;o.current={activate:function(){i||(i=!0,tL(e,{allowTouchMove:function(e){return e.closest("[data-body-scroll-lock-ignore]")},reserveScrollBarGap:r}))},deactivate:function(){i&&(i=!1,nL(e))}}}),[n,t,r]),o}({targetRef:F,enabled:A&&w,reserveScrollBarGap:M}),Q=function(e){var t=e.targetRef,n=e.enabled,r=ae({activate:function(){throw new TypeError("Tried to activate aria hider too early")},deactivate:function(){}});return ce(n?"Enabled":"Disabled"),de((function(){if(!n)return r.current.deactivate(),void(r.current={activate:function(){},deactivate:function(){}});var e=t.current,o=!1,i=[],s=[];r.current={activate:function(){if(!o){o=!0;var t=e.parentNode;document.querySelectorAll("body > *").forEach((function(e){if(e!==t){var n=e.getAttribute("aria-hidden");null!==n&&"false"!==n||(i.push(n),s.push(e),e.setAttribute("aria-hidden","true"))}}))}},deactivate:function(){o&&(o=!1,s.forEach((function(e,t){var n=i[t];null===n?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",n)})),i=[],s=[])}}}),[t,n]),r}({targetRef:j,enabled:A&&b}),ee=function(e){var t=e.targetRef,n=e.fallbackRef,r=e.initialFocusRef,o=e.enabled,i=ae({activate:function(){throw new TypeError("Tried to activate focus trap too early")},deactivate:function(){}});return ce(o?"Enabled":"Disabled"),de((function(){if(!o)return i.current.deactivate(),void(i.current={activate:function(){},deactivate:function(){}});var e=n.current,s=FO(t.current,{onActivate:void 0,initialFocus:r?function(){return(null==r?void 0:r.current)||e}:void 0,fallbackFocus:e,escapeDeactivates:!1,clickOutsideDeactivates:!1}),a=!1;i.current={activate:function(){try{return a?Promise.resolve():(a=!0,Promise.resolve(s.activate()).then((function(){return Promise.resolve(new Promise((function(e){return setTimeout((function(){return e(void 0)}),0)}))).then((function(){}))})))}catch(e){return Promise.reject(e)}},deactivate:function(){a&&(a=!1,s.deactivate())}}}),[o,n,r,t]),i}({targetRef:j,fallbackRef:K,initialFocusRef:d||void 0,enabled:A&&b&&!1!==d}),te=function(e){var t=e.getSnapPoints,n=e.heightRef,r=e.lastSnapRef,o=e.ready,i=function(e){var t=e.contentRef,n=e.controlledMaxHeight,r=e.footerEnabled,o=e.footerRef,i=e.headerEnabled,s=e.headerRef,a=e.registerReady,l=e.resizeSourceRef,c=ie((function(){return a("contentHeight")}),[a]),d=function(e,t,n){var r=ie((function(){return t("maxHeight")}),[t]),o=le((function(){return UL(e)||"undefined"!=typeof window?window.innerHeight:0})),i=o[0],s=o[1],a=i>0,l=ae(0);return ce(e?"controlled":"auto"),de((function(){a&&r()}),[a,r]),qL((function(){if(e)return s(UL(e)),void(n.current="maxheightprop");var t=function(){l.current||(l.current=requestAnimationFrame((function(){s(window.innerHeight),n.current="window",l.current=0})))};return window.addEventListener("resize",t),s(window.innerHeight),n.current="window",r(),function(){window.removeEventListener("resize",t),cancelAnimationFrame(l.current)}}),[e,r,n]),i}(n,a,l),u=ZL(s,{label:"headerHeight",enabled:i,resizeSourceRef:l}),h=ZL(t,{label:"contentHeight",enabled:!0,resizeSourceRef:l}),p=ZL(o,{label:"footerHeight",enabled:r,resizeSourceRef:l}),f=Math.min(d-u-p,h)+u+p;ce("minHeight: "+f);var m=h>0;return de((function(){m&&c()}),[m,c]),{maxHeight:d,minHeight:f,headerHeight:u,footerHeight:p}}({contentRef:e.contentRef,controlledMaxHeight:e.controlledMaxHeight,footerEnabled:e.footerEnabled,footerRef:e.footerRef,headerEnabled:e.headerEnabled,headerRef:e.headerRef,registerReady:e.registerReady,resizeSourceRef:e.resizeSourceRef}),s=i.maxHeight,a=i.minHeight,l=i.headerHeight,c=i.footerHeight,d=function(e,t){var n=[].concat(e).map(UL).reduce((function(e,n){return e.add(WL(n,0,t)),e}),new Set),r=Array.from(n),o=Math.min.apply(Math,r);if(Number.isNaN(o))throw new TypeError("minSnap is NaN");var i=Math.max.apply(Math,r);if(Number.isNaN(i))throw new TypeError("maxSnap is NaN");return{snapPoints:r,minSnap:o,maxSnap:i}}(o?t({height:n.current,footerHeight:c,headerHeight:l,minHeight:a,maxHeight:s}):[0],s),u=d.snapPoints,h=d.minSnap,p=d.maxSnap;return ce("minSnap: "+h+", maxSnap:"+p),{minSnap:h,maxSnap:p,findSnap:function(e){var t=UL("function"==typeof e?e({footerHeight:c,headerHeight:l,height:n.current,minHeight:a,maxHeight:s,snapPoints:u,lastSnap:r.current}):e);return u.reduce((function(e,n){return Math.abs(n-t)<Math.abs(e-t)?n:e}),h)},maxHeight:s}}({contentRef:q,controlledMaxHeight:h,footerEnabled:!!i,footerRef:U,getSnapPoints:g,headerEnabled:!1!==s,headerRef:W,heightRef:Z,lastSnapRef:c,ready:A,registerReady:R,resizeSourceRef:G}),re=te.minSnap,oe=te.maxSnap,se=te.maxHeight,ue=te.findSnap,he=ae(se),pe=ae(re),me=ae(oe),ve=ae(ue),be=ae(0);qL((function(){he.current=se,me.current=oe,pe.current=re,ve.current=ue,be.current=ue(f)}),[ue,f,se,oe,re]);var ye=fe((function(e){var t=e.onRest,n=e.config,r=(n=void 0===n?{}:n).velocity,o=void 0===r?1:r,i=FL(n,eA),s=FL(e,tA);return new Promise((function(e){return B(jL({},s,{config:jL({velocity:o},i,{mass:1,tension:rA,friction:Math.max(oA,oA+(oA-oA*o))}),onRest:function(){var n=[].slice.call(arguments);e.apply(void 0,n),null==t||t.apply(void 0,n)}}))}))}),[B]),we=mE(YL,{devTools:!1,actions:{onOpenCancel:fe((function(){return null==P.current?void 0:P.current({type:"OPEN"})}),[]),onSnapCancel:fe((function(e){return null==P.current?void 0:P.current({type:"SNAP",source:e.snapSource})}),[]),onCloseCancel:fe((function(){return null==P.current?void 0:P.current({type:"CLOSE"})}),[]),onResizeCancel:fe((function(){return null==P.current?void 0:P.current({type:"RESIZE",source:G.current})}),[]),onOpenEnd:fe((function(){return null==I.current?void 0:I.current({type:"OPEN"})}),[]),onSnapEnd:fe((function(e,t){return null==I.current?void 0:I.current({type:"SNAP",source:e.snapSource})}),[]),onResizeEnd:fe((function(){return null==I.current?void 0:I.current({type:"RESIZE",source:G.current})}),[])},context:{initialState:l},services:{onSnapStart:fe((function(e,t){try{return Promise.resolve(null==D.current?void 0:D.current({type:"SNAP",source:t.payload.source||"custom"}))}catch(e){return Promise.reject(e)}}),[]),onOpenStart:fe((function(){try{return Promise.resolve(null==D.current?void 0:D.current({type:"OPEN"}))}catch(e){return Promise.reject(e)}}),[]),onCloseStart:fe((function(){try{return Promise.resolve(null==D.current?void 0:D.current({type:"CLOSE"}))}catch(e){return Promise.reject(e)}}),[]),onResizeStart:fe((function(){try{return Promise.resolve(null==D.current?void 0:D.current({type:"RESIZE",source:G.current}))}catch(e){return Promise.reject(e)}}),[]),onSnapEnd:fe((function(e,t){try{return Promise.resolve(null==I.current?void 0:I.current({type:"SNAP",source:e.snapSource}))}catch(e){return Promise.reject(e)}}),[]),onOpenEnd:fe((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"OPEN"}))}catch(e){return Promise.reject(e)}}),[]),onCloseEnd:fe((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"CLOSE"}))}catch(e){return Promise.reject(e)}}),[]),onResizeEnd:fe((function(){try{return Promise.resolve(null==I.current?void 0:I.current({type:"RESIZE",source:G.current}))}catch(e){return Promise.reject(e)}}),[]),renderVisuallyHidden:fe((function(e,t){try{return Promise.resolve(ye({y:be.current,ready:0,maxHeight:he.current,maxSnap:me.current,minSnap:be.current,immediate:!0})).then((function(){}))}catch(e){return Promise.reject(e)}}),[ye]),activate:fe((function(e,t){try{return N.current=!0,Promise.resolve(Promise.all([Y.current.activate(),ee.current.activate(),Q.current.activate()])).then((function(){}))}catch(e){return Promise.reject(e)}}),[Q,ee,Y]),deactivate:fe((function(){try{return Y.current.deactivate(),ee.current.deactivate(),Q.current.deactivate(),N.current=!1,Promise.resolve()}catch(e){return Promise.reject(e)}}),[Q,ee,Y]),openImmediately:fe((function(){try{return Z.current=be.current,Promise.resolve(ye({y:be.current,ready:1,maxHeight:he.current,maxSnap:me.current,minSnap:be.current,immediate:!0})).then((function(){}))}catch(e){return Promise.reject(e)}}),[ye]),openSmoothly:fe((function(){try{return Promise.resolve(ye({y:0,ready:1,maxHeight:he.current,maxSnap:me.current,minSnap:be.current,immediate:!0})).then((function(){return Z.current=be.current,Promise.resolve(ye({y:be.current,ready:1,maxHeight:he.current,maxSnap:me.current,minSnap:be.current,immediate:X.current})).then((function(){}))}))}catch(e){return Promise.reject(e)}}),[ye,X]),snapSmoothly:fe((function(e,t){try{var n=ve.current(e.y);return Z.current=n,c.current=n,Promise.resolve(ye({y:n,ready:1,maxHeight:he.current,maxSnap:me.current,minSnap:pe.current,immediate:X.current,config:{velocity:e.velocity}})).then((function(){}))}catch(e){return Promise.reject(e)}}),[ye,c,X]),resizeSmoothly:fe((function(){try{var e=ve.current(Z.current);return Z.current=e,c.current=e,Promise.resolve(ye({y:e,ready:1,maxHeight:he.current,maxSnap:me.current,minSnap:pe.current,immediate:"element"!==G.current||X.current})).then((function(){}))}catch(e){return Promise.reject(e)}}),[ye,c,X]),closeSmoothly:fe((function(e,t){try{return ye({minSnap:Z.current,immediate:!0}),Z.current=0,Promise.resolve(ye({y:0,maxHeight:he.current,maxSnap:me.current,immediate:X.current})).then((function(){return Promise.resolve(ye({ready:0,immediate:!0})).then((function(){}))}))}catch(e){return Promise.reject(e)}}),[ye,X])}}),Ce=we[0],xe=we[1];de((function(){A&&xe(a?"OPEN":"CLOSE")}),[a,xe,A]),qL((function(){(se||oe||re)&&xe("RESIZE")}),[se,oe,re,xe]),de((function(){return function(){Y.current.deactivate(),ee.current.deactivate(),Q.current.deactivate()}}),[Q,ee,Y]),ge(t,(function(){return{snapTo:function(e,t){var n=void 0===t?{}:t,r=n.velocity,o=void 0===r?1:r,i=n.source,s=void 0===i?"custom":i;xe("SNAP",{payload:{y:ve.current(e),velocity:o,source:s}})},get height(){return Z.current}}}),[xe]),de((function(){var e=F.current,t=function(e){J.current&&e.preventDefault()},n=function(t){e.scrollTop<0&&(requestAnimationFrame((function(){e.style.overflow="hidden",e.scrollTop=0,e.style.removeProperty("overflow")})),t.preventDefault())};return T&&(e.addEventListener("scroll",t),e.addEventListener("touchmove",t),e.addEventListener("touchstart",n)),function(){e.removeEventListener("scroll",t),e.removeEventListener("touchmove",t),e.removeEventListener("touchstart",n)}}),[T,F]);var ke=pO((function(e){var t=e.args,n=(t=void 0===t?[]:t)[0],r=(n=void 0===n?{}:n).closeOnTap,o=void 0!==r&&r,i=n.isContentDragging,s=void 0!==i&&i,a=e.cancel,l=e.direction[1],c=e.down,d=e.first,h=e.last,p=e.memo,f=void 0===p?_.y.getValue():p,m=e.tap,g=e.velocity,v=-1*e.movement[1];if(!N.current)return a(),f;if(u&&o&&m)return a(),setTimeout((function(){return u()}),0),f;if(m)return f;var b=f+v,y=v*g,w=Math.max(pe.current,Math.min(me.current,b+2*y));if(!c&&u&&l>0&&b+y<pe.current/2)return a(),u(),f;var C=c?u||pe.current!==me.current?ET(b,u?0:pe.current,me.current,.55):b<pe.current?ET(b,pe.current,2*me.current,.55):ET(b,pe.current/2,me.current,.55):w;return T&&s?(C>=me.current&&(C=me.current),f===me.current&&F.current.scrollTop>0&&(C=me.current),J.current=C<me.current):J.current=!1,d&&xe("DRAG"),h?(xe("SNAP",{payload:{y:C,velocity:g>.05?g:1,source:"dragging"}}),f):(B({y:C,ready:1,maxHeight:he.current,maxSnap:me.current,minSnap:pe.current,immediate:!0,config:{velocity:g}}),f)}),{filterTaps:!0});if(Number.isNaN(me.current))throw new TypeError("maxSnapRef is NaN!!");if(Number.isNaN(pe.current))throw new TypeError("minSnapRef is NaN!!");var $e=function(e){var t,n=e.spring,r=VE([n.y,n.maxHeight],(function(e,t){return Math.round(WL(t-e,0,16))+"px"})),o=VE([n.y,n.minSnap,n.maxSnap],(function(e,t,n){return WL(e,t,n)+"px"})),i=VE([n.y,n.minSnap,n.maxSnap],(function(e,t,n){return e<t?t-e+"px":e>n?n-e+"px":"0px"})),s=VE([n.y,n.maxSnap],(function(e,t){return e>=t?Math.ceil(e-t):0})),a=VE([n.y,n.minSnap],(function(e,t){if(!t)return 0;var n=Math.max(t/2-45,0);return WL((e-n)*(1/(Math.min(t/2+45,t)-n)+0),0,1)})),l=VE([n.y,n.minSnap],(function(e,t){return t?WL(e/t,0,1):0}));return(t={})["--rsbs-content-opacity"]=a,t["--rsbs-backdrop-opacity"]=l,t["--rsbs-antigap-scale-y"]=s,t["--rsbs-overlay-translate-y"]=i,t["--rsbs-overlay-rounded"]=r,t["--rsbs-overlay-h"]=o,t}({spring:_});return ne.createElement(CT.div,jL({},O,{"data-rsbs-root":!0,"data-rsbs-state":sA.find(Ce.matches),"data-rsbs-is-blocking":b,"data-rsbs-is-dismissable":!!u,"data-rsbs-has-header":!!s,"data-rsbs-has-footer":!!i,className:o,ref:j,style:jL({},$e,C,{opacity:_.ready})}),r,b&&ne.createElement("div",jL({key:"backdrop","data-rsbs-backdrop":!0},ke({closeOnTap:!0}))),ne.createElement("div",{key:"overlay","aria-modal":"true",role:"dialog","data-rsbs-overlay":!0,tabIndex:-1,ref:K,onKeyDown:function(e){"Escape"===e.key&&(e.stopPropagation(),u&&u())}},!1!==s&&ne.createElement("div",jL({key:"header","data-rsbs-header":!0,ref:W},ke()),s),ne.createElement("div",jL({key:"scroll","data-rsbs-scroll":!0,ref:F},T?ke({isContentDragging:!0}):{}),ne.createElement("div",{"data-rsbs-content":!0,ref:q},n)),i&&ne.createElement("div",jL({key:"footer",ref:U,"data-rsbs-footer":!0},ke()),i)))})),sA=["closed","opening","open","closing","dragging","snapping","resizing"];function aA(e){var t=e.lastSnap;return null!=t?t:Math.min.apply(Math,e.snapPoints)}function lA(e){return e.minHeight}var cA=["onSpringStart","onSpringEnd","skipInitialTransition"],dA=se((function(e,t){var n=e.onSpringStart,r=e.onSpringEnd,o=e.skipInitialTransition,i=FL(e,cA),s=le(!1),a=s[0],l=s[1],c=ae(),d=ae(null),u=ae(o&&i.open?"OPEN":"CLOSED");qL((function(){if(i.open)return cancelAnimationFrame(c.current),l(!0),function(){u.current="CLOSED"}}),[i.open]);var h=fe((function(e){return Promise.resolve(null==n?void 0:n(e)).then((function(){"OPEN"===e.type&&cancelAnimationFrame(c.current)}))}),[n]),p=fe((function(e){return Promise.resolve(null==r?void 0:r(e)).then((function(){"CLOSE"===e.type&&(c.current=requestAnimationFrame((function(){return l(!1)})))}))}),[r]);return a?ne.createElement(oS,{"data-rsbs-portal":!0},ne.createElement(iA,jL({},i,{lastSnapRef:d,ref:t,initialState:u.current,onSpringStart:h,onSpringEnd:p}))):null}));const uA=$e`
2690
2690
  width: ${He(1e3)};
2691
2691
  border-radius: ${Be(300)};
2692
2692
  background: transparent;
@@ -2726,7 +2726,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
2726
2726
  padding: 0;
2727
2727
  min-height: ${He(1600)};
2728
2728
  }
2729
- `;!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("[data-rsbs-overlay] {\n border-top-left-radius: 16px;\n border-top-left-radius: var(--rsbs-overlay-rounded,16px);\n border-top-right-radius: 16px;\n border-top-right-radius: var(--rsbs-overlay-rounded,16px);\n display: flex;\n background: #fff;\n background: var(--rsbs-bg,#fff);\n flex-direction: column;\n height: 0px;\n height: var(--rsbs-overlay-h,0px);\n transform: translate3d(0, 0px, 0);\n transform: translate3d(0, var(--rsbs-overlay-translate-y,0px), 0);\n will-change: height;\n}\n\n[data-rsbs-overlay]:focus {\n outline: none;\n}\n\n[data-rsbs-is-blocking='false'] [data-rsbs-overlay] {\n box-shadow: 0 -5px 60px 0 rgba(38, 89, 115, 0.11),\n 0 -1px 0 rgba(38, 89, 115, 0.05);\n}\n\n[data-rsbs-overlay],\n[data-rsbs-root]:after {\n max-width: auto;\n max-width: var(--rsbs-max-w,auto);\n margin-left: env(safe-area-inset-left);\n margin-left: var(--rsbs-ml,env(safe-area-inset-left));\n margin-right: env(safe-area-inset-right);\n margin-right: var(--rsbs-mr,env(safe-area-inset-right));\n}\n\n[data-rsbs-overlay],\n[data-rsbs-backdrop],\n[data-rsbs-root]:after {\n z-index: 3;\n -ms-scroll-chaining: none;\n overscroll-behavior: none;\n touch-action: none;\n position: fixed;\n right: 0;\n bottom: 0;\n left: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n}\n\n[data-rsbs-backdrop] {\n top: -60px;\n bottom: -60px;\n background-color: rgba(0, 0, 0, 0.6);\n background-color: var(--rsbs-backdrop-bg,rgba(0, 0, 0, 0.6));\n will-change: opacity;\n cursor: pointer;\n opacity: 1;\n}\n\n[data-rsbs-is-dismissable='false'] [data-rsbs-backdrop] {\n cursor: ns-resize;\n}\n\n[data-rsbs-root]:after {\n content: '';\n pointer-events: none;\n background: #fff;\n background: var(--rsbs-bg,#fff);\n height: 1px;\n transform-origin: bottom;\n transform: scale3d(1, 0, 1);\n transform: scale3d(1, var(--rsbs-antigap-scale-y,0), 1);\n will-change: transform;\n}\n\n[data-rsbs-footer],\n[data-rsbs-header] {\n flex-shrink: 0;\n cursor: ns-resize;\n padding: 16px;\n}\n\n[data-rsbs-header] {\n text-align: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n box-shadow: 0 1px 0\n rgba(46, 59, 66, calc(1 * 0.125));\n box-shadow: 0 1px 0\n rgba(46, 59, 66, calc(var(--rsbs-content-opacity,1) * 0.125));\n z-index: 1;\n padding-top: calc(20px + env(safe-area-inset-top));\n padding-bottom: 8px;\n}\n\n[data-rsbs-header]:before {\n position: absolute;\n content: '';\n display: block;\n width: 36px;\n height: 4px;\n top: calc(8px + env(safe-area-inset-top));\n left: 50%;\n transform: translateX(-50%);\n border-radius: 2px;\n background-color: hsla(0, 0%, 0%, 0.14);\n background-color: var(--rsbs-handle-bg,hsla(0, 0%, 0%, 0.14));\n}\n\n@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {\n [data-rsbs-header]:before {\n transform: translateX(-50%) scaleY(0.75);\n }\n}\n\n[data-rsbs-has-header='false'] [data-rsbs-header] {\n box-shadow: none;\n padding-top: calc(12px + env(safe-area-inset-top));\n}\n\n[data-rsbs-scroll] {\n flex-shrink: 1;\n flex-grow: 1;\n -webkit-tap-highlight-color: revert;\n -webkit-touch-callout: revert;\n -webkit-user-select: auto;\n -ms-user-select: auto;\n -moz-user-select: auto;\n user-select: auto;\n overflow: auto;\n -ms-scroll-chaining: none;\n overscroll-behavior: contain;\n -webkit-overflow-scrolling: touch;\n}\n\n[data-rsbs-scroll]:focus {\n outline: none;\n}\n\n[data-rsbs-has-footer='false'] [data-rsbs-content] {\n padding-bottom: env(safe-area-inset-bottom);\n}\n\n[data-rsbs-content] {\n /* The overflow hidden is to ensure any margin on child nodes are included when the resize observer is measuring the height */\n overflow: hidden;\n}\n\n[data-rsbs-footer] {\n box-shadow: 0 -1px 0 rgba(46, 59, 66, calc(1 * 0.125)),\n 0 2px 0 #fff;\n box-shadow: 0 -1px 0 rgba(46, 59, 66, calc(var(--rsbs-content-opacity,1) * 0.125)),\n 0 2px 0 var(--rsbs-bg,#fff);\n overflow: hidden;\n z-index: 1;\n padding-bottom: calc(16px + env(safe-area-inset-bottom));\n}\n\n[data-rsbs-is-dismissable='true'] [data-rsbs-header] > *, [data-rsbs-is-dismissable='true'] [data-rsbs-scroll] > *, [data-rsbs-is-dismissable='true'] [data-rsbs-footer] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-header] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-header] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-scroll] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-scroll] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-footer] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-footer] > * {\n opacity: 1;\n opacity: var(--rsbs-content-opacity,1);\n }\n\n[data-rsbs-is-dismissable='true'] [data-rsbs-backdrop], [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-backdrop], [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-backdrop] {\n opacity: 1;\n opacity: var(--rsbs-backdrop-opacity,1);\n }\n\n[data-rsbs-state='closed'],\n[data-rsbs-state='closing'] {\n /* Allows interactions on the rest of the page before the close transition is finished */\n pointer-events: none;\n}\n");const pA=(e,t)=>{let n=0,r=1/0;return t.forEach(((t,o)=>{const i=Math.abs(t-e);i<r&&(r=i,n=o)})),n},fA=({header:e,content:t,footer:n,open:r=!1,onClose:o,minimizedHeight:i,midHeight:s=200,maxFullHeight:a,defaultSnap:l="minimized",className:c,blocking:d,zIndex:u=1e3})=>{const h=ae(null),p=ne.useRef([]),[f,m]=ne.useState(null),g=window.innerWidth>768,v=p.current;let b="Expand sheet";if(null!=f){const e=pA(f,v);e>0&&e<v.length-1?b="Make full screen":e===v.length-1&&(b="Expanded sheet")}const y=!(null==f||!v.length||pA(f,v)!==v.length-1);return ye(dA,{ref:h,css:hA(!!e,u),className:c,open:r,onDismiss:o,header:be("div",{children:[ye("button",{type:"button",disabled:y,"aria-label":b,css:uA,onKeyDown:e=>{if("Enter"!==e.key&&" "!==e.key)return;e.preventDefault();const t=v[v.length-1];if(g)return void h.current?.snapTo?.((()=>t));const n=f??v[0];let r=v.findIndex((e=>e>n));-1===r&&(r=v.length-1);const o=v[r];h.current?.snapTo?.((()=>o))},children:ye("div",{})}),ye("span",{"aria-live":"polite",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:b}),e]}),footer:n,snapPoints:({headerHeight:e,maxHeight:t,footerHeight:r})=>{const o=[20,i||e,s+(n?r:0),a||t-t/6];return p.current=o,o},onSpringEnd:()=>{const e=h.current?.height;e&&m(e)},defaultSnap:({headerHeight:e,maxHeight:t,footerHeight:r})=>{let o=20;return"minimized"===l?o=i||e:"mid"===l?o=s+(n?r:0):"full"===l&&(o=a||t-t/6),o},blocking:d,children:r?t:null})},mA=(e,t)=>{let n="14.875rem";return"full-width"===e?n="100%":"large"===e&&(n="22.875rem"),$e`
2729
+ `;!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("[data-rsbs-overlay] {\n border-top-left-radius: 16px;\n border-top-left-radius: var(--rsbs-overlay-rounded,16px);\n border-top-right-radius: 16px;\n border-top-right-radius: var(--rsbs-overlay-rounded,16px);\n display: flex;\n background: #fff;\n background: var(--rsbs-bg,#fff);\n flex-direction: column;\n height: 0px;\n height: var(--rsbs-overlay-h,0px);\n transform: translate3d(0, 0px, 0);\n transform: translate3d(0, var(--rsbs-overlay-translate-y,0px), 0);\n will-change: height;\n}\n\n[data-rsbs-overlay]:focus {\n outline: none;\n}\n\n[data-rsbs-is-blocking='false'] [data-rsbs-overlay] {\n box-shadow: 0 -5px 60px 0 rgba(38, 89, 115, 0.11),\n 0 -1px 0 rgba(38, 89, 115, 0.05);\n}\n\n[data-rsbs-overlay],\n[data-rsbs-root]:after {\n max-width: auto;\n max-width: var(--rsbs-max-w,auto);\n margin-left: env(safe-area-inset-left);\n margin-left: var(--rsbs-ml,env(safe-area-inset-left));\n margin-right: env(safe-area-inset-right);\n margin-right: var(--rsbs-mr,env(safe-area-inset-right));\n}\n\n[data-rsbs-overlay],\n[data-rsbs-backdrop],\n[data-rsbs-root]:after {\n z-index: 3;\n -ms-scroll-chaining: none;\n overscroll-behavior: none;\n touch-action: none;\n position: fixed;\n right: 0;\n bottom: 0;\n left: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n}\n\n[data-rsbs-backdrop] {\n top: -60px;\n bottom: -60px;\n background-color: rgba(0, 0, 0, 0.6);\n background-color: var(--rsbs-backdrop-bg,rgba(0, 0, 0, 0.6));\n will-change: opacity;\n cursor: pointer;\n opacity: 1;\n}\n\n[data-rsbs-is-dismissable='false'] [data-rsbs-backdrop] {\n cursor: ns-resize;\n}\n\n[data-rsbs-root]:after {\n content: '';\n pointer-events: none;\n background: #fff;\n background: var(--rsbs-bg,#fff);\n height: 1px;\n transform-origin: bottom;\n transform: scale3d(1, 0, 1);\n transform: scale3d(1, var(--rsbs-antigap-scale-y,0), 1);\n will-change: transform;\n}\n\n[data-rsbs-footer],\n[data-rsbs-header] {\n flex-shrink: 0;\n cursor: ns-resize;\n padding: 16px;\n}\n\n[data-rsbs-header] {\n text-align: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n box-shadow: 0 1px 0\n rgba(46, 59, 66, calc(1 * 0.125));\n box-shadow: 0 1px 0\n rgba(46, 59, 66, calc(var(--rsbs-content-opacity,1) * 0.125));\n z-index: 1;\n padding-top: calc(20px + env(safe-area-inset-top));\n padding-bottom: 8px;\n}\n\n[data-rsbs-header]:before {\n position: absolute;\n content: '';\n display: block;\n width: 36px;\n height: 4px;\n top: calc(8px + env(safe-area-inset-top));\n left: 50%;\n transform: translateX(-50%);\n border-radius: 2px;\n background-color: hsla(0, 0%, 0%, 0.14);\n background-color: var(--rsbs-handle-bg,hsla(0, 0%, 0%, 0.14));\n}\n\n@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {\n [data-rsbs-header]:before {\n transform: translateX(-50%) scaleY(0.75);\n }\n}\n\n[data-rsbs-has-header='false'] [data-rsbs-header] {\n box-shadow: none;\n padding-top: calc(12px + env(safe-area-inset-top));\n}\n\n[data-rsbs-scroll] {\n flex-shrink: 1;\n flex-grow: 1;\n -webkit-tap-highlight-color: revert;\n -webkit-touch-callout: revert;\n -webkit-user-select: auto;\n -ms-user-select: auto;\n -moz-user-select: auto;\n user-select: auto;\n overflow: auto;\n -ms-scroll-chaining: none;\n overscroll-behavior: contain;\n -webkit-overflow-scrolling: touch;\n}\n\n[data-rsbs-scroll]:focus {\n outline: none;\n}\n\n[data-rsbs-has-footer='false'] [data-rsbs-content] {\n padding-bottom: env(safe-area-inset-bottom);\n}\n\n[data-rsbs-content] {\n /* The overflow hidden is to ensure any margin on child nodes are included when the resize observer is measuring the height */\n overflow: hidden;\n}\n\n[data-rsbs-footer] {\n box-shadow: 0 -1px 0 rgba(46, 59, 66, calc(1 * 0.125)),\n 0 2px 0 #fff;\n box-shadow: 0 -1px 0 rgba(46, 59, 66, calc(var(--rsbs-content-opacity,1) * 0.125)),\n 0 2px 0 var(--rsbs-bg,#fff);\n overflow: hidden;\n z-index: 1;\n padding-bottom: calc(16px + env(safe-area-inset-bottom));\n}\n\n[data-rsbs-is-dismissable='true'] [data-rsbs-header] > *, [data-rsbs-is-dismissable='true'] [data-rsbs-scroll] > *, [data-rsbs-is-dismissable='true'] [data-rsbs-footer] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-header] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-header] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-scroll] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-scroll] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-footer] > *, [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-footer] > * {\n opacity: 1;\n opacity: var(--rsbs-content-opacity,1);\n }\n\n[data-rsbs-is-dismissable='true'] [data-rsbs-backdrop], [data-rsbs-is-dismissable='false'][data-rsbs-state='opening'] [data-rsbs-backdrop], [data-rsbs-is-dismissable='false'][data-rsbs-state='closing'] [data-rsbs-backdrop] {\n opacity: 1;\n opacity: var(--rsbs-backdrop-opacity,1);\n }\n\n[data-rsbs-state='closed'],\n[data-rsbs-state='closing'] {\n /* Allows interactions on the rest of the page before the close transition is finished */\n pointer-events: none;\n}\n");const pA=(e,t)=>{let n=0,r=1/0;return t.forEach(((t,o)=>{const i=Math.abs(t-e);i<r&&(r=i,n=o)})),n},fA=({header:e,content:t,footer:n,open:r=!1,onClose:o,minimizedHeight:i,midHeight:s=200,maxFullHeight:a,defaultSnap:l="minimized",className:c,blocking:d,zIndex:u=1e3,labels:h})=>{const p=qm("Sheet",h),f=ae(null),m=ne.useRef([]),[g,v]=ne.useState(null),b=window.innerWidth>768,y=m.current;let w=p.expandSheetLabel;if(null!=g){const e=pA(g,y);e>0&&e<y.length-1?w=p.makeFullScreenLabel:e===y.length-1&&(w=p.expandedSheetLabel)}const C=!(null==g||!y.length||pA(g,y)!==y.length-1);return ye(dA,{ref:f,css:hA(!!e,u),className:c,open:r,onDismiss:o,header:be("div",{children:[ye("button",{type:"button",disabled:C,"aria-label":w,css:uA,onKeyDown:e=>{if("Enter"!==e.key&&" "!==e.key)return;e.preventDefault();const t=y[y.length-1];if(b)return void f.current?.snapTo?.((()=>t));const n=g??y[0];let r=y.findIndex((e=>e>n));-1===r&&(r=y.length-1);const o=y[r];f.current?.snapTo?.((()=>o))},children:ye("div",{})}),ye("span",{"aria-live":"polite",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:w}),e]}),footer:n,snapPoints:({headerHeight:e,maxHeight:t,footerHeight:r})=>{const o=[20,i||e,s+(n?r:0),a||t-t/6];return m.current=o,o},onSpringEnd:()=>{const e=f.current?.height;e&&v(e)},defaultSnap:({headerHeight:e,maxHeight:t,footerHeight:r})=>{let o=20;return"minimized"===l?o=i||e:"mid"===l?o=s+(n?r:0):"full"===l&&(o=a||t-t/6),o},blocking:d,children:r?t:null})},mA=(e,t)=>{let n="14.875rem";return"full-width"===e?n="100%":"large"===e&&(n="22.875rem"),$e`
2730
2730
  width: 100%;
2731
2731
  max-width: ${n};
2732
2732
  border-radius: ${Be(300)};
@@ -2803,13 +2803,13 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
2803
2803
  p {
2804
2804
  color: ${ze("error",900)};
2805
2805
  }
2806
- `,SA=({label:e,caption:t,variant:n,size:r="large",icon:o=ye(Ym,{height:"1rem",width:"1rem"}),onActionClick:i,actionLabel:s,isButtonRight:a,buttonLeftIcon:l,buttonRightIcon:c,labels:d})=>{const u=qm("InlineMessage",d);let h=wA;"info-grey"===n?h=CA:"success"===n?h=xA:"warning"===n?h=kA:"error"===n&&(h=$A);const p="error"===n||"warning"===n?"alert":"status",f="alert"===p?"assertive":"polite";return be("div",{css:[mA(r,a),h],role:p,"aria-live":f,"aria-roledescription":u.roleDescription,children:[be("div",{children:[be("div",{css:gA,children:[o,ye("p",{css:vA(r),children:e})]}),t&&"string"==typeof t?ye("p",{css:bA(r,!!o),children:t}):t?ye("div",{css:yA(r,!!o),children:t}):null]}),s?ye(Wm,{label:s,variant:"info-white"===n||"info-grey"===n?"primary":"secondary",size:"large"===r?"default":"small",onClick:i,leftIcon:l,rightIcon:c}):null]})},EA=$e`
2806
+ `,SA=({label:e,caption:t,variant:n,size:r="large",icon:o=ye(Ym,{height:"1rem",width:"1rem"}),onActionClick:i,actionLabel:s,isButtonRight:a,buttonLeftIcon:l,buttonRightIcon:c,labels:d})=>{const u=qm("InlineMessage",d);let h=wA;"info-grey"===n?h=CA:"success"===n?h=xA:"warning"===n?h=kA:"error"===n&&(h=$A);const p="error"===n||"warning"===n?"alert":"status",f="alert"===p?"assertive":"polite";return be("div",{css:[mA(r,a),h],role:p,"aria-live":f,"aria-roledescription":u.roleDescription,children:[be("div",{children:[be("div",{css:gA,children:[o,ye("p",{css:vA(r),children:e})]}),t&&"string"==typeof t?ye("p",{css:bA(r,!!o),children:t}):t?ye("div",{css:yA(r,!!o),children:t}):null]}),s?ye(Wm,{label:s,variant:"info-white"===n||"info-grey"===n?"primary":"secondary",size:"large"===r?"default":"small",onClick:i,leftIcon:l,rightIcon:c}):null]})},MA=$e`
2807
2807
  width: 100%;
2808
2808
  min-height: calc(${He(1200)} * 12);
2809
2809
  background-color: ${ze("neutral",100)};
2810
2810
  display: flex;
2811
2811
  flex-direction: column;
2812
- `,MA=$e`
2812
+ `,EA=$e`
2813
2813
  background-color: ${ze("neutral",200)};
2814
2814
  padding: ${He(300)};
2815
2815
  display: flex;
@@ -2839,9 +2839,9 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
2839
2839
  font-size: ${Ve(400)};
2840
2840
  line-height: ${_e(600)};
2841
2841
  font-weight: 700;
2842
- `,NA=$e`
2843
- width: 100%;
2844
2842
  `,RA=$e`
2843
+ width: 100%;
2844
+ `,NA=$e`
2845
2845
  flex: 1;
2846
2846
  min-height: 0;
2847
2847
  overflow-y: auto;
@@ -2896,7 +2896,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
2896
2896
  overflow: hidden;
2897
2897
  text-overflow: ellipsis;
2898
2898
  white-space: nowrap;
2899
- `,VA=({value:e,placeholder:t,showInfoMessage:n=!0,items:r=[],disabled:o,readOnly:i,id:s,name:a,autoFocus:l,autoComplete:c,onBlur:d,onFocus:u,onQueryChange:h,onCancel:p,onItemClick:f,onChange:m,labels:g})=>{const v=qm("MobileSearch",g),[b,y]=ne.useState(e??""),[w,C]=ne.useState(!0),[x,k]=ne.useState(!1),$=ne.useRef(null),S="string"==typeof e,E=S?e:b;ne.useEffect((()=>{S&&y(e)}),[S,e]),ne.useEffect((()=>{h?.(E)}),[E,h]);const M=ne.useMemo((()=>{const e=E.trim().toLowerCase();return e?r.filter((t=>`${t.id??""} ${t.label} ${t.caption??""}`.toLowerCase().includes(e))):r}),[r,E]),T=E.trim().length?v.matchingResultsTitle(M.length):v.recentSearchesTitle,O=E.length?ye(Sv,{onClick:()=>{S||y("");const e=$.current?.querySelector("input");e&&(e.value="",e.focus()),C(!0)}}):null;let L=ze("neutral",500);return o?L=ze("neutral",500):x&&(L=ze("primary",700)),be("div",{ref:$,css:EA,children:[be("div",{css:MA,children:[ye("div",{css:TA,children:ye(V,{startElement:ye(Og,{width:"1.25rem",height:"1.25rem",fill:L,"aria-hidden":"true"}),endElement:O,children:ye(mv,{label:"",value:E,placeholder:t??v.inputAriaLabel,onChange:e=>{S||y(e.target.value),C(!0),m?.(e)},onFocus:e=>{k(!0),C(!0),u?.(e)},onBlur:e=>{k(!1),d?.(e)},noMarginBottom:!0,type:"search","aria-label":t??v.inputAriaLabel,disabled:o,readOnly:i,id:s,name:a,autoFocus:l??!0,autoComplete:c,style:{paddingLeft:"2.5rem"}})})}),ye(Wm,{css:OA,variant:"borderless",label:v.cancelLabel,onClick:()=>{S||y(""),C(!1);const e=$.current?.querySelector("input");e&&(e.value="",e.blur()),p?.()}})]}),w?be("div",{css:LA,children:[ye("h3",{css:AA,children:T}),n?ye("div",{css:NA,children:ye(SA,{label:v.infoLabel,variant:"info-white",size:"full-width"})}):null,ye("ul",{css:RA,"aria-label":T,children:M.map((e=>ye("li",{children:be(N.button,{type:"button",css:DA,onClick:()=>(e=>{f?.(e)})(e),"aria-label":`${e.label}, ${e.caption??""}`,style:{width:"100%"},children:[e.icon??null,be("div",{css:PA,children:[ye("p",{css:IA,children:e.label}),ye("p",{css:zA,children:e.caption})]})]})},e.id)))})]}):null]})},HA=e=>$e`
2899
+ `,VA=({value:e,placeholder:t,showInfoMessage:n=!0,items:r=[],disabled:o,readOnly:i,id:s,name:a,autoFocus:l,autoComplete:c,onBlur:d,onFocus:u,onQueryChange:h,onCancel:p,onItemClick:f,onChange:m,labels:g})=>{const v=qm("MobileSearch",g),[b,y]=ne.useState(e??""),[w,C]=ne.useState(!0),[x,k]=ne.useState(!1),$=ne.useRef(null),S="string"==typeof e,M=S?e:b;ne.useEffect((()=>{S&&y(e)}),[S,e]),ne.useEffect((()=>{h?.(M)}),[M,h]);const E=ne.useMemo((()=>{const e=M.trim().toLowerCase();return e?r.filter((t=>`${t.id??""} ${t.label} ${t.caption??""}`.toLowerCase().includes(e))):r}),[r,M]),T=M.trim().length?v.matchingResultsTitle(E.length):v.recentSearchesTitle,O=M.length?ye(Sv,{onClick:()=>{S||y("");const e=$.current?.querySelector("input");e&&(e.value="",e.focus()),C(!0)}}):null;let L=ze("neutral",500);return o?L=ze("neutral",500):x&&(L=ze("primary",700)),be("div",{ref:$,css:MA,children:[be("div",{css:EA,children:[ye("div",{css:TA,children:ye(V,{startElement:ye(Og,{width:"1.25rem",height:"1.25rem",fill:L,"aria-hidden":"true"}),endElement:O,children:ye(mv,{label:"",value:M,placeholder:t??v.inputAriaLabel,onChange:e=>{S||y(e.target.value),C(!0),m?.(e)},onFocus:e=>{k(!0),C(!0),u?.(e)},onBlur:e=>{k(!1),d?.(e)},noMarginBottom:!0,type:"search","aria-label":t??v.inputAriaLabel,disabled:o,readOnly:i,id:s,name:a,autoFocus:l??!0,autoComplete:c,style:{paddingLeft:"2.5rem"}})})}),ye(Wm,{css:OA,variant:"borderless",label:v.cancelLabel,onClick:()=>{S||y(""),C(!1);const e=$.current?.querySelector("input");e&&(e.value="",e.blur()),p?.()}})]}),w?be("div",{css:LA,children:[ye("h3",{css:AA,children:T}),n?ye("div",{css:RA,children:ye(SA,{label:v.infoLabel,variant:"info-white",size:"full-width"})}):null,ye("ul",{css:NA,"aria-label":T,children:E.map((e=>ye("li",{children:be(R.button,{type:"button",css:DA,onClick:()=>(e=>{f?.(e)})(e),"aria-label":`${e.label}, ${e.caption??""}`,style:{width:"100%"},children:[e.icon??null,be("div",{css:PA,children:[ye("p",{css:IA,children:e.label}),ye("p",{css:zA,children:e.caption})]})]})},e.id)))})]}):null]})},HA=e=>$e`
2900
2900
  a,
2901
2901
  p {
2902
2902
  font-size: ${Ve("small"===e?200:400)};
@@ -2953,7 +2953,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
2953
2953
  `,qA=e=>$e`
2954
2954
  height: 100%;
2955
2955
  width: 100%;
2956
- max-width: ${null!=e?Me(e):"100%"};
2956
+ max-width: ${null!=e?Ee(e):"100%"};
2957
2957
  display: flex;
2958
2958
  align-items: center;
2959
2959
  justify-content: space-between;
@@ -3112,7 +3112,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3112
3112
  display: flex;
3113
3113
  justify-content: center;
3114
3114
  align-items: center;
3115
- `,QA=(e,t)=>Math.max(0,e.findIndex((e=>e.value===t))),eN=({defaultValue:e,tabs:t,onTabClick:n,hideLabels:r,activationMode:o="manual"})=>{const i=t.length,[s,a]=le((()=>QA(t,e)));return ye("div",{css:GA,children:ye(_.Root,{width:"full",defaultValue:e||t?.[0]?.value,onValueChange:({value:e})=>(e=>{const r=QA(t,e);a(r),n&&n(e)})(e),activationMode:o,children:ye(_.List,{alignItems:"center",border:"none",children:t.map(((e,t)=>{const{label:n,icon:o,bagdeCount:a,"aria-label":l,"aria-describedby":c,disabled:d,...u}=e,h=`${e.value}-str-status`,p=[`tab ${t+1} of ${i}`,s===t?"selected":"not selected"];d&&p.push("disabled");const f=[c,h].filter(Boolean).join(" ")||void 0;return be(_.Trigger,{css:JA,"aria-label":l||n,"aria-disabled":!!d||void 0,"aria-describedby":f,disabled:d,...u,children:[be("div",{css:XA,children:[o,a?ye("div",{css:YA,className:"ds-badge-count",children:a}):null]}),r?null:ye("p",{children:n}),ye(B,{id:h,children:p.join(", ")})]},e.value)}))})})})},tN=(e,t,n,r,o)=>{let i="3rem";return e?i="6rem":o&&(i="1.75rem"),$e`
3115
+ `,QA=(e,t)=>Math.max(0,e.findIndex((e=>e.value===t))),eR=({defaultValue:e,tabs:t,onTabClick:n,hideLabels:r,activationMode:o="manual",labels:i})=>{const s=qm("MobileTabBar",i),a=t.length,[l,c]=le((()=>QA(t,e)));return ye("div",{css:GA,children:ye(_.Root,{width:"full",defaultValue:e||t?.[0]?.value,onValueChange:({value:e})=>(e=>{const r=QA(t,e);c(r),n&&n(e)})(e),activationMode:o,children:ye(_.List,{alignItems:"center",border:"none",children:t.map(((e,t)=>{const{label:n,icon:o,bagdeCount:i,"aria-label":c,"aria-describedby":d,disabled:u,...h}=e,p=`${e.value}-str-status`,f=l===t,m=[s.tabPositionStatus(t+1,a),f?s.selectedStatus:s.notSelectedStatus];u&&m.push(s.disabledStatus);const g=[d,p].filter(Boolean).join(" ")||void 0;return be(_.Trigger,{css:JA,"aria-label":c||n,"aria-disabled":!!u||void 0,"aria-describedby":g,disabled:u,...h,children:[be("div",{css:XA,children:[o,i?ye("div",{css:YA,className:"ds-badge-count",children:i}):null]}),r?null:ye("p",{children:n}),ye(B,{id:p,children:m.join(", ")})]},e.value)}))})})})},tR=(e,t,n,r,o)=>{let i="3rem";return e?i="6rem":o&&(i="1.75rem"),$e`
3116
3116
  max-height: ${i};
3117
3117
  width: 100%;
3118
3118
  background-color: ${n??ze("neutral","dark"===r?800:100)};
@@ -3122,7 +3122,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3122
3122
  z-index: 102;
3123
3123
  border-bottom: ${je(100)} solid
3124
3124
  ${ze("neutral",400)};
3125
- `},nN=(e,t)=>$e`
3125
+ `},nR=(e,t)=>$e`
3126
3126
  height: ${He(t?700:1200)};
3127
3127
  width: 100%;
3128
3128
  background-color: ${ze("neutral","dark"===e?800:100)};
@@ -3133,10 +3133,10 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3133
3133
  justify-content: flex-start;
3134
3134
  gap: 0;
3135
3135
  padding: ${t?0:`${He(200)} ${He(400)}`};
3136
- `,rN=(e,t,n)=>$e`
3136
+ `,rR=(e,t,n)=>$e`
3137
3137
  height: ${He(n?700:1200)};
3138
3138
  width: 100%;
3139
- max-width: ${t?Me(t):"100%"};
3139
+ max-width: ${t?Ee(t):"100%"};
3140
3140
  background-color: ${e?ze("neutral",800):"transparent"};
3141
3141
  display: flex;
3142
3142
  align-items: ${n?"start":"center"};
@@ -3144,13 +3144,13 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3144
3144
  justify-content: space-between;
3145
3145
  margin: 0 auto;
3146
3146
  padding: ${n?0:`${He(200)} ${He(400)}`};
3147
- `,oN=(e,t)=>$e`
3147
+ `,oR=(e,t)=>$e`
3148
3148
  display: flex;
3149
3149
  margin: ${t?"-0.0625rem":"0rem"};
3150
3150
  justify-content: flex-start;
3151
3151
  gap: ${He(300)};
3152
3152
  color: ${ze("neutral",e?100:900)};
3153
- `,iN=$e`
3153
+ `,iR=$e`
3154
3154
  outline: none;
3155
3155
 
3156
3156
  a {
@@ -3162,12 +3162,12 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3162
3162
  outline-width: ${He(50)};
3163
3163
  }
3164
3164
  }
3165
- `,sN=e=>$e`
3165
+ `,sR=e=>$e`
3166
3166
  display: ${e?"none":"flex"};
3167
3167
  align-items: center;
3168
3168
  justify-content: flex-start;
3169
3169
  gap: 0rem;
3170
- `,aN=(e,t,n)=>$e`
3170
+ `,aR=(e,t,n)=>$e`
3171
3171
  font-size: ${Ve(n?300:400)};
3172
3172
  line-height: ${_e(600)};
3173
3173
  font-weight: 400;
@@ -3192,12 +3192,12 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3192
3192
  font-weight: 700;
3193
3193
  color: ${ze("accessible","controls-on-neutral-lights")};
3194
3194
  `:""}
3195
- `,lN=e=>$e`
3195
+ `,lR=e=>$e`
3196
3196
  height: ${He(e?700:1200)};
3197
3197
  display: flex;
3198
3198
  align-items: center;
3199
3199
  justify-content: flex-end;
3200
- `,cN=e=>$e`
3200
+ `,cR=e=>$e`
3201
3201
  height: 100%;
3202
3202
  font-size: ${Ve(400)};
3203
3203
  line-height: ${_e(600)};
@@ -3217,7 +3217,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3217
3217
  }
3218
3218
  }
3219
3219
  `:""}
3220
- `,dN=e=>$e`
3220
+ `,dR=e=>$e`
3221
3221
  height: 100%;
3222
3222
  display: flex;
3223
3223
  align-items: center;
@@ -3226,7 +3226,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3226
3226
  padding-left: ${He(400)};
3227
3227
  border-left: ${je(100)} solid
3228
3228
  ${ze("neutral",e?700:300)};
3229
- `,uN=(e="light",t)=>$e`
3229
+ `,uR=(e="light",t)=>$e`
3230
3230
  background-color: none;
3231
3231
  border: none;
3232
3232
  cursor: pointer;
@@ -3252,7 +3252,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3252
3252
  outline-width: ${je(200)};
3253
3253
  background-color: ${ze("neutral",200)};
3254
3254
  }
3255
- `,hN=(e,t)=>$e`
3255
+ `,hR=(e,t)=>$e`
3256
3256
  position: absolute;
3257
3257
  top: ${He(t?700:1200)};
3258
3258
  right: 0;
@@ -3267,10 +3267,10 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3267
3267
  justify-content: flex-start;
3268
3268
  gap: ${He(400)};
3269
3269
  transition: width 0.5s ease-in-out;
3270
- `,pN=$e`
3270
+ `,pR=$e`
3271
3271
  height: 100%;
3272
3272
  width: 100%;
3273
- `,fN=e=>$e`
3273
+ `,fR=e=>$e`
3274
3274
  background-color: ${ze("neutral","dark"===e?800:200)};
3275
3275
  border-bottom: ${je(100)} solid
3276
3276
  ${ze("neutral",300)};
@@ -3291,13 +3291,13 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3291
3291
  margin-left: -${He(300)};
3292
3292
  }
3293
3293
  }
3294
- `,mN=$e`
3294
+ `,mR=$e`
3295
3295
  background-color: ${ze("neutral",100)};
3296
- `,gN=$e`
3296
+ `,gR=$e`
3297
3297
  min-height: 100vh;
3298
3298
  width: 100%;
3299
3299
  overflow-y: scroll;
3300
- `;$e``;const vN=e=>$e`
3300
+ `;$e``;const vR=e=>$e`
3301
3301
  display: inline-block;
3302
3302
  width: 100%;
3303
3303
  padding: ${He(300)} ${He(400)};
@@ -3326,7 +3326,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3326
3326
  outline-width: ${je(200)};
3327
3327
  background-color: ${ze("neutral",200)};
3328
3328
  }
3329
- `,bN=$e`
3329
+ `,bR=$e`
3330
3330
  width: 100%;
3331
3331
  padding: ${He(300)} ${He(400)};
3332
3332
  display: flex;
@@ -3350,7 +3350,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3350
3350
  outline-width: ${je(200)};
3351
3351
  background-color: ${ze("neutral",200)};
3352
3352
  }
3353
- `,yN=e=>$e`
3353
+ `,yR=e=>$e`
3354
3354
  position: absolute;
3355
3355
  top: 0rem;
3356
3356
  right: 0;
@@ -3362,7 +3362,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3362
3362
  align-items: flex-start;
3363
3363
  justify-content: flex-start;
3364
3364
  transition: width 0.5s ease-in-out;
3365
- `,wN=$e`
3365
+ `,wR=$e`
3366
3366
  height: ${He(1200)};
3367
3367
  width: 100%;
3368
3368
  display: flex;
@@ -3374,7 +3374,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3374
3374
  position: relative;
3375
3375
  top: 0;
3376
3376
  left: 0;
3377
- `,CN=$e`
3377
+ `,CR=$e`
3378
3378
  position: absolute;
3379
3379
  bottom: 0;
3380
3380
  left: 0;
@@ -3389,7 +3389,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3389
3389
  button {
3390
3390
  width: calc(48% - 1.5rem);
3391
3391
  }
3392
- `,xN=({theme:e="light",variant:t,navigationSection:n,utilitySection:r,actionsSection:o,linkRouter:i,isOpen:s,setIsOpen:a,pathname:l,resolvedLabels:c})=>{const d="condensed"===t,[u,h]=le(void 0),[p,f]=le(-1),m=ae(null),g=ae([]),v=i;return be(we,{children:[ye("div",{css:hN(s,d),children:s&&be("div",{css:pN,children:[be("div",{style:{overflowY:"scroll",width:"100%",height:"100%",paddingBottom:"4.5rem"},children:[r?ye("div",{css:fN(e),children:r?.map((e=>ye("div",{className:"ds-utility-item",children:e})))}):null,n?ye("div",{css:mN,children:n.map(((e,t)=>e.link?ye(v,{to:e.link,href:e.link,onClick:()=>{h(void 0),f(-1),a(!1)},css:vN(l===e.link),children:e.label},e.label):be("button",{css:bN,type:"button",ref:e=>{g.current[t]=e},onClick:()=>{e.items&&(h(e),f(t),setTimeout((()=>{m.current?.focus()}),100))},children:[e.label,e.items?ye(Qm,{rotate:"270",color:"var(--chakra-colors-neutral-700)"}):null]},e.label)))}):null]}),o?ye("div",{css:CN,children:o.map((e=>ye(Wm,{...e,onClick:t=>{e?.onClick?.(t),h(void 0),f(-1),a(!1)}},e.ariaLabel)))}):null]})}),ye("div",{css:yN(!!u?.items),children:u?.items?be(we,{children:[be("div",{css:wN,children:[be("button",{type:"button",onClick:()=>{h(void 0),f(-1),g.current[p]?.focus()},"aria-label":c.goBackLabel,css:uN(e),ref:m,children:[ye(Qm,{rotate:"90",color:"var(--chakra-colors-neutral-700)"}),u?.label]}),be("button",{type:"button",onClick:()=>{h(void 0),f(-1),a(!1)},"aria-label":c.closeMenuLabel,css:uN(e),children:[c.closeButtonText,ye(tg,{height:"1rem",width:"1rem"})]})]}),ye("div",{css:gN,children:u?.items?.map((e=>ye(v,{to:e.link,href:e.link,css:vN(),onClick:()=>{h(void 0),f(-1),a(!1)},children:e.label},e.label)))})]}):null})]})},kN=1023,$N=({variant:e="default",theme:t="light",logo:n,linkRouter:r,pathname:o,navigationSection:i,utilitySection:s,actionsSection:a,maxWidth:l,fixed:c,onNavbarHeightChange:d,backgroundColor:u,labels:h})=>{const p=qm("Navbar",h),f=ae(null),m=ae(null),g=ae(null),[v,b]=le(!1),[y,w]=le(-1),[C,x]=le("undefined"!=typeof window&&window?.innerWidth<=kN),[k,$]=le(!1),S=r,E=fe((()=>{if(m.current&&f.current&&g.current){const e=f.current.getBoundingClientRect(),t=m.current.getBoundingClientRect(),n=g.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=kN||window.innerWidth<=y?(d?.(96),b(!0)):window.innerWidth>kN&&window.innerWidth<=1440?e.right>=t.left?(d?.(96),b(!0),w(window.innerWidth)):window.innerWidth>y&&(d?.(48),b(!1),w(-1)):(d?.(48),b(!1),w(-1)),v&&(window.innerWidth<=kN||n.right>=t.left?(x(!0),d?.(48)):(x(!1),d?.(96)))}}),[y,v]);de((()=>(E(),window.addEventListener("resize",E),()=>{window.removeEventListener("resize",E)})),[E]);const M="condensed"===e;return be("nav",{css:tN(v&&!C,c,u,t,M),children:[be("div",{css:rN(v&&!C,l,M),children:[be("div",{css:oN(v&&!C||"dark"===t,M),ref:f,children:[n?ye("div",{ref:g,css:iN,children:n}):null,ye("div",{css:sN(v),children:i?.map((e=>e.link?ye(S,{to:e.link,href:e.link,css:aN(o===e.link,t,M),children:e.label},e.label):ye(Fg,{theme:t,label:e.label,fontSize:M?"0.875rem":"1rem",items:e.items||[]},e.label)))})]}),ye("div",{css:lN(M),ref:m,children:C?be("button",{type:"button",onClick:()=>$(!k),"aria-label":k?p.closeMenuLabel:p.openMenuLabel,"aria-expanded":k,css:uN(t),children:[k?p.closeLabel:p.menuLabel,ye(k?tg:Sg,{height:M?"0.75rem":"1rem",width:M?"0.75rem":"1rem"})]}):be(we,{children:[ye("div",{css:lN(M),children:s?.map(((e,t)=>ye("div",{css:cN(v),children:e},t)))}),a?.length?ye("div",{css:dN(v),children:a.map((e=>ye(Wm,{...e},e.ariaLabel)))}):null]})})]}),v&&!C?ye("div",{css:nN(t,M),children:i?.map((e=>e.link?ye(S,{to:e.link,href:e.link,css:aN(o===e.link,t,M),children:e.label},e.label):ye(Fg,{theme:t,label:e.label,fontSize:M?"0.875rem":"1rem",items:e.items||[]},e.label)))}):null,C?ye(xN,{theme:t,variant:e,navigationSection:i,utilitySection:s,actionsSection:a,linkRouter:r,isOpen:k,setIsOpen:$,pathname:o,resolvedLabels:p}):null]})},SN=$e`
3392
+ `,xR=({theme:e="light",variant:t,navigationSection:n,utilitySection:r,actionsSection:o,linkRouter:i,isOpen:s,setIsOpen:a,pathname:l,resolvedLabels:c})=>{const d="condensed"===t,[u,h]=le(void 0),[p,f]=le(-1),m=ae(null),g=ae([]),v=i;return be(we,{children:[ye("div",{css:hR(s,d),children:s&&be("div",{css:pR,children:[be("div",{style:{overflowY:"scroll",width:"100%",height:"100%",paddingBottom:"4.5rem"},children:[r?ye("div",{css:fR(e),children:r?.map((e=>ye("div",{className:"ds-utility-item",children:e})))}):null,n?ye("div",{css:mR,children:n.map(((e,t)=>e.link?ye(v,{to:e.link,href:e.link,onClick:()=>{h(void 0),f(-1),a(!1)},css:vR(l===e.link),children:e.label},e.label):be("button",{css:bR,type:"button",ref:e=>{g.current[t]=e},onClick:()=>{e.items&&(h(e),f(t),setTimeout((()=>{m.current?.focus()}),100))},children:[e.label,e.items?ye(Qm,{rotate:"270",color:"var(--chakra-colors-neutral-700)"}):null]},e.label)))}):null]}),o?ye("div",{css:CR,children:o.map((e=>ye(Wm,{...e,onClick:t=>{e?.onClick?.(t),h(void 0),f(-1),a(!1)}},e.ariaLabel)))}):null]})}),ye("div",{css:yR(!!u?.items),children:u?.items?be(we,{children:[be("div",{css:wR,children:[be("button",{type:"button",onClick:()=>{h(void 0),f(-1),g.current[p]?.focus()},"aria-label":c.goBackLabel,css:uR(e),ref:m,children:[ye(Qm,{rotate:"90",color:"var(--chakra-colors-neutral-700)"}),u?.label]}),be("button",{type:"button",onClick:()=>{h(void 0),f(-1),a(!1)},"aria-label":c.closeMenuLabel,css:uR(e),children:[c.closeButtonText,ye(tg,{height:"1rem",width:"1rem"})]})]}),ye("div",{css:gR,children:u?.items?.map((e=>ye(v,{to:e.link,href:e.link,css:vR(),onClick:()=>{h(void 0),f(-1),a(!1)},children:e.label},e.label)))})]}):null})]})},kR=1023,$R=({variant:e="default",theme:t="light",logo:n,linkRouter:r,pathname:o,navigationSection:i,utilitySection:s,actionsSection:a,maxWidth:l,fixed:c,onNavbarHeightChange:d,backgroundColor:u,labels:h})=>{const p=qm("Navbar",h),f=ae(null),m=ae(null),g=ae(null),[v,b]=le(!1),[y,w]=le(-1),[C,x]=le("undefined"!=typeof window&&window?.innerWidth<=kR),[k,$]=le(!1),S=r,M=fe((()=>{if(m.current&&f.current&&g.current){const e=f.current.getBoundingClientRect(),t=m.current.getBoundingClientRect(),n=g.current.getBoundingClientRect();t.width,e.width,window.innerWidth<=kR||window.innerWidth<=y?(d?.(96),b(!0)):window.innerWidth>kR&&window.innerWidth<=1440?e.right>=t.left?(d?.(96),b(!0),w(window.innerWidth)):window.innerWidth>y&&(d?.(48),b(!1),w(-1)):(d?.(48),b(!1),w(-1)),v&&(window.innerWidth<=kR||n.right>=t.left?(x(!0),d?.(48)):(x(!1),d?.(96)))}}),[y,v]);de((()=>(M(),window.addEventListener("resize",M),()=>{window.removeEventListener("resize",M)})),[M]);const E="condensed"===e;return be("nav",{css:tR(v&&!C,c,u,t,E),children:[be("div",{css:rR(v&&!C,l,E),children:[be("div",{css:oR(v&&!C||"dark"===t,E),ref:f,children:[n?ye("div",{ref:g,css:iR,children:n}):null,ye("div",{css:sR(v),children:i?.map((e=>e.link?ye(S,{to:e.link,href:e.link,css:aR(o===e.link,t,E),children:e.label},e.label):ye(Fg,{theme:t,label:e.label,fontSize:E?"0.875rem":"1rem",items:e.items||[]},e.label)))})]}),ye("div",{css:lR(E),ref:m,children:C?be("button",{type:"button",onClick:()=>$(!k),"aria-label":k?p.closeMenuLabel:p.openMenuLabel,"aria-expanded":k,css:uR(t),children:[k?p.closeLabel:p.menuLabel,ye(k?tg:Sg,{height:E?"0.75rem":"1rem",width:E?"0.75rem":"1rem"})]}):be(we,{children:[ye("div",{css:lR(E),children:s?.map(((e,t)=>ye("div",{css:cR(v),children:e},t)))}),a?.length?ye("div",{css:dR(v),children:a.map((e=>ye(Wm,{...e},e.ariaLabel)))}):null]})})]}),v&&!C?ye("div",{css:nR(t,E),children:i?.map((e=>e.link?ye(S,{to:e.link,href:e.link,css:aR(o===e.link,t,E),children:e.label},e.label):ye(Fg,{theme:t,label:e.label,fontSize:E?"0.875rem":"1rem",items:e.items||[]},e.label)))}):null,C?ye(xR,{theme:t,variant:e,navigationSection:i,utilitySection:s,actionsSection:a,linkRouter:r,isOpen:k,setIsOpen:$,pathname:o,resolvedLabels:p}):null]})},SR=$e`
3393
3393
  width: ${He(1600)};
3394
3394
  height: 100%;
3395
3395
  z-index: 100;
@@ -3399,7 +3399,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3399
3399
  display: flex;
3400
3400
  flex-direction: column;
3401
3401
  justify-content: space-between;
3402
- `,EN=$e`
3402
+ `,MR=$e`
3403
3403
  width: ${He(1600)};
3404
3404
  height: ${He(1600)};
3405
3405
  background-color: ${ze("neutral",200)};
@@ -3490,7 +3490,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3490
3490
  }
3491
3491
  }
3492
3492
  }
3493
- `,MN=$e`
3493
+ `,ER=$e`
3494
3494
  display: flex;
3495
3495
  justify-content: center;
3496
3496
  align-items: center;
@@ -3503,7 +3503,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3503
3503
  fill: ${ze("neutral",600)};
3504
3504
  }
3505
3505
  }
3506
- `,TN=$e`
3506
+ `,TR=$e`
3507
3507
  width: ${He(1600)};
3508
3508
  height: ${He(1600)};
3509
3509
  background-color: ${ze("neutral",200)};
@@ -3541,7 +3541,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3541
3541
  text-align: center;
3542
3542
  color: ${ze("neutral",600)};
3543
3543
  }
3544
- `,ON=$e`
3544
+ `,OR=$e`
3545
3545
  width: 20rem;
3546
3546
  height: 100%;
3547
3547
  z-index: 100;
@@ -3551,7 +3551,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3551
3551
  overflow-x: hidden;
3552
3552
  border-right: ${je(100)} solid
3553
3553
  ${ze("neutral",300)};
3554
- `,LN=({tabs:e=[],defaultValue:t,onTabClick:n,children:o,onOpenChange:i,labels:s})=>{const a=qm("NavigationRail",s),[l,c]=le(!1),[d,u]=le(t||e?.[0]?.value),h=e=>{u(e),n&&n(e)},[p]=j(["(max-width: 48rem)"]);return p?be(_.Root,{defaultValue:d,onValueChange:({value:e})=>h(e),children:[ye(_.List,{style:{display:"flex",overflowX:"auto",whiteSpace:"nowrap",padding:"0.5rem",gap:"0.5rem"},children:e.map((e=>ye(_.Trigger,{value:e.value,css:{"--indicator-color":ze("primary",500),flexShrink:0,padding:"0.625rem 1rem",color:ze("neutral",600),"&[data-selected]":{color:ze("neutral",800),fontWeight:600}},children:e.label},e.value)))}),e.map((e=>ye(_.Content,{value:e.value,children:o},e.value)))]}):be("div",{style:{height:"calc(100vh - 3rem - 3.5rem)",position:"fixed",top:"3rem",left:0,display:"flex"},children:[be("div",{css:SN,children:[ye(_.Root,{defaultValue:t||e?.[0]?.value,orientation:"horizontal",width:"full",onValueChange:({value:e})=>{h(e)},children:ye(_.List,{alignItems:"center",border:"none",style:{flexDirection:"column"},children:e.map((e=>ye(_.Trigger,{css:EN,"aria-label":e["aria-label"]||e.label,...e,children:be(r,{display:"flex",alignItems:"center",flexDirection:"column",gap:"0.3125rem",className:"ds-tab-label",children:[e.icon?ye("div",{css:MN,children:e.icon}):null,ye("p",{children:e.label})]})},e.label)))})}),o?ye(F.Root,{onOpenChange:({open:e})=>{c(e),i&&i(!e)},children:be(F.Trigger,{css:TN,children:[ye("div",{css:MN,children:ye(l?Gm:Zm,{})}),be("div",{className:"ds-tab-label",children:[ye("p",{children:l?a.showLabel:a.hideLabel}),ye("p",{children:a.sidebarLabel})]})]})}):null]}),o?ye(F.Root,{defaultOpen:!0,open:!l,children:ye(F.Content,{height:"100%",children:ye("div",{css:ON,role:"tabpanel","aria-labelledby":d,children:o})})}):null]})},AN=e=>$e`
3554
+ `,LR=({tabs:e=[],defaultValue:t,onTabClick:n,children:o,onOpenChange:i,labels:s})=>{const a=qm("NavigationRail",s),[l,c]=le(!1),[d,u]=le(t||e?.[0]?.value),h=e=>{u(e),n&&n(e)},[p]=j(["(max-width: 48rem)"]);return p?be(_.Root,{defaultValue:d,onValueChange:({value:e})=>h(e),children:[ye(_.List,{style:{display:"flex",overflowX:"auto",whiteSpace:"nowrap",padding:"0.5rem",gap:"0.5rem"},children:e.map((e=>ye(_.Trigger,{value:e.value,css:{"--indicator-color":ze("primary",500),flexShrink:0,padding:"0.625rem 1rem",color:ze("neutral",600),"&[data-selected]":{color:ze("neutral",800),fontWeight:600}},children:e.label},e.value)))}),e.map((e=>ye(_.Content,{value:e.value,children:o},e.value)))]}):be("div",{style:{height:"calc(100vh - 3rem - 3.5rem)",position:"fixed",top:"3rem",left:0,display:"flex"},children:[be("div",{css:SR,children:[ye(_.Root,{defaultValue:t||e?.[0]?.value,orientation:"horizontal",width:"full",onValueChange:({value:e})=>{h(e)},children:ye(_.List,{alignItems:"center",border:"none",style:{flexDirection:"column"},children:e.map((e=>ye(_.Trigger,{css:MR,"aria-label":e["aria-label"]||e.label,...e,children:be(r,{display:"flex",alignItems:"center",flexDirection:"column",gap:"0.3125rem",className:"ds-tab-label",children:[e.icon?ye("div",{css:ER,children:e.icon}):null,ye("p",{children:e.label})]})},e.label)))})}),o?ye(F.Root,{onOpenChange:({open:e})=>{c(e),i&&i(!e)},children:be(F.Trigger,{css:TR,children:[ye("div",{css:ER,children:ye(l?Gm:Zm,{})}),be("div",{className:"ds-tab-label",children:[ye("p",{children:l?a.showLabel:a.hideLabel}),ye("p",{children:a.sidebarLabel})]})]})}):null]}),o?ye(F.Root,{defaultOpen:!0,open:!l,children:ye(F.Content,{height:"100%",children:ye("div",{css:OR,role:"tabpanel","aria-labelledby":d,children:o})})}):null]})},AR=e=>$e`
3555
3555
  width: 100%;
3556
3556
  display: flex;
3557
3557
  align-items: center;
@@ -3560,7 +3560,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3560
3560
  ${"view"===e&&`\n border: ${je(100)} solid ${ze("neutral",400)};\n background-color: ${ze("neutral",200)};\n border-radius: ${Be(300)};\n padding: ${He(100)};\n `}
3561
3561
 
3562
3562
  ${"transparent"===e&&`\n border: none;\n background-color: transparent;\n border-radius: ${Be(300)};\n padding: 0 ${He(400)};\n\n .chakra-tabs__list {\n gap: ${He(800)};\n }\n `}
3563
- `,NN=$e`
3563
+ `,RR=$e`
3564
3564
  width: 99%;
3565
3565
  height: ${He(1e3)};
3566
3566
  padding: ${He(200)} ${He(400)};
@@ -3576,7 +3576,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3576
3576
  &:focus-visible {
3577
3577
  box-shadow: none;
3578
3578
  }
3579
- `,RN=$e`
3579
+ `,NR=$e`
3580
3580
  background-color: ${ze("neutral",200)};
3581
3581
  color: ${ze("neutral",700)};
3582
3582
 
@@ -3633,11 +3633,11 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3633
3633
  opacity: 1;
3634
3634
  }
3635
3635
  }
3636
- `,DN=$e`
3636
+ `,DR=$e`
3637
3637
  width: ${He(100)};
3638
3638
  height: ${He(600)};
3639
3639
  background-color: ${ze("neutral",400)};
3640
- `,PN=$e`
3640
+ `,PR=$e`
3641
3641
  height: ${He(800)};
3642
3642
  border-radius: ${Be(200)};
3643
3643
  background-color: ${ze("neutral",200)};
@@ -3712,7 +3712,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3712
3712
  opacity: 1;
3713
3713
  }
3714
3714
  }
3715
- `,IN=$e`
3715
+ `,IR=$e`
3716
3716
  background-color: transparent;
3717
3717
  color: ${ze("neutral",600)};
3718
3718
  width: auto;
@@ -3789,7 +3789,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3789
3789
  }
3790
3790
  }
3791
3791
  }
3792
- `,zN=(e,t)=>Math.max(0,e.findIndex((e=>e.value===t))),VN=e=>1===e?"none":2===e?"left":"right",HN=({variant:e="panel",defaultValue:t,tabs:n,onTabClick:o,activationMode:i="manual"})=>{const[s,a]=le(zN(n,t)||0);return ye("div",{css:AN(e),children:ye(_.Root,{width:"full",defaultValue:t||n?.[0]?.value,onValueChange:({value:e})=>{return a(zN(n,t=e)),void(o&&o(t));var t},activationMode:i,children:ye(_.List,{alignItems:"center",border:"none",children:n.map(((t,n)=>be(ve,{children:["view"===e&&1===n&&"left"===VN(s)?ye("div",{css:DN}):null,ye(_.Trigger,{css:[NN,"view"===e&&PN,"panel"===e&&RN,"transparent"===e&&IN],"aria-label":t["aria-label"]||t.label,...t,children:be(r,{display:"flex",alignItems:"center",gap:"0.3125rem",children:[t.icon,t.label]})},t.label),"view"===e&&1===n&&"right"===VN(s)?ye("div",{css:DN}):null]},t.label)))})})})},_N=({text:e,query:t})=>{if(!t)return e;const n=new RegExp(`(${t})`,"ig"),r=e.split(n);return Y(ee,{children:r.map((e=>n.test(e)?Y("strong",{children:e},e):Y("span",{children:e},e)))})},BN=({items:e,query:t,onSelect:n,highlightedIndex:o})=>{const i=ae(null);return de((()=>{if(!i.current)return;const e=i.current.children[o];e&&e.scrollIntoView({block:"nearest"})}),[o]),Y(r,{padding:"0.5rem",children:e.map(((e,s)=>Y(r,{ref:i,padding:"0.375rem 0.5rem",borderRadius:"md",cursor:"pointer",bg:s===o?"gray.100":void 0,_hover:{background:"gray.50"},onClick:()=>n(e.id||e.label),children:Y(_N,{text:e.label,query:t})},e.id)))})},jN=({placeholder:e,disabled:t,size:n="default",options:i=[],resultsMaxHeight:s=50,isLoading:l=!1,displayResults:c="text",onSelect:d,onQueryChange:u,onClear:h,renderResults:p,labels:f})=>{const m=qm("Search",f),[g,v]=le(""),{open:b,onOpen:y,onClose:w}=q(),[C,x]=le(i),[k,$]=le(-1),[S,E]=le(!1),M=ae(null),T=`search-results-${he()}`,O=e=>{const t=i.find((t=>t.id===e||t.label===e));t&&(d?.(t),v(""),w())};de((()=>{if(u?.(g),!g)return void x(i);const e=i.filter((e=>e.id?.toLowerCase().includes(g.toLowerCase())||e.label.toLowerCase().includes(g.toLowerCase())||e.caption?.toLowerCase().includes(g.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>O(e.id||e.label)})));x(e),y()}),[g]),de((()=>{function e(e){b&&M.current&&!M.current.contains(e.target)&&w()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[b]);const L=g.length?ye(Sv,{onClick:()=>{v(""),h?.()}}):null,A="none"!==c&&!!g.length&&C.length>0&&b;let N=ze("neutral",500);t?N=ze("neutral",500):S&&(N=ze("primary",700));const R="small"===n?"1rem":"1.25rem",D=Me(s);return be("div",{ref:M,style:{position:"relative",width:"100%"},children:[ye(V,{startElement:ye(Og,{width:R,height:R,fill:N}),endElement:L,children:ye(mv,{autoComplete:"off",placeholder:e||m.filterPlaceholder,onChange:e=>{const{value:t}=e.target;v(t)},onFocus:()=>E(!0),onBlur:()=>E(!1),value:g,label:"",style:{paddingLeft:"2.5rem"},type:"search","aria-label":e||m.filterAriaLabel,"aria-expanded":A,"aria-controls":T,role:"combobox","aria-autocomplete":"list",disabled:t,size:n,noMarginBottom:!0,onKeyDown:e=>{if(A){if("ArrowDown"===e.key&&(e.preventDefault(),$((e=>Math.min(e+1,C.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),$((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),k>=0)){const e=C[k];O(e.id||e.label)}"Escape"===e.key&&w()}}})}),(A||l&&!!g.length)&&"custom"===c&&p&&!l&&p({items:C,highlightedIndex:k,query:g,onSelect:O}),(A||l&&!!g.length)&&ye(a,{container:M,children:be(r,{position:"absolute",width:"100%",backgroundColor:"white",border:"custom"===c?"none":"0.0625rem solid",borderColor:"gray.200",borderRadius:"md",zIndex:1e3,overflowY:"auto",maxHeight:D,children:[l&&ye(r,{padding:"1rem",children:ye(o,{})}),"text"===c&&!l&&ye(BN,{highlightedIndex:k,items:C,query:g,onSelect:O}),"list"===c&&!l&&ye(vk,{items:C,highlightedIndex:k})]})})]})},FN={small:He(400),medium:He(600),large:He(1e3),default:He(400)};function qN(e,t,n,r){const o=function(e,t){return null!=t&&""!==t?Me(t):e&&FN[e]?FN[e]:FN.default}(e,t),i=n?ze("neutral",200):ze("primary",300),s=r??i,a=r&&n?"opacity: 0.7;":"",l=ze("neutral",n?400:800);return $e`
3792
+ `,zR=(e,t)=>Math.max(0,e.findIndex((e=>e.value===t))),VR=e=>1===e?"none":2===e?"left":"right",HR=({variant:e="panel",defaultValue:t,tabs:n,onTabClick:o,activationMode:i="manual"})=>{const[s,a]=le(zR(n,t)||0);return ye("div",{css:AR(e),children:ye(_.Root,{width:"full",defaultValue:t||n?.[0]?.value,onValueChange:({value:e})=>{return a(zR(n,t=e)),void(o&&o(t));var t},activationMode:i,children:ye(_.List,{alignItems:"center",border:"none",children:n.map(((t,n)=>be(ve,{children:["view"===e&&1===n&&"left"===VR(s)?ye("div",{css:DR}):null,ye(_.Trigger,{css:[RR,"view"===e&&PR,"panel"===e&&NR,"transparent"===e&&IR],"aria-label":t["aria-label"]||t.label,...t,children:be(r,{display:"flex",alignItems:"center",gap:"0.3125rem",children:[t.icon,t.label]})},t.label),"view"===e&&1===n&&"right"===VR(s)?ye("div",{css:DR}):null]},t.label)))})})})},_R=({text:e,query:t})=>{if(!t)return e;const n=new RegExp(`(${t})`,"ig"),r=e.split(n);return Y(ee,{children:r.map((e=>n.test(e)?Y("strong",{children:e},e):Y("span",{children:e},e)))})},BR=({items:e,query:t,onSelect:n,highlightedIndex:o})=>{const i=ae(null);return de((()=>{if(!i.current)return;const e=i.current.children[o];e&&e.scrollIntoView({block:"nearest"})}),[o]),Y(r,{padding:"0.5rem",children:e.map(((e,s)=>Y(r,{ref:i,padding:"0.375rem 0.5rem",borderRadius:"md",cursor:"pointer",bg:s===o?"gray.100":void 0,_hover:{background:"gray.50"},onClick:()=>n(e.id||e.label),children:Y(_R,{text:e.label,query:t})},e.id)))})},jR=({placeholder:e,disabled:t,size:n="default",options:i=[],resultsMaxHeight:s=50,isLoading:l=!1,displayResults:c="text",onSelect:d,onQueryChange:u,onClear:h,renderResults:p,labels:f})=>{const m=qm("Search",f),[g,v]=le(""),{open:b,onOpen:y,onClose:w}=q(),[C,x]=le(i),[k,$]=le(-1),[S,M]=le(!1),E=ae(null),T=`search-results-${he()}`,O=e=>{const t=i.find((t=>t.id===e||t.label===e));t&&(d?.(t),v(""),w())};de((()=>{if(u?.(g),!g)return void x(i);const e=i.filter((e=>e.id?.toLowerCase().includes(g.toLowerCase())||e.label.toLowerCase().includes(g.toLowerCase())||e.caption?.toLowerCase().includes(g.toLowerCase()))).map((e=>({id:e.id,label:e.label,caption:e.caption,variant:"select",icon:e.icon,onItemClick:()=>O(e.id||e.label)})));x(e),y()}),[g]),de((()=>{function e(e){b&&E.current&&!E.current.contains(e.target)&&w()}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[b]);const L=g.length?ye(Sv,{onClick:()=>{v(""),h?.()}}):null,A="none"!==c&&!!g.length&&C.length>0&&b;let R=ze("neutral",500);t?R=ze("neutral",500):S&&(R=ze("primary",700));const N="small"===n?"1rem":"1.25rem",D=Ee(s);return be("div",{ref:E,style:{position:"relative",width:"100%"},children:[ye(V,{startElement:ye(Og,{width:N,height:N,fill:R}),endElement:L,children:ye(mv,{autoComplete:"off",placeholder:e||m.filterPlaceholder,onChange:e=>{const{value:t}=e.target;v(t)},onFocus:()=>M(!0),onBlur:()=>M(!1),value:g,label:"",style:{paddingLeft:"2.5rem"},type:"search","aria-label":e||m.filterAriaLabel,"aria-expanded":A,"aria-controls":T,role:"combobox","aria-autocomplete":"list",disabled:t,size:n,noMarginBottom:!0,onKeyDown:e=>{if(A){if("ArrowDown"===e.key&&(e.preventDefault(),$((e=>Math.min(e+1,C.length-1)))),"ArrowUp"===e.key&&(e.preventDefault(),$((e=>Math.max(e-1,0)))),"Enter"===e.key&&(e.preventDefault(),k>=0)){const e=C[k];O(e.id||e.label)}"Escape"===e.key&&w()}}})}),(A||l&&!!g.length)&&"custom"===c&&p&&!l&&p({items:C,highlightedIndex:k,query:g,onSelect:O}),(A||l&&!!g.length)&&ye(a,{container:E,children:be(r,{position:"absolute",width:"100%",backgroundColor:"white",border:"custom"===c?"none":"0.0625rem solid",borderColor:"gray.200",borderRadius:"md",zIndex:1e3,overflowY:"auto",maxHeight:D,children:[l&&ye(r,{padding:"1rem",children:ye(o,{})}),"text"===c&&!l&&ye(BR,{highlightedIndex:k,items:C,query:g,onSelect:O}),"list"===c&&!l&&ye(vk,{items:C,highlightedIndex:k})]})})]})},FR={small:He(400),medium:He(600),large:He(1e3),default:He(400)};function qR(e,t,n,r){const o=function(e,t){return null!=t&&""!==t?Ee(t):e&&FR[e]?FR[e]:FR.default}(e,t),i=n?ze("neutral",200):ze("primary",300),s=r??i,a=r&&n?"opacity: 0.7;":"",l=ze("neutral",n?400:800);return $e`
3793
3793
  height: ${o};
3794
3794
  width: ${o};
3795
3795
  border-radius: 50%;
@@ -3824,17 +3824,17 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3824
3824
  background-color: ${ze("primary",500)};
3825
3825
  }
3826
3826
  }
3827
- `}const WN=e=>$e`
3827
+ `}const WR=e=>$e`
3828
3828
  width: ${e||He(400)};
3829
3829
  position: absolute;
3830
3830
  top: -${He(200)};
3831
3831
  left: 0.9375rem;
3832
- `,UN=$e`
3832
+ `,UR=$e`
3833
3833
  font-size: ${Ve(200)};
3834
3834
  line-height: ${_e(400)};
3835
3835
  font-weight: 700;
3836
3836
  color: ${ze("primary",800)};
3837
- `,KN=se((({name:e,ariaLabel:t,size:n="medium",customSize:r,src:o,srcSet:i,onClick:s,notificationCount:a,disabled:l=!0,customBackgroundColor:c=""},d)=>{const u=()=>{l||s?.()},h=(()=>{let e="";return a&&a>0&&(e=`${a>99?"99+":a}`),e})();let p="1rem";a&&a>99?p="1.75rem":a&&a>9&&(p="1.375rem");const f=!!o||!!i,m=s&&!l;return be(W.Root,{"aria-label":t||e,ref:d,css:qN(n,r,l,c),onClick:u,onKeyDown:e=>{l||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),u())},role:m?"button":"img",tabIndex:m?0:void 0,"aria-disabled":m?l:void 0,children:[f&&ye(W.Image,{src:o,srcSet:i,alt:t||e||"Avatar image"}),!f&&e&&ye(W.Fallback,{name:e,css:UN}),!f&&!e&&ye(Eg,{size:"100%",style:{padding:"15%",color:l?ze("neutral",400):void 0}}),h.length>0?ye("div",{css:WN(p),children:ye("div",{css:$e`
3837
+ `,KR=se((({name:e,ariaLabel:t,size:n="medium",customSize:r,src:o,srcSet:i,onClick:s,notificationCount:a,disabled:l=!0,customBackgroundColor:c="",labels:d},u)=>{const h=qm("Avatar",d),p=()=>{l||s?.()},f=(()=>{let e="";return a&&a>0&&(e=`${a>99?"99+":a}`),e})();let m="1rem";a&&a>99?m="1.75rem":a&&a>9&&(m="1.375rem");const g=!!o||!!i,v=s&&!l;return be(W.Root,{"aria-label":t||e,ref:u,css:qR(n,r,l,c),onClick:p,onKeyDown:e=>{l||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),p())},role:v?"button":"img",tabIndex:v?0:void 0,"aria-disabled":v?l:void 0,children:[g&&ye(W.Image,{src:o,srcSet:i,alt:t||e||"Avatar image"}),!g&&e&&ye(W.Fallback,{name:e,css:UR}),!g&&!e&&ye(Mg,{size:"100%",style:{padding:"15%",color:l?ze("neutral",400):void 0}}),f.length>0?ye("div",{css:WR(m),children:ye("div",{css:$e`
3838
3838
  height: ${He(400)};
3839
3839
  width: auto;
3840
3840
  background-color: ${ze("error",500)};
@@ -3847,16 +3847,16 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3847
3847
  line-height: ${_e(400)};
3848
3848
  font-weight: 700;
3849
3849
  color: ${ze("error",100)};
3850
- `,children:ye("p",{"aria-label":`${a} unread message`,children:h})})}):null]})})),ZN=$e`
3850
+ `,children:ye("p",{"aria-label":h.unreadMessagesLabel(a||0),children:f})})}):null]})})),ZR=$e`
3851
3851
  display: flex;
3852
3852
  justify-content: flex-start;
3853
3853
  align-items: center;
3854
3854
  gap: ${He(200)};
3855
- `,GN=e=>$e`
3855
+ `,GR=e=>$e`
3856
3856
  width: ${e||He(400)};
3857
3857
  position: relative;
3858
3858
  display: flex;
3859
- `,JN=$e`
3859
+ `,JR=$e`
3860
3860
  height: ${He(100)};
3861
3861
  width: ${He(100)};
3862
3862
  background-color: ${ze("error",500)};
@@ -3864,7 +3864,7 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3864
3864
  position: absolute;
3865
3865
  top: 0rem;
3866
3866
  right: 0rem;
3867
- `,XN=$e`
3867
+ `,XR=$e`
3868
3868
  height: 0.625rem;
3869
3869
  background-color: ${ze("error",500)};
3870
3870
  padding: 0 0.1875rem 0.0625rem 0.1875rem;
@@ -3875,12 +3875,12 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3875
3875
  position: absolute;
3876
3876
  top: -${He(50)};
3877
3877
  left: 0.5625rem;
3878
- `,YN=$e`
3878
+ `,YR=$e`
3879
3879
  font-size: ${Ve(200)};
3880
3880
  line-height: ${_e(400)};
3881
3881
  font-weight: 700;
3882
3882
  color: ${ze("error",100)};
3883
- `,QN=$e`
3883
+ `,QR=$e`
3884
3884
  height: ${He(400)};
3885
3885
  min-width: ${He(400)};
3886
3886
  background-color: ${ze("error",500)};
@@ -3889,44 +3889,44 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3889
3889
  justify-content: center;
3890
3890
  align-items: center;
3891
3891
  padding: 0rem ${He(100)} 0.0625rem ${He(100)};
3892
- `,eR=$e`
3892
+ `,eN=$e`
3893
3893
  font-size: ${Ve(400)};
3894
3894
  line-height: ${_e(600)};
3895
3895
  font-weight: 700;
3896
3896
  color: ${ze("error",100)};
3897
- `,tR=({hasNotification:e,notificationCount:t,label:n})=>{const[r,o]=le(!1);de((()=>{const e=()=>{window.innerWidth<1024?o(!0):o(!1)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const i=(()=>{let e="";return t&&t>0&&(e=`${t>99?"99+":t}`),e})();let s="1rem";return t&&t>99?s="1.75rem":t&&t>9&&(s="1.375rem"),be("div",r?{css:ZN,role:"status","aria-live":"polite",children:[be("div",{css:GN(),children:[ye(cg,{color:"currentColor",height:"1rem",width:"1rem"}),!e||t||n?null:ye("div",{css:JN,"aria-hidden":!0})]}),n?ye("p",{children:n}):null,i.length>0?ye("div",{css:QN,children:ye("p",{css:eR,"aria-label":`${t} unread message`,children:i})}):null]}:{css:ZN,role:"status","aria-live":"polite",children:[n?ye("p",{children:n}):null,be("div",{css:GN(s),children:[i.length>0?ye("div",{css:XN,children:ye("p",{css:YN,"aria-label":`${t} unread message`,children:i})}):null,e&&!t?ye("div",{css:JN,"aria-hidden":!0}):null,ye(cg,{color:"currentColor",height:"1rem",width:"1rem"})]})]})},nR=e=>{let t="",n="",r="";return"success"===e?(t=ze("success",100),n=ze("success",500),r=ze("success",300)):"warning"===e?(t=ze("warning",100),n=ze("warning",500),r=ze("warning",300)):"error"===e?(t=ze("error",100),n=ze("error",500),r=ze("error",300)):"information"===e?(t=ze("secondary",100),n=ze("secondary",500),r=ze("secondary",200)):"general-grey"===e?(t=ze("neutral",200),n=ze("neutral",700),r=ze("neutral",300)):(t=ze("neutral",100),n=ze("neutral",700),r=ze("neutral",300)),$e`
3897
+ `,tN=({hasNotification:e,notificationCount:t,label:n,labels:r})=>{const o=qm("Badge",r),[i,s]=le(!1);de((()=>{const e=()=>{window.innerWidth<1024?s(!0):s(!1)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const a=(()=>{let e="";return t&&t>0&&(e=`${t>99?"99+":t}`),e})();let l="1rem";return t&&t>99?l="1.75rem":t&&t>9&&(l="1.375rem"),be("div",i?{css:ZR,role:"status","aria-live":"polite",children:[be("div",{css:GR(),children:[ye(cg,{color:"currentColor",height:"1rem",width:"1rem"}),!e||t||n?null:ye("div",{css:JR,"aria-hidden":!0})]}),n?ye("p",{children:n}):null,a.length>0?ye("div",{css:QR,children:ye("p",{css:eN,"aria-label":o.unreadMessagesLabel(t||0),children:a})}):null]}:{css:ZR,role:"status","aria-live":"polite",children:[n?ye("p",{children:n}):null,be("div",{css:GR(l),children:[a.length>0?ye("div",{css:XR,children:ye("p",{css:YR,"aria-label":o.unreadMessagesLabel(t||0),children:a})}):null,e&&!t?ye("div",{css:JR,"aria-hidden":!0}):null,ye(cg,{color:"currentColor",height:"1rem",width:"1rem"})]})]})},nN=e=>{let t="",n="",r="";return"success"===e?(t=ze("success",100),n=ze("success",500),r=ze("success",300)):"warning"===e?(t=ze("warning",100),n=ze("warning",500),r=ze("warning",300)):"error"===e?(t=ze("error",100),n=ze("error",500),r=ze("error",300)):"information"===e?(t=ze("secondary",100),n=ze("secondary",500),r=ze("secondary",200)):"general-grey"===e?(t=ze("neutral",200),n=ze("neutral",700),r=ze("neutral",300)):(t=ze("neutral",100),n=ze("neutral",700),r=ze("neutral",300)),$e`
3898
3898
  display: flex;
3899
3899
  color: ${n};
3900
3900
  align-items: center;
3901
3901
  background-color: ${t};
3902
3902
  border-bottom: ${je(100)} solid ${r};
3903
3903
  border-radius: 0;
3904
- `},rR=te.forwardRef((({title:e,children:t,icon:n,variant:r,onClose:o},i)=>{const[s,a]=te.useState(!0),l=ye("success"===r?ig:"warning"===r?sg:Ym,{});return s?be(U.Root,{css:nR(r),children:[ye(U.Indicator,{children:n||l}),t?ye(U.Content,{children:be("div",{style:{display:"flex",gap:"0.75rem",alignItems:"center"},children:[ye(U.Title,{children:e}),ye(U.Description,{children:t})]})}):ye(U.Title,{flex:"1",children:e}),ye(K,{"aria-label":"Close alert",pos:"absolute",insetEnd:"2",_hover:{bg:"gray.200"},onClick:()=>{a(!1),o?.()}})]}):null})),oR=$e`
3904
+ `},rN=te.forwardRef((({title:e,children:t,icon:n,variant:r,onClose:o,labels:i},s)=>{const a=qm("AlertBanner",i),[l,c]=te.useState(!0),d=ye("success"===r?ig:"warning"===r?sg:Ym,{});return l?be(U.Root,{css:nN(r),children:[ye(U.Indicator,{children:n||d}),t?ye(U.Content,{children:be("div",{style:{display:"flex",gap:"0.75rem",alignItems:"center"},children:[ye(U.Title,{children:e}),ye(U.Description,{children:t})]})}):ye(U.Title,{flex:"1",children:e}),ye(K,{"aria-label":a.closeAlertLabel,pos:"absolute",insetEnd:"2",_hover:{bg:"gray.200"},onClick:()=>{c(!1),o?.()}})]}):null})),oN=$e`
3905
3905
  height: ${He(200)};
3906
3906
  width: 100%;
3907
3907
  background-color: ${ze("neutral",300)};
3908
3908
  display: flex;
3909
3909
  align-items: center;
3910
3910
  justify-content: flex-start;
3911
- `,iR=e=>$e`
3911
+ `,iN=e=>$e`
3912
3912
  height: 100%;
3913
3913
  width: ${e}%;
3914
3914
  background-color: ${ze("primary",500)};
3915
3915
  transition: width 0.5s ease-in-out;
3916
- `,sR=({progress:e})=>{let t=e;return t>100&&(t=100),t<0&&(t=0),ye("div",{css:oR,role:"progressbar","aria-label":`Progress: ${t}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t,children:ye("div",{css:iR(t)})})},aR=$e`
3916
+ `,sN=({progress:e,labels:t})=>{const n=qm("ProgressBar",t);let r=e;return r>100&&(r=100),r<0&&(r=0),ye("div",{css:oN,role:"progressbar","aria-label":n.progressAriaLabel(r),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r,children:ye("div",{css:iN(r)})})},aN=$e`
3917
3917
  width: 100%;
3918
3918
  display: flex;
3919
3919
  align-items: center;
3920
3920
  justify-content: space-between;
3921
3921
  position: relative;
3922
- `,lR=$e`
3922
+ `,lN=$e`
3923
3923
  height: 3.75rem;
3924
3924
  width: ${He(2e3)};
3925
3925
  display: flex;
3926
3926
  flex-direction: column;
3927
3927
  align-items: center;
3928
3928
  justify-content: space-between;
3929
- `,cR=(e,t)=>$e`
3929
+ `,cN=(e,t)=>$e`
3930
3930
  height: ${He(800)};
3931
3931
  width: ${He(800)};
3932
3932
  display: flex;
@@ -3962,12 +3962,12 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3962
3962
  }
3963
3963
 
3964
3964
  ${t?`\n background-color: ${ze("neutral",300)};\n \n &:hover {\n background-color: ${ze("neutral",300)};\n box-shadow: none;\n }\n `:""}
3965
- `,dR=e=>$e`
3965
+ `,dN=e=>$e`
3966
3966
  color: ${ze("neutral",e?800:600)};
3967
3967
  font-size: ${Ve(300)};
3968
3968
  line-height: ${_e(500)};
3969
3969
  font-weight: 400;
3970
- `,uR=$e`
3970
+ `,uN=$e`
3971
3971
  height: ${je(100)};
3972
3972
  width: 100%;
3973
3973
  padding: 0 1.875rem;
@@ -3975,25 +3975,25 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
3975
3975
  top: ${He(400)};
3976
3976
  left: 0;
3977
3977
  z-index: -1;
3978
- `,hR=$e`
3978
+ `,hN=$e`
3979
3979
  height: ${je(100)};
3980
3980
  width: 100%;
3981
3981
  background-color: ${ze("neutral",400)};
3982
- `,pR=({steps:e,currentStep:t,labels:n})=>{const r=qm("StepProgressIndicator",n);return be("div",{css:aR,children:[e.map(((e,n)=>be("div",{css:lR,children:[ye("button",{css:cR(t>=n+1,t<n+1),type:"button",onClick:e.onClick,"aria-current":t===n+1,"aria-disabled":t<n+1,disabled:t<n+1,"aria-label":r.currentStepLabel(n+1,e.label||"",t>n+1),"data-active":t>=n+1,children:t>n+1?ye(Jm,{height:"1rem",width:"1rem"}):n+1}),e.label?ye("p",{css:dR(t===n+1),children:e.label}):null]},`${e.label}-${n}`))),ye("div",{css:uR,children:ye("div",{css:hR})})]})},fR=$e`
3982
+ `,pN=({steps:e,currentStep:t,labels:n})=>{const r=qm("StepProgressIndicator",n);return be("div",{css:aN,children:[e.map(((e,n)=>be("div",{css:lN,children:[ye("button",{css:cN(t>=n+1,t<n+1),type:"button",onClick:e.onClick,"aria-current":t===n+1,"aria-disabled":t<n+1,disabled:t<n+1,"aria-label":r.currentStepLabel(n+1,e.label||"",t>n+1),"data-active":t>=n+1,children:t>n+1?ye(Jm,{height:"1rem",width:"1rem"}):n+1}),e.label?ye("p",{css:dN(t===n+1),children:e.label}):null]},`${e.label}-${n}`))),ye("div",{css:uN,children:ye("div",{css:hN})})]})},fN=$e`
3983
3983
  font-size: ${Ve(500)};
3984
3984
  line-height: ${_e(700)};
3985
3985
  font-weight: 400;
3986
3986
  color: ${ze("neutral",800)};
3987
- `,mR=$e`
3987
+ `,mN=$e`
3988
3988
  font-size: ${Ve(400)};
3989
3989
  line-height: ${_e(600)};
3990
3990
  font-weight: 400;
3991
3991
  color: ${ze("neutral",700)};
3992
- `,gR=$e`
3992
+ `,gN=$e`
3993
3993
  padding: 0.375rem;
3994
- `,vR=$e`
3994
+ `,vN=$e`
3995
3995
  padding: 0.375rem;
3996
- `,bR={pauseOnPageIdle:!0,offsets:"1.5rem"},yR={"top-start":Z({placement:"top-start",...bR}),top:Z({placement:"top",...bR}),"top-end":Z({placement:"top-end",...bR}),"bottom-start":Z({placement:"bottom-start",...bR}),bottom:Z({placement:"bottom",...bR}),"bottom-end":Z({placement:"bottom-end",...bR})},wR=e=>{yR[e.placement].create({title:e.label,description:e.caption,duration:e.duration||5e3,meta:{closable:e.closable,icon:e.icon,closableLabel:e.closableLabel,onClose:e.onClose,maxWidth:e.maxWidth},...e})},CR=e=>{Object.values(yR).forEach((t=>{t.dismiss(e)}))},xR=({labels:e})=>{const t=qm("Toast",e);return Object.keys(yR).map((e=>ye(a,{children:ye(G,{toaster:yR[e],insetInline:{mdDown:"4"},children:n=>{return be(J.Root,{css:(r=n.meta?.maxWidth,$e`
3996
+ `,bN={pauseOnPageIdle:!0,offsets:"1.5rem"},yN={"top-start":Z({placement:"top-start",...bN}),top:Z({placement:"top",...bN}),"top-end":Z({placement:"top-end",...bN}),"bottom-start":Z({placement:"bottom-start",...bN}),bottom:Z({placement:"bottom",...bN}),"bottom-end":Z({placement:"bottom-end",...bN})},wN=e=>{yN[e.placement].create({title:e.label,description:e.caption,duration:e.duration||5e3,meta:{closable:e.closable,icon:e.icon,closableLabel:e.closableLabel,onClose:e.onClose,maxWidth:e.maxWidth},...e})},CN=e=>{Object.values(yN).forEach((t=>{t.dismiss(e)}))},xN=({labels:e})=>{const t=qm("Toast",e);return Object.keys(yN).map((e=>ye(a,{children:ye(G,{toaster:yN[e],insetInline:{mdDown:"4"},children:n=>{return be(J.Root,{css:(r=n.meta?.maxWidth,$e`
3997
3997
  justify-content: space-between;
3998
3998
  align-items: center;
3999
3999
  gap: ${He(200)};
@@ -4037,4 +4037,4 @@ function DO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Obj
4037
4037
  color: ${ze("error",900)};
4038
4038
  }
4039
4039
  }
4040
- `),width:{md:"sm"},children:[be(X,{flexDirection:"row",className:"ds-toast-icon-container",alignItems:n.description?"flex-start":"center",children:["info"===n.type?n.meta?.icon?n.meta.icon:ye(Ym,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===n.type?ye(o,{size:"lg",borderWidth:"0.1875rem",color:"var(--chakra-colors-primary-500)"}):null,"success"===n.type?n.meta?.icon?n.meta.icon:ye(ig,{color:"var(--chakra-colors-success-500)"}):null,"warning"===n.type?n.meta?.icon?n.meta.icon:ye(sg,{color:"var(--chakra-colors-warning-500)"}):null,"error"===n.type?n.meta?.icon?n.meta.icon:ye(ag,{color:"var(--chakra-colors-error-500)"}):null,be(X,{gap:"1",flex:"1",maxWidth:"100%",children:[ye(J.Title,{css:fR,"aria-label":`${n.title}`,children:n.title}),n.description?ye(J.Title,{css:mR,"aria-label":`${n.description}`,children:n.description}):null]})]}),n.action||n.meta?.closable?be(X,{flexDirection:"row",children:[n.action?ye(Wm,{css:gR,label:n.action.label,size:"small",variant:"info"===n.type?"primary":"secondary",onClick:()=>{n?.action?.onClick&&n.action.onClick(),yR[e].dismiss()}}):null,n.meta?.closable?ye(Wm,{css:vR,label:n.meta.closableLabel,"aria-label":n.meta?.closableLabel||t.dismissLabel,leftIcon:ye(tg,{height:"0.625rem!",width:"0.625rem!"}),size:"small",variant:"secondary",onClick:()=>{n.meta?.onClose&&n.meta.onClose(),yR[e].dismiss()}}):null]}):null]});var r}})},e)))};export{rR as AlertBanner,Uk as AnalysisWidget,KN as Avatar,tR as Badge,Ky as BaseMap,jA as Breadcrumb,Wm as Button,Wv as Checkbox,Lb as CheckboxList,Yv as CheckboxOptionCard,Sv as CloseButton,Jy as ClusterPoint,Vy as Combobox,qe as DesignSystemLocaleProvider,Bk as ExtendableCard,ZA as Footer,Fv as FormContainer,Km as IconButton,SA as InlineMessage,cy as InputWithUnits,lk as ItemCount,$x as LayerGroup,Sx as LayerGroupContainer,kx as LayerItem,Lx as LayerParameters,jx as LegendItem,vk as List,Av as MapControlsToolbar,Gy as MapMarker,Yy as MapMarkers,px as MapPopUp,Fg as Menu,VA as MobileSearch,eN as MobileTabBar,U$ as Modal,Vv as MultiActionButton,$N as Navbar,LN as NavigationRail,ib as OptionCard,xk as Pagination,Q$ as Panel,vy as Password,sR as ProgressBar,Xx as QualitativeAttribute,cb as Radio,db as RadioGroup,Sy as RadioList,xv as RichTextEditor,kv as SSOButtons,ok as ScaleBar,jN as Search,ly as Select,fA as Sheet,Xy as SimpleMapPin,yb as Slider,Oy as SliderInput,pR as StepProgressIndicator,Cb as Switch,HN as TabBar,Ik as Table,Vk as TableCell,zk as TableRow,iy as Tag,mv as TextInput,zy as Textarea,xR as Toast,Lv as Toolbar,Ug as Tooltip,CR as closeToast,Ie as designSystemStyles,Pe as designSystemStylesForTailwind,je as getThemedBorderWidth,ze as getThemedColor,Ve as getThemedFontSize,_e as getThemedLineHeight,Be as getThemedRadius,He as getThemedSpacing,wR as showToast};
4040
+ `),width:{md:"sm"},children:[be(X,{flexDirection:"row",className:"ds-toast-icon-container",alignItems:n.description?"flex-start":"center",children:["info"===n.type?n.meta?.icon?n.meta.icon:ye(Ym,{color:"var(--chakra-colors-neutral-700)"}):null,"loading"===n.type?ye(o,{size:"lg",borderWidth:"0.1875rem",color:"var(--chakra-colors-primary-500)"}):null,"success"===n.type?n.meta?.icon?n.meta.icon:ye(ig,{color:"var(--chakra-colors-success-500)"}):null,"warning"===n.type?n.meta?.icon?n.meta.icon:ye(sg,{color:"var(--chakra-colors-warning-500)"}):null,"error"===n.type?n.meta?.icon?n.meta.icon:ye(ag,{color:"var(--chakra-colors-error-500)"}):null,be(X,{gap:"1",flex:"1",maxWidth:"100%",children:[ye(J.Title,{css:fN,"aria-label":`${n.title}`,children:n.title}),n.description?ye(J.Title,{css:mN,"aria-label":`${n.description}`,children:n.description}):null]})]}),n.action||n.meta?.closable?be(X,{flexDirection:"row",children:[n.action?ye(Wm,{css:gN,label:n.action.label,size:"small",variant:"info"===n.type?"primary":"secondary",onClick:()=>{n?.action?.onClick&&n.action.onClick(),yN[e].dismiss()}}):null,n.meta?.closable?ye(Wm,{css:vN,label:n.meta.closableLabel,"aria-label":n.meta?.closableLabel||t.dismissLabel,leftIcon:ye(tg,{height:"0.625rem!",width:"0.625rem!"}),size:"small",variant:"secondary",onClick:()=>{n.meta?.onClose&&n.meta.onClose(),yN[e].dismiss()}}):null]}):null]});var r}})},e)))};export{rN as AlertBanner,Uk as AnalysisWidget,KR as Avatar,tN as Badge,Ky as BaseMap,jA as Breadcrumb,Wm as Button,Wv as Checkbox,Lb as CheckboxList,Yv as CheckboxOptionCard,Sv as CloseButton,Jy as ClusterPoint,Vy as Combobox,qe as DesignSystemLocaleProvider,Bk as ExtendableCard,ZA as Footer,Fv as FormContainer,Km as IconButton,SA as InlineMessage,cy as InputWithUnits,lk as ItemCount,$x as LayerGroup,Sx as LayerGroupContainer,kx as LayerItem,Lx as LayerParameters,jx as LegendItem,vk as List,Av as MapControlsToolbar,Gy as MapMarker,Yy as MapMarkers,px as MapPopUp,Fg as Menu,VA as MobileSearch,eR as MobileTabBar,U$ as Modal,Vv as MultiActionButton,$R as Navbar,LR as NavigationRail,ib as OptionCard,xk as Pagination,Q$ as Panel,vy as Password,sN as ProgressBar,Xx as QualitativeAttribute,cb as Radio,db as RadioGroup,Sy as RadioList,xv as RichTextEditor,kv as SSOButtons,ok as ScaleBar,jR as Search,ly as Select,fA as Sheet,Xy as SimpleMapPin,yb as Slider,Oy as SliderInput,pN as StepProgressIndicator,Cb as Switch,HR as TabBar,Ik as Table,Vk as TableCell,zk as TableRow,iy as Tag,mv as TextInput,zy as Textarea,xN as Toast,Lv as Toolbar,Ug as Tooltip,CN as closeToast,Ie as designSystemStyles,Pe as designSystemStylesForTailwind,je as getThemedBorderWidth,ze as getThemedColor,Ve as getThemedFontSize,_e as getThemedLineHeight,Be as getThemedRadius,He as getThemedSpacing,wN as showToast};