@pie-element/graphing-solution-set 6.1.2-next.14 → 6.1.2-next.15
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/browser/{alert-dialog-NRlYz3Y7.js → alert-dialog-r0qW7dWl.js} +2 -2
- package/dist/browser/{alert-dialog-NRlYz3Y7.js.map → alert-dialog-r0qW7dWl.js.map} +1 -1
- package/dist/browser/author/index.js +1 -1
- package/dist/browser/delivery/index.js +1 -1
- package/dist/index.iife.js +1 -1
- package/package.json +2 -2
package/dist/index.iife.js
CHANGED
|
@@ -356,7 +356,7 @@ mid `,`∤`),Z.intercal=Z[`⊺`]=q($,`\\intercal `,`⊺`),Z.veebar=Z[`
|
|
|
356
356
|
`,Kq=e=>{let{classes:t,variant:n,color:r}=e;return za({root:[`root`,`color${V(r)}`,n],dashed:[`dashed`,`dashedColor${V(r)}`],bar1:[`bar`,`bar1`,`barColor${V(r)}`,(n===`indeterminate`||n===`query`)&&`bar1Indeterminate`,n===`determinate`&&`bar1Determinate`,n===`buffer`&&`bar1Buffer`],bar2:[`bar`,`bar2`,n!==`buffer`&&`barColor${V(r)}`,n===`buffer`&&`color${V(r)}`,(n===`indeterminate`||n===`query`)&&`bar2Indeterminate`,n===`buffer`&&`bar2Buffer`]},Rq,t)},qq=(e,t)=>e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:e.palette.mode===`light`?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.5),Jq=z(`span`,{name:`MuiLinearProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`color${V(n.color)}`],t[n.variant]]}})(jd(({theme:e})=>({position:`relative`,overflow:`hidden`,display:`block`,height:4,zIndex:0,"@media print":{colorAdjust:`exact`},variants:[...Object.entries(e.palette).filter(vm()).map(([t])=>({props:{color:t},style:{backgroundColor:qq(e,t)}})),{props:({ownerState:e})=>e.color===`inherit`&&e.variant!==`buffer`,style:{"&::before":{content:`""`,position:`absolute`,left:0,top:0,right:0,bottom:0,backgroundColor:`currentColor`,opacity:.3}}},{props:{variant:`buffer`},style:{backgroundColor:`transparent`}},{props:{variant:`query`},style:{transform:`rotate(180deg)`}}]}))),Yq=z(`span`,{name:`MuiLinearProgress`,slot:`Dashed`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.dashed,t[`dashedColor${V(n.color)}`]]}})(jd(({theme:e})=>({position:`absolute`,marginTop:0,height:`100%`,width:`100%`,backgroundSize:`10px 10px`,backgroundPosition:`0 -23px`,variants:[{props:{color:`inherit`},style:{opacity:.3,backgroundImage:`radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)`}},...Object.entries(e.palette).filter(vm()).map(([t])=>{let n=qq(e,t);return{props:{color:t},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),Gq||{animation:`${Wq} 3s infinite linear`}),Xq=z(`span`,{name:`MuiLinearProgress`,slot:`Bar1`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t.bar1,t[`barColor${V(n.color)}`],(n.variant===`indeterminate`||n.variant===`query`)&&t.bar1Indeterminate,n.variant===`determinate`&&t.bar1Determinate,n.variant===`buffer`&&t.bar1Buffer]}})(jd(({theme:e})=>({width:`100%`,position:`absolute`,left:0,bottom:0,top:0,transition:`transform 0.2s linear`,transformOrigin:`left`,variants:[{props:{color:`inherit`},style:{backgroundColor:`currentColor`}},...Object.entries(e.palette).filter(vm()).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main}})),{props:{variant:`determinate`},style:{transition:`transform .${zq}s linear`}},{props:{variant:`buffer`},style:{zIndex:1,transition:`transform .${zq}s linear`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:{width:`auto`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:Vq||{animation:`${Bq} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),Zq=z(`span`,{name:`MuiLinearProgress`,slot:`Bar2`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t.bar2,t[`barColor${V(n.color)}`],(n.variant===`indeterminate`||n.variant===`query`)&&t.bar2Indeterminate,n.variant===`buffer`&&t.bar2Buffer]}})(jd(({theme:e})=>({width:`100%`,position:`absolute`,left:0,bottom:0,top:0,transition:`transform 0.2s linear`,transformOrigin:`left`,variants:[...Object.entries(e.palette).filter(vm()).map(([t])=>({props:{color:t},style:{"--LinearProgressBar2-barColor":(e.vars||e).palette[t].main}})),{props:({ownerState:e})=>e.variant!==`buffer`&&e.color!==`inherit`,style:{backgroundColor:`var(--LinearProgressBar2-barColor, currentColor)`}},{props:({ownerState:e})=>e.variant!==`buffer`&&e.color===`inherit`,style:{backgroundColor:`currentColor`}},{props:{color:`inherit`},style:{opacity:.3}},...Object.entries(e.palette).filter(vm()).map(([t])=>({props:{color:t,variant:`buffer`},style:{backgroundColor:qq(e,t),transition:`transform .${zq}s linear`}})),{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:{width:`auto`}},{props:({ownerState:e})=>e.variant===`indeterminate`||e.variant===`query`,style:Uq||{animation:`${Hq} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),Qq=F.forwardRef(function(e,t){let n=ou({props:e,name:`MuiLinearProgress`}),{className:r,color:i=`primary`,value:a,valueBuffer:o,variant:s=`indeterminate`,...c}=n,l={...n,color:i,variant:s},u=Kq(l),d=ia(),f={},p={bar1:{},bar2:{}};if((s===`determinate`||s===`buffer`)&&a!==void 0){f[`aria-valuenow`]=Math.round(a),f[`aria-valuemin`]=0,f[`aria-valuemax`]=100;let e=a-100;d&&(e=-e),p.bar1.transform=`translateX(${e}%)`}if(s===`buffer`&&o!==void 0){let e=(o||0)-100;d&&(e=-e),p.bar2.transform=`translateX(${e}%)`}return(0,I.jsxs)(Jq,{className:L(u.root,r),ownerState:l,role:`progressbar`,...f,ref:t,...c,children:[s===`buffer`?(0,I.jsx)(Yq,{className:u.dashed,ownerState:l}):null,(0,I.jsx)(Xq,{className:u.bar1,ownerState:l,style:p.bar1}),s===`determinate`?null:(0,I.jsx)(Zq,{className:u.bar2,ownerState:l,style:p.bar2})]})}),$q=(e,t)=>{if(!e||!t)return null;let n=null;return e.state.doc.descendants((e,r)=>{if(n!==null)return!1;if(e.type.name===`imageUploadNode`&&e.attrs.nodeKey===t)return n=[e,r],!1}),n},eJ=()=>`img-${Date.now()}-${Math.random().toString(36).slice(2)}`,tJ=Bp(`@pie-lib:editable-html:image:insert-image-handler`),nJ=class{constructor(e,t,n,r=!1){this.editor=e,this.nodeInfo=t,this.node=t[0],this.nodePos=t[1],this.onFinish=n,this.isPasted=r,this.chosenFile=null,this.nodeKey=this.node?.attrs?.nodeKey||null}resolveNodePos(){let e=$q(this.editor,this.nodeKey);return e?e[1]:this.nodeKey?null:this.nodePos}cancel(){tJ(`insert cancelled`);try{this.deleteNode(),this.onFinish(!1)}catch{}finally{this.editor._insertingImage=!1}}updateNode(e){let t=this.resolveNodePos();if(t===null){tJ(`[updateNode] node is gone, dropping update: `,e);return}let{state:n,view:r}=this.editor,{tr:i}=n,a=n.doc.nodeAt(t);if(a){let n=i.setNodeMarkup(t,void 0,{...a.attrs,...e});r.dispatch(n)}}deleteNode(){let e=this.resolveNodePos();if(e===null)return;let{state:t,view:n}=this.editor,{tr:r}=t,i=t.doc.nodeAt(e)||this.node,a=r.delete(e,e+i.nodeSize);n.dispatch(a)}done(e,t){tJ(`done: err:`,e),e?(console.log(e),this.onFinish(!1)):(this.updateNode({loaded:!0,src:t,percent:100}),this.onFinish(!0)),this.editor._insertingImage=!1}fileChosen(e){if(!e)return;this.chosenFile=e,this.editor._insertingImage=!1,tJ(`[fileChosen] file: `,e);let t=new FileReader;t.onload=()=>{let e=t.result;this.updateNode({src:e})},t.readAsDataURL(e)}progress(e,t,n){tJ(`progress: `,e,t,n),this.updateNode({percent:e})}getChosenFile(){return this.chosenFile}};function rJ(e){return _i(`MuiDialogContent`,e)}vi(`MuiDialogContent`,[`root`,`dividers`]);function iJ(e){return _i(`MuiDialogTitle`,e)}var aJ=vi(`MuiDialogTitle`,[`root`]),oJ=e=>{let{classes:t,dividers:n}=e;return za({root:[`root`,n&&`dividers`]},rJ,t)},sJ=z(`div`,{name:`MuiDialogContent`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(jd(({theme:e})=>({flex:`1 1 auto`,WebkitOverflowScrolling:`touch`,overflowY:`auto`,padding:`20px 24px`,variants:[{props:({ownerState:e})=>e.dividers,style:{padding:`16px 24px`,borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:e})=>!e.dividers,style:{[`.${aJ.root} + &`]:{paddingTop:0}}}]}))),cJ=F.forwardRef(function(e,t){let n=ou({props:e,name:`MuiDialogContent`}),{className:r,dividers:i=!1,...a}=n,o={...n,dividers:i},s=oJ(o);return(0,I.jsx)(sJ,{className:L(s.root,r),ownerState:o,ref:t,...a})}),lJ=df((0,I.jsx)(`path`,{d:`M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z`}),`ArrowBackIos`);function uJ(e){return _i(`MuiFormHelperText`,e)}var dJ=vi(`MuiFormHelperText`,[`root`,`error`,`disabled`,`sizeSmall`,`sizeMedium`,`contained`,`focused`,`filled`,`required`]),fJ,pJ=e=>{let{classes:t,contained:n,size:r,disabled:i,error:a,filled:o,focused:s,required:c}=e;return za({root:[`root`,i&&`disabled`,a&&`error`,r&&`size${V(r)}`,n&&`contained`,s&&`focused`,o&&`filled`,c&&`required`]},uJ,t)},mJ=z(`p`,{name:`MuiFormHelperText`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.size&&t[`size${V(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(jd(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:`left`,marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${dJ.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${dJ.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:`small`},style:{marginTop:4}},{props:({ownerState:e})=>e.contained,style:{marginLeft:14,marginRight:14}}]}))),hJ=F.forwardRef(function(e,t){let n=ou({props:e,name:`MuiFormHelperText`}),{children:r,className:i,component:a=`p`,disabled:o,error:s,filled:c,focused:l,margin:u,required:d,variant:f,...p}=n,m=nh({props:n,muiFormControl:ih(),states:[`variant`,`size`,`disabled`,`error`,`filled`,`focused`,`required`]}),h={...n,component:a,contained:m.variant===`filled`||m.variant===`outlined`,variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};delete h.ownerState;let g=pJ(h);return(0,I.jsx)(mJ,{as:a,className:L(g.root,i),ref:t,...p,ownerState:h,children:r===` `?fJ||=(0,I.jsx)(`span`,{className:`notranslate`,"aria-hidden":!0,children:``}):r})});function gJ(e){return _i(`MuiTextField`,e)}vi(`MuiTextField`,[`root`]);var _J={standard:TK,filled:jK,outlined:HK},vJ=e=>{let{classes:t}=e;return za({root:[`root`]},gJ,t)},yJ=z(xh,{name:`MuiTextField`,slot:`Root`})({}),bJ=F.forwardRef(function(e,t){let n=ou({props:e,name:`MuiTextField`}),{autoComplete:r,autoFocus:i=!1,children:a,className:o,color:s=`primary`,defaultValue:c,disabled:l=!1,error:u=!1,FormHelperTextProps:d,fullWidth:f=!1,helperText:p,id:m,InputLabelProps:h,inputProps:g,InputProps:_,inputRef:v,label:y,maxRows:b,minRows:x,multiline:S=!1,name:C,onBlur:w,onChange:T,onFocus:E,placeholder:D,required:O=!1,rows:k,select:A=!1,SelectProps:j,slots:M={},slotProps:ee={},type:N,value:te,variant:ne=`outlined`,...re}=n,ie={...n,autoFocus:i,color:s,disabled:l,error:u,fullWidth:f,multiline:S,required:O,select:A,variant:ne},ae=vJ(ie),oe=fa(m),se=p&&oe?`${oe}-helper-text`:void 0,ce=y&&oe?`${oe}-label`:void 0,le=_J[ne],ue={slots:M,slotProps:{input:_,inputLabel:h,htmlInput:g,formHelperText:d,select:j,...ee}},de={},fe=ue.slotProps.inputLabel;ne===`outlined`&&(fe&&fe.shrink!==void 0&&(de.notched=fe.shrink),de.label=y),A&&((!j||!j.native)&&(de.id=void 0),de[`aria-describedby`]=void 0);let[pe,me]=Ld(`root`,{elementType:yJ,shouldForwardComponentProp:!0,externalForwardedProps:{...ue,...re},ownerState:ie,className:L(ae.root,o),ref:t,additionalProps:{disabled:l,error:u,fullWidth:f,required:O,color:s,variant:ne}}),[he,P]=Ld(`input`,{elementType:le,externalForwardedProps:ue,additionalProps:de,ownerState:ie}),[ge,_e]=Ld(`inputLabel`,{elementType:mh,externalForwardedProps:ue,ownerState:ie}),[ve,ye]=Ld(`htmlInput`,{elementType:`input`,externalForwardedProps:ue,ownerState:ie}),[be,xe]=Ld(`formHelperText`,{elementType:hJ,externalForwardedProps:ue,ownerState:ie}),[Se,Ce]=Ld(`select`,{elementType:JK,externalForwardedProps:ue,ownerState:ie}),we=(0,I.jsx)(he,{"aria-describedby":se,autoComplete:r,autoFocus:i,defaultValue:c,fullWidth:f,multiline:S,name:C,rows:k,maxRows:b,minRows:x,type:N,value:te,id:oe,inputRef:v,onBlur:w,onChange:T,onFocus:E,placeholder:D,inputProps:ye,slots:{input:M.htmlInput?ve:void 0},...P});return(0,I.jsxs)(pe,{...me,children:[y!=null&&y!==``&&(0,I.jsx)(ge,{htmlFor:oe,id:ce,..._e,children:y}),A?(0,I.jsx)(Se,{"aria-describedby":se,id:oe,labelId:ce,value:te,input:we,...Ce,children:a}):we,p&&(0,I.jsx)(be,{id:se,...xe,children:p})]})});function xJ(e){return _i(`MuiDialogActions`,e)}vi(`MuiDialogActions`,[`root`,`spacing`]);var SJ=e=>{let{classes:t,disableSpacing:n}=e;return za({root:[`root`,!n&&`spacing`]},xJ,t)},CJ=z(`div`,{name:`MuiDialogActions`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:`flex`,alignItems:`center`,padding:8,justifyContent:`flex-end`,flex:`0 0 auto`,variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),wJ=F.forwardRef(function(e,t){let n=ou({props:e,name:`MuiDialogActions`}),{className:r,disableSpacing:i=!1,...a}=n,o={...n,disableSpacing:i},s=SJ(o);return(0,I.jsx)(CJ,{className:L(s.root,r),ownerState:o,ref:t,...a})});function TJ(e){return _i(`MuiDialog`,e)}var EJ=vi(`MuiDialog`,[`root`,`backdrop`,`scrollPaper`,`scrollBody`,`container`,`paper`,`paperScrollPaper`,`paperScrollBody`,`paperWidthFalse`,`paperWidthXs`,`paperWidthSm`,`paperWidthMd`,`paperWidthLg`,`paperWidthXl`,`paperFullWidth`,`paperFullScreen`]),DJ=F.createContext({}),OJ=z(Wd,{name:`MuiDialog`,slot:`Backdrop`})({zIndex:-1}),kJ=e=>{let{classes:t,scroll:n,maxWidth:r,fullWidth:i,fullScreen:a}=e;return za({root:[`root`],backdrop:[`backdrop`],container:[`container`,`scroll${V(n)}`],paper:[`paper`,`paperScroll${V(n)}`,`paperWidth${V(String(r))}`,i&&`paperFullWidth`,a&&`paperFullScreen`]},TJ,t)},AJ=z(nf,{name:`MuiDialog`,slot:`Root`})({"@media print":{position:`absolute !important`}}),jJ=z(`div`,{name:`MuiDialog`,slot:`Container`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.container,t[`scroll${V(n.scroll)}`]]}})({height:`100%`,"@media print":{height:`auto`},outline:0,variants:[{props:{scroll:`paper`},style:{display:`flex`,justifyContent:`center`,alignItems:`center`}},{props:{scroll:`body`},style:{overflowY:`auto`,overflowX:`hidden`,textAlign:`center`,"&::after":{content:`""`,display:`inline-block`,verticalAlign:`middle`,height:`100%`,width:`0`}}}]}),MJ=z(sf,{name:`MuiDialog`,slot:`Paper`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.paper,t[`scrollPaper${V(n.scroll)}`],t[`paperWidth${V(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(jd(({theme:e})=>({margin:32,position:`relative`,overflowY:`auto`,"@media print":{overflowY:`visible`,boxShadow:`none`},variants:[{props:{scroll:`paper`},style:{display:`flex`,flexDirection:`column`,maxHeight:`calc(100% - 64px)`}},{props:{scroll:`body`},style:{display:`inline-block`,verticalAlign:`middle`,textAlign:`initial`}},{props:({ownerState:e})=>!e.maxWidth,style:{maxWidth:`calc(100% - 64px)`}},{props:{maxWidth:`xs`},style:{maxWidth:e.breakpoints.unit===`px`?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${EJ.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:`calc(100% - 64px)`}}}},...Object.keys(e.breakpoints.values).filter(e=>e!==`xs`).map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${EJ.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:`calc(100% - 64px)`}}}})),{props:({ownerState:e})=>e.fullWidth,style:{width:`calc(100% - 64px)`}},{props:({ownerState:e})=>e.fullScreen,style:{margin:0,width:`100%`,maxWidth:`100%`,height:`100%`,maxHeight:`none`,borderRadius:0,[`&.${EJ.paperScrollBody}`]:{margin:0,maxWidth:`100%`}}}]}))),NJ=F.forwardRef(function(e,t){let n=ou({props:e,name:`MuiDialog`}),r=Qo(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":a,"aria-labelledby":o,"aria-modal":s=!0,BackdropComponent:c,BackdropProps:l,children:u,className:d,disableEscapeKeyDown:f=!1,fullScreen:p=!1,fullWidth:m=!1,maxWidth:h=`sm`,onClick:g,onClose:_,open:v,PaperComponent:y=sf,PaperProps:b={},role:x=`dialog`,scroll:S=`paper`,slots:C={},slotProps:w={},TransitionComponent:T=Bd,transitionDuration:E=i,TransitionProps:D,...O}=n,k={...n,disableEscapeKeyDown:f,fullScreen:p,fullWidth:m,maxWidth:h,scroll:S},A=kJ(k),j=F.useRef(),M=e=>{j.current=e.target===e.currentTarget},ee=e=>{g&&g(e),j.current&&(j.current=null,_&&_(e,`backdropClick`))},N=fa(o),te=F.useMemo(()=>({titleId:N}),[N]),ne={slots:{transition:T,...C},slotProps:{transition:D,paper:b,backdrop:l,...w}},[re,ie]=Ld(`root`,{elementType:AJ,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:k,className:L(A.root,d),ref:t}),[ae,oe]=Ld(`backdrop`,{elementType:OJ,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:k,className:A.backdrop}),[se,ce]=Ld(`paper`,{elementType:MJ,shouldForwardComponentProp:!0,externalForwardedProps:ne,ownerState:k,className:A.paper,additionalProps:{elevation:24,role:x,"aria-describedby":a,"aria-labelledby":N,"aria-modal":s,tabIndex:-1,[bd]:``}}),[le,ue]=Ld(`container`,{elementType:jJ,externalForwardedProps:ne,ownerState:k,className:A.container}),[de,fe]=Ld(`transition`,{elementType:Bd,externalForwardedProps:ne,ownerState:k,additionalProps:{appear:!0,in:v,timeout:E,role:`presentation`}});return(0,I.jsx)(re,{closeAfterTransition:!0,slots:{backdrop:ae},slotProps:{backdrop:{transitionDuration:E,as:c,...oe}},disableEscapeKeyDown:f,onClose:_,open:v,onClick:ee,...ie,...O,children:(0,I.jsx)(de,{...fe,children:(0,I.jsx)(le,{onMouseDown:M,...ue,children:(0,I.jsx)(se,{as:y,...ce,children:(0,I.jsx)(DJ.Provider,{value:te,children:u})})})})})}),PJ=class extends F.Component{static propTypes={onDone:P.func.isRequired,alt:P.string};constructor(e){super(e);let{alt:t}=e;this.state={value:t}}closeDialog=()=>{document.querySelectorAll(`#text-dialog`).forEach(function(e){return e.remove()})};onDone=()=>{let{onDone:e}=this.props,{value:t}=this.state;e(t),this.closeDialog()};handleOverflow=()=>{document.body.style.removeProperty(`overflow`)};render(){let{value:e}=this.state;return(0,I.jsxs)(NJ,{open:!0,disablePortal:!0,onClose:this.closeDialog,id:`text-dialog`,hideBackdrop:!0,disableScrollLock:!0,onEntered:this.handleOverflow,children:[(0,I.jsx)(cJ,{children:(0,I.jsxs)(`div`,{style:{display:`flex`},children:[(0,I.jsx)(lJ,{style:{paddingTop:`6px`}}),(0,I.jsx)(bJ,{multiline:!0,placeholder:`Enter an Alt Text description of this image`,helperText:`Users with visual limitations rely on Alt Text, since screen readers cannot otherwise describe the contents of an image.`,value:e,onChange:e=>this.setState({value:e.target.value}),FormHelperTextProps:{style:{fontSize:14}}})]})}),(0,I.jsx)(wJ,{children:(0,I.jsx)(Hm,{onClick:this.onDone,children:`Done`})})]})}},FJ=z(`button`,{shouldForwardProp:e=>![`active`,`disabled`,`extraStyles`].includes(e)})(({active:e,disabled:t})=>({color:e?Nf():Pf(),display:`inline-flex`,padding:`2px`,background:`none`,border:`none`,cursor:t?`not-allowed`:`pointer`,"& svg":{width:`24px`,height:`24px`},"&:hover":{color:t?Pf():Nf()},"&:focus":{outline:`2px solid ${Sp()}`},...t&&{opacity:.7}})),IJ=Bp(`pie-elements:editable-html:raw-button`);(class extends F.Component{static propTypes={onClick:P.func.isRequired,children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired,active:P.bool,disabled:P.bool,extraStyles:P.object};constructor(e){super(e)}onClick=e=>{IJ(`[onClick]`),e.preventDefault();let{onClick:t}=this.props;t(e)};onKeyDown=e=>{if(e.key===`Enter`||e.key===` `){IJ(`[onKeyDown]`),e.preventDefault();let{onClick:t}=this.props;t(e)}};render(){let{active:e,children:t,disabled:n,extraStyles:r,ariaLabel:i}=this.props;return(0,I.jsx)(FJ,{style:r,active:e,disabled:n,onMouseDown:this.onClick,onKeyDown:this.onKeyDown,"aria-label":i,"aria-pressed":e,tabIndex:0,children:t})}});var LJ=class extends F.Component{static propTypes={onToggle:P.func.isRequired,mark:P.string,label:P.string.isRequired,children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired,active:P.bool};constructor(e){super(e)}onToggle=e=>{e.preventDefault(),this.props.onToggle(this.props.mark)};onKeyDown=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.props.onToggle(this.props.mark))};render(){let{children:e,active:t,label:n}=this.props;return(0,I.jsx)(FJ,{active:t,onMouseDown:this.onToggle,"aria-pressed":t,onKeyDown:this.onKeyDown,"aria-label":n,tabIndex:0,children:e})}},RJ=Bp(`@pie-lib:editable-html:plugins:image:image-toolbar`),zJ=z(`div`)(({theme:e})=>({paddingLeft:e.spacing.unit,display:`flex`,alignItems:`center`})),BJ=z(`span`,{shouldForwardProp:e=>![`disabled`,`hasAlignmentButtons`].includes(e)})(({disabled:e,hasAlignmentButtons:t})=>({...e&&{opacity:.5},...t&&{borderLeft:`1px solid grey`,paddingLeft:8,marginLeft:4}})),VJ=({alignment:e,active:t,onClick:n})=>(0,I.jsx)(LJ,{active:t,onToggle:()=>n(e),label:e,children:e});VJ.propTypes={alignment:P.string.isRequired,active:P.bool.isRequired,onClick:P.func.isRequired};var HJ=class extends F.Component{static propTypes={onChange:P.func.isRequired,alignment:P.string,alt:P.string,imageLoaded:P.bool,disableImageAlignmentButtons:P.bool};onAltTextDone=e=>{RJ(`[onAltTextDone]: alt:`,e),this.props.onChange({alt:e},!0)};onAlignmentClick=e=>{RJ(`[onAlignmentClick]: alignment:`,e),this.props.onChange({alignment:e})};renderDialog=()=>{let{alt:e}=this.props,t=document.createElement(`div`),n=(0,I.jsx)(PJ,{alt:e,onDone:this.onAltTextDone});Au.render(n,t),document.body.appendChild(t)};render(){let{alignment:e,imageLoaded:t,disableImageAlignmentButtons:n}=this.props;return(0,I.jsxs)(zJ,{children:[!n&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(VJ,{alignment:`left`,active:e===`left`,onClick:this.onAlignmentClick}),(0,I.jsx)(VJ,{alignment:`center`,active:e===`center`,onClick:this.onAlignmentClick}),(0,I.jsx)(VJ,{alignment:`right`,active:e===`right`,onClick:this.onAlignmentClick})]}),(0,I.jsx)(BJ,{disabled:!t,hasAlignmentButtons:!n,onMouseDown:e=>t&&this.renderDialog(e),children:`Alt text`})]})}},UJ=z(Qq,{shouldForwardProp:e=>e!==`hideProgress`})(({hideProgress:e})=>({position:`absolute`,left:`0`,width:`fit-content`,top:`0%`,transition:`opacity 200ms linear`,...e&&{opacity:0}})),WJ=z(`div`,{shouldForwardProp:e=>![`active`,`loading`,`pendingDelete`].includes(e)})(({loading:e,pendingDelete:t})=>({position:`relative`,display:`flex`,transition:`opacity 200ms linear`,...e&&{opacity:.3},...t&&{opacity:.3}})),GJ=z(`div`)(({theme:e})=>({position:`relative`,width:`fit-content`,display:`flex`,alignItems:`center`,"&&:hover > .resize":{display:`block`}})),KJ=z(`img`,{shouldForwardProp:e=>e!==`active`})(({theme:e,active:t})=>({border:t?`solid 1px ${e.palette.primary.main}`:`solid 1px transparent`})),qJ=z(`div`)(({theme:e})=>({backgroundColor:e.palette.primary.main,cursor:`col-resize`,height:`35px`,width:`5px`,borderRadius:8,marginLeft:`5px`,marginRight:`10px`,display:`none`})),JJ=e=>e?`${e}px`:`calc(20px)`;function YJ(e){let{node:t,editor:n,attributes:r,onFocus:i,getPos:a,selected:o,options:s,maxImageWidth:c=700,maxImageHeight:l=900}=e,{alt:u}=t.attrs,d=a(),f=n.state.selection.from,p=n.state.selection.to,m=(0,F.useMemo)(()=>f+t.nodeSize===p,[f,p,t.nodeSize]),[h,g]=(0,F.useState)(!1),_=(0,F.useRef)(t),v=(0,F.useRef)(null),y=(0,F.useRef)(null),b=(0,F.useRef)(null),x=(0,F.useCallback)(e=>{let t=e/v.current.naturalWidth*4;return parseInt(t.toFixed(0)*25,10)},[]),S=(0,F.useCallback)(()=>{let e=$q(n,_.current.attrs.nodeKey);return e?e[1]:null},[n]),C=(0,F.useCallback)(e=>{let t=S();if(t===null)return;let r=n.state.doc.nodeAt(t);r&&n.view.dispatch(n.state.tr.setNodeMarkup(t,void 0,{...r.attrs,...e}))},[n,S]),w=(0,F.useCallback)(()=>{if(!t.attrs.width||!v.current||!v.current.naturalWidth)return;let e=x(t.attrs.width);t.attrs.resizePercent!==e&&C({resizePercent:e})},[t.attrs.width,t.attrs.resizePercent,x,C]);(0,F.useEffect)(()=>{_.current={...t,pos:d}},[t,d]),(0,F.useEffect)(()=>{o?m&&n.isEditable&&(!String(t.attrs?.src??``).trim()&&s.imageHandling?.insertImageRequested&&s.imageHandling.insertImageRequested(n,[t,d],e=>new nJ(n,[t,d],e)),g(o)):g(o)},[m,o,n.isEditable]),(0,F.useEffect)(()=>{w();let e=y?.current;return e&&n.isEditable&&e.addEventListener(`mousedown`,A,!1),()=>{e&&e.removeEventListener(`mousedown`,A,!1)}},[]),(0,F.useEffect)(()=>{w()});let T=(0,F.useCallback)(()=>{let e=v.current;if(e&&(!e.style.width||e.style.width===`calc(20px)`)){let n=Math.min(e.naturalWidth,c),r=Math.min(e.naturalHeight,l);e.style.width=`${n}px`,e.style.height=`${r}px`;let i={width:n,height:r};xs(i,{width:t.attrs.width,height:t.attrs.height})||C(i)}},[t.attrs.width,t.attrs.height,c,l,C]),E=(e,t,n=!0,r)=>{if(n){let n=e.width/e.height;return r===`height`?{width:t.height*n,height:t.height}:{width:t.width,height:t.width/n}}return t},D=(0,F.useCallback)(e=>{let t=v.current;if(!t)return;let n=e.target.getBoundingClientRect(),r={width:t.naturalWidth,height:t.naturalHeight},i=E(r,{width:e.clientX-n.left,height:e.clientY-n.top});i.width>50&&i.height>50&&i.width<=700&&i.height<=900&&(t.style.width=`${i.width}px`,t.style.height=`${i.height}px`,C({width:i.width,height:i.height}))},[n,C]),O=(0,F.useCallback)(e=>{C(e)},[n,C]),k=(0,F.useCallback)(()=>{window.removeEventListener(`mousemove`,D),window.removeEventListener(`mouseup`,k)},[D]),A=(0,F.useCallback)(()=>{window.addEventListener(`mousemove`,D),window.addEventListener(`mouseup`,k)},[D,k]),j={width:JJ(t.attrs.width),height:JJ(t.attrs.height),objectFit:`contain`},M={left:`flex-start`,center:`center`,right:`flex-end`}[t.attrs.alignment]||`flex-start`;return(0,I.jsxs)(hA,{children:[(0,I.jsxs)(WJ,{onFocus:i,loading:!t.attrs.loaded,pendingDelete:t.attrs.deleteStatus===`pending`,style:{justifyContent:M},children:[(0,I.jsx)(UJ,{mode:`determinate`,value:t.attrs.percent||0,hideProgress:t.attrs.loaded}),(0,I.jsxs)(GJ,{onDragStart:e=>e.preventDefault(),children:[(0,I.jsx)(KJ,{...r,active:o&&t.attrs.loaded,draggable:!1,ref:v,src:t.attrs.src,style:j,onLoad:T,alt:t.attrs.alt}),(0,I.jsx)(qJ,{ref:y,className:`resize`,style:{display:n.isEditable?void 0:`none`}})]})]}),h&&n._tiptapContainerEl&&Au.createPortal((0,I.jsx)(`div`,{ref:b,style:{zIndex:20,background:`var(--editable-html-toolbar-bg, #efefef)`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`,width:`100%`},children:(0,I.jsx)(PR,{showDone:!0,deletable:!0,toolbarOpts:s.toolbarOpts||{},onDelete:()=>{let e=S();e!==null&&(s.imageHandling?.onDelete?.(_.current),n.view.dispatch(n.state.tr.delete(e,e+n.state.doc.nodeAt(e).nodeSize)),g(!1),n.commands.focus())},onDone:()=>{g(!1),s.imageHandling?.onDone?.(n),n.commands.focus(`end`)},children:(0,I.jsx)(HJ,{disableImageAlignmentButtons:s.imageHandling?.disableImageAlignmentButtons,alt:t.attrs.alt,imageLoaded:t.attrs.loaded,alignment:t.attrs.alignment||`left`,onChange:O})})}),n._tiptapContainerEl)]})}YJ.propTypes={node:P.object.isRequired,editor:P.object.isRequired,attributes:P.object,onFocus:P.func,maxImageWidth:P.number,maxImageHeight:P.number};var XJ=YO.create({name:`imageUploadNode`,group:`block`,atom:!0,selectable:!0,draggable:!0,addAttributes(){return{nodeKey:{default:null},loaded:{default:!1},deleteStatus:{default:null},alignment:{default:null},percent:{default:null},width:{default:null},height:{default:null},src:{default:null},alt:{default:null}}},parseHTML(){return[{tag:`img[data-type="image-upload-node"]`}]},renderHTML({HTMLAttributes:e}){return[`img`,bE(e,{"data-type":`image-upload-node`})]},addNodeView(){return kA(e=>(0,I.jsx)(YJ,{...e,options:this.options}))},addCommands(){return{setImageUploadNode:()=>({commands:e})=>e.insertContent({type:this.name,attrs:{nodeKey:eJ()}})}},addProseMirrorPlugins(){let e=this.editor,t=this.options;return[new my({props:{handlePaste(n,r){let i=Array.from(r.clipboardData?.items||[]).find(e=>e.kind===`file`&&e.type.startsWith(`image/`));if(!i)return!1;let a=i.getAsFile();if(!a)return!1;let o=t?.imageHandling?.insertImageRequested,s=eJ(),c=new FileReader;return c.onload=()=>{let t=c.result;if(typeof t!=`string`||(e.commands.insertContent({type:`imageUploadNode`,attrs:{src:t,loaded:!o,nodeKey:s}}),!o))return;let n=$q(e,s);n&&o(e,n,t=>{let r;return r=new nJ(e,n,e=>{e||r?.updateNode({loaded:!0}),t(e)},!0),r.fileChosen(a),r})},c.readAsDataURL(a),!0}}})]}});function ZJ(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function QJ(e,t,n,r={},i=()=>{}){let{ease:a=ZJ,duration:o=300}=r,s=null,c=t[e],l=!1,u=()=>{l=!0},d=r=>{if(l){i(Error(`Animation cancelled`));return}s===null&&(s=r);let u=Math.min(1,(r-s)/o);if(t[e]=a(u)*(n-c)+c,u>=1){requestAnimationFrame(()=>{i(null)});return}requestAnimationFrame(d)};return c===n?(i(Error(`Element already at target position`)),u):(requestAnimationFrame(d),u)}var $J={width:99,height:99,position:`absolute`,top:-9999,overflow:`scroll`};function eY(e){let{onChange:t,...n}=e,r=F.useRef(),i=F.useRef(null),a=()=>{r.current=i.current.offsetHeight-i.current.clientHeight};return pf(()=>{let e=cu(()=>{let e=r.current;a(),e!==r.current&&t(r.current)}),n=fu(i.current);return n.addEventListener(`resize`,e),()=>{e.clear(),n.removeEventListener(`resize`,e)}},[t]),F.useEffect(()=>{a(),t(r.current)},[t]),(0,I.jsx)(`div`,{style:$J,...n,ref:i})}var tY=df((0,I.jsx)(`path`,{d:`M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z`}),`KeyboardArrowLeft`),nY=df((0,I.jsx)(`path`,{d:`M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z`}),`KeyboardArrowRight`);function rY(e){return _i(`MuiTabScrollButton`,e)}var iY=vi(`MuiTabScrollButton`,[`root`,`vertical`,`horizontal`,`disabled`]),aY=e=>{let{classes:t,orientation:n,disabled:r}=e;return za({root:[`root`,n,r&&`disabled`]},rY,t)},oY=z(mm,{name:`MuiTabScrollButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${iY.disabled}`]:{opacity:0},variants:[{props:{orientation:`vertical`},style:{width:`100%`,height:40,"& svg":{transform:`var(--TabScrollButton-svgRotate)`}}}]}),sY=F.forwardRef(function(e,t){let n=ou({props:e,name:`MuiTabScrollButton`}),{className:r,slots:i={},slotProps:a={},direction:o,orientation:s,disabled:c,...l}=n,u=ia(),d={isRtl:u,...n},f=aY(d),p=i.StartScrollButtonIcon??tY,m=i.EndScrollButtonIcon??nY,h=zh({elementType:p,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:d}),g=zh({elementType:m,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:`small`},ownerState:d});return(0,I.jsx)(oY,{component:`div`,className:L(f.root,r),ref:t,role:null,ownerState:d,tabIndex:null,...l,style:{...l.style,...s===`vertical`&&{"--TabScrollButton-svgRotate":`rotate(${u?-90:90}deg)`}},children:o===`left`?(0,I.jsx)(p,{...h}):(0,I.jsx)(m,{...g})})});function cY(e){return _i(`MuiTabs`,e)}var lY=vi(`MuiTabs`,[`root`,`vertical`,`list`,`flexContainer`,`flexContainerVertical`,`centered`,`scroller`,`fixed`,`scrollableX`,`scrollableY`,`hideScrollbar`,`scrollButtons`,`scrollButtonsHideMobile`,`indicator`]),uY=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,dY=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,fY=(e,t,n)=>{let r=!1,i=n(e,t);for(;i;){if(i===e.firstChild){if(r)return;r=!0}let t=i.disabled||i.getAttribute(`aria-disabled`)===`true`;if(!i.hasAttribute(`tabindex`)||t)i=n(e,i);else{i.focus();return}}},pY=e=>{let{vertical:t,fixed:n,hideScrollbar:r,scrollableX:i,scrollableY:a,centered:o,scrollButtonsHideMobile:s,classes:c}=e;return za({root:[`root`,t&&`vertical`],scroller:[`scroller`,n&&`fixed`,r&&`hideScrollbar`,i&&`scrollableX`,a&&`scrollableY`],list:[`list`,`flexContainer`,t&&`flexContainerVertical`,t&&`vertical`,o&&`centered`],indicator:[`indicator`],scrollButtons:[`scrollButtons`,s&&`scrollButtonsHideMobile`],scrollableX:[i&&`scrollableX`],hideScrollbar:[r&&`hideScrollbar`]},cY,c)},mY=z(`div`,{name:`MuiTabs`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[{[`& .${lY.scrollButtons}`]:t.scrollButtons},{[`& .${lY.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(jd(({theme:e})=>({overflow:`hidden`,minHeight:48,WebkitOverflowScrolling:`touch`,display:`flex`,variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:`column`}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${lY.scrollButtons}`]:{[e.breakpoints.down(`sm`)]:{display:`none`}}}}]}))),hY=z(`div`,{name:`MuiTabs`,slot:`Scroller`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:`relative`,display:`inline-block`,flex:`1 1 auto`,whiteSpace:`nowrap`,variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:`hidden`,width:`100%`}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:`auto`,overflowY:`hidden`}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:`auto`,overflowX:`hidden`}}]}),gY=z(`div`,{name:`MuiTabs`,slot:`List`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.list,t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})({display:`flex`,variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:`column`}},{props:({ownerState:e})=>e.centered,style:{justifyContent:`center`}}]}),_Y=z(`span`,{name:`MuiTabs`,slot:`Indicator`})(jd(({theme:e})=>({position:`absolute`,height:2,bottom:0,width:`100%`,transition:e.transitions.create(),variants:[{props:{indicatorColor:`primary`},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:`secondary`},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:`100%`,width:2,right:0}}]}))),vY=z(eY)({overflowX:`auto`,overflowY:`hidden`,scrollbarWidth:`none`,"&::-webkit-scrollbar":{display:`none`}}),yY={},bY=F.forwardRef(function(e,t){let n=ou({props:e,name:`MuiTabs`}),r=Qo(),i=ia(),{"aria-label":a,"aria-labelledby":o,action:s,centered:c=!1,children:l,className:u,component:d=`div`,allowScrollButtonsMobile:f=!1,indicatorColor:p=`primary`,onChange:m,orientation:h=`horizontal`,ScrollButtonComponent:g,scrollButtons:_=`auto`,selectionFollowsFocus:v,slots:y={},slotProps:b={},TabIndicatorProps:x={},TabScrollButtonProps:S={},textColor:C=`primary`,value:w,variant:T=`standard`,visibleScrollbar:E=!1,...D}=n,O=T===`scrollable`,k=h===`vertical`,A=k?`scrollTop`:`scrollLeft`,j=k?`top`:`left`,M=k?`bottom`:`right`,ee=k?`clientHeight`:`clientWidth`,N=k?`height`:`width`,te={...n,component:d,allowScrollButtonsMobile:f,indicatorColor:p,orientation:h,vertical:k,scrollButtons:_,textColor:C,variant:T,visibleScrollbar:E,fixed:!O,hideScrollbar:O&&!E,scrollableX:O&&!k,scrollableY:O&&k,centered:c&&!O,scrollButtonsHideMobile:!f},ne=pY(te),re=zh({elementType:y.StartScrollButtonIcon,externalSlotProps:b.startScrollButtonIcon,ownerState:te}),ie=zh({elementType:y.EndScrollButtonIcon,externalSlotProps:b.endScrollButtonIcon,ownerState:te}),[ae,oe]=F.useState(!1),[se,ce]=F.useState(yY),[le,ue]=F.useState(!1),[de,fe]=F.useState(!1),[pe,me]=F.useState(!1),[he,P]=F.useState({overflow:`hidden`,scrollbarWidth:0}),ge=new Map,_e=F.useRef(null),ve=F.useRef(null),ye={slots:y,slotProps:{indicator:x,scrollButtons:S,...b}},be=()=>{let e=_e.current,t;if(e){let n=e.getBoundingClientRect();t={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}let n;if(e&&w!==!1){let e=ve.current.children;if(e.length>0){let t=e[ge.get(w)];n=t?t.getBoundingClientRect():null}}return{tabsMeta:t,tabMeta:n}},xe=_f(()=>{let{tabsMeta:e,tabMeta:t}=be(),n=0,r;k?(r=`top`,t&&e&&(n=t.top-e.top+e.scrollTop)):(r=i?`right`:`left`,t&&e&&(n=(i?-1:1)*(t[r]-e[r]+e.scrollLeft)));let a={[r]:n,[N]:t?t[N]:0};if(typeof se[r]!=`number`||typeof se[N]!=`number`)ce(a);else{let e=Math.abs(se[r]-a[r]),t=Math.abs(se[N]-a[N]);(e>=1||t>=1)&&ce(a)}}),Se=(e,{animation:t=!0}={})=>{t?QJ(A,_e.current,e,{duration:r.transitions.duration.standard}):_e.current[A]=e},Ce=e=>{let t=_e.current[A];k?t+=e:t+=e*(i?-1:1),Se(t)},we=()=>{let e=_e.current[ee],t=0,n=Array.from(ve.current.children);for(let r=0;r<n.length;r+=1){let i=n[r];if(t+i[ee]>e){r===0&&(t=e);break}t+=i[ee]}return t},Te=()=>{Ce(-1*we())},Ee=()=>{Ce(we())},[De,{onChange:Oe,...ke}]=Ld(`scrollbar`,{className:L(ne.scrollableX,ne.hideScrollbar),elementType:vY,shouldForwardComponentProp:!0,externalForwardedProps:ye,ownerState:te}),Ae=F.useCallback(e=>{Oe?.(e),P({overflow:null,scrollbarWidth:e})},[Oe]),[je,Me]=Ld(`scrollButtons`,{className:L(ne.scrollButtons,S.className),elementType:sY,externalForwardedProps:ye,ownerState:te,additionalProps:{orientation:h,slots:{StartScrollButtonIcon:y.startScrollButtonIcon||y.StartScrollButtonIcon,EndScrollButtonIcon:y.endScrollButtonIcon||y.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:re,endScrollButtonIcon:ie}}}),Ne=()=>{let e={};e.scrollbarSizeListener=O?(0,I.jsx)(De,{...ke,onChange:Ae}):null;let t=O&&(_===`auto`&&(le||de)||_===!0);return e.scrollButtonStart=t?(0,I.jsx)(je,{direction:i?`right`:`left`,onClick:Te,disabled:!le,...Me}):null,e.scrollButtonEnd=t?(0,I.jsx)(je,{direction:i?`left`:`right`,onClick:Ee,disabled:!de,...Me}):null,e},Pe=_f(e=>{let{tabsMeta:t,tabMeta:n}=be();if(!(!n||!t)){if(n[j]<t[j]){let r=t[A]+(n[j]-t[j]);Se(r,{animation:e})}else if(n[M]>t[M]){let r=t[A]+(n[M]-t[M]);Se(r,{animation:e})}}}),Fe=_f(()=>{O&&_!==!1&&me(!pe)});F.useEffect(()=>{let e=cu(()=>{_e.current&&xe()}),t,n=n=>{n.forEach(e=>{e.removedNodes.forEach(e=>{t?.unobserve(e)}),e.addedNodes.forEach(e=>{t?.observe(e)})}),e(),Fe()},r=fu(_e.current);r.addEventListener(`resize`,e);let i;return typeof ResizeObserver<`u`&&(t=new ResizeObserver(e),Array.from(ve.current.children).forEach(e=>{t.observe(e)})),typeof MutationObserver<`u`&&(i=new MutationObserver(n),i.observe(ve.current,{childList:!0})),()=>{e.clear(),r.removeEventListener(`resize`,e),i?.disconnect(),t?.disconnect()}},[xe,Fe]),F.useEffect(()=>{let e=Array.from(ve.current.children),t=e.length;if(typeof IntersectionObserver<`u`&&t>0&&O&&_!==!1){let n=e[0],r=e[t-1],i={root:_e.current,threshold:.99},a=new IntersectionObserver(e=>{ue(!e[0].isIntersecting)},i);a.observe(n);let o=new IntersectionObserver(e=>{fe(!e[0].isIntersecting)},i);return o.observe(r),()=>{a.disconnect(),o.disconnect()}}},[O,_,pe,l?.length]),F.useEffect(()=>{oe(!0)},[]),F.useEffect(()=>{xe()}),F.useEffect(()=>{Pe(yY!==se)},[Pe,se]),F.useImperativeHandle(s,()=>({updateIndicator:xe,updateScrollButtons:Fe}),[xe,Fe]);let[Ie,Le]=Ld(`indicator`,{className:L(ne.indicator,x.className),elementType:_Y,externalForwardedProps:ye,ownerState:te,additionalProps:{style:se}}),Re=(0,I.jsx)(Ie,{...Le}),ze=0,Be=F.Children.map(l,e=>{if(!F.isValidElement(e))return null;let t=e.props.value===void 0?ze:e.props.value;ge.set(t,ze);let n=t===w;return ze+=1,F.cloneElement(e,{fullWidth:T===`fullWidth`,indicator:n&&!ae&&Re,selected:n,selectionFollowsFocus:v,onChange:m,textColor:C,value:t,...ze===1&&w===!1&&!e.props.tabIndex?{tabIndex:0}:{}})}),Ve=e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;let t=ve.current,n=yd(uu(t));if(n?.getAttribute(`role`)!==`tab`)return;let r=h===`horizontal`?`ArrowLeft`:`ArrowUp`,a=h===`horizontal`?`ArrowRight`:`ArrowDown`;switch(h===`horizontal`&&i&&(r=`ArrowRight`,a=`ArrowLeft`),e.key){case r:e.preventDefault(),fY(t,n,dY);break;case a:e.preventDefault(),fY(t,n,uY);break;case`Home`:e.preventDefault(),fY(t,null,uY);break;case`End`:e.preventDefault(),fY(t,null,dY);break;default:break}},He=Ne(),[Ue,We]=Ld(`root`,{ref:t,className:L(ne.root,u),elementType:mY,externalForwardedProps:{...ye,...D,component:d},ownerState:te}),[Ge,Ke]=Ld(`scroller`,{ref:_e,className:ne.scroller,elementType:hY,externalForwardedProps:ye,ownerState:te,additionalProps:{style:{overflow:he.overflow,[k?`margin${i?`Left`:`Right`}`:`marginBottom`]:E?void 0:-he.scrollbarWidth}}}),[qe,Je]=Ld(`list`,{ref:ve,className:L(ne.list,ne.flexContainer),elementType:gY,externalForwardedProps:ye,ownerState:te,getSlotProps:e=>({...e,onKeyDown:t=>{Ve(t),e.onKeyDown?.(t)}})});return(0,I.jsxs)(Ue,{...We,children:[He.scrollButtonStart,He.scrollbarSizeListener,(0,I.jsxs)(Ge,{...Ke,children:[(0,I.jsx)(qe,{"aria-label":a,"aria-labelledby":o,"aria-orientation":h===`vertical`?`vertical`:null,role:`tablist`,...Je,children:Be}),ae&&Re]}),He.scrollButtonEnd]})});function xY(e){return _i(`MuiTab`,e)}var SY=vi(`MuiTab`,[`root`,`labelIcon`,`textColorInherit`,`textColorPrimary`,`textColorSecondary`,`selected`,`disabled`,`fullWidth`,`wrapped`,`iconWrapper`,`icon`]),CY=e=>{let{classes:t,textColor:n,fullWidth:r,wrapped:i,icon:a,label:o,selected:s,disabled:c}=e;return za({root:[`root`,a&&o&&`labelIcon`,`textColor${V(n)}`,r&&`fullWidth`,i&&`wrapped`,s&&`selected`,c&&`disabled`],icon:[`iconWrapper`,`icon`]},xY,t)},wY=z(mm,{name:`MuiTab`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${V(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${SY.iconWrapper}`]:t.iconWrapper},{[`& .${SY.icon}`]:t.icon}]}})(jd(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:`relative`,minHeight:48,flexShrink:0,padding:`12px 16px`,overflow:`hidden`,whiteSpace:`normal`,textAlign:`center`,lineHeight:1.25,variants:[{props:({ownerState:e})=>e.label&&(e.iconPosition===`top`||e.iconPosition===`bottom`),style:{flexDirection:`column`}},{props:({ownerState:e})=>e.label&&e.iconPosition!==`top`&&e.iconPosition!==`bottom`,style:{flexDirection:`row`}},{props:({ownerState:e})=>e.icon&&e.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`top`,style:{[`& > .${SY.icon}`]:{marginBottom:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`bottom`,style:{[`& > .${SY.icon}`]:{marginTop:6}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`start`,style:{[`& > .${SY.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:e,iconPosition:t})=>e.icon&&e.label&&t===`end`,style:{[`& > .${SY.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:`inherit`},style:{color:`inherit`,opacity:.6,[`&.${SY.selected}`]:{opacity:1},[`&.${SY.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:`primary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${SY.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${SY.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:`secondary`},style:{color:(e.vars||e).palette.text.secondary,[`&.${SY.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${SY.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:e})=>e.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:`none`}},{props:({ownerState:e})=>e.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),TY=F.forwardRef(function(e,t){let n=ou({props:e,name:`MuiTab`}),{className:r,disabled:i=!1,disableFocusRipple:a=!1,fullWidth:o,icon:s,iconPosition:c=`top`,indicator:l,label:u,onChange:d,onClick:f,onFocus:p,selected:m,selectionFollowsFocus:h,textColor:g=`inherit`,value:_,wrapped:v=!1,...y}=n,b={...n,disabled:i,disableFocusRipple:a,selected:m,icon:!!s,iconPosition:c,label:!!u,fullWidth:o,textColor:g,wrapped:v},x=CY(b),S=s&&u&&F.isValidElement(s)?F.cloneElement(s,{className:L(x.icon,s.props.className)}):s;return(0,I.jsxs)(wY,{focusRipple:!a,className:L(x.root,r),ref:t,role:`tab`,"aria-selected":m,disabled:i,onClick:e=>{!m&&d&&d(e,_),f&&f(e)},onFocus:e=>{h&&!m&&d&&d(e,_),p&&p(e)},ownerState:b,tabIndex:m?0:-1,...y,children:[c===`top`||c===`start`?(0,I.jsxs)(F.Fragment,{children:[S,u]}):(0,I.jsxs)(F.Fragment,{children:[u,S]}),l]})}),EY=e=>{let{classes:t}=e;return za({root:[`root`]},iJ,t)},DY=z(AG,{name:`MuiDialogTitle`,slot:`Root`})({padding:`16px 24px`,flex:`0 0 auto`}),OY=F.forwardRef(function(e,t){let n=ou({props:e,name:`MuiDialogTitle`}),{className:r,id:i,...a}=n,o=n,s=EY(o),{titleId:c=i}=F.useContext(DJ);return(0,I.jsx)(DY,{component:`h2`,className:L(s.root,r),ownerState:o,ref:t,variant:`h6`,id:i??c,...a})});function kY(e){return _i(`MuiDialogContentText`,e)}vi(`MuiDialogContentText`,[`root`]);var AY=e=>{let{classes:t}=e,n=za({root:[`root`]},kY,t);return{...t,...n}},jY=z(AG,{shouldForwardProp:e=>es(e)||e===`classes`,name:`MuiDialogContentText`,slot:`Root`})({}),MY=F.forwardRef(function(e,t){let n=ou({props:e,name:`MuiDialogContentText`}),{children:r,className:i,...a}=n,o=AY(a);return(0,I.jsx)(jY,{component:`p`,variant:`body1`,color:`textSecondary`,ref:t,ownerState:a,className:L(o.root,i),...n,classes:o})}),NY=Bp(`@pie-lib:editable-html:plugins:media:dialog`),PY=e=>{if(!e)return!1;let t=/^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;return e.match(t)?e.match(t)[1]:!1},FY=e=>e&&/(http|https)?:\/\/(www\.)?(player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|)(video\/)?(\d+)(?:|\/\?)/.test(e),IY=e=>e&&/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)/.test(e),LY=e=>{if(!e)return!1;let t=/^https?:\/\/(soundcloud\.com|snd\.sc)\/(.*)$/;return e.match(t)&&e.match(t)[2]},RY=e=>new Promise(t=>{try{fetch(`https://soundcloud.com/oembed?format=json&url=${e}`).then(e=>e.json()).then(e=>{let n=document.createElement(`div`);n.innerHTML=e.html,t(n.querySelector(`iframe`).src)}).catch(e=>{t(``),NY(e)})}catch{t(``)}}),zY={video:`Video`,audio:`Audio`},BY={uploadFile:`upload-file`,insertUrl:`insert-url`},VY=z(NJ)(({theme:e})=>({"& .MuiDialog-paper":{minWidth:`500px`}})),HY=z(cJ)(({theme:e})=>({padding:0})),UY=z(`div`)(({theme:e})=>({display:`flex`,flexDirection:`space-between`})),WY=z(`div`)(({theme:e})=>({marginTop:e.spacing(1.5)})),GY=z(`input`)(({theme:e})=>({})),KY=z(AG)(({theme:e})=>({marginTop:e.spacing(1.5),color:e.palette.error.main})),qY=z(wR)(({theme:e})=>({marginLeft:e.spacing(1.5)})),JY=class extends F.Component{static propTypes={open:P.bool,edit:P.bool,disablePortal:P.bool,handleClose:P.func,uploadSoundSupport:P.shape({add:P.func,delete:P.func}),type:P.string,src:P.string,url:P.string,urlToUse:P.string,starts:P.number,ends:P.number,height:P.number,width:P.number};constructor(e){super(e);let{ends:t,height:n,src:r,starts:i,type:a,uploadSoundSupport:o,url:s,urlToUse:c,width:l}=e,u=o?.add&&o?.delete&&a!==`video`&&!r;this.state={ends:t||0,url:s,urlToUse:c,formattedUrl:r,height:n||315,invalid:!1,starts:i||0,width:l||560,tabValue:u?BY.uploadFile:BY.insertUrl,fileUpload:{error:null,loading:!1,scheduled:!1,url:``,mimeType:``}}}componentDidMount(){this.props.url&&this.urlChange({target:{value:this.props.url}})}formatUrl=()=>{let{url:e,urlToUse:t,starts:n,ends:r}=this.state,i=PY(e),a=FY(e),o=t;if((i||a)&&t){let e=[],s,c;switch(!0){case a:s=`t`,c=`#`;break;case i:s=`start`,c=`?`;break;default:s=`start`,c=`?`}n&&e.push(`${s}=${n}`),r&&e.push(`end=${r}`),o=`${t}${e.length?c:``}${e.join(`&`)}`}this.setState({formattedUrl:null,updating:!0},()=>this.setState({formattedUrl:o,updating:!1}))};handleStateChange=e=>this.setState(e,this.formatUrl);checkAudio=e=>{LY(e)&&RY(e).then(t=>{this.handleStateChange({urlToUse:t,invalid:!t,url:e})}).catch(NY)};checkVideo=e=>{if(PY(e)){let t=`https://youtube.com/embed/${e.match(/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)[2]}`;NY(`is youtube`),this.handleStateChange({urlToUse:t,url:e,invalid:!1})}if(FY(e)){let t=`https://player.vimeo.com/video/${e.replace(/.*vimeo.com\/(.*)/g,`$1`)}`;NY(`is vimeo`),this.handleStateChange({urlToUse:t,url:e,ends:null,invalid:!1})}if(IY(e)){let t=`https://drive.google.com/file/d/${e.replace(/^https:\/\/drive\.google\.com\/(?:file\/d\/|drive\/(?:u\/\d+\/)?folders\/|uc\?id=)([a-zA-Z0-9_-]+)\/.*/,`$1`)}/preview`;NY(`is google drive`),this.handleStateChange({urlToUse:t,url:e,ends:null,invalid:!1})}};urlChange=e=>{let{value:t}=e.target||{},{type:n}=this.props;if(n&&n===`audio`){this.checkAudio(t);return}else if(n&&n===`video`){this.checkVideo(t);return}this.handleStateChange({urlToUse:null,url:null,invalid:!0})};changeHandler=e=>t=>this.handleStateChange({[e]:t.target.value});handleDone=e=>{let{handleClose:t}=this.props,{tabValue:n,fileUpload:r}=this.state,i=n===BY.insertUrl;if(!e){r.url&&this.handleRemoveFile(),t(e);return}if(i){let{ends:n,height:r,url:i,urlToUse:a,formattedUrl:o,starts:s,width:c}=this.state;t(e,{tag:`iframe`,ends:n,height:r,starts:s,width:c,url:i,urlToUse:a,src:o});return}if(!r.loading){t(e,{tag:`audio`,src:r.url});return}this.setState({fileUpload:{...r,scheduled:!0}})};handleUploadFile=async e=>{e.preventDefault(),this.setState({fileUpload:{...this.state.fileUpload,error:null,loading:!0}});let t=e.target.files[0],n=new FileReader;n.onload=()=>{let e=n.result;this.setState({fileUpload:{...this.state.fileUpload,url:e,mimeType:t.type}})},n.readAsDataURL(t),this.props.uploadSoundSupport.add({fileChosen:t,done:(e,t)=>{if(NY(`done: err:`,e),e){console.log(e),this.setState({fileUpload:{...this.state.fileUpload,scheduled:!1,loading:!1,error:e}});return}let{fileUpload:n}=this.state,r=n&&n.scheduled?this.handleDone.bind(this,!0):void 0;this.setState({fileUpload:{...n,scheduled:!1,loading:!1,url:t}},r)}})};handleRemoveFile=async()=>{this.props.uploadSoundSupport.delete(this.state.fileUpload.url,e=>{e&&(console.log(e),this.setState({fileUpload:{...this.state.fileUpload,error:e}}))}),this.setState({fileUpload:{...this.state.fileUpload,loading:!1,url:``,mimeType:``}})};render(){let{open:e,disablePortal:t,type:n,edit:r,uploadSoundSupport:i}=this.props,{ends:a,height:o,invalid:s,starts:c,width:l,url:u,mimeType:d,formattedUrl:f,updating:p,tabValue:m,fileUpload:h}=this.state,g=PY(u),_=m===BY.insertUrl,v=m===BY.uploadFile,y=_?s||u==null:!h.url||h.scheduled,b=i?.add&&i?.delete&&n!==`video`;return(0,I.jsxs)(VY,{disablePortal:t,open:e,onClose:()=>this.handleDone(!1),"aria-labelledby":`form-dialog-title`,children:[(0,I.jsxs)(OY,{id:`form-dialog-title`,children:[`Insert `,zY[n]]}),(0,I.jsx)(cJ,{children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(UY,{children:(0,I.jsxs)(bY,{indicatorColor:`primary`,value:m,onChange:(e,t)=>{this.setState({tabValue:t})},children:[b?(0,I.jsx)(TY,{value:BY.uploadFile,label:`Upload file`}):null,(0,I.jsx)(TY,{value:BY.insertUrl,label:n===`video`?`Insert YouTube, Vimeo, or Google Drive URL`:`Insert SoundCloud URL`})]})}),_&&(0,I.jsxs)(`div`,{children:[(0,I.jsx)(bJ,{autoFocus:!0,error:s,helperText:s?`Invalid URL`:``,margin:`dense`,id:`name`,label:`URL`,placeholder:`Paste URL of ${n}...`,type:`text`,onChange:this.urlChange,value:u,fullWidth:!0}),n===`video`&&(0,I.jsxs)(HY,{children:[(0,I.jsx)(MY,{children:`Video Properties`}),(0,I.jsx)(bJ,{autoFocus:!0,margin:`dense`,id:`width`,label:`Width`,type:`number`,placeholder:`Width`,value:l,onChange:this.changeHandler(`width`)}),(0,I.jsx)(bJ,{autoFocus:!0,margin:`dense`,id:`height`,label:`Height`,type:`number`,placeholder:`Height`,value:o,onChange:this.changeHandler(`height`)})]}),f&&(0,I.jsx)(`iframe`,{width:l,height:o,src:f,frameBorder:`0`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:!0}),n===`video`&&(f||p)&&!s&&(0,I.jsx)(F.Fragment,{children:(0,I.jsxs)(HY,{children:[(0,I.jsx)(bJ,{autoFocus:!0,margin:`dense`,id:`starts`,label:`Starts`,type:`number`,placeholder:`Starts`,value:c,onChange:this.changeHandler(`starts`)}),g&&(0,I.jsx)(bJ,{autoFocus:!0,margin:`dense`,id:`ends`,label:`Ends`,type:`number`,placeholder:`Ends`,value:a,onChange:this.changeHandler(`ends`)})]})})]}),v&&(0,I.jsx)(WY,{children:(0,I.jsxs)(`div`,{children:[h.url?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(UY,{children:[(0,I.jsx)(`audio`,{controls:`controls`,controlsList:`nodownload`,children:(0,I.jsx)(`source`,{type:d,src:h.url})}),(0,I.jsx)(qY,{"aria-label":`delete`,onClick:this.handleRemoveFile,children:(0,I.jsx)(TR,{})})]}),!h.scheduled&&h.loading?(0,I.jsx)(AG,{variant:`subheading`,children:`Loading...`}):null,h.scheduled?(0,I.jsx)(AG,{variant:`subheading`,children:`Waiting for Upload to finish, then inserting item...`}):null]}):h.loading?null:(0,I.jsx)(GY,{accept:`audio/*`,onChange:this.handleUploadFile,type:`file`}),!!h.error&&(0,I.jsx)(KY,{variant:`caption`,children:h.error})]})})]})}),(0,I.jsxs)(wJ,{children:[(0,I.jsx)(Hm,{onClick:()=>this.handleDone(!1),color:`primary`,children:`Cancel`}),(0,I.jsx)(Hm,{disabled:y,onClick:()=>this.handleDone(!0),color:`primary`,children:r?`Update`:`Insert`})]})]})}},YY=z(`span`)(({theme:e})=>({position:`relative`,bottom:`5px`,left:0,width:`100%`,background:e.palette.common.white,display:`inline-flex`,padding:`5px`,boxShadow:`0px 4px 4px rgba(0, 0, 0, 0.25)`})),XY=z(`span`)(({theme:e})=>({cursor:`pointer`,flex:3,border:`solid ${e.palette.common.black}`,textAlign:`right`,borderWidth:`0 2px 0 0`,marginRight:`5px`,paddingRight:`5px`})),ZY=z(`span`)({cursor:`pointer`}),QY=class extends F.Component{static propTypes={onEdit:P.func,hideEdit:P.bool,onRemove:P.func};render(){let{hideEdit:e,onEdit:t,onRemove:n}=this.props;return(0,I.jsxs)(YY,{children:[e?null:(0,I.jsx)(XY,{onClick:t,children:`Edit Settings`}),(0,I.jsx)(ZY,{onClick:n,children:`Remove`})]})}},$Y=YO.create({name:`media`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{type:{default:`video`},src:{default:null},width:{default:null},height:{default:null},title:{default:null},starts:{default:null},ends:{default:null},editing:{default:!1},tag:{default:`iframe`},url:{default:null}}},parseHTML(){return[{tag:`iframe[data-type="video"]`,getAttrs:e=>({type:`video`,tag:`iframe`,src:e.getAttribute(`src`),width:e.getAttribute(`width`),height:e.getAttribute(`height`),title:e.dataset.title,starts:e.dataset.starts,ends:e.dataset.ends,url:e.dataset.url})},{tag:`audio`,getAttrs:e=>({type:`audio`,tag:`audio`,src:e.querySelector(`source`)?.getAttribute(`src`)})}]},renderHTML({HTMLAttributes:e}){let{tag:t,src:n,width:r,height:i}=e;return t===`audio`?[`audio`,{controls:`controls`,controlsList:`nodownload`},[`source`,{src:n,type:`audio/mp3`}]]:[`iframe`,bE({"data-type":`video`,frameborder:`0`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowfullscreen:``,src:n},r?{width:r}:{},i?{height:i}:{})]},addCommands(){return{insertMedia:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateMedia:e=>({commands:t})=>t.updateAttributes(this.name,e)}},addNodeView(){return kA(e=>(0,I.jsx)(nX,{...e,options:this.options}))}}),eX=()=>{document.querySelectorAll(`.insert-media-dialog`).forEach(e=>e.remove())},tX=e=>{let t=document.createElement(`div`),{type:n,callback:r,options:i,...a}=e,o=document.body.style.overflow;eX(),t.className=`insert-media-dialog`,document.body.style.overflow=`hidden`;let s=(e,n)=>{r(e,n),t.remove(),document.body.style.overflow=o},c=(0,I.jsx)(JY,{...a,uploadSoundSupport:i.uploadSoundSupport,type:n,disablePortal:!0,open:!0,handleClose:s});Au.render(c,t),document.body.appendChild(t)};function nX({editor:e,node:t,updateAttributes:n,deleteNode:r,options:i}){let{type:a,src:o,width:s,height:c,tag:l}=t.attrs;return(0,F.useEffect)(()=>{o||tX({...t.attrs,options:i,edit:!0,callback:(t,i)=>{t?n(i):r(),e.chain().focus().run()}})},[]),(0,I.jsxs)(hA,{"data-type":a,style:{width:s,height:c},children:[l===`audio`?(0,I.jsx)(`audio`,{controls:!0,controlsList:`nodownload`,children:(0,I.jsx)(`source`,{type:`audio/mp3`,src:o})}):(0,I.jsx)(`iframe`,{src:o,allowFullScreen:!0,frameBorder:`0`,width:s,height:c}),(0,I.jsx)(QY,{onEdit:()=>{tX({...t.attrs,options:i,edit:!0,callback:(t,r)=>{t&&n(r),e.chain().focus().run()}})},onRemove:r})]})}function rX(e){return _i(`MuiListItem`,e)}vi(`MuiListItem`,[`root`,`container`,`dense`,`alignItemsFlexStart`,`divider`,`gutters`,`padding`,`secondaryAction`]);var iX=vi(`MuiListItemButton`,[`root`,`focusVisible`,`dense`,`alignItemsFlexStart`,`disabled`,`divider`,`gutters`,`selected`]);function aX(e){return _i(`MuiListItemSecondaryAction`,e)}vi(`MuiListItemSecondaryAction`,[`root`,`disableGutters`]);var oX=e=>{let{disableGutters:t,classes:n}=e;return za({root:[`root`,t&&`disableGutters`]},aX,n)},sX=z(`div`,{name:`MuiListItemSecondaryAction`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:`absolute`,right:16,top:`50%`,transform:`translateY(-50%)`,variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),cX=F.forwardRef(function(e,t){let n=ou({props:e,name:`MuiListItemSecondaryAction`}),{className:r,...i}=n,a=F.useContext(Bh),o={...n,disableGutters:a.disableGutters},s=oX(o);return(0,I.jsx)(sX,{className:L(s.root,r),ownerState:o,ref:t,...i})});cX.muiName=`ListItemSecondaryAction`;var lX=(e,t)=>{let{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems===`flex-start`&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]},uX=e=>{let{alignItems:t,classes:n,dense:r,disableGutters:i,disablePadding:a,divider:o,hasSecondaryAction:s}=e;return za({root:[`root`,r&&`dense`,!i&&`gutters`,!a&&`padding`,o&&`divider`,t===`flex-start`&&`alignItemsFlexStart`,s&&`secondaryAction`],container:[`container`],secondaryAction:[`secondaryAction`]},rX,n)},dX=z(`div`,{name:`MuiListItem`,slot:`Root`,overridesResolver:lX})(jd(({theme:e})=>({display:`flex`,justifyContent:`flex-start`,alignItems:`center`,position:`relative`,textDecoration:`none`,width:`100%`,boxSizing:`border-box`,textAlign:`left`,variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>!e.disablePadding&&e.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:e})=>!e.disablePadding&&!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>!e.disablePadding&&!!e.secondaryAction,style:{paddingRight:48}},{props:({ownerState:e})=>!!e.secondaryAction,style:{[`& > .${iX.root}`]:{paddingRight:48}}},{props:{alignItems:`flex-start`},style:{alignItems:`flex-start`}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:`padding-box`}},{props:({ownerState:e})=>e.button,style:{transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:`none`,backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:`transparent`}}}},{props:({ownerState:e})=>e.hasSecondaryAction,style:{paddingRight:48}}]}))),fX=z(`li`,{name:`MuiListItem`,slot:`Container`})({position:`relative`}),pX=F.forwardRef(function(e,t){let n=ou({props:e,name:`MuiListItem`}),{alignItems:r=`center`,children:i,className:a,component:o,components:s={},componentsProps:c={},ContainerComponent:l=`li`,ContainerProps:{className:u,...d}={},dense:f=!1,disableGutters:p=!1,disablePadding:m=!1,divider:h=!1,secondaryAction:g,slotProps:_={},slots:v={},...y}=n,b=F.useContext(Bh),x=F.useMemo(()=>({dense:f||b.dense||!1,alignItems:r,disableGutters:p}),[r,b.dense,f,p]),S=F.useRef(null),C=F.Children.toArray(i),w=C.length&&ff(C[C.length-1],[`ListItemSecondaryAction`]),T={...n,alignItems:r,dense:x.dense,disableGutters:p,disablePadding:m,divider:h,hasSecondaryAction:w},E=uX(T),D=td(S,t),[O,k]=Ld(`secondaryAction`,{elementType:cX,externalForwardedProps:{slots:v,slotProps:_},ownerState:T,className:E.secondaryAction}),A=v.root||s.Root||dX,j=_.root||c.root||{},M={className:L(E.root,j.className,a),...y},ee=o||`li`;return w?(ee=!M.component&&!o?`div`:ee,l===`li`&&(ee===`li`?ee=`div`:M.component===`li`&&(M.component=`div`)),(0,I.jsx)(Bh.Provider,{value:x,children:(0,I.jsxs)(fX,{as:l,className:L(E.container,u),ref:D,ownerState:T,...d,children:[(0,I.jsx)(A,{...j,...!nu(A)&&{as:ee,ownerState:{...T,...j.ownerState}},...M,children:C}),C.pop()]})})):(0,I.jsx)(Bh.Provider,{value:x,children:(0,I.jsxs)(A,{...j,as:ee,ref:D,...!nu(A)&&{ownerState:{...T,...j.ownerState}},...M,children:[C,g&&(0,I.jsx)(O,{...k,children:g})]})})}),mX=()=>{document.querySelectorAll(`.insert-css-dialog`).forEach(e=>e.remove())},hX=({editor:e,callback:t,opts:n,selectedText:r,parentNode:i})=>{let a=e.options.element,o=document.createElement(`div`),{selection:s}=e.state;mX(),o.className=`insert-css-dialog`;let c=!1,l=e=>{if(c){let t=o.contains(e.target)||void 0,n=a.contains(e.target);t||n||u()}else c=!0},u=()=>{t(void 0,!0),o.remove(),document.body.removeEventListener(`click`,l)},d=e=>{t(e,!0),o.remove(),document.body.removeEventListener(`click`,l)},f=i?.attrs.class,p=e=>{let t=`<span class="${e}">${r}</span>`;if(i){let e=`span`;i?.object===`inline`&&(e=`span`),i?.object===`block`&&(e=`div`),t=`<${e} class="${f}">${i.text.slice(0,s.$anchor.textOffset)}${t}${i.text.slice(s.$head.textOffset)}</${e}>`}return t},m=(0,I.jsxs)(`div`,{style:{background:`white`,height:500,padding:20,overflow:`hidden`,display:`flex`,flexFlow:`column`},children:[(0,I.jsx)(`h2`,{children:`Please choose a css class`}),f&&(0,I.jsxs)(`div`,{children:[`The current parent has this class `,f]}),(0,I.jsx)(Wh,{component:`nav`,style:{overflow:`scroll`},children:n.names.map((e,t)=>(0,I.jsxs)(pX,{button:!0,onClick:()=>d(e),children:[(0,I.jsx)(`div`,{style:{marginRight:20},children:e}),(0,I.jsx)(`div`,{dangerouslySetInnerHTML:{__html:p(e)}})]},`rule-${t}`))})]});Au.render(m,o,()=>{let t=e.view.nodeDOM(e.state.selection.from)?.parentNode;if(t){let e=a.parentElement.parentElement.parentElement.getBoundingClientRect(),n=t.getBoundingClientRect();a.parentElement.parentElement.parentElement.appendChild(o),o.style.maxWidth=`500px`,o.style.position=`absolute`,o.style.top=0,o.style.zIndex=99999;let r=`${n.left+Math.abs(e.left)+t.offsetWidth+10}px`,i=`${n.x}px`;o.style.left=r;let s=o.offsetWidth;o.style.left=`unset`,o.style.right=i;let c=o.offsetWidth;o.style.left=`unset`,o.style.right=`unset`,s>=c?o.style.left=r:o.style.right=i,document.body.addEventListener(`click`,l)}})},gX=vO.create({name:`cssmark`,addOptions(){return{classes:[]}},addAttributes(){return{class:{default:null,parseHTML:e=>e.getAttribute(`class`),renderHTML:e=>e.class?{class:e.class}:{}}}},parseHTML(){return[{tag:`span[class]`,getAttrs:e=>{let t=e.getAttribute(`class`)||``;if(!t)return!1;if((this.options&&this.options.classes||[]).length>0){let e=this.options.classes.find(e=>t.includes(e));return e?{class:e}:!1}return{class:t}}}]},renderHTML({HTMLAttributes:e}){return[`span`,bE(e),0]},addCommands(){return{setCSSClass:e=>({commands:t})=>t.setMark(this.name,{class:e}),unsetCSSClass:()=>({commands:e})=>e.unsetMark(this.name),openCSSClassDialog:()=>({editor:e})=>{hX({editor:e,selectedText:e.state.doc.textBetween(e.state.selection.from,e.state.selection.to),parentNode:e.state.selection.$from.nodeAfter,opts:this.options.extraCSSRules,callback:t=>{t&&e.chain().focus().setCSSClass(t).run()}})}}}}),_X=cP.extend({content:`(div | paragraph | heading | bulletList | orderedList | blockquote | codeBlock | horizontalRule | image | imageUploadNode)+`}),vX=YO.create({name:`headingParagraph`,group:`block`,content:`inline*`,defining:!0,addAttributes(){return{"data-heading":{default:`heading1`,parseHTML:e=>e.getAttribute(`data-heading`),renderHTML:e=>({"data-heading":e[`data-heading`]})}}},parseHTML(){return[{tag:`p[data-heading]`}]},renderHTML({HTMLAttributes:e}){return[`p`,bE(e),0]},addCommands(){return{toggleHeadingParagraph:()=>({commands:e,editor:t})=>t.isActive(`headingParagraph`)?e.setNode(`paragraph`):e.setNode(`headingParagraph`,{"data-heading":`heading1`})}}}),yX=e=>{if(!e)return;let t=/^calc\((.*)\)$/;if(typeof e==`string`){if(e.endsWith(`%`))return;if(e.endsWith(`px`)||e.endsWith(`vh`)||e.endsWith(`vw`)||e.endsWith(`ch`)||e.endsWith(`em`)||e.match(t))return e;let n=parseInt(e,10);return Number.isNaN(n)?n:`${n}px`}if(typeof e==`number`)return`${e}px`},bX=df((0,I.jsx)(`path`,{d:`M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42M10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5`}),`FormatBold`),xX=df((0,I.jsx)(`path`,{d:`M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z`}),`FormatItalic`),SX=df((0,I.jsx)(`path`,{d:`M10 19h4v-3h-4zM5 4v3h5v3h4V7h5V4zM3 14h18v-2H3z`}),`FormatStrikethrough`),CX=df((0,I.jsx)(`path`,{d:`M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z`}),`Code`),wX=df((0,I.jsx)(`path`,{d:`M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M8 20H4v-4h4zm0-6H4v-4h4zm0-6H4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4z`}),`GridOn`),TX=df((0,I.jsx)(`path`,{d:`M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5m0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5M7 19h14v-2H7zm0-6h14v-2H7zm0-8v2h14V5z`}),`FormatListBulleted`),EX=df((0,I.jsx)(`path`,{d:`M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z`}),`FormatListNumbered`),DX=df((0,I.jsx)(`path`,{d:`M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6m-7 2v2h14v-2z`}),`FormatUnderlined`),OX=df((0,I.jsx)(`path`,{d:`M18 4H6v2l6.5 6L6 18v2h12v-3h-7l5-5-5-5h7z`}),`Functions`),kX=df((0,I.jsx)(`path`,{d:`M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z`}),`Image`),AX=df((0,I.jsx)(`path`,{d:`M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z`}),`Redo`),jX=df((0,I.jsx)(`path`,{d:`M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z`}),`FormatQuote`),MX=df((0,I.jsx)(`path`,{d:`M18 3v2h-2V3H8v2H6V3H4v18h2v-2h2v2h8v-2h2v2h2V3zM8 17H6v-2h2zm0-4H6v-2h2zm0-4H6V7h2zm10 8h-2v-2h2zm0-4h-2v-2h2zm0-4h-2V7h2z`}),`Theaters`),NX=df((0,I.jsx)(`path`,{d:`M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77`}),`VolumeUp`),PX=df((0,I.jsx)(`path`,{d:`M3 3v18h18V3zm8 16H5v-6h6zm0-8H5V5h6zm8 8h-6v-6h6zm0-8h-6V5h6z`}),`BorderAll`),FX=z(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans !important`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,top:`7px`,width:`110px`,height:`28px`,whiteSpace:`nowrap`})),IX=()=>(0,I.jsx)(FX,{children:`+ Response Area`}),LX={characters:[[`á`,`é`,`í`,`ó`,`ú`],[`Á`,`É`,`Í`,`Ó`,`Ú`],[`—`,`«`,`»`,`ñ`,`ü`],[`-`,`¿`,`¡`,`Ñ`,`Ü`]]},RX={hasPreview:!0,characters:[[{unicode:`U+00A2`,description:`CENT SIGN`,write:`¢`,label:`¢`},{unicode:`U+00BF`,description:`INVERTED QUESTION MARK`,write:`¿`,label:`¿`},{unicode:`U+00B4`,description:`ACUTE ACCENT`,write:`´`,label:`´`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E1`,description:`LATIN SMALL LETTER A WITH ACUTE`,write:`á`,label:`á`},{unicode:`U+00E9`,description:`LATIN SMALL LETTER E WITH ACUTE`,write:`é`,label:`é`},{unicode:`U+00ED`,description:`LATIN SMALL LETTER I WITH ACUTE`,write:`í`,label:`í`},{unicode:`U+00F3`,description:`LATIN SMALL LETTER O WITH ACUTE`,write:`ó`,label:`ó`},{unicode:`U+00FA`,description:`LATIN SMALL LETTER U WITH ACUTE`,write:`ú`,label:`ú`},{unicode:`U+00F1`,description:`LATIN SMALL LETTER N WITH TILDE`,write:`ñ`,label:`ñ`}],[{unicode:`U+20AC`,description:`EURO SIGN`,write:`€`,label:`€`},{unicode:`U+00A1`,description:`INVERTED EXCLAMATION MARK`,write:`¡`,label:`¡`},{unicode:`U+00C1`,description:`LATIN CAPITAL LETTER A WITH ACUTE`,write:`Á`,label:`Á`},{unicode:`U+00C9`,description:`LATIN CAPITAL LETTER E WITH ACUTE`,write:`É`,label:`É`},{unicode:`U+00CD`,description:`LATIN CAPITAL LETTER I WITH ACUTE`,write:`Í`,label:`Í`},{unicode:`U+00D3`,description:`LATIN CAPITAL LETTER O WITH ACUTE`,write:`Ó`,label:`Ó`},{unicode:`U+00DA`,description:`LATIN CAPITAL LETTER U WITH ACUTE`,write:`Ú`,label:`Ú`},{unicode:`U+00D1`,description:`LATIN CAPITAL LETTER N WITH TILDE`,write:`Ñ`,label:`Ñ`}],[{unicode:`U+00A3`,description:`POUND SIGN`,write:`£`,label:`£`},{unicode:`U+00AB`,description:`LEFT-POINTING DOUBLE ANGLE QUOTATION MARK`,write:`«`,label:`«`},{unicode:`U+005E`,description:`CIRCUMFLEX ACCENT`,write:`^`,label:`^`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E2`,description:`LATIN SMALL LETTER A WITH CIRCUMFLEX`,write:`â`,label:`â`},{unicode:`U+00EA`,description:`LATIN SMALL LETTER E WITH CIRCUMFLEX`,write:`ê`,label:`ê`},{unicode:`U+00EE`,description:`LATIN SMALL LETTER I WITH CIRCUMFLEX`,write:`î`,label:`î`},{unicode:`U+00F4`,description:`LATIN SMALL LETTER O WITH CIRCUMFLEX`,write:`ô`,label:`ô`},{unicode:`U+00FB`,description:`LATIN SMALL LETTER U WITH CIRCUMFLEX`,write:`û`,label:`û`},{unicode:`U+00E7`,description:`LATIN SMALL LETTER C WITH CEDILLA`,write:`ç`,label:`ç`}],[{unicode:`U+00A5`,description:`YEN SIGN`,write:`¥`,label:`¥`},{unicode:`U+00BB`,description:`RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK`,write:`»`,label:`»`},{unicode:`U+00C2`,description:`LATIN CAPITAL LETTER A WITH CIRCUMFLEX`,write:`Â`,label:`Â`},{unicode:`U+00CA`,description:`LATIN CAPITAL LETTER E WITH CIRCUMFLEX`,write:`Ê`,label:`Ê`},{unicode:`U+00CE`,description:`LATIN CAPITAL LETTER I WITH CIRCUMFLEX`,write:`Î`,label:`Î`},{unicode:`U+00D4`,description:`LATIN CAPITAL LETTER O WITH CIRCUMFLEX`,write:`Ô`,label:`Ô`},{unicode:`U+00DB`,description:`LATIN CAPITAL LETTER U WITH CIRCUMFLEX`,write:`Û`,label:`Û`},{unicode:`U+00C7`,description:`LATIN CAPITAL LETTER C WITH CEDILLA`,write:`Ç`,label:`Ç`}],[{unicode:`U+200A`,description:`HAIR SPACE`,write:String.fromCodePoint(`0x200A`),label:` `},{unicode:`U+00A7`,description:`SECTION SIGN`,write:`§`,label:`§`},{unicode:`U+00A8`,description:`DIAERESIS`,write:`¨`,label:`¨`,extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E4`,description:`LATIN SMALL LETTER A WITH DIAERESIS`,write:`ä`,label:`ä`},{unicode:`U+00EB`,description:`LATIN SMALL LETTER E WITH DIAERESIS`,write:`ë`,label:`ë`},{unicode:`U+00EF`,description:`LATIN SMALL LETTER I WITH DIAERESIS`,write:`ï`,label:`ï`},{unicode:`U+00F6`,description:`LATIN SMALL LETTER O WITH DIAERESIS`,write:`ö`,label:`ö`},{unicode:`U+00FC`,description:`LATIN SMALL LETTER U WITH DIAERESIS`,write:`ü`,label:`ü`},{unicode:`U+00DF`,description:`LATIN SMALL LETTER SHARP S`,write:`ß`,label:`ß`}],[{unicode:`U+2009`,description:`THIN SPACE`,write:String.fromCodePoint(`0x2009`),label:` `},{unicode:`U+2026`,description:`HORIZONTAL ELLIPSIS`,write:`…`,label:`…`},{unicode:`U+00C4`,description:`LATIN CAPITAL LETTER A WITH DIAERESIS`,write:`Ä`,label:`Ä`},{unicode:`U+00CB`,description:`LATIN CAPITAL LETTER E WITH DIAERESIS`,write:`Ë`,label:`Ë`},{unicode:`U+00CF`,description:`LATIN CAPITAL LETTER I WITH DIAERESIS`,write:`Ï`,label:`Ï`},{unicode:`U+00D6`,description:`LATIN CAPITAL LETTER O WITH DIAERESIS`,write:`Ö`,label:`Ö`},{unicode:`U+00DC`,description:`LATIN CAPITAL LETTER U WITH DIAERESIS`,write:`Ü`,label:`Ü`},{unicode:`U+2212`,description:`MINUS SIGN`,write:`−`,label:`−`}],[{unicode:`U+00A0`,description:`NO-BREAK SPACE`,write:String.fromCodePoint(`0x00A0`),label:` `},{unicode:`U+2022`,description:`BULLET`,write:`•`,label:`•`},{unicode:`U+0060`,description:`GRAVE ACCENT`,write:"`",label:"`",extraProps:{style:{gridRow:`span 2`}}},{unicode:`U+00E0`,description:`LATIN SMALL LETTER A WITH GRAVE`,write:`à`,label:`à`},{unicode:`U+00E8`,description:`LATIN SMALL LETTER E WITH GRAVE`,write:`è`,label:`è`},{unicode:`U+00EC`,description:`LATIN SMALL LETTER I WITH GRAVE`,write:`ì`,label:`ì`},{unicode:`U+00F2`,description:`LATIN SMALL LETTER O WITH GRAVE`,write:`ò`,label:`ò`},{unicode:`U+00F9`,description:`LATIN SMALL LETTER U WITH GRAVE`,write:`ù`,label:`ù`},{unicode:`U+2013`,description:`EN DASH`,write:`–`,label:`–`}],[{unicode:`U+2003`,description:`EM SPACE`,write:String.fromCodePoint(`0x2003`),label:` `},{unicode:`U+25E6`,description:`WHITE BULLET`,write:`◦`,label:`◦`},{unicode:`U+00C0`,description:`LATIN CAPITAL LETTER A WITH GRAVE`,write:`À`,label:`À`},{unicode:`U+00C8`,description:`LATIN CAPITAL LETTER E WITH GRAVE`,write:`È`,label:`È`},{unicode:`U+00CC`,description:`LATIN CAPITAL LETTER I WITH GRAVE`,write:`Ì`,label:`Ì`},{unicode:`U+00D2`,description:`LATIN CAPITAL LETTER O WITH GRAVE`,write:`Ò`,label:`Ò`},{unicode:`U+00D9`,description:`LATIN CAPITAL LETTER U WITH GRAVE`,write:`Ù`,label:`Ù`},{unicode:`U+2014`,description:`EM DASH`,write:`—`,label:`—`}]]},zX=()=>(0,I.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,I.jsx)(`path`,{d:`M42.1875 4.75C42.1875 7.38672 39.9902 9.4375 37.5 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H37.5C39.9902 0.0625 42.1875 2.25977 42.1875 4.75ZM42.1875 42.25C42.1875 44.8867 39.9902 46.9375 37.5 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H37.5C39.9902 37.5625 42.1875 39.7598 42.1875 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),BX=()=>(0,I.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,I.jsx)(`path`,{d:`M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H28.125C25.4883 9.4375 23.4375 7.38672 23.4375 4.75C23.4375 2.25977 25.4883 0.0625 28.125 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H28.125C25.4883 46.9375 23.4375 44.8867 23.4375 42.25C23.4375 39.7598 25.4883 37.5625 28.125 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),VX=()=>(0,I.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,I.jsx)(`path`,{d:`M51.5625 4.75C51.5625 7.38672 49.3652 9.4375 46.875 9.4375H18.75C16.1133 9.4375 14.0625 7.38672 14.0625 4.75C14.0625 2.25977 16.1133 0.0625 18.75 0.0625H46.875C49.3652 0.0625 51.5625 2.25977 51.5625 4.75ZM65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5ZM0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61ZM51.5625 42.25C51.5625 44.8867 49.3652 46.9375 46.875 46.9375H18.75C16.1133 46.9375 14.0625 44.8867 14.0625 42.25C14.0625 39.7598 16.1133 37.5625 18.75 37.5625H46.875C49.3652 37.5625 51.5625 39.7598 51.5625 42.25Z`,fill:`currentColor`})}),HX=()=>(0,I.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 66 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`,focusable:`false`,children:(0,I.jsx)(`path`,{d:`M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z`,fill:`currentColor`})}),UX=({editor:e,onChange:t})=>{let[n,r]=(0,F.useState)(!1),i;switch(!0){case e.isActive({textAlign:`right`}):i=(0,I.jsx)(BX,{});break;case e.isActive({textAlign:`center`}):i=(0,I.jsx)(VX,{});break;case e.isActive({textAlign:`justify`}):i=(0,I.jsx)(HX,{});break;default:i=(0,I.jsx)(zX,{});break}let a=t=>{let n=t.currentTarget?.getAttribute(`value`);n&&e.commands.setTextAlign(n),r(!1)};return(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`},onClick:e=>{e.preventDefault(),e.stopPropagation(),r(!n)},children:[i,(0,I.jsx)(`span`,{style:{marginLeft:`5px`,fontSize:`8px`},"aria-hidden":`true`,children:`▼`})]}),(0,I.jsx)(nm,{in:n,timeout:`auto`,unmountOnExit:!0,style:{position:`absolute`},children:(0,I.jsxs)(Wh,{component:`div`,disablePadding:!0,style:{background:`#fff`,display:`flex`,flexDirection:`row`,padding:0},children:[(0,I.jsx)(pX,{button:!0,type:`submit`,value:`left`,"aria-label":`Align text left`,onClick:a,children:(0,I.jsx)(zX,{})}),(0,I.jsx)(pX,{button:!0,type:`submit`,value:`center`,"aria-label":`Align text center`,onClick:a,children:(0,I.jsx)(VX,{})}),(0,I.jsx)(pX,{button:!0,type:`submit`,value:`right`,"aria-label":`Align text right`,onClick:a,children:(0,I.jsx)(BX,{})}),(0,I.jsx)(pX,{button:!0,type:`submit`,value:`justify`,"aria-label":`Justify text`,onClick:a,children:(0,I.jsx)(HX,{})})]})})]})},WX=z(`div`)(({theme:e})=>({fontFamily:`Cerebri Sans, Arial, sans-serif`,fontSize:e.typography.fontSize,fontWeight:`bold`,lineHeight:`14px`,position:`relative`,whiteSpace:`nowrap`})),GX=()=>(0,I.jsx)(WX,{children:`CSS`}),KX=z(`path`)({fill:`grey`,"&:hover":{fill:`black`}}),qX=e=>t=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,version:`1.1`,width:`24`,height:`24`,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:(0,I.jsx)(e,{...t})}),JX=qX(e=>(0,I.jsx)(KX,{...e,d:`M22,10A2,2 0 0,1 20,12H4A2,2 0 0,1 2,10V3H4V5H8V3H10V5H14V3H16V5H20V3H22V10M4,10H8V7H4V10M10,10H14V7H10V10M20,10V7H16V10H20M11,14H13V17H16V19H13V22H11V19H8V17H11V14Z`})),YX=qX(e=>(0,I.jsx)(KX,{...e,d:`M9.41,13L12,15.59L14.59,13L16,14.41L13.41,17L16,19.59L14.59,21L12,18.41L9.41,21L8,19.59L10.59,17L8,14.41L9.41,13M22,9A2,2 0 0,1 20,11H4A2,2 0 0,1 2,9V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V9M4,9H8V6H4V9M10,9H14V6H10V9M16,9H20V6H16V9Z`})),XX=qX(e=>(0,I.jsx)(KX,{...e,d:`M11,2A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H2V2H11M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M15,11H18V8H20V11H23V13H20V16H18V13H15V11Z`})),ZX=qX(e=>(0,I.jsx)(KX,{...e,d:`M4,2H11A2,2 0 0,1 13,4V20A2,2 0 0,1 11,22H4A2,2 0 0,1 2,20V4A2,2 0 0,1 4,2M4,10V14H11V10H4M4,16V20H11V16H4M4,4V8H11V4H4M17.59,12L15,9.41L16.41,8L19,10.59L21.59,8L23,9.41L20.41,12L23,14.59L21.59,16L19,13.41L16.41,16L15,14.59L17.59,12Z`})),QX=qX(e=>(0,I.jsx)(KX,{...e,d:`M15.46,15.88L16.88,14.46L19,16.59L21.12,14.46L22.54,15.88L20.41,18L22.54,20.12L21.12,21.54L19,19.41L16.88,21.54L15.46,20.12L17.59,18L15.46,15.88M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z`})),$X=`bottom`,eZ=`right`,tZ=`left`,nZ=`auto`,rZ=[`top`,$X,eZ,tZ],iZ=`start`,aZ=`clippingParents`,oZ=`viewport`,sZ=`popper`,cZ=`reference`,lZ=rZ.reduce(function(e,t){return e.concat([t+`-`+iZ,t+`-end`])},[]),uZ=[].concat(rZ,[nZ]).reduce(function(e,t){return e.concat([t,t+`-`+iZ,t+`-end`])},[]),dZ=[`beforeRead`,`read`,`afterRead`,`beforeMain`,`main`,`afterMain`,`beforeWrite`,`write`,`afterWrite`];function fZ(e){return e?(e.nodeName||``).toLowerCase():null}function pZ(e){if(e==null)return window;if(e.toString()!==`[object Window]`){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function mZ(e){return e instanceof pZ(e).Element||e instanceof Element}function hZ(e){return e instanceof pZ(e).HTMLElement||e instanceof HTMLElement}function gZ(e){return typeof ShadowRoot>`u`?!1:e instanceof pZ(e).ShadowRoot||e instanceof ShadowRoot}function _Z(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];!hZ(i)||!fZ(i)||(Object.assign(i.style,n),Object.keys(r).forEach(function(e){var t=r[e];t===!1?i.removeAttribute(e):i.setAttribute(e,t===!0?``:t)}))})}function vZ(e){var t=e.state,n={popper:{position:t.options.strategy,left:`0`,top:`0`,margin:`0`},arrow:{position:`absolute`},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(e){var r=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce(function(e,t){return e[t]=``,e},{});!hZ(r)||!fZ(r)||(Object.assign(r.style,a),Object.keys(i).forEach(function(e){r.removeAttribute(e)}))})}}var yZ={name:`applyStyles`,enabled:!0,phase:`write`,fn:_Z,effect:vZ,requires:[`computeStyles`]};function bZ(e){return e.split(`-`)[0]}var xZ=Math.max,SZ=Math.min,CZ=Math.round;function wZ(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+`/`+e.version}).join(` `):navigator.userAgent}function TZ(){return!/^((?!chrome|android).)*safari/i.test(wZ())}function EZ(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,a=1;t&&hZ(e)&&(i=e.offsetWidth>0&&CZ(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&CZ(r.height)/e.offsetHeight||1);var o=(mZ(e)?pZ(e):window).visualViewport,s=!TZ()&&n,c=(r.left+(s&&o?o.offsetLeft:0))/i,l=(r.top+(s&&o?o.offsetTop:0))/a,u=r.width/i,d=r.height/a;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c,x:c,y:l}}function DZ(e){var t=EZ(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function OZ(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&gZ(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function kZ(e){return pZ(e).getComputedStyle(e)}function AZ(e){return[`table`,`td`,`th`].indexOf(fZ(e))>=0}function jZ(e){return((mZ(e)?e.ownerDocument:e.document)||window.document).documentElement}function MZ(e){return fZ(e)===`html`?e:e.assignedSlot||e.parentNode||(gZ(e)?e.host:null)||jZ(e)}function NZ(e){return!hZ(e)||kZ(e).position===`fixed`?null:e.offsetParent}function PZ(e){var t=/firefox/i.test(wZ());if(/Trident/i.test(wZ())&&hZ(e)&&kZ(e).position===`fixed`)return null;var n=MZ(e);for(gZ(n)&&(n=n.host);hZ(n)&&[`html`,`body`].indexOf(fZ(n))<0;){var r=kZ(n);if(r.transform!==`none`||r.perspective!==`none`||r.contain===`paint`||[`transform`,`perspective`].indexOf(r.willChange)!==-1||t&&r.willChange===`filter`||t&&r.filter&&r.filter!==`none`)return n;n=n.parentNode}return null}function FZ(e){for(var t=pZ(e),n=NZ(e);n&&AZ(n)&&kZ(n).position===`static`;)n=NZ(n);return n&&(fZ(n)===`html`||fZ(n)===`body`&&kZ(n).position===`static`)?t:n||PZ(e)||t}function IZ(e){return[`top`,`bottom`].indexOf(e)>=0?`x`:`y`}function LZ(e,t,n){return xZ(e,SZ(t,n))}function RZ(e,t,n){var r=LZ(e,t,n);return r>n?n:r}function zZ(){return{top:0,right:0,bottom:0,left:0}}function BZ(e){return Object.assign({},zZ(),e)}function VZ(e,t){return t.reduce(function(t,n){return t[n]=e,t},{})}var HZ=function(e,t){return e=typeof e==`function`?e(Object.assign({},t.rects,{placement:t.placement})):e,BZ(typeof e==`number`?VZ(e,rZ):e)};function UZ(e){var t,n=e.state,r=e.name,i=e.options,a=n.elements.arrow,o=n.modifiersData.popperOffsets,s=bZ(n.placement),c=IZ(s),l=[`left`,`right`].indexOf(s)>=0?`height`:`width`;if(!(!a||!o)){var u=HZ(i.padding,n),d=DZ(a),f=c===`y`?`top`:tZ,p=c===`y`?$X:eZ,m=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],h=o[c]-n.rects.reference[c],g=FZ(a),_=g?c===`y`?g.clientHeight||0:g.clientWidth||0:0,v=m/2-h/2,y=u[f],b=_-d[l]-u[p],x=_/2-d[l]/2+v,S=LZ(y,x,b),C=c;n.modifiersData[r]=(t={},t[C]=S,t.centerOffset=S-x,t)}}function WZ(e){var t=e.state,n=e.options.element,r=n===void 0?`[data-popper-arrow]`:n;r!=null&&(typeof r==`string`&&(r=t.elements.popper.querySelector(r),!r)||OZ(t.elements.popper,r)&&(t.elements.arrow=r))}var GZ={name:`arrow`,enabled:!0,phase:`main`,fn:UZ,effect:WZ,requires:[`popperOffsets`],requiresIfExists:[`preventOverflow`]};function KZ(e){return e.split(`-`)[1]}var qZ={top:`auto`,right:`auto`,bottom:`auto`,left:`auto`};function JZ(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:CZ(n*i)/i||0,y:CZ(r*i)/i||0}}function YZ(e){var t,n=e.popper,r=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,u=e.roundOffsets,d=e.isFixed,f=o.x,p=f===void 0?0:f,m=o.y,h=m===void 0?0:m,g=typeof u==`function`?u({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var _=o.hasOwnProperty(`x`),v=o.hasOwnProperty(`y`),y=tZ,b=`top`,x=window;if(l){var S=FZ(n),C=`clientHeight`,w=`clientWidth`;if(S===pZ(n)&&(S=jZ(n),kZ(S).position!==`static`&&s===`absolute`&&(C=`scrollHeight`,w=`scrollWidth`)),S=S,i===`top`||(i===`left`||i===`right`)&&a===`end`){b=$X;var T=d&&S===x&&x.visualViewport?x.visualViewport.height:S[C];h-=T-r.height,h*=c?1:-1}if(i===`left`||(i===`top`||i===`bottom`)&&a===`end`){y=eZ;var E=d&&S===x&&x.visualViewport?x.visualViewport.width:S[w];p-=E-r.width,p*=c?1:-1}}var D=Object.assign({position:s},l&&qZ),O=u===!0?JZ({x:p,y:h},pZ(n)):{x:p,y:h};if(p=O.x,h=O.y,c){var k;return Object.assign({},D,(k={},k[b]=v?`0`:``,k[y]=_?`0`:``,k.transform=(x.devicePixelRatio||1)<=1?`translate(`+p+`px, `+h+`px)`:`translate3d(`+p+`px, `+h+`px, 0)`,k))}return Object.assign({},D,(t={},t[b]=v?h+`px`:``,t[y]=_?p+`px`:``,t.transform=``,t))}function XZ(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0||r,a=n.adaptive,o=a===void 0||a,s=n.roundOffsets,c=s===void 0||s,l={placement:bZ(t.placement),variation:KZ(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy===`fixed`};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,YZ(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,YZ(Object.assign({},l,{offsets:t.modifiersData.arrow,position:`absolute`,adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var ZZ={name:`computeStyles`,enabled:!0,phase:`beforeWrite`,fn:XZ,data:{}},QZ={passive:!0};function $Z(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,a=i===void 0||i,o=r.resize,s=o===void 0||o,c=pZ(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&l.forEach(function(e){e.addEventListener(`scroll`,n.update,QZ)}),s&&c.addEventListener(`resize`,n.update,QZ),function(){a&&l.forEach(function(e){e.removeEventListener(`scroll`,n.update,QZ)}),s&&c.removeEventListener(`resize`,n.update,QZ)}}var eQ={name:`eventListeners`,enabled:!0,phase:`write`,fn:function(){},effect:$Z,data:{}},tQ={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function nQ(e){return e.replace(/left|right|bottom|top/g,function(e){return tQ[e]})}var rQ={start:`end`,end:`start`};function iQ(e){return e.replace(/start|end/g,function(e){return rQ[e]})}function aQ(e){var t=pZ(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function oQ(e){return EZ(jZ(e)).left+aQ(e).scrollLeft}function sQ(e,t){var n=pZ(e),r=jZ(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var l=TZ();(l||!l&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+oQ(e),y:c}}function cQ(e){var t=jZ(e),n=aQ(e),r=e.ownerDocument?.body,i=xZ(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=xZ(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-n.scrollLeft+oQ(e),s=-n.scrollTop;return kZ(r||t).direction===`rtl`&&(o+=xZ(t.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:o,y:s}}function lQ(e){var t=kZ(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function uQ(e){return[`html`,`body`,`#document`].indexOf(fZ(e))>=0?e.ownerDocument.body:hZ(e)&&lQ(e)?e:uQ(MZ(e))}function dQ(e,t){t===void 0&&(t=[]);var n=uQ(e),r=n===e.ownerDocument?.body,i=pZ(n),a=r?[i].concat(i.visualViewport||[],lQ(n)?n:[]):n,o=t.concat(a);return r?o:o.concat(dQ(MZ(a)))}function fQ(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function pQ(e,t){var n=EZ(e,!1,t===`fixed`);return n.top+=e.clientTop,n.left+=e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function mQ(e,t,n){return t===`viewport`?fQ(sQ(e,n)):mZ(t)?pQ(t,n):fQ(cQ(jZ(e)))}function hQ(e){var t=dQ(MZ(e)),n=[`absolute`,`fixed`].indexOf(kZ(e).position)>=0&&hZ(e)?FZ(e):e;return mZ(n)?t.filter(function(e){return mZ(e)&&OZ(e,n)&&fZ(e)!==`body`}):[]}function gQ(e,t,n,r){var i=t===`clippingParents`?hQ(e):[].concat(t),a=[].concat(i,[n]),o=a[0],s=a.reduce(function(t,n){var i=mQ(e,n,r);return t.top=xZ(i.top,t.top),t.right=SZ(i.right,t.right),t.bottom=SZ(i.bottom,t.bottom),t.left=xZ(i.left,t.left),t},mQ(e,o,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function _Q(e){var t=e.reference,n=e.element,r=e.placement,i=r?bZ(r):null,a=r?KZ(r):null,o=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(i){case`top`:c={x:o,y:t.y-n.height};break;case $X:c={x:o,y:t.y+t.height};break;case eZ:c={x:t.x+t.width,y:s};break;case tZ:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=i?IZ(i):null;if(l!=null){var u=l===`y`?`height`:`width`;switch(a){case iZ:c[l]=c[l]-(t[u]/2-n[u]/2);break;case`end`:c[l]=c[l]+(t[u]/2-n[u]/2);break;default:}}return c}function vQ(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,a=n.strategy,o=a===void 0?e.strategy:a,s=n.boundary,c=s===void 0?aZ:s,l=n.rootBoundary,u=l===void 0?oZ:l,d=n.elementContext,f=d===void 0?sZ:d,p=n.altBoundary,m=p!==void 0&&p,h=n.padding,g=h===void 0?0:h,_=BZ(typeof g==`number`?VZ(g,rZ):g),v=f===`popper`?cZ:sZ,y=e.rects.popper,b=e.elements[m?v:f],x=gQ(mZ(b)?b:b.contextElement||jZ(e.elements.popper),c,u,o),S=EZ(e.elements.reference),C=_Q({reference:S,element:y,strategy:`absolute`,placement:i}),w=fQ(Object.assign({},y,C)),T=f===`popper`?w:S,E={top:x.top-T.top+_.top,bottom:T.bottom-x.bottom+_.bottom,left:x.left-T.left+_.left,right:T.right-x.right+_.right},D=e.modifiersData.offset;if(f===`popper`&&D){var O=D[i];Object.keys(E).forEach(function(e){var t=[`right`,`bottom`].indexOf(e)>=0?1:-1,n=[`top`,`bottom`].indexOf(e)>=0?`y`:`x`;E[e]+=O[n]*t})}return E}function yQ(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,a=n.rootBoundary,o=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?uZ:c,u=KZ(r),d=u?s?lZ:lZ.filter(function(e){return KZ(e)===u}):rZ,f=d.filter(function(e){return l.indexOf(e)>=0});f.length===0&&(f=d);var p=f.reduce(function(t,n){return t[n]=vQ(e,{placement:n,boundary:i,rootBoundary:a,padding:o})[bZ(n)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}function bQ(e){if(bZ(e)===`auto`)return[];var t=nQ(e);return[iQ(e),t,iQ(t)]}function xQ(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o===void 0||o,c=n.fallbackPlacements,l=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,m=p===void 0||p,h=n.allowedAutoPlacements,g=t.options.placement,_=bZ(g)===g,v=c||(_||!m?[nQ(g)]:bQ(g)),y=[g].concat(v).reduce(function(e,n){return e.concat(bZ(n)===`auto`?yQ(t,{placement:n,boundary:u,rootBoundary:d,padding:l,flipVariations:m,allowedAutoPlacements:h}):n)},[]),b=t.rects.reference,x=t.rects.popper,S=new Map,C=!0,w=y[0],T=0;T<y.length;T++){var E=y[T],D=bZ(E),O=KZ(E)===iZ,k=[`top`,$X].indexOf(D)>=0,A=k?`width`:`height`,j=vQ(t,{placement:E,boundary:u,rootBoundary:d,altBoundary:f,padding:l}),M=k?O?eZ:tZ:O?$X:`top`;b[A]>x[A]&&(M=nQ(M));var ee=nQ(M),N=[];if(a&&N.push(j[D]<=0),s&&N.push(j[M]<=0,j[ee]<=0),N.every(function(e){return e})){w=E,C=!1;break}S.set(E,N)}if(C)for(var te=m?3:1,ne=function(e){var t=y.find(function(t){var n=S.get(t);if(n)return n.slice(0,e).every(function(e){return e})});if(t)return w=t,`break`},re=te;re>0&&ne(re)!==`break`;re--);t.placement!==w&&(t.modifiersData[r]._skip=!0,t.placement=w,t.reset=!0)}}var SQ={name:`flip`,enabled:!0,phase:`main`,fn:xQ,requiresIfExists:[`offset`],data:{_skip:!1}};function CQ(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function wQ(e){return[`top`,eZ,$X,tZ].some(function(t){return e[t]>=0})}function TQ(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=vQ(t,{elementContext:`reference`}),s=vQ(t,{altBoundary:!0}),c=CQ(o,r),l=CQ(s,i,a),u=wQ(c),d=wQ(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var EQ={name:`hide`,enabled:!0,phase:`main`,requiresIfExists:[`preventOverflow`],fn:TQ};function DQ(e,t,n){var r=bZ(e),i=[`left`,`top`].indexOf(r)>=0?-1:1,a=typeof n==`function`?n(Object.assign({},t,{placement:e})):n,o=a[0],s=a[1];return o||=0,s=(s||0)*i,[`left`,`right`].indexOf(r)>=0?{x:s,y:o}:{x:o,y:s}}function OQ(e){var t=e.state,n=e.options,r=e.name,i=n.offset,a=i===void 0?[0,0]:i,o=uZ.reduce(function(e,n){return e[n]=DQ(n,t.rects,a),e},{}),s=o[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=o}var kQ={name:`offset`,enabled:!0,phase:`main`,requires:[`popperOffsets`],fn:OQ};function AQ(e){var t=e.state,n=e.name;t.modifiersData[n]=_Q({reference:t.rects.reference,element:t.rects.popper,strategy:`absolute`,placement:t.placement})}var jQ={name:`popperOffsets`,enabled:!0,phase:`read`,fn:AQ,data:{}};function MQ(e){return e===`x`?`y`:`x`}function NQ(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,a=i===void 0||i,o=n.altAxis,s=o!==void 0&&o,c=n.boundary,l=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0||f,m=n.tetherOffset,h=m===void 0?0:m,g=vQ(t,{boundary:c,rootBoundary:l,padding:d,altBoundary:u}),_=bZ(t.placement),v=KZ(t.placement),y=!v,b=IZ(_),x=MQ(b),S=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,T=typeof h==`function`?h(Object.assign({},t.rects,{placement:t.placement})):h,E=typeof T==`number`?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),D=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(S){if(a){var k=b===`y`?`top`:tZ,A=b===`y`?$X:eZ,j=b===`y`?`height`:`width`,M=S[b],ee=M+g[k],N=M-g[A],te=p?-w[j]/2:0,ne=v===`start`?C[j]:w[j],re=v===`start`?-w[j]:-C[j],ie=t.elements.arrow,ae=p&&ie?DZ(ie):{width:0,height:0},oe=t.modifiersData[`arrow#persistent`]?t.modifiersData[`arrow#persistent`].padding:zZ(),se=oe[k],ce=oe[A],le=LZ(0,C[j],ae[j]),ue=y?C[j]/2-te-le-se-E.mainAxis:ne-le-se-E.mainAxis,de=y?-C[j]/2+te+le+ce+E.mainAxis:re+le+ce+E.mainAxis,fe=t.elements.arrow&&FZ(t.elements.arrow),pe=fe?b===`y`?fe.clientTop||0:fe.clientLeft||0:0,me=D?.[b]??0,he=M+ue-me-pe,P=M+de-me,ge=LZ(p?SZ(ee,he):ee,M,p?xZ(N,P):N);S[b]=ge,O[b]=ge-M}if(s){var _e=b===`x`?`top`:tZ,ve=b===`x`?$X:eZ,ye=S[x],be=x===`y`?`height`:`width`,xe=ye+g[_e],Se=ye-g[ve],Ce=[`top`,tZ].indexOf(_)!==-1,we=D?.[x]??0,Te=Ce?xe:ye-C[be]-w[be]-we+E.altAxis,Ee=Ce?ye+C[be]+w[be]-we-E.altAxis:Se,De=p&&Ce?RZ(Te,ye,Ee):LZ(p?Te:xe,ye,p?Ee:Se);S[x]=De,O[x]=De-ye}t.modifiersData[r]=O}}var PQ={name:`preventOverflow`,enabled:!0,phase:`main`,fn:NQ,requiresIfExists:[`offset`]};function FQ(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function IQ(e){return e===pZ(e)||!hZ(e)?aQ(e):FQ(e)}function LQ(e){var t=e.getBoundingClientRect(),n=CZ(t.width)/e.offsetWidth||1,r=CZ(t.height)/e.offsetHeight||1;return n!==1||r!==1}function RQ(e,t,n){n===void 0&&(n=!1);var r=hZ(t),i=hZ(t)&&LQ(t),a=jZ(t),o=EZ(e,i,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((fZ(t)!==`body`||lQ(a))&&(s=IQ(t)),hZ(t)?(c=EZ(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):a&&(c.x=oQ(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function zQ(e){var t=new Map,n=new Set,r=[];e.forEach(function(e){t.set(e.name,e)});function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}}),r.push(e)}return e.forEach(function(e){n.has(e.name)||i(e)}),r}function BQ(e){var t=zQ(e);return dZ.reduce(function(e,n){return e.concat(t.filter(function(e){return e.phase===n}))},[])}function VQ(e){var t;return function(){return t||=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})}),t}}function HQ(e){var t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{});return Object.keys(t).map(function(e){return t[e]})}var UQ={placement:`bottom`,modifiers:[],strategy:`absolute`};function WQ(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&typeof e.getBoundingClientRect==`function`)})}function GQ(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,a=i===void 0?UQ:i;return function(e,t,n){n===void 0&&(n=a);var i={placement:`bottom`,orderedModifiers:[],options:Object.assign({},UQ,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],s=!1,c={state:i,setOptions:function(n){var o=typeof n==`function`?n(i.options):n;u(),i.options=Object.assign({},a,i.options,o),i.scrollParents={reference:mZ(e)?dQ(e):e.contextElement?dQ(e.contextElement):[],popper:dQ(t)};var s=BQ(HQ([].concat(r,i.options.modifiers)));return i.orderedModifiers=s.filter(function(e){return e.enabled}),l(),c.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,n=e.popper;if(WQ(t,n)){i.rects={reference:RQ(t,FZ(n),i.options.strategy===`fixed`),popper:DZ(n)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach(function(e){return i.modifiersData[e.name]=Object.assign({},e.data)});for(var r=0;r<i.orderedModifiers.length;r++){if(i.reset===!0){i.reset=!1,r=-1;continue}var a=i.orderedModifiers[r],o=a.fn,l=a.options,u=l===void 0?{}:l,d=a.name;typeof o==`function`&&(i=o({state:i,options:u,name:d,instance:c})||i)}}}},update:VQ(function(){return new Promise(function(e){c.forceUpdate(),e(i)})}),destroy:function(){u(),s=!0}};if(!WQ(e,t))return c;c.setOptions(n).then(function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)});function l(){i.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,r=n===void 0?{}:n,a=e.effect;if(typeof a==`function`){var s=a({state:i,name:t,instance:c,options:r});o.push(s||function(){})}})}function u(){o.forEach(function(e){return e()}),o=[]}return c}}var KQ=GQ({defaultModifiers:[eQ,jQ,ZZ,yZ,kQ,SQ,PQ,GZ,EQ]});function qQ(e){return _i(`MuiPopper`,e)}vi(`MuiPopper`,[`root`]);function JQ(e,t){if(t===`ltr`)return e;switch(e){case`bottom-end`:return`bottom-start`;case`bottom-start`:return`bottom-end`;case`top-end`:return`top-start`;case`top-start`:return`top-end`;default:return e}}function YQ(e){return typeof e==`function`?e():e}function XQ(e){return e.nodeType!==void 0}var ZQ=e=>{let{classes:t}=e;return za({root:[`root`]},qQ,t)},QQ={},$Q=F.forwardRef(function(e,t){let{anchorEl:n,children:r,direction:i,disablePortal:a,modifiers:o,open:s,placement:c,popperOptions:l,popperRef:u,slotProps:d={},slots:f={},TransitionProps:p,ownerState:m,...h}=e,g=F.useRef(null),_=ed(g,t),v=F.useRef(null),y=ed(v,u),b=F.useRef(y);Mi(()=>{b.current=y},[y]),F.useImperativeHandle(u,()=>v.current,[]);let x=JQ(c,i),[S,C]=F.useState(x),[w,T]=F.useState(YQ(n));F.useEffect(()=>{v.current&&v.current.forceUpdate()}),F.useEffect(()=>{n&&T(YQ(n))},[n]),Mi(()=>{if(!w||!s)return;let e=e=>{C(e.placement)},t=[{name:`preventOverflow`,options:{altBoundary:a}},{name:`flip`,options:{altBoundary:a}},{name:`onUpdate`,enabled:!0,phase:`afterWrite`,fn:({state:t})=>{e(t)}}];o!=null&&(t=t.concat(o)),l&&l.modifiers!=null&&(t=t.concat(l.modifiers));let n=KQ(w,g.current,{placement:x,...l,modifiers:t});b.current(n);let r=g.current;return()=>{if(r){let{style:e}=r,t=e.position,i=e.top,a=e.left,o=e.transform;n.destroy(),e.position=t,e.top=i,e.left=a,e.transform=o}else n.destroy();b.current(null)}},[w,a,o,s,l,x]);let E={placement:S};p!==null&&(E.TransitionProps=p);let D=ZQ(e),O=f.root??`div`;return(0,I.jsx)(O,{...zh({elementType:O,externalSlotProps:d.root,externalForwardedProps:h,additionalProps:{role:`tooltip`,ref:_},ownerState:e,className:D.root}),children:typeof r==`function`?r(E):r})}),e$=z(F.forwardRef(function(e,t){let{anchorEl:n,children:r,container:i,direction:a=`ltr`,disablePortal:o=!1,keepMounted:s=!1,modifiers:c,open:l,placement:u=`bottom`,popperOptions:d=QQ,popperRef:f,style:p,transition:m=!1,slotProps:h={},slots:g={},..._}=e,[v,y]=F.useState(!0),b=()=>{y(!1)},x=()=>{y(!0)};if(!s&&!l&&(!m||v))return null;let S;if(i)S=i;else if(n){let e=YQ(n);S=e&&XQ(e)?lu(e).body:lu(null).body}let C=!l&&s&&(!m||v)?`none`:void 0,w=m?{in:l,onEnter:b,onExited:x}:void 0;return(0,I.jsx)(Ad,{disablePortal:o,container:S,children:(0,I.jsx)($Q,{anchorEl:n,direction:a,disablePortal:o,modifiers:c,ref:t,open:m?!v:l,placement:u,popperOptions:d,popperRef:f,slotProps:h,slots:g,..._,style:{position:`fixed`,top:0,left:0,display:C,...p},TransitionProps:w,children:r})})}),{name:`MuiPopper`,slot:`Root`})({}),qee=z(F.forwardRef(function(e,t){let n=ia(),{anchorEl:r,component:i,components:a,componentsProps:o,container:s,disablePortal:c,keepMounted:l,modifiers:u,open:d,placement:f,popperOptions:p,popperRef:m,transition:h,slots:g,slotProps:_,...v}=ou({props:e,name:`MuiPopper`}),y=g?.root??a?.Root,b={anchorEl:r,container:s,disablePortal:c,keepMounted:l,modifiers:u,open:d,placement:f,popperOptions:p,popperRef:m,transition:h,...v};return(0,I.jsx)(e$,{as:i,direction:n?`rtl`:`ltr`,slots:{root:y},slotProps:_??o,...b,ref:t})}))({background:`#fff`,padding:`10px`,pointerEvents:`none`,zIndex:99999}),t$=z(AG)({fontSize:50,textAlign:`center`}),n$=({children:e,...t})=>(0,I.jsx)(qee,{id:`mouse-over-popover`,open:!0,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},disableRestoreFocus:!0,disableAutoFocus:!0,...t,children:(0,I.jsx)(t$,{children:e})}),r$=({letter:e})=>(0,I.jsx)(`div`,{style:{fontSize:`24px`,lineHeight:`24px`},children:e});r$.propTypes={letter:P.string};function i$({editor:e,opts:t,onClose:n}){if(!t?.characters?.length)return null;let r=(0,F.useRef)(null),i=(0,F.useRef)(n),[a,o]=(0,F.useState)({top:0,left:0}),[s,c]=(0,F.useState)(null);i.current=n;let l=(0,F.useMemo)(()=>{if(!t)return LX;switch(!0){case t.language===`spanish`:return LX;case t.language===`special`:return RX;default:return t}},[t]),u=(0,F.useMemo)(()=>l.characters.reduce((e,t)=>(t.length>=e.columns&&(e.columns=t.length),e),{rows:l.characters.length,columns:0}),[l]),d=()=>c(null);(0,F.useEffect)(()=>()=>{d()},[]),(0,F.useEffect)(()=>{if(!e)return;let t=e.options.element,n=e.view.dom,a=()=>{if(!r.current)return;let n=t.getBoundingClientRect(),{from:i}=e.state.selection,a=e.view.coordsAtPos(i),s=r.current.offsetHeight,c=r.current.offsetWidth,l=window.innerHeight-(n.bottom+60)>=s||n.top<s+80?n.bottom+60:n.top-s-20,u=a.left;l=Math.max(8,Math.min(l,window.innerHeight-s-8)),u=Math.max(8,Math.min(u,window.innerWidth-c-8)),o({top:l,left:u})};a();let s=null,c=()=>{s===null&&(s=requestAnimationFrame(()=>{s=null,a()}))};window.addEventListener(`scroll`,c,!0),window.addEventListener(`resize`,c);let l=e=>{r.current&&!r.current.contains(e.target)&&!n.contains(e.target)&&i.current()},u=setTimeout(()=>{document.addEventListener(`click`,l)});return()=>{clearTimeout(u),s!==null&&cancelAnimationFrame(s),window.removeEventListener(`scroll`,c,!0),window.removeEventListener(`resize`,c),document.removeEventListener(`click`,l)}},[e]);let f=(e,t)=>c({anchorEl:e.currentTarget,el:t});return(0,I.jsxs)(I.Fragment,{children:[Au.createPortal((0,I.jsx)(`div`,{ref:r,className:`insert-character-dialog`,"data-toolbar-for":e.instanceId,style:{visibility:a.top===0&&a.left===0?`hidden`:`initial`,position:`fixed`,top:`${a.top}px`,left:`${a.left}px`,maxWidth:`500px`,zIndex:1e3},children:(0,I.jsx)(`div`,{children:(0,I.jsx)(Aq,{keyPadCharacterRef:t.keyPadCharacterRef,setKeypadInteraction:t.setKeypadInteraction,autoFocus:!0,noDecimal:!0,hideInput:!0,noLatexHandling:!0,hideDoneButtonBackground:!0,layoutForKeyPad:u,additionalKeys:l.characters.reduce((e,t)=>(e=[...e,...t.map(e=>({name:_s(e,`name`)||e,write:_s(e,`write`)||e,label:_s(e,`label`)||e,category:`character`,extraClass:`character`,extraProps:{...e.extraProps||{},style:{...(e.extraProps||{}).style,border:`1px solid #000`}},...l.hasPreview?{actions:{onMouseEnter:t=>f(t,e),onMouseLeave:d}}:{}}))],e),[]),keypadMode:`language`,onChange:t=>{typeof t==`string`&&e.chain().focus().insertContent(t).run()},onDone:n})})}),document.body),s&&Au.createPortal((0,I.jsxs)(n$,{onClose:d,anchorEl:s.anchorEl,children:[(0,I.jsx)(`div`,{children:s.el.label}),(0,I.jsx)(`div`,{style:{fontSize:20,lineHeight:`20px`},children:s.el.description}),(0,I.jsx)(`div`,{style:{fontSize:20,lineHeight:`20px`},children:s.el.unicode})]}),document.body)]})}i$.propTypes={editor:P.object,opts:P.object,onClose:P.func.isRequired};var a$=()=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24px`,viewBox:`0 0 24 24`,width:`24px`,fill:`none`,"aria-hidden":`true`,focusable:`false`,children:(0,I.jsx)(`path`,{d:`M22,7h-2v1h3v1h-4V7c0-0.55,0.45-1,1-1h2V5h-3V4h3c0.55,0,1,0.45,1,1v1C23,6.55,22.55,7,22,7z M5.88,20h2.66l3.4-5.42h0.12 l3.4,5.42h2.66l-4.65-7.27L17.81,6h-2.68l-3.07,4.99h-0.12L8.85,6H6.19l4.32,6.73L5.88,20z`,fill:`currentColor`})}),o$=()=>(0,I.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`24px`,viewBox:`0 0 24 24`,width:`24px`,fill:`none`,"aria-hidden":`true`,focusable:`false`,children:(0,I.jsx)(`path`,{d:`M22,18h-2v1h3v1h-4v-2c0-0.55,0.45-1,1-1h2v-1h-3v-1h3c0.55,0,1,0.45,1,1v1C23,17.55,22.55,18,22,18z M5.88,18h2.66 l3.4-5.42h0.12l3.4,5.42h2.66l-4.65-7.27L17.81,4h-2.68l-3.07,4.99h-0.12L8.85,4H6.19l4.32,6.73L5.88,18z`,fill:`currentColor`})}),s$=()=>(0,I.jsx)(`svg`,{width:`30`,height:`28`,viewBox:`0 0 30 28`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{width:`20px`,height:`18px`},"aria-hidden":`true`,focusable:`false`,children:(0,I.jsx)(`path`,{d:`M27 4V24H29C29.5 24 30 24.5 30 25V27C30 27.5625 29.5 28 29 28H19C18.4375 28 18 27.5625 18 27V25C18 24.5 18.4375 24 19 24H21V16H9V24H11C11.5 24 12 24.5 12 25V27C12 27.5625 11.5 28 11 28H1C0.4375 28 0 27.5625 0 27V25C0 24.5 0.4375 24 1 24H3V4H1C0.4375 4 0 3.5625 0 3V1C0 0.5 0.4375 0 1 0H11C11.5 0 12 0.5 12 1V3C12 3.5625 11.5 4 11 4H9V12H21V4H19C18.4375 4 18 3.5625 18 3V1C18 0.5 18.4375 0 19 0H29C29.5 0 30 0.5 30 1V3C30 3.5625 29.5 4 29 4H27Z`,fill:`currentColor`})});function c$({editor:e,classes:t,activePlugins:n,toolbarOpts:r,responseAreaProps:i,onChange:a,autoWidthToolbar:o}){let[s,c]=(0,F.useState)(!1),l=r??{},u=sA({editor:e,selector:e=>{let{selection:t}=e.editor?.state||{},n;if(!e.editor?.commandManager)return{};t instanceof Qv&&(n=t.node);let r=e.editor?.isActive(`math`)||e.editor?.isActive(`explicit_constructed_response`)||e.editor?.isActive(`imageUploadNode`)||e.editor?.isActive(`drag_in_the_blank`),i=t&&t.empty===!1&&e.editor.isActive(`table`);return{currentNode:n,hideDefaultToolbar:r,hasTextSelectionInTable:i,isFocused:e.editor?.isFocused,toolbarOpened:e.editor?._toolbarOpened??!1,isBold:e.editor.isActive(`bold`)??!1,canBold:e.editor.can().chain().toggleBold().run()??!1,isTable:e.editor.isActive(`table`)??!1,tableHasBorder:e.editor.getAttributes(`table`)?.border===`1`,canTable:e.editor.can().chain().insertTable().run()??!1,isItalic:e.editor.isActive(`italic`)??!1,canItalic:e.editor.can().chain().toggleItalic().run()??!1,isStrike:e.editor.isActive(`strike`)??!1,canStrike:e.editor.can().chain().toggleStrike().run()??!1,isCode:e.editor.isActive(`code`)??!1,canCode:e.editor.can().chain().toggleCode().run()??!1,canClearMarks:e.editor.can().chain().unsetAllMarks().run()??!1,isUnderline:e.editor.isActive(`underline`)??!1,isSubScript:e.editor.isActive(`subscript`)??!1,isSuperScript:e.editor.isActive(`superscript`)??!1,isParagraph:e.editor.isActive(`paragraph`)??!1,isHeading1:e.editor.isActive(`heading`,{level:1})??!1,isHeading2:e.editor.isActive(`heading`,{level:2})??!1,isHeading3:e.editor.isActive(`heading`,{level:3})??!1,isHeadingParagraph:e.editor.isActive(`headingParagraph`)??!1,isHeading4:e.editor.isActive(`heading`,{level:4})??!1,isHeading5:e.editor.isActive(`heading`,{level:5})??!1,isHeading6:e.editor.isActive(`heading`,{level:6})??!1,isBulletList:e.editor.isActive(`bulletList`)??!1,isOrderedList:e.editor.isActive(`orderedList`)??!1,isCodeBlock:e.editor.isActive(`codeBlock`)??!1,isBlockquote:e.editor.isActive(`blockquote`)??!1,canUndo:e.editor.can().chain().undo().run()??!1,canRedo:e.editor.can().chain().redo().run()??!1}}}),d=!!o,f=L(t.toolbar,ER,{[t.toolbarWithNoDone]:!0,[t.toolbarTop]:l.position===`top`,[t.toolbarRight]:l.alignment===`right`,[t.focused]:l.alwaysVisible||u.isFocused&&!u.toolbarOpened&&!u.hideDefaultToolbar,[t.autoWidth]:d,[t.fullWidth]:!d,[t.hidden]:l.isHidden===!0}),p=l.minWidth===void 0?{}:{minWidth:l.minWidth},m=e=>{e.preventDefault()},h=(0,F.useMemo)(()=>[{icon:(0,I.jsx)(wX,{}),label:`Insert table`,onClick:e=>e.chain().focus().insertTable({rows:2,cols:2,withHeaderRow:!1}).run(),hidden:e=>!n?.includes(`table`)||e.isTable,isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,I.jsx)(JX,{}),label:`Add table row`,onClick:e=>e.chain().focus().addRowAfter().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,I.jsx)(YX,{}),label:`Remove table row`,onClick:e=>e.chain().focus().deleteRow().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,I.jsx)(XX,{}),label:`Add table column`,onClick:e=>e.chain().focus().addColumnAfter().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,I.jsx)(ZX,{}),label:`Remove table column`,onClick:e=>e.chain().focus().deleteColumn().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,I.jsx)(QX,{}),label:`Remove table`,onClick:e=>e.chain().focus().deleteTable().run(),hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.isTable,isDisabled:e=>!e.canTable},{icon:(0,I.jsx)(PX,{}),label:`Table borders`,toggle:!0,onClick:e=>{let t=e.getAttributes(`table`),n={...t,border:t.border===`0`?`1`:`0`};e.commands.updateAttributes(`table`,n)},hidden:e=>!(e.isTable&&!e.hasTextSelectionInTable),isActive:e=>e.tableHasBorder,isDisabled:e=>!e.canTable},{icon:(0,I.jsx)(bX,{}),label:`Bold`,toggle:!0,onClick:e=>e.chain().focus().toggleBold().run(),hidden:()=>!n?.includes(`bold`),isActive:e=>e.isBold,isDisabled:e=>!e.canBold},{icon:(0,I.jsx)(xX,{}),label:`Italic`,toggle:!0,onClick:e=>e.chain().focus().toggleItalic().run(),hidden:()=>!n?.includes(`italic`),isActive:e=>e.isItalic,isDisabled:e=>!e.canItalic},{icon:(0,I.jsx)(SX,{}),label:`Strikethrough`,toggle:!0,onClick:e=>e.chain().focus().toggleStrike().run(),hidden:()=>!n?.includes(`strikethrough`),isActive:e=>e.isStrike,isDisabled:e=>!e.canStrike},{icon:(0,I.jsx)(CX,{}),label:`Code`,toggle:!0,onClick:e=>e.chain().focus().toggleCode().run(),hidden:()=>!n?.includes(`code`),isActive:e=>e.isCode,isDisabled:e=>!e.canCode},{icon:(0,I.jsx)(DX,{}),label:`Underline`,toggle:!0,onClick:e=>e.chain().focus().toggleUnderline().run(),hidden:()=>!n?.includes(`underline`),isActive:e=>e.isUnderline},{icon:(0,I.jsx)(o$,{}),label:`Subscript`,toggle:!0,onClick:e=>e.chain().focus().toggleSubscript().run(),hidden:()=>!n?.includes(`subscript`),isActive:e=>e.isSubScript},{icon:(0,I.jsx)(a$,{}),label:`Superscript`,toggle:!0,onClick:e=>e.chain().focus().toggleSuperscript().run(),hidden:()=>!n?.includes(`superscript`),isActive:e=>e.isSuperScript},{icon:(0,I.jsx)(kX,{}),label:`Insert image`,hidden:()=>!n?.includes(`image`),onClick:e=>e.chain().focus().setImageUploadNode().run()},{icon:(0,I.jsx)(MX,{}),label:`Insert video`,hidden:()=>!n?.includes(`video`),onClick:e=>e.chain().focus().insertMedia({type:`video`}).run()},{icon:(0,I.jsx)(NX,{}),label:`Insert audio`,hidden:()=>!n?.includes(`audio`),onClick:e=>e.chain().focus().insertMedia({type:`audio`,tag:`audio`}).run()},{icon:(0,I.jsx)(GX,{}),label:`CSS classes`,hidden:()=>!n?.includes(`css`),onClick:e=>e.commands.openCSSClassDialog()},{icon:(0,I.jsx)(jX,{}),label:`Blockquote`,toggle:!0,hidden:()=>!n?.includes(`blockquote`),onClick:e=>e.chain().focus().toggleBlockquote().run(),isActive:e=>e.isBlockquote},{icon:(0,I.jsx)(s$,{}),label:`Heading`,toggle:!0,hidden:()=>!n?.includes(`h3`),onClick:e=>e.chain().focus().toggleHeadingParagraph().run(),isActive:e=>e.isHeadingParagraph},{icon:(0,I.jsx)(OX,{}),label:`Insert math`,hidden:()=>!n?.includes(`math`),onClick:e=>e.chain().focus().insertMath(``).run()},{icon:(0,I.jsx)(r$,{letter:`ñ`}),label:`Spanish characters (ñ)`,hidden:()=>!n?.includes(`languageCharacters`),onClick:()=>c(LX)},{icon:(0,I.jsx)(r$,{letter:`€`}),label:`Special characters (€)`,hidden:()=>n?.filter(e=>e===`languageCharacters`).length!==2,onClick:()=>c(RX)},{icon:(0,I.jsx)(UX,{editor:e}),label:`Text alignment`,hidden:()=>!n?.includes(`text-align`),onClick:()=>{}},{icon:(0,I.jsx)(TX,{}),label:`Bulleted list`,toggle:!0,hidden:()=>!n?.includes(`bulleted-list`),onClick:e=>e.chain().focus().toggleBulletList().run(),isActive:e=>e.isBulletList},{icon:(0,I.jsx)(EX,{}),label:`Numbered list`,toggle:!0,hidden:()=>!n?.includes(`numbered-list`),onClick:e=>e.chain().focus().toggleOrderedList().run(),isActive:e=>e.isOrderedList},{icon:(0,I.jsx)(Wm,{}),label:`Undo`,hidden:()=>!n?.includes(`undo`),onClick:e=>e.chain().focus().undo().run(),isDisabled:e=>!e.canUndo},{icon:(0,I.jsx)(AX,{}),label:`Redo`,hidden:()=>!n?.includes(`redo`),onClick:e=>e.chain().focus().redo().run(),isDisabled:e=>!e.canRedo}],[n,e]),g=u.hideDefaultToolbar&&u.currentNode?.type?.name===`drag_in_the_blank`;return(0,I.jsxs)(`div`,{className:f,style:{...p},onMouseDown:m,children:[g&&(0,I.jsx)(`div`,{className:t.defaultToolbar,tabIndex:`1`,children:(0,I.jsx)(`div`,{className:t.buttonsContainer,children:(0,I.jsx)(`button`,{type:`button`,className:t.button,onClick:t=>{t.preventDefault(),e.chain().focus().deleteSelection().run(),a?.(e.getHTML())},"aria-label":`Delete response area`,title:`Delete response area`,children:(0,I.jsx)(TR,{})})})}),!u.hideDefaultToolbar&&(0,I.jsxs)(`div`,{className:t.defaultToolbar,tabIndex:`1`,children:[(0,I.jsx)(`div`,{className:t.buttonsContainer,children:h.filter(e=>!e.hidden?.(u)).map((n,r)=>{let i=n.isDisabled?.(u),a=n.isActive?.(u);return(0,I.jsx)(`button`,{type:`button`,disabled:i,"aria-label":n.label,title:n.label,"aria-pressed":n.toggle?!!a:void 0,onClick:t=>{t.preventDefault(),n.onClick(e)},className:L(t.button,{[t.active]:a}),children:n.icon},r)})}),n?.includes(`responseArea`)&&(0,I.jsx)(`button`,{type:`button`,"aria-label":`Insert response area`,title:`Insert response area`,onClick:()=>{e.chain().focus().insertResponseArea(i.type).run()},className:t.button,children:(0,I.jsx)(IX,{})}),l.showDone&&(0,I.jsx)(AR,{onClick:()=>{a?.(e.getHTML()),e.commands.blur()}})]}),s&&(0,I.jsx)(i$,{editor:e,opts:{...s,renderPopOver:(e,t)=>console.log(`Show popover`,t),closePopOver:()=>console.log(`Close popover`)},onClose:()=>c(!1)})]})}var l$=e=>{Qo();let t={defaultToolbar:`defaultToolbar`,buttonsContainer:`buttonsContainer`,button:`toolbarButton`,active:`active`,disabled:`disabled`,isActive:`isActive`,toolbar:`toolbar`,toolbarWithNoDone:`toolbarWithNoDone`,toolbarTop:`toolbarTop`,toolbarRight:`toolbarRight`,fullWidth:`fullWidth`,hidden:`hidden`,autoWidth:`autoWidth`,focused:`focused`,iconRoot:`iconRoot`,label:`label`,shared:`shared`};return(0,I.jsx)(u$,{children:(0,I.jsx)(c$,{...e,classes:t})})},u$=z(`div`)(()=>({height:0,overflow:`visible`,"& .defaultToolbar":{display:`flex`,width:`100%`,justifyContent:`space-between`},"& .buttonsContainer":{alignItems:`center`,display:`flex`,width:`100%`},"& .toolbarButton":{color:`grey`,display:`inline-flex`,padding:`2px`,background:`none`,border:`none`,cursor:`pointer`,"& svg":{width:`24px`,height:`24px`},"&:hover":{color:Nf()},"&:focus":{outline:`2px solid ${Sp()}`}},"& .active":{color:Nf()},"& .disabled":{opacity:.7,cursor:`not-allowed`,"& :hover":{color:Pf()}},"& .isActive":{background:`var(--purple)`,color:`var(--white)`},"& .toolbar":{position:`relative`,top:`5px`,zIndex:20,cursor:`pointer`,justifyContent:`space-between`,background:`var(--editable-html-toolbar-bg, #efefef)`,minWidth:`280px`,margin:0,padding:`2px`,boxShadow:`0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)`,boxSizing:`border-box`,display:`flex`,opacity:0,pointerEvents:`none`},"& .toolbarWithNoDone":{minWidth:`265px`},"& .toolbarTop":{position:`absolute`,top:`-45px`},"& .toolbarRight":{right:0},"& .fullWidth":{width:`fit-content`,minWidth:`100%`},"& .hidden":{visibility:`hidden`},"& .autoWidth":{width:`fit-content`},"& .focused":{opacity:1,pointerEvents:`auto`},"& .iconRoot":{width:`28px`,height:`28px`,padding:`4px`,verticalAlign:`top`},"& .label":{color:`var(--editable-html-toolbar-check, #00bb00)`},"& .shared":{display:`flex`}})),d$=z(`div`,{shouldForwardProp:e=>![`noBorder`,`error`].includes(e)})(({theme:e,noBorder:t,error:n})=>({position:`relative`,padding:`0px`,border:t?`none`:`1px solid #ccc`,borderRadius:`4px`,cursor:`text`,'& [data-slate-editor="true"]':{wordBreak:`break-word`,overflow:`visible`,maxHeight:`500px`,padding:`5px`},"&:first-child":{marginTop:0},"& ul, & ol":{padding:`0 1rem`,margin:`1.25rem 1rem 1.25rem 0.4rem`},"& ul li p, & ol li p":{marginTop:`0.25em`,marginBottom:`0.25em`},"& h1, & h2, & h3, & h4, & h5, & h6":{lineHeight:1.1,marginTop:`2.5rem`,textWrap:`pretty`},"& h1, & h2":{marginTop:`3.5rem`,marginBottom:`1.5rem`},"& h1":{fontSize:`1.4rem`},"& h2":{fontSize:`1.2rem`},"& h3":{fontSize:`1.1rem`},"& h4, & h5, & h6":{fontSize:`1rem`},"& code":{backgroundColor:`var(--purple-light)`,borderRadius:`0.4rem`,color:`var(--black)`,fontSize:`0.85rem`,padding:`0.25em 0.3em`},"& pre":{background:`var(--black)`,borderRadius:`0.5rem`,color:`var(--white)`,fontFamily:`'JetBrainsMono', monospace`,margin:`1.5rem 0`,padding:`0.75rem 1rem`,"& code":{background:`none`,color:`inherit`,fontSize:`0.8rem`,padding:0}},"& blockquote":{background:`#f9f9f9`,borderLeft:`5px solid #ccc`,margin:`1.5em 10px`,padding:`.5em 10px`},"& p":{margin:`0`},"& table":{tableLayout:`fixed`,width:`100%`,borderCollapse:`collapse`,color:Nf(),backgroundColor:tp()},'& table:not([border="1"]) tr':{borderTop:`1px solid ${pp()}`},"& td, th":{padding:`.6em 1em`,textAlign:`center`},'& table:not([border="1"]) td, th':{border:`1px solid ${pp()}`},...n&&{border:`2px solid ${e.palette.error.main} !important`}})),f$=z(`div`,{shouldForwardProp:e=>![`disableScrollbar`,`highlightShape`].includes(e)})(({theme:e,disableScrollbar:t,highlightShape:n})=>({position:`relative`,padding:`0px`,overflowY:`auto`,color:Nf(),backgroundColor:n?e.palette.action.selected:tp(),...t&&{"&::-webkit-scrollbar":{display:`none`},scrollbarWidth:`none`,"-ms-overflow-style":`none`}})),p$=z(`div`,{shouldForwardProp:e=>e!==`noPadding`})(({noPadding:e})=>({padding:e?0:`10px 8px`}));function m$(e){let[t,n]=(0,F.useState)(null),r=(0,F.useRef)(null),{editor:i,disabled:a,children:o,disableScrollbar:s,activePlugins:c,toolbarOpts:l,responseAreaProps:u,autoFocus:d,minWidth:f,width:p,maxWidth:m,minHeight:h,height:g,maxHeight:_,highlightShape:v,ref:y}=e;(0,F.useEffect)(()=>{i&&r.current&&(i._tiptapContainerEl=r.current)},[i,r.current]),(0,F.useEffect)(()=>{i&&d&&Promise.resolve().then(()=>{i.commands.focus(`end`)})},[i,d]),(0,F.useEffect)(()=>{if(e.adjustWidthForLimit){let t=document.createElement(`p`);t.style.visibility=`hidden`,t.style.position=`absolute`,t.style.whiteSpace=`nowrap`,t.textContent=`W`.repeat(e.charactersLimit);let i=window.getComputedStyle(r.current);[`fontFamily`,`fontSize`,`fontWeight`,`fontStyle`,`letterSpacing`,`wordSpacing`,`textTransform`,`lineHeight`].forEach(e=>{t.style[e]=i[e]}),document.body.appendChild(t),n(`${t.offsetWidth+27}px`),t.remove()}},[e.adjustWidthForLimit,e.charactersLimit]);let b=(0,F.useMemo)(()=>({width:yX(t||p),minWidth:yX(f),maxWidth:yX(m),height:yX(g),minHeight:yX(h),maxHeight:yX(_)}),[t,f,p,m,h,g,_]);return(0,I.jsxs)(d$,{noBorder:l&&l.noBorder,error:l&&l.error,className:e.className,style:{width:b.width,minWidth:b.minWidth,maxWidth:b.maxWidth},ref:r,children:[(0,I.jsx)(f$,{disableScrollbar:s,highlightShape:v,children:(0,I.jsx)(p$,{noPadding:l&&l.noPadding,children:o})}),i&&(0,I.jsx)(l$,{editor:i,responseAreaProps:u,toolbarOpts:l,activePlugins:c,onChange:e.onChange,autoWidthToolbar:e.autoWidthToolbar})]})}var h$=Bp(`@pie-lib:editable-html:plugins`),g$=[`bold`,`html`,`extraCSSRules`,`italic`,`underline`,`strikethrough`,`bulleted-list`,`numbered-list`,`image`,`math`,`languageCharacters`,`text-align`,`blockquote`,`h3`,`table`,`video`,`audio`,`responseArea`,`redo`,`undo`,`superscript`,`subscript`],_$={"text-align":`textAlign`,"bulleted-list":`ul_list`,"numbered-list":`ol_list`},v$=g$.filter(e=>![`responseArea`,`h3`,`blockquote`].includes(e)),y$=(e,t,n)=>{h$(`[buildPlugins] opts: `,n),e||=v$;let r=(t,n=!0)=>e.includes(t)&&n&&t,i=n.image&&n.image.delete,a=n.math,o=n.responseArea&&n.responseArea.type,s=!ys(n.extraCSSRules),c=n?.languageCharacters||[];return ms([r(`table`),r(`bold`),r(`italic`),r(`strikethrough`),r(`underline`),r(`superscript`),r(`subscript`),r(`image`,!!i),r(`video`),r(`audio`),r(`math`,!!a),...c.map(e=>r(`languageCharacters`,e)),r(`text-align`),r(`blockquote`),r(`h3`),r(`bulleted-list`),r(`numbered-list`),r(`undo`),r(`redo`),r(`responseArea`,!!o),r(`css`,!!s),r(`html`,!!n.html)])},b$={position:`bottom`,alignment:`left`,alwaysVisible:!1,showDone:!0,doneOn:`blur`},x$={options:{},respAreaToolbar:()=>{},onHandleAreaChange:()=>{}},S$=[`bold`,`italic`,`underline`,`strikethrough`,`code`,`bulleted-list`,`numbered-list`,`image`,`math`,`languageCharacters`,`text-align`,`table`,`video`,`audio`,`responseArea`,`superscript`,`subscript`,`css`,`h3`,`undo`,`redo`],C$={"--white":`#fff`,"--black":`#2e2b29`,"--black-contrast":`#110f0e`,"--gray-1":`rgba(61, 37, 20, .05)`,"--gray-2":`rgba(61, 37, 20, .08)`,"--gray-3":`rgba(61, 37, 20, .12)`,"--gray-4":`rgba(53, 38, 28, .3)`,"--gray-5":`rgba(28, 25, 23, .6)`,"--green":`#22c55e`,"--purple":`#6a00f5`,"--purple-contrast":`#5800cc`,"--purple-light":`rgba(88, 5, 255, .05)`,"--yellow-contrast":`#facc15`,"--yellow":`rgba(250, 204, 21, .4)`,"--yellow-light":`#fffae5`,"--red":`#ff5c33`,"--red-light":`#ffebe5`,"--shadow":`0px 12px 33px 0px rgba(0, 0, 0, .06),
|
|
357
357
|
0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)`},w$=e=>({role:`textbox`,"data-pie-editor":`true`,spellcheck:e?`true`:`false`,autocorrect:e?`on`:`off`,autocapitalize:e?`on`:`off`}),T$=e=>{let{showParagraphs:t,separateParagraphs:n}=e.pluginProps||{},[r,i]=(0,F.useState)([]),[a,o]=(0,F.useState)(!1),{toolbarOpts:s}=e,c=(0,F.useCallback)(e=>{i(t=>{let n=t.filter(t=>t.pos!==e);return n.length===0&&o(!1),n})},[i]),l={...b$,...s},u=(0,F.useCallback)(t=>{let n=t.getHTML();e.markup!==n&&e.onChange?.(n),l.doneOn===`blur`&&e.onDone?.(n)},[e.markup,e.onChange,e.onDone,l.doneOn]),d=(0,F.useMemo)(()=>({...x$,...e.responseAreaProps,onInlineDropdownToolbarClose:u}),[e.responseAreaProps,u]),f=(0,F.useMemo)(()=>{let{customPlugins:t,...n}=e.pluginProps||{};t||=[];let r=(e.activePlugins||S$)?.filter(e=>{let t=_$[e]||e,r=n[t]||{};return!r||!r.disabled});return y$(r,t,{math:{},textAlign:e.textAlign,html:{},extraCSSRules:e.extraCSSRules||{},image:{...e.imageSupport},toolbar:{},table:{},responseArea:{type:d.type},languageCharacters:e.languageCharactersProps,keyPadCharacterRef:{},setKeypadInteraction:{},media:{}})},[e,d.type]),p=[vI.configure({types:[`heading`,`paragraph`,`div`,`headingParagraph`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`td`,`th`],alignments:[`left`,`right`,`center`,`justify`]}),hI,jF.configure({limit:e.charactersLimit||1e6}),aI.configure({trailingNode:{node:`paragraph`,notAfter:[`paragraph`,`div`]},link:{autolink:!1,linkOnPaste:!1}}),_X,gR,vX,_R,vR,xI.configure({placeholder:e.placeholder,showOnlyWhenEditable:!0,showOnlyCurrent:!1,includeChildren:!0}),fR,JL,hR,mR,_G.configure(d),vG.configure(d),bG.configure(d),xG.configure(d),yG.configure(d),Iq.configure({toolbarOpts:l,math:e.pluginProps?.math||{}}),_I,gI,bI,XJ.configure({toolbarOpts:l,imageHandling:{disableImageAlignmentButtons:e.disableImageAlignmentButtons,onDone:t=>e.onDone?.(t.getHTML()),onDelete:e.imageSupport&&e.imageSupport.delete&&(t=>{let{src:n}=t.attrs;e.imageSupport.delete(n,e=>{c(t.pos)})}),insertImageRequested:e.imageSupport&&((t,n,r)=>{let[o,s]=n,l=n=>{let r;a&&n&&(r=e.onChange),c(s),r?.(t.getHTML())};t._insertingImage=!0,i(e=>[...e,o]),(()=>{let n=r(l),i=hs(()=>{let e=()=>window.removeEventListener(`focus`,i);if(!t._insertingImage){e();return}c(s),t._insertingImage=!1,e()},500);window.addEventListener(`focus`,i),e.imageSupport.add(n)})()}),maxImageWidth:e.maxImageWidth,maxImageHeight:e.maxImageHeight},limit:3}),$Y.configure({uploadSoundSupport:e.uploadSoundSupport}),gX.configure({extraCSSRules:e.extraCSSRules})],m=e.spellCheck!==!1,h=dA({extensions:p,immediatelyRender:!1,editorProps:{attributes:w$(m),handleKeyDown(t,n){return e.onKeyDown?e.onKeyDown(n):!1}},editable:!e.disabled,content:wI(e.markup),onUpdate:({editor:t,transaction:n})=>{n.isDone&&e.onChange?.(t.getHTML())},onBlur:({editor:e})=>{e._insertingImage||e._toolbarOpened||e.isActive(`inline_dropdown`)||e.isActive(`explicit_constructed_response`)||!e.schema||u(e)}},[e.charactersLimit]);(0,F.useEffect)(()=>{e.editorRef&&e.editorRef(h)},[e.editorRef,h]),(0,F.useEffect)(()=>{h?.setEditable(!e.disabled)},[e.disabled,h]),(0,F.useEffect)(()=>{if(!h)return;let e=h.options?.editorProps,t={...e?.attributes,...w$(m)};e?.attributes?.spellcheck!==t.spellcheck&&h.setOptions({editorProps:{...e,attributes:t}})},[m,h]),(0,F.useEffect)(()=>{if(!h)return;let t=wI(e.markup);t!==h.getHTML()&&h.commands.setContent(t,{emitUpdate:!1})},[e.markup,h]),(0,F.useEffect)(()=>{Object.entries(C$).forEach(([e,t])=>{document.documentElement.style.setProperty(e,t)})},[]);let g=sA({editor:h,selector:e=>({isFocused:e.editor?.isFocused})}),_=(0,F.useMemo)(()=>{let{minWidth:t,width:n,maxWidth:r,minHeight:i,height:a,maxHeight:o}=e;return{width:yX(n),minWidth:yX(t),maxWidth:yX(r),height:yX(a),minHeight:yX(i),maxHeight:yX(o)}},[e]);return(0,I.jsx)(m$,{...e,activePlugins:f,toolbarOpts:l,editorState:g,editor:h,children:h&&(0,I.jsx)(E$,{style:{minHeight:_.minHeight,height:_.height,maxHeight:_.maxHeight},showParagraph:t&&!t.disabled,separateParagraph:n&&!n.disabled,editor:h})})},E$=z(iA,{shouldForwardProp:e=>![`showParagraph`,`separateParagraph`].includes(e)})(({showParagraph:e,separateParagraph:t})=>({display:`flex`,outline:`none !important`,"& .ProseMirror":{flex:1,padding:`5px`,maxHeight:`500px`,outline:`none !important`,position:`initial`,"& > p, & > div":{margin:`0`},"& p[data-placeholder].is-empty:only-child, & div[data-placeholder].is-empty:only-child":{position:`relative`},"& p[data-placeholder].is-empty:only-child::before, & div[data-placeholder].is-empty:only-child::before":{content:`attr(data-placeholder)`,position:`absolute`,left:0,top:0,color:`#9CA3AF`,pointerEvents:`none`,whiteSpace:`pre-wrap`},...e&&{"& > p:has(+ p)::after, & > div:has(+ div)::after":{display:`block`,content:`"¶"`,fontSize:`1em`,color:`#146EB3`}},...t&&{"& > p:has(+ p)":{marginBottom:`1em`}}}})),D$=T$,O$={min:P.number.isRequired,max:P.number.isRequired,step:P.number},k$=P.shape(O$),A$=P.shape(O$),j$=P.shape({width:P.number.isRequired,height:P.number.isRequired}),M$=P.shape({x:P.number.isRequired,y:P.number.isRequired}),N$=P.oneOfType([P.arrayOf(P.node),P.node]).isRequired,P$=P.shape({x:P.func.isRequired,y:P.func.isRequired}),F$=P.shape({x:P.func.isRequired,y:P.func.isRequired}),I$=P.shape({scale:P$.isRequired,snap:F$.isRequired,domain:k$.isRequired,range:A$.isRequired,size:j$.isRequired}),L$={graphProps:I$.isRequired,mark:P.object,onChange:P.func,onDelete:P.func,onClick:P.func};P.shape(L$);var R$=o(((e,t)=>{t.exports=function(e,t,n,r,i,a,o,s){if(!e){var c;if(t===void 0)c=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var l=[n,r,i,a,o,s],u=0;c=Error(t.replace(/%s/g,function(){return l[u++]})),c.name=`Invariant Violation`}throw c.framesToPop=1,c}}}));function z$(e,t){this.x=e,this.y=t}z$.prototype={clone(){return new z$(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),n=Math.sin(e),r=t*this.x-n*this.y,i=n*this.x+t*this.y;return this.x=r,this.y=i,this},_rotateAround(e,t){let n=Math.cos(e),r=Math.sin(e),i=t.x+n*(this.x-t.x)-r*(this.y-t.y),a=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=i,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:z$},z$.convert=function(e){if(e instanceof z$)return e;if(Array.isArray(e))return new z$(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new z$(+e.x,+e.y);throw Error(`Expected [x, y] or {x, y} point format`)};var B$=l(R$(),1),V$=(e,t)=>({x:e,y:t}),H$=(e,t,n)=>{let r=Ts(e,t,n);return r.splice(r.length,1,t),r};function U$(e,t,n,r){if(r>=t)return t;if(r<=e)return e;let i=H$(e,t,n);return i=i.filter(e=>Math.abs(r-e)<=n),i.length&&i.reduce((e,t)=>Math.abs(t-r)<=Math.abs(e-r)?t:e)}var W$=(e,t)=>({left:Math.min(e.x,t.x),top:Math.max(e.y,t.y),bottom:Math.min(e.y,t.y),right:Math.max(e.x,t.x)}),G$=(e,t,n)=>({left:t.min-e.left,right:Math.abs(e.right-t.max),top:Math.abs(e.top-n.max),bottom:n.min-e.bottom}),K$=e=>new z$(e.x,e.y),q$=(e,t)=>K$(t).sub(K$(e)),J$=(e,t)=>xs(e.domain,t.domain)&&xs(e.range,t.range),Y$=e=>(new DOMParser()?.parseFromString(e,`text/html`))?.body?.textContent||``,X$=e=>e&&Object.keys(e).length===0&&e.constructor===Object,Z$=e=>typeof e==`string`&&e.trim()===``;function Q$(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function $$(e,t){return!e||Q$(e)?e:Q$(e.default)?e.default:t&&Q$(e[t])?e[t]:t&&Q$(e[t]?.default)?e[t].default:e}var e1=$$(Ah,`Readable`)||$$(r1.Readable,`Readable`),t1=og,n1=t1.default,r1=n1&&typeof n1==`object`?n1:t1,i1={axisLabel:{fontSize:12,textAlign:`center`,margin:4,padding:`4px 0`},chartLabel:{fontSize:16,textAlign:`center`,margin:4,padding:`4px 0`},disabledLabel:{pointerEvents:`none`,width:`100%`},editLabel:{position:`absolute`,backgroundColor:`white`,borderRadius:4,boxShadow:`0px 5px 8px rgba(0,0,0,0.15)`,zIndex:10},rotateLeftLabel:{transform:`rotate(-90deg)`,transformOrigin:`0 0`,position:`absolute`},rotateRightLabel:{transform:`rotate(90deg)`,transformOrigin:`0 0`,position:`absolute`},customBottom:{position:`absolute`},displayNone:{display:`none`},centerPlaceholder:{"& .ProseMirror p.is-editor-empty::before, & .ProseMirror div.is-editor-empty::before":{left:0,right:0,width:`100%`,textAlign:`center`}}},a1=z(`div`)({...i1.centerPlaceholder}),o1=z(`div`)({...i1.disabledLabel,"& p":{margin:0}}),s1=e=>{let{disabledLabel:t,graphHeight:n,graphWidth:r,isChartBottomLabel:i,isDefineChartBottomLabel:a,isChartLeftLabel:o,isDefineChartLeftLabel:s,placeholder:c,text:l,side:u,onChange:d,mathMlOptions:f={},charactersLimit:p,titleHeight:m,preventNewLines:h}=e,[g,_]=(0,F.useState)(!1),v=[`bold`,`italic`,`underline`,`strikethrough`,`math`],y=i||o||a||s,b=u===`left`&&s&&n-220,x={width:b||(u===`left`||u===`right`?n-8:r-8),top:b||o&&`${n-70}px`||u===`left`&&`${n-8}px`||i&&`${n-60+m}px`||u===`bottom`&&`${n-120+m}px`||0,left:u===`right`&&`${r-8}px`||(s||a)&&`40px`||i&&`-10px`||0},S={width:r-8,top:u===`right`?`${n-22}px`:0,left:0},C=()=>{!t&&(u===`left`||u===`right`)&&_(!0)},w=()=>{_(!1),requestAnimationFrame(()=>{document.activeElement?.blur?.()})},T=e=>!!(h&&e.key===`Enter`);return(0,I.jsx)(e1,{false:!0,children:(0,I.jsx)(a1,{onClick:C,style:{...g?S:x,...y?i1.chartLabel:i1.axisLabel,...u===`left`&&!g?i1.rotateLeftLabel:{},...u===`right`&&!g?i1.rotateRightLabel:{},...g?i1.editLabel:{},...i||a?i1.customBottom:{},...t&&!y&&Z$(Y$(l))&&i1.displayNone},children:t?(0,I.jsx)(o1,{dangerouslySetInnerHTML:{__html:l||``}}):(0,I.jsx)(D$,{markup:l||``,onChange:d,placeholder:!t&&c,toolbarOpts:{position:u===`bottom`?`top`:`bottom`,noPadding:!0,noBorder:!0},disableScrollbar:!0,activePlugins:v,onDone:w,onKeyDown:T,mathMlOptions:f,charactersLimit:p})})})};s1.propTypes={disabledLabel:P.bool,graphHeight:P.number,graphWidth:P.number,isChartBottomLabel:P.bool,isDefineChartBottomLabel:P.bool,isChartLeftLabel:P.bool,isDefineChartLeftLabel:P.bool,placeholder:P.string,text:P.string,side:P.string,onChange:P.func,mathMlOptions:P.object,charactersLimit:P.number,titleHeight:P.number};function c1(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function l1(e,t){return!e||c1(e)?e:c1(e.default)?e.default:t&&c1(e[t])?e[t]:t&&c1(e[t]?.default)?e[t].default:e}var u1=l1(Ah,`Readable`)||l1(p1.Readable,`Readable`),d1=og,f1=d1.default,p1=f1&&typeof f1==`object`?f1:d1,m1={"& .ProseMirror p.is-editor-empty::before, & .ProseMirror div.is-editor-empty::before":{left:0,right:0,width:`100%`,textAlign:`center`}},h1=z(`div`)(({theme:e})=>({border:`solid 1px ${qf()}`,color:H.TEXT,backgroundColor:e.palette.common.white,touchAction:`none`,position:`relative`,boxSizing:`unset`})),g1=z(`div`)({display:`flex`,position:`relative`}),_1=z(`svg`)({paddingLeft:`50px`,overflow:`visible`,boxSizing:`content-box`}),v1=z(`svg`)({overflow:`visible`,boxSizing:`content-box`}),y1=z(`g`)({cursor:`pointer`,userSelect:`none`}),b1=z(`div`)(({theme:e})=>({color:H.TEXT,fontSize:e.typography.fontSize+2,padding:`${e.spacing(1.5)} ${e.spacing(.5)} 0`,textAlign:`center`,"&.disabledTitle":{pointerEvents:`none`},"&.rightMargin":{marginRight:`74px`},"& p":{margin:0},...m1})),x1=z(`div`)(({theme:e})=>({color:H.TEXT,fontSize:e.typography.fontSize+4,padding:`${e.spacing(1.5)} ${e.spacing(.5)} 0`,textAlign:`center`,"&.disabledTitle":{pointerEvents:`none`},"&.rightMargin":{marginRight:`74px`},"& p":{margin:0},...m1})),S1=z(`div`)({display:`flex`,paddingTop:`6px`}),C1=z(`div`)({display:`flex`,flexDirection:`column`,alignItems:`center`,width:`100px`,pointerEvents:`none`,userSelect:`none`}),w1=z(`div`)({width:`70px`,display:`flex`,flexDirection:`column`,marginRight:`6px`}),T1=z(`div`)({textAlign:`right`,height:`20px`,pointerEvents:`none`,userSelect:`none`,"&:not(:last-child)":{marginBottom:`80px`}}),E1=class extends F.Component{constructor(e){super(e),this.state={titleHeight:0},this.resizeObserver=null}static propTypes={title:P.string,children:N$,defineChart:P.bool,disabledLabels:P.bool,disabledTitle:P.bool,graphProps:I$.isRequired,isChart:P.bool,labels:P.object,labelsPlaceholders:P.object,onChangeTitle:P.func,onMouseMove:P.func,showLabels:P.bool,showTitle:P.bool,showPixelGuides:P.bool,rootRef:P.func,onChangeLabels:P.func,titlePlaceholder:P.string,mathMlOptions:P.object,labelsCharactersLimit:P.number};mouseMove=(e,t)=>{let{graphProps:n,onMouseMove:r}=this.props;if(!r)return;let{scale:i,snap:a}=n,o=kl(t,e.node()),s=i.x.invert(o[0]),c=i.y.invert(o[1]);r({x:a.x(s),y:a.y(c)})};componentDidMount(){let e=Dl(this.g);e.on(`mousemove`,this.mouseMove.bind(this,e)),this.measureTitleHeight(),this.setupVisibilityObserver()}componentWillUnmount(){Dl(this.g).on(`mousemove`,null),this.cleanupVisibilityObserver()}componentDidUpdate(e){e.title!==this.props.title&&this.measureTitleHeight()}onChangeLabel=(e,t)=>{let{labels:n,onChangeLabels:r,isChart:i}=this.props;if(r){if(i){r(t===`left`?`range`:`domain`,e);return}r({...n,[t]:e})}};measureTitleHeight=()=>{let e=this.titleRef;if(e){let t=e.clientHeight;this.setState({titleHeight:t,prevTitle:this.props.title}),!this.resizeObserver&&typeof ResizeObserver<`u`&&this.setupVisibilityObserver()}};handleKeyDown=()=>{setTimeout(()=>{this.measureTitleHeight()},0)};setupVisibilityObserver=()=>{typeof ResizeObserver<`u`&&this.titleRef&&(this.resizeObserver=new ResizeObserver(e=>{for(let t of e){let{width:e,height:n}=t.contentRect;if(e>0&&n>0){setTimeout(()=>{this.measureTitleHeight()},10);break}}}),this.resizeObserver.observe(this.titleRef))};cleanupVisibilityObserver=()=>{this.resizeObserver&&=(this.resizeObserver.disconnect(),null)};render(){let{disabledTitle:e,disabledLabels:t,labels:n,labelsPlaceholders:r,titlePlaceholder:i,graphProps:a,children:o,defineChart:s,onChangeTitle:c,isChart:l,showLabels:u,showPixelGuides:d,showTitle:f,title:p,rootRef:m,mathMlOptions:h={},labelsCharactersLimit:g}=this.props,{size:{width:_=500,height:v=500},domain:y,range:b}=a,x=Z$(Y$(n?.left))&&X$(r)?48:70,S=Z$(Y$(n?.right))&&X$(r)?48:70,C=_+x+S+(y.padding||0)*2,w=v+80+(b.padding||0)*2,T=[`bold`,`italic`,`underline`,`superscript`,`subscript`,`strikethrough`,`math`],E=s&&d?v-160:v,D=parseInt(_/100),O=parseInt(E/100),k=parseInt(E%100),{titleHeight:A}=this.state;return(0,I.jsxs)(h1,{children:[d&&(0,I.jsx)(S1,{style:{marginLeft:l?80:u?30:10},children:[...Array(D+1).keys()].map(e=>(0,I.jsx)(u1,{false:!0,children:(0,I.jsxs)(C1,{children:[(0,I.jsxs)(`div`,{children:[e*100,`px`]}),(0,I.jsx)(`div`,{children:`|`})]})},`top-guide-${e}`))}),f&&(e?(0,I.jsx)(`div`,{ref:e=>this.titleRef=e,style:{...l&&{width:C},...Z$(Y$(p))&&{display:`none`}},children:l?(0,I.jsx)(x1,{className:`disabledTitle`,dangerouslySetInnerHTML:{__html:p||``}}):(0,I.jsx)(b1,{className:`disabledTitle`,dangerouslySetInnerHTML:{__html:p||``}})}):(0,I.jsx)(`div`,{ref:e=>this.titleRef=e,children:l?(0,I.jsx)(x1,{className:d?`rightMargin`:``,children:(0,I.jsx)(D$,{...l&&{width:C},markup:p||``,onChange:c,placeholder:s&&i||!e&&`Click here to add a title for this graph`,toolbarOpts:{noPadding:!0,noBorder:!0},activePlugins:T,disableScrollbar:!0,onKeyDown:this.handleKeyDown})}):(0,I.jsx)(b1,{className:d?`rightMargin`:``,children:(0,I.jsx)(D$,{...l&&{width:C},markup:p||``,onChange:c,placeholder:s&&i||!e&&`Click here to add a title for this graph`,toolbarOpts:{noPadding:!0,noBorder:!0},activePlugins:T,disableScrollbar:!0,onKeyDown:this.handleKeyDown})})})),u&&!l&&(0,I.jsx)(s1,{side:`top`,text:n.top,disabledLabel:t,placeholder:r?.top,graphHeight:w,graphWidth:C,onChange:e=>this.onChangeLabel(e,`top`),mathMlOptions:h,preventNewLines:!0,charactersLimit:g}),(0,I.jsxs)(g1,{children:[u&&(0,I.jsx)(s1,{side:`left`,text:n.left,disabledLabel:t,placeholder:r?.left,graphHeight:w,graphWidth:C,isChartLeftLabel:l&&!s,isDefineChartLeftLabel:l&&s,onChange:e=>this.onChangeLabel(e,`left`),mathMlOptions:h,preventNewLines:!0,charactersLimit:g}),s?(0,I.jsx)(_1,{width:C,height:w,children:(0,I.jsx)(y1,{ref:e=>{this.g=e,m&&m(e)},transform:`translate(${x+(y.padding||0)}, ${40+(b.padding||0)})`,children:o})}):(0,I.jsx)(v1,{width:C,height:w,children:(0,I.jsx)(y1,{ref:e=>{this.g=e,m&&m(e)},transform:`translate(${x+(y.padding||0)}, ${40+(b.padding||0)})`,children:o})}),u&&!l&&(0,I.jsx)(s1,{side:`right`,text:n.right,disabledLabel:t,placeholder:r?.right,graphHeight:w,graphWidth:C,onChange:e=>this.onChangeLabel(e,`right`),mathMlOptions:h,preventNewLines:!0,charactersLimit:g}),d&&(0,I.jsx)(w1,{style:{paddingTop:k,marginTop:31},children:[...Array(O+1).keys()].reverse().map(e=>(0,I.jsx)(u1,{false:!0,children:(0,I.jsxs)(T1,{children:[`━ `,e*100,`px`]})},`top-guide-${e}`))})]}),u&&(0,I.jsx)(s1,{side:`bottom`,text:n.bottom,disabledLabel:t,placeholder:r?.bottom,graphHeight:w,graphWidth:C,titleHeight:A,isChartBottomLabel:l&&!s,isDefineChartBottomLabel:l&&s,onChange:e=>this.onChangeLabel(e,`bottom`),mathMlOptions:h,preventNewLines:!0,charactersLimit:g})]})}};function D1(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function O1(e){return typeof e==`function`||Object.prototype.toString.call(e)===`[object Function]`}function k1(e){return typeof e==`number`&&!isNaN(e)}function A1(e){return parseInt(e,10)}function j1(e,t,n){if(e[t])return Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`)}var M1=[`Moz`,`Webkit`,`O`,`ms`];function N1(e=`transform`){if(typeof window>`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;n<M1.length;n++)if(P1(e,M1[n])in t)return M1[n];return``}function P1(e,t){return t?`${t}${F1(e)}`:e}function F1(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}var I1=N1(),L1=``;function R1(e,t){L1||=D1([`matches`,`webkitMatchesSelector`,`mozMatchesSelector`,`msMatchesSelector`,`oMatchesSelector`],function(t){return O1(e[t])})??``;let n=e[L1];return O1(n)?!!n.call(e,t):!1}function z1(e,t,n){let r=e;do{if(R1(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function B1(e,t,n,r){if(!e)return;let i={capture:!0,...r},a=n;e.addEventListener?e.addEventListener(t,a,i):e.attachEvent?e.attachEvent(`on`+t,a):e[`on`+t]=a}function V1(e,t,n,r){if(!e)return;let i={capture:!0,...r},a=n;e.removeEventListener?e.removeEventListener(t,a,i):e.detachEvent?e.detachEvent(`on`+t,a):e[`on`+t]=null}function H1(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=A1(n.borderTopWidth),t+=A1(n.borderBottomWidth),t}function U1(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=A1(n.borderLeftWidth),t+=A1(n.borderRightWidth),t}function W1(e){let t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=A1(n.paddingTop),t-=A1(n.paddingBottom),t}function G1(e){let t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=A1(n.paddingLeft),t-=A1(n.paddingRight),t}function K1(e,t,n){let r=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect();return{x:(e.clientX+t.scrollLeft-r.left)/n,y:(e.clientY+t.scrollTop-r.top)/n}}function q1(e,t){let n=Y1(e,t,`px`);return{[P1(`transform`,I1)]:n}}function J1(e,t){return Y1(e,t,``)}function Y1({x:e,y:t},n,r){let i=`translate(${e}${r},${t}${r})`;return n&&(i=`translate(${`${typeof n.x==`string`?n.x:n.x+r}`}, ${`${typeof n.y==`string`?n.y:n.y+r}`})`+i),i}function X1(e,t){return e.targetTouches&&D1(e.targetTouches,e=>t===e.identifier)||e.changedTouches&&D1(e.changedTouches,e=>t===e.identifier)}function Z1(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Q1(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function $1(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??Q1();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
358
358
|
`,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
359
|
-
`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&n0(e.body,`react-draggable-transparent-selection`)}function e0(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{t0(e)}):t0(e)}function t0(e){if(e)try{e.body&&r0(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function n0(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function r0(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function i0(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:d0(r);let i=f0(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+A1(s.paddingLeft)+A1(o.marginLeft),top:-i.offsetTop+A1(s.paddingTop)+A1(o.marginTop),right:G1(a)-U1(i)-i.offsetLeft+A1(s.paddingRight)-A1(o.marginRight),bottom:W1(a)-H1(i)-i.offsetTop+A1(s.paddingBottom)-A1(o.marginBottom)}}return k1(r.right)&&(t=Math.min(t,r.right)),k1(r.bottom)&&(n=Math.min(n,r.bottom)),k1(r.left)&&(t=Math.max(t,r.left)),k1(r.top)&&(n=Math.max(n,r.top)),[t,n]}function a0(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function o0(e){return e.props.axis===`both`||e.props.axis===`x`}function s0(e){return e.props.axis===`both`||e.props.axis===`y`}function c0(e,t,n){let r=typeof t==`number`?X1(e,t):null;if(typeof t==`number`&&!r)return null;let i=f0(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return K1(r||e,a,n.props.scale)}function l0(e,t,n){let r=!k1(e.lastX),i=f0(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function u0(e,t){let 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}}function d0(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function f0(e){let t=e.findDOMNode();if(!t)throw Error(`<DraggableCore>: Unmounted during event!`);return t}var p0=typeof process<`u`&&process.env.DRAGGABLE_DEBUG?console.log.bind(console):function(){},m0={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},h0=m0.mouse,g0=class extends F.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(`<DraggableCore> not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!z1(e.target,this.props.handle,t)||this.props.cancel&&z1(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=Z1(e);this.touchIdentifier=r;let i=c0(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=l0(this,a,o);p0(`DraggableCore: handleDragStart: %j`,s),p0(`calling`,this.props.onStart),!(this.props.onStart(e,s)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&$1(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,B1(n,h0.move,this.handleDrag),B1(n,h0.stop,this.handleDragStop))},this.handleDrag=e=>{let t=c0(e,this.touchIdentifier,this);if(t==null)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]=a0(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=l0(this,n,r);if(p0(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=c0(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=a0(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=l0(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&e0(a.ownerDocument),p0(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(p0(`DraggableCore: Removing handlers`),V1(a.ownerDocument,h0.move,this.handleDrag),V1(a.ownerDocument,h0.stop,this.handleDragStop))},this.onMouseDown=e=>(h0=m0.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(h0=m0.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(h0=m0.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(h0=m0.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&B1(e,m0.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;V1(t,m0.mouse.move,this.handleDrag),V1(t,m0.touch.move,this.handleDrag),V1(t,m0.mouse.stop,this.handleDragStop),V1(t,m0.touch.stop,this.handleDragStop),V1(e,m0.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&e0(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Au.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(p0(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return F.cloneElement(F.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};g0.displayName=`DraggableCore`,g0.propTypes={allowAnyClick:P.bool,allowMobileScroll:P.bool,children:P.node.isRequired,disabled:P.bool,enableUserSelectHack:P.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:P.arrayOf(P.number),handle:P.string,cancel:P.string,nodeRef:P.object,nonce:P.string,onStart:P.func,onDrag:P.func,onStop:P.func,onMouseDown:P.func,scale:P.number,className:j1,style:j1,transform:j1},g0.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var _0=class extends F.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(p0(`Draggable: onDragStart: %j`,t),this.props.onStart(e,u0(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;p0(`Draggable: onDrag: %j`,t);let n=u0(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=i0(this,r.x,r.y);r.x=i,r.y=a,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(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,u0(this,t))===!1)return!1;p0(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{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.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(p0(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Au.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,p=!s||this.state.dragging,m=s||r,h={x:o0(this)&&p?this.state.x:m.x,y:s0(this)&&p?this.state.y:m.y};this.state.isElementSVG?f=J1(h,c):d=q1(h,c);let g=F.Children.only(n),_=L(g.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return F.createElement(g0,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},F.cloneElement(g,{className:_,style:{...g.props.style,...d},transform:f}))}};_0.displayName=`Draggable`,_0.propTypes={...g0.propTypes,axis:P.oneOf([`both`,`x`,`y`,`none`]),bounds:P.oneOfType([P.shape({left:P.number,right:P.number,top:P.number,bottom:P.number}),P.string,P.oneOf([!1])]),defaultClassName:P.string,defaultClassNameDragging:P.string,defaultClassNameDragged:P.string,defaultPosition:P.shape({x:P.number,y:P.number}),positionOffset:P.shape({x:P.oneOfType([P.number,P.string]),y:P.oneOfType([P.number,P.string])}),position:P.shape({x:P.number,y:P.number}),className:j1,style:j1,transform:j1},_0.defaultProps={...g0.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var v0=Bp(`pie-lib:plot:grid-draggable`),y0=(e,t,n)=>r=>{let i=r+e(0);return t(n+e.invert(i)).toFixed(4)*1e3/1e3},b0=e=>t=>((0,B$.default)(!!e&&Ss(e.fromDelta)&&Ss(e.bounds)&&Ss(e.anchorPoint),`You must supply an object with: { anchorPoint: Function, fromDelta: Function, bounds: Function }`),class extends F.Component{static propTypes={disabled:P.bool,onDragStart:P.func,onDrag:P.func,onDragStop:P.func,onClick:P.func,onMove:P.func,graphProps:I$.isRequired};constructor(e){super(e),this.state={startX:null,startY:null}}grid=()=>{let{graphProps:e}=this.props,{scale:t,domain:n,range:r}=e;return{x:t.x(n.step)-t.x(0),y:t.y(r.step)-t.y(0)}};onStart=e=>{let{onDragStart:t}=this.props;document.activeElement&&document.activeElement.blur(),this._didDrag=!1,this.setState({startX:e.clientX,startY:e.clientY});let n=e.target,r=e=>{n.removeEventListener(`click`,r,!0),this._didDrag&&(e.stopPropagation(),e.preventDefault())};n.addEventListener(`click`,r,!0),t&&t()};position=()=>{let{x:t,y:n}=e.anchorPoint(this.props),{graphProps:r}=this.props,{scale:i,snap:a}=r;return{anchorPoint:{x:t,y:n},x:y0(i.x,a.x,t),y:y0(i.y,a.y,n)}};tiny=(e,t)=>{let n=e.toUpperCase(),r=Math.abs(t[`client${n}`]-this.state[`start${n}`]),i=r<Math.abs(this.grid()[e])/10;return v0(`[tiny] key: `,e,`delta: `,r,`out: `,i),i};getScaledBounds=()=>{let t=e.bounds(this.props,this.props.graphProps);v0(`bounds: `,t);let n=this.grid(),r={left:t.left*n.x,right:t.right*n.x,top:t.top*n.y,bottom:t.bottom*n.y},i=Math.abs(n.y);return r={...r,top:Math.min(0,r.top)-i,bottom:Math.abs(r.bottom)+i},v0(`[getScaledBounds]: `,r),r};getClientPoint=(e,t)=>{if(!e||!t)return null;let n=e.ownerSVGElement||e;if(n&&n.createSVGPoint){let r=n.createSVGPoint();if(t.touches&&t.touches.length>0){let e=t.touches[0];r.x=e.clientX,r.y=e.clientY}else r.x=t.clientX,r.y=t.clientY;return e.getScreenCTM?(r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]):null}let r=e.getBoundingClientRect();return r?[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]:null};skipDragOutsideOfBounds=(e,t,n)=>{let r=n.getRootNode(),i=this.getClientPoint(r,t);if(i===null)return!0;let[a,o]=i,{scale:s,domain:c,range:l}=n,u=s.x.invert(a),d=s.y.invert(o),f=e.deltaX>0&&u<c.min||e.deltaX<0&&u>c.max,p=e.deltaY>0&&d>l.max||e.deltaY<0&&d<l.min;return f||p};onDrag=(e,t)=>{let{onDrag:n,graphProps:r,disabled:i}=this.props;if((Math.abs(t.deltaX)>1||Math.abs(t.deltaY)>1)&&(this._didDrag=!0),!n||i)return;let a=this.getScaledBounds();if(t.deltaX<0&&t.deltaX<a.left||t.deltaX>0&&t.deltaX>a.right||t.deltaY<0&&t.deltaY<a.top||t.deltaY>0&&t.deltaY>a.bottom||this.skipDragOutsideOfBounds(t,e,r))return;let o=this.applyDelta({x:t.deltaX,y:t.deltaY});(o!==void 0||o!==null)&&n(o)};getDelta=e=>{let t=this.position(),n={x:t.x(e.x),y:t.y(e.y)};return q$(t.anchorPoint,n)};applyDelta=t=>{let n=this.getDelta(t);return v0(`[applyDelta] delta:`,n),e.fromDelta(this.props,n)};onStop=(e,t)=>{v0(`[onStop] dd:`,t);let{onDragStop:n,onClick:r,disabled:i}=this.props;if(n&&!i&&n(),v0(`[onStop] lastX/Y: `,t.lastX,t.lastY),!this._didDrag){if(!i&&typeof e?.stopPropagation==`function`&&e.stopPropagation(),r){v0(`call onClick`),this.setState({startX:null,startY:null});let{graphProps:t}=this.props,{scale:n,snap:i}=t;try{let[t,a]=kl(e,e.target),o=n.x.invert(t),s=n.y.invert(a);o=i.x(o),s=i.y(s),r({x:o,y:s})}catch{r({})}}this.setState({startX:null,startY:null});return}this.setState({startX:null,startY:null})};render(){let{disabled:n,onClick:r,...i}=this.props,a=this.grid(),o=e=>e.nativeEvent.preventDefault(),s=this.state?!!this.state.startX:!1;return(0,I.jsx)(g0,{onMouseDown:o,onStart:this.onStart,onDrag:this.onDrag,onStop:this.onStop,axis:e.axis||`both`,grid:[a.x,a.y],children:(0,I.jsx)(t,{...i,disabled:n,isDragging:s,onClick:s?void 0:r})})}}),x0=Bp(`pie-lib:plot:trig`),S0=e=>180/Math.PI*e,C0=e=>Math.PI/180*e,w0=(e,t)=>{let n=t.y-e.y,r=t.x-e.x;x0(e,t,`vd: `,n,`hd: `,r);let i=Math.atan2(n,r);return i<0?i+Math.PI*2:i},T0=Math.PI/2;Math.PI+T0;var E0=(e,t)=>Math.abs(e/Math.sin(t)),D0=(e,t)=>(n,r)=>[A0(V$(n.x<r.x?e.max:e.min,n.y<r.y?t.max:t.min),n,r),A0(V$(r.x<n.x?e.max:e.min,r.y<n.y?t.max:t.min),r,n)],O0=(e,t)=>(x0(`[getOpposingSide] hyp: `,e,`angle:`,t),Math.abs(e*Math.sin(t))),k0=(e,t)=>{if(Number.isFinite(e)&&Number.isFinite(t))return e===0&&t>0?`y`:t===0&&e>0||e<t?`x`:`y`;if(isNaN(e)&&!isNaN(t))return`y`;if(!isNaN(e)&&isNaN(t))return`x`;if(e===1/0)return`y`;if(t===1/0)return`x`;console.warn(`hypotenuse - which is shorter? x:`,e,`y:`,t)},A0=(e,t,n)=>{let r=x0.enabled?x0.bind(x0,`diffEdge: [${t.x},${t.y} -> ${n.x},${n.y}]`):()=>{},i=w0(t,n);r(`x angle`,S0(i));let a=Math.abs(i-C0(90));r(`y angle`,S0(a));let o=Math.abs(t.x-e.x),s=E0(o,a),c=Math.abs(t.y-e.y),l=E0(c,i);r(`x: side`,o,`h:`,s),r(`y: side`,c,`h:`,l);let u=k0(s,l);if(u!==`x`&&u!==`y`)throw Error(`Cant decide which hypotenuse to use`);let d=u===`x`?new z$(o,O0(s,i)):new z$(O0(l,a),c);r(`point:`,d);let f=new z$(n.x<t.x?-1:1,n.y<t.y?-1:1);r(`multiplier:`,f);let p=d.multByPoint(f);r(`out:`,p);let m=p.add(new z$(t.x,t.y));return r(`normalized:`,m),m};function j0(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function M0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function N0(e){let t,n,r;e.length===2?(t=e===j0||e===M0?e:P0,n=e,r=e):(t=j0,n=(t,n)=>j0(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function P0(){return 0}function F0(e){return e===null?NaN:+e}var I0=N0(j0),L0=I0.right;I0.left,N0(F0).center;var R0=Math.sqrt(50),z0=Math.sqrt(10),B0=Math.sqrt(2);function V0(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=R0?10:a>=z0?5:a>=B0?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?V0(e,t,n*2):[s,c,l]}function H0(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?V0(t,e,n):V0(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function U0(e,t,n){return t=+t,e=+e,n=+n,V0(e,t,n)[2]}function W0(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?U0(t,e,n):U0(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function G0(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function K0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function q0(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function J0(){}var Y0=.7,X0=1/Y0,Z0=`\\s*([+-]?\\d+)\\s*`,Q0=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,$0=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,e2=/^#([0-9a-f]{3,8})$/,t2=RegExp(`^rgb\\(${Z0},${Z0},${Z0}\\)$`),n2=RegExp(`^rgb\\(${$0},${$0},${$0}\\)$`),r2=RegExp(`^rgba\\(${Z0},${Z0},${Z0},${Q0}\\)$`),i2=RegExp(`^rgba\\(${$0},${$0},${$0},${Q0}\\)$`),a2=RegExp(`^hsl\\(${Q0},${$0},${$0}\\)$`),o2=RegExp(`^hsla\\(${Q0},${$0},${$0},${Q0}\\)$`),s2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};K0(J0,f2,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:c2,formatHex:c2,formatHex8:l2,formatHsl:u2,formatRgb:d2,toString:d2});function c2(){return this.rgb().formatHex()}function l2(){return this.rgb().formatHex8()}function u2(){return T2(this).formatHsl()}function d2(){return this.rgb().formatRgb()}function f2(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=e2.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?p2(t):n===3?new _2(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?m2(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?m2(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=t2.exec(e))?new _2(t[1],t[2],t[3],1):(t=n2.exec(e))?new _2(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=r2.exec(e))?m2(t[1],t[2],t[3],t[4]):(t=i2.exec(e))?m2(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=a2.exec(e))?w2(t[1],t[2]/100,t[3]/100,1):(t=o2.exec(e))?w2(t[1],t[2]/100,t[3]/100,t[4]):s2.hasOwnProperty(e)?p2(s2[e]):e===`transparent`?new _2(NaN,NaN,NaN,0):null}function p2(e){return new _2(e>>16&255,e>>8&255,e&255,1)}function m2(e,t,n,r){return r<=0&&(e=t=n=NaN),new _2(e,t,n,r)}function h2(e){return e instanceof J0||(e=f2(e)),e?(e=e.rgb(),new _2(e.r,e.g,e.b,e.opacity)):new _2}function g2(e,t,n,r){return arguments.length===1?h2(e):new _2(e,t,n,r??1)}function _2(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}K0(_2,g2,q0(J0,{brighter(e){return e=e==null?X0:X0**+e,new _2(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Y0:Y0**+e,new _2(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _2(S2(this.r),S2(this.g),S2(this.b),x2(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:v2,formatHex:v2,formatHex8:y2,formatRgb:b2,toString:b2}));function v2(){return`#${C2(this.r)}${C2(this.g)}${C2(this.b)}`}function y2(){return`#${C2(this.r)}${C2(this.g)}${C2(this.b)}${C2((isNaN(this.opacity)?1:this.opacity)*255)}`}function b2(){let e=x2(this.opacity);return`${e===1?`rgb(`:`rgba(`}${S2(this.r)}, ${S2(this.g)}, ${S2(this.b)}${e===1?`)`:`, ${e})`}`}function x2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function S2(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function C2(e){return e=S2(e),(e<16?`0`:``)+e.toString(16)}function w2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new D2(e,t,n,r)}function T2(e){if(e instanceof D2)return new D2(e.h,e.s,e.l,e.opacity);if(e instanceof J0||(e=f2(e)),!e)return new D2;if(e instanceof D2)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new D2(o,s,c,e.opacity)}function E2(e,t,n,r){return arguments.length===1?T2(e):new D2(e,t,n,r??1)}function D2(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}K0(D2,E2,q0(J0,{brighter(e){return e=e==null?X0:X0**+e,new D2(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Y0:Y0**+e,new D2(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new _2(A2(e>=240?e-240:e+120,i,r),A2(e,i,r),A2(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new D2(O2(this.h),k2(this.s),k2(this.l),x2(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=x2(this.opacity);return`${e===1?`hsl(`:`hsla(`}${O2(this.h)}, ${k2(this.s)*100}%, ${k2(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function O2(e){return e=(e||0)%360,e<0?e+360:e}function k2(e){return Math.max(0,Math.min(1,e||0))}function A2(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var j2=e=>()=>e;function M2(e,t){return function(n){return e+n*t}}function N2(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function P2(e){return(e=+e)==1?F2:function(t,n){return n-t?N2(t,n,e):j2(isNaN(t)?n:t)}}function F2(e,t){var n=t-e;return n?M2(e,n):j2(isNaN(e)?t:e)}var I2=(function e(t){var n=P2(t);function r(e,t){var r=n((e=g2(e)).r,(t=g2(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=F2(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function L2(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function R2(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function z2(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=J2(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function B2(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function V2(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function H2(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=J2(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var U2=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,W2=new RegExp(U2.source,`g`);function G2(e){return function(){return e}}function K2(e){return function(t){return e(t)+``}}function q2(e,t){var n=U2.lastIndex=W2.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=U2.exec(e))&&(i=W2.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:V2(r,i)})),n=W2.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?K2(c[0].x):G2(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function J2(e,t){var n=typeof t,r;return t==null||n===`boolean`?j2(t):(n===`number`?V2:n===`string`?(r=f2(t))?(t=r,I2):q2:t instanceof f2?I2:t instanceof Date?B2:R2(t)?L2:Array.isArray(t)?z2:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?H2:V2)(e,t)}function Y2(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function X2(e){return function(){return e}}function Z2(e){return+e}var Q2=[0,1];function $2(e){return e}function e4(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:X2(isNaN(t)?NaN:.5)}function t4(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function n4(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=e4(i,r),a=n(o,a)):(r=e4(r,i),a=n(a,o)),function(e){return a(r(e))}}function r4(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=e4(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=L0(e,t,1,r)-1;return a[n](i[n](t))}}function i4(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function a4(){var e=Q2,t=Q2,n=J2,r,i,a,o=$2,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==$2&&(o=t4(e[0],e[n-1])),s=n>2?r4:n4,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),V2))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,Z2),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=Y2,u()},d.clamp=function(e){return arguments.length?(o=e?!0:$2,u()):o!==$2},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function o4(){return a4()($2,$2)}function s4(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function c4(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function l4(e){return e=c4(Math.abs(e)),e?e[1]:NaN}function u4(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function d4(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var f4=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function p4(e){if(!(t=f4.exec(e)))throw Error(`invalid format: `+e);var t;return new m4({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}p4.prototype=m4.prototype;function m4(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}m4.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function h4(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var g4;function _4(e,t){var n=c4(e,t);if(!n)return g4=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(g4=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+c4(e,Math.max(0,t+a-1))[0]}function v4(e,t){var n=c4(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var y4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:s4,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>v4(e*100,t),r:v4,s:_4,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function b4(e){return e}var x4=Array.prototype.map,S4=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function C4(e){var t=e.grouping===void 0||e.thousands===void 0?b4:u4(x4.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?b4:d4(x4.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=p4(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):y4[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=y4[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=h4(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&g4!==void 0?S4[8+g4/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(l4(t)/3)))*3,r=10**-n,i=l((e=p4(e),e.type=`f`,e),{suffix:S4[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var w4,T4,E4;D4({thousands:`,`,grouping:[3],currency:[`$`,``]});function D4(e){return w4=C4(e),T4=w4.format,E4=w4.formatPrefix,w4}function O4(e){return Math.max(0,-l4(Math.abs(e)))}function k4(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(l4(t)/3)))*3-l4(Math.abs(e)))}function A4(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,l4(t)-l4(e))+1}function j4(e,t,n,r){var i=W0(e,t,n),a;switch(r=p4(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=k4(i,o))&&(r.precision=a),E4(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=A4(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=O4(i))&&(r.precision=a-(r.type===`%`)*2);break}return T4(r)}function M4(e){var t=e.domain;return e.ticks=function(e){var n=t();return H0(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return j4(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=U0(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function N4(){var e=o4();return e.copy=function(){return i4(e,N4())},G0.apply(e,arguments),M4(e)}var P4=({min:e,max:t,step:n})=>({step:n,min:parseInt(e/n)*n,max:parseInt(t/n)*n}),F4=(e,t,n,r)=>{(0,B$.default)(e.min<e.max,`domain: min must be less than max`),(0,B$.default)(t.min<t.max,`range: min must be less than max`);let i=P4(e),a=P4(t);return{scale:{x:N4().domain([e.min,e.max]).range([0,n.width]),y:N4().domain([t.max,t.min]).range([0,n.height])},snap:{x:U$.bind(null,i.min,i.max,i.step),y:U$.bind(null,a.min,a.max,a.step)},domain:e,range:t,size:n,getRootNode:r}},I4=l(o(((e,t)=>{(function(){"use strict";var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}))());function L4(e){let{top:t=0,left:n=0,transform:r,className:i,children:a,innerRef:o,...s}=e;return(0,I.jsx)(`g`,{ref:o,className:(0,I4.default)(`visx-group`,i),transform:r||`translate(${n}, ${t})`,...s,children:a})}function R4(e){if((typeof e==`function`||typeof e==`object`&&e)&&`valueOf`in e){let t=e.valueOf();if(typeof t==`number`)return t}return e}function z4(e,t){let n=e;return`ticks`in n?n.ticks(t):n.domain().filter((e,n,r)=>t==null||r.length<=t||n%Math.round((r.length-1)/t)===0)}function B4(e){return e?.toString()}function V4(e){let{from:t={x:0,y:0},to:n={x:1,y:1},fill:r=`transparent`,className:i,innerRef:a,...o}=e,s=t.x===n.x||t.y===n.y;return(0,I.jsx)(`line`,{ref:a,className:(0,I4.default)(`visx-line`,i),x1:t.x,y1:t.y,x2:n.x,y2:n.y,fill:r,shapeRendering:s?`crispEdges`:`auto`,...o})}var H4=o(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}})),U4=o(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}})),W4=o(((e,t)=>{var n=U4();t.exports=r;function r(e,t,n){var r=e;return i(e,t).reduce(function(e,i){return e.replace(i.functionIdentifier+`(`+i.matches.body+`)`,a(i.matches.body,i.functionIdentifier,n,r,t))},e)}function i(e,t){var r=[],i=typeof t==`string`?RegExp(`\\b(`+t+`)\\(`):t;do{var a=i.exec(e);if(!a)return r;if(a[1]===void 0)throw Error(`Missing the first couple of parenthesis to get the function identifier in `+t);var o=a[1],s=a.index,c=n(`(`,`)`,e.substring(s));if(!c||c.start!==a[0].length-1)throw SyntaxError(o+`(): missing closing ')' in the value '`+e+`'`);r.push({matches:c,functionIdentifier:o}),e=c.post}while(i.test(e));return r}function a(e,t,n,i,a){return n(r(e,a,n),t,i)}})),G4=o(((e,t)=>{var n=function(e){this.value=e};n.math={isDegree:!0,acos:function(e){return n.math.isDegree?180/Math.PI*Math.acos(e):Math.acos(e)},add:function(e,t){return e+t},asin:function(e){return n.math.isDegree?180/Math.PI*Math.asin(e):Math.asin(e)},atan:function(e){return n.math.isDegree?180/Math.PI*Math.atan(e):Math.atan(e)},acosh:function(e){return Math.log(e+Math.sqrt(e*e-1))},asinh:function(e){return Math.log(e+Math.sqrt(e*e+1))},atanh:function(e){return Math.log((1+e)/(1-e))},C:function(e,t){var r=1,i=e-t,a=t;a<i&&(a=i,i=t);for(var o=a+1;o<=e;o++)r*=o;return r/n.math.fact(i)},changeSign:function(e){return-e},cos:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.cos(e)},cosh:function(e){return(Math.E**+e+Math.E**(-1*e))/2},div:function(e,t){return e/t},fact:function(e){if(e%1!=0)return`NaN`;for(var t=1,n=2;n<=e;n++)t*=n;return t},inverse:function(e){return 1/e},log:function(e){return Math.log(e)/Math.log(10)},mod:function(e,t){return e%t},mul:function(e,t){return e*t},P:function(e,t){for(var n=1,r=Math.floor(e)-Math.floor(t)+1;r<=Math.floor(e);r++)n*=r;return n},Pi:function(e,t,n){for(var r=1,i=e;i<=t;i++)r*=Number(n.postfixEval({n:i}));return r},pow10x:function(e){for(var t=1;e--;)t*=10;return t},sigma:function(e,t,n){for(var r=0,i=e;i<=t;i++)r+=Number(n.postfixEval({n:i}));return r},sin:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.sin(e)},sinh:function(e){return(Math.E**+e-Math.E**(-1*e))/2},sub:function(e,t){return e-t},tan:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.tan(e)},tanh:function(e){return n.sinha(e)/n.cosha(e)},toRadian:function(e){return e*Math.PI/180},and:function(e,t){return e&t}},n.Exception=function(e){this.message=e},t.exports=n})),K4=o(((e,t)=>{var n=G4();function r(e,t){for(var n=0;n<e.length;n++)e[n]+=t;return e}for(var i=[{token:`sin`,show:`sin`,type:0,value:n.math.sin},{token:`cos`,show:`cos`,type:0,value:n.math.cos},{token:`tan`,show:`tan`,type:0,value:n.math.tan},{token:`pi`,show:`π`,type:3,value:`PI`},{token:`(`,show:`(`,type:4,value:`(`},{token:`)`,show:`)`,type:5,value:`)`},{token:`P`,show:`P`,type:10,value:n.math.P},{token:`C`,show:`C`,type:10,value:n.math.C},{token:` `,show:` `,type:14,value:` `.anchor},{token:`asin`,show:`asin`,type:0,value:n.math.asin},{token:`acos`,show:`acos`,type:0,value:n.math.acos},{token:`atan`,show:`atan`,type:0,value:n.math.atan},{token:`7`,show:`7`,type:1,value:`7`},{token:`8`,show:`8`,type:1,value:`8`},{token:`9`,show:`9`,type:1,value:`9`},{token:`int`,show:`Int`,type:0,value:Math.floor},{token:`cosh`,show:`cosh`,type:0,value:n.math.cosh},{token:`acosh`,show:`acosh`,type:0,value:n.math.acosh},{token:`ln`,show:` ln`,type:0,value:Math.log},{token:`^`,show:`^`,type:10,value:Math.pow},{token:`root`,show:`root`,type:0,value:Math.sqrt},{token:`4`,show:`4`,type:1,value:`4`},{token:`5`,show:`5`,type:1,value:`5`},{token:`6`,show:`6`,type:1,value:`6`},{token:`/`,show:`÷`,type:2,value:n.math.div},{token:`!`,show:`!`,type:7,value:n.math.fact},{token:`tanh`,show:`tanh`,type:0,value:n.math.tanh},{token:`atanh`,show:`atanh`,type:0,value:n.math.atanh},{token:`Mod`,show:` Mod `,type:2,value:n.math.mod},{token:`1`,show:`1`,type:1,value:`1`},{token:`2`,show:`2`,type:1,value:`2`},{token:`3`,show:`3`,type:1,value:`3`},{token:`*`,show:`×`,type:2,value:n.math.mul},{token:`sinh`,show:`sinh`,type:0,value:n.math.sinh},{token:`asinh`,show:`asinh`,type:0,value:n.math.asinh},{token:`e`,show:`e`,type:3,value:`E`},{token:`log`,show:` log`,type:0,value:n.math.log},{token:`0`,show:`0`,type:1,value:`0`},{token:`.`,show:`.`,type:6,value:`.`},{token:`+`,show:`+`,type:9,value:n.math.add},{token:`-`,show:`-`,type:9,value:n.math.sub},{token:`,`,show:`,`,type:11,value:`,`},{token:`Sigma`,show:`Σ`,type:12,value:n.math.sigma},{token:`n`,show:`n`,type:13,value:`n`},{token:`Pi`,show:`Π`,type:12,value:n.math.Pi},{token:`pow`,show:`pow`,type:8,value:Math.pow,numberOfArguments:2},{token:`&`,show:`&`,type:9,value:n.math.and}],a={0:11,1:0,2:3,3:0,4:0,5:0,6:0,7:11,8:11,9:1,10:10,11:0,12:11,13:0,14:-1,15:11},o=0;o<i.length;o++)i[o].precedence=a[i[o].type];var s={0:!0,1:!0,3:!0,4:!0,6:!0,8:!0,9:!0,12:!0,13:!0,14:!0,15:!0},c={0:!0,1:!0,2:!0,3:!0,4:!0,5:!0,6:!0,7:!0,8:!0,9:!0,10:!0,11:!0,12:!0,13:!0,15:!0},l={0:!0,3:!0,4:!0,8:!0,12:!0,13:!0,15:!0},u={},d={0:!0,1:!0,3:!0,4:!0,6:!0,8:!0,12:!0,13:!0,15:!0},f={1:!0},p=[[],`123789456+-*/()^!PCe0.,n &`.split(``),[`pi`,`ln`,`Pi`],[`sin`,`cos`,`tan`,`Del`,`int`,`Mod`,`log`,`pow`],[`asin`,`acos`,`atan`,`cosh`,`root`,`tanh`,`sinh`],[`acosh`,`atanh`,`asinh`,`Sigma`]];function m(e,t,n,r){for(var i=0;i<r;i++)if(e[n+i]!==t[i])return!1;return!0}n.tokenTypes={FUNCTION_WITH_ONE_ARG:0,NUMBER:1,BINARY_OPERATOR_HIGH_PRECENDENCE:2,CONSTANT:3,OPENING_PARENTHESIS:4,CLOSING_PARENTHESIS:5,DECIMAL:6,POSTFIX_FUNCTION_WITH_ONE_ARG:7,FUNCTION_WITH_N_ARGS:8,BINARY_OPERATOR_LOW_PRECENDENCE:9,BINARY_OPERATOR_PERMUTATION:10,COMMA:11,EVALUATED_FUNCTION:12,EVALUATED_FUNCTION_PARAMETER:13,SPACE:14},n.addToken=function(e){for(var t=0;t<e.length;t++){var r=e[t].token.length,o=-1;e[t].type===n.tokenTypes.FUNCTION_WITH_N_ARGS&&e[t].numberOfArguments===void 0&&(e[t].numberOfArguments=2),p[r]=p[r]||[];for(var s=0;s<p[r].length;s++)if(e[t].token===p[r][s]){o=h(p[r][s],i);break}o===-1?(i.push(e[t]),e[t].precedence=a[e[t].type],p.length<=e[t].token.length&&(p[e[t].token.length]=[]),p[e[t].token.length].push(e[t].token)):(i[o]=e[t],e[t].precedence=a[e[t].type])}};function h(e,t){for(var n=0;n<t.length;n++)if(t[n].token===e)return n;return-1}function g(e){for(var t=[],r=e.length,a,o,s,c=0;c<r;c++)if(!(c<r-1&&e[c]===` `&&e[c+1]===` `)){for(a=``,o=e.length-c>p.length-2?p.length-1:e.length-c;o>0;o--)if(p[o]!==void 0)for(s=0;s<p[o].length;s++)m(e,p[o][s],c,o)&&(a=p[o][s],s=p[o].length,o=0);if(c+=a.length-1,a===``)throw new n.Exception(`Can't understand after `+e.slice(c));t.push(i[h(a,i)])}return t}var _={value:n.math.changeSign,type:0,pre:21,show:`-`},v={value:`)`,show:`)`,type:5,pre:0},y={value:`(`,type:4,pre:0,show:`(`};n.lex=function(e,t){"use strict";var i=[y],a=[],o=e,p=s,m=0,h=u,b=``,x;t!==void 0&&n.addToken(t);var S={},C=g(o);for(x=0;x<C.length;x++){var w=C[x];if(w.type===14){if(x>0&&x<C.length-1&&C[x+1].type===1&&(C[x-1].type===1||C[x-1].type===6))throw new n.Exception(`Unexpected Space`);continue}var T=w.token,E=w.type,D=w.value,O=w.precedence,k=w.show,A=i[i.length-1],j;for(j=a.length;j--&&a[j]===0;)if([0,2,3,4,5,9,11,12,13].indexOf(E)!==-1){if(p[E]!==!0)throw new n.Exception(T+` is not allowed after `+b);i.push(v),p=c,h=d,a.pop()}if(p[E]!==!0)throw new n.Exception(T+` is not allowed after `+b);if(h[E]===!0&&(E=2,D=n.math.mul,k=`×`,O=3,--x),S={value:D,type:E,pre:O,show:k,numberOfArguments:w.numberOfArguments},E===0)p=s,h=u,r(a,2),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(2));else if(E===1)A.type===1?(A.value+=D,r(a,1)):i.push(S),p=c,h=l;else if(E===2)p=s,h=u,r(a,2),i.push(S);else if(E===3)i.push(S),p=c,h=d;else if(E===4)r(a,1),m++,p=s,h=u,i.push(S);else if(E===5){if(!m)throw new n.Exception(`Closing parenthesis are more than opening one, wait What!!!`);m--,p=c,h=d,i.push(S),r(a,1)}else if(E===6){if(A.hasDec)throw new n.Exception(`Two decimals are not allowed in one number`);A.type!==1&&(A={value:0,type:1,pre:0},i.push(A)),p=f,r(a,1),h=u,A.value+=D,A.hasDec=!0}else E===7&&(p=c,h=d,r(a,1),i.push(S));E===8?(p=s,h=u,r(a,w.numberOfArguments+2),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(w.numberOfArguments+2))):E===9?(A.type===9?A.value===n.math.add?(A.value=D,A.show=k,r(a,1)):A.value===n.math.sub&&k===`-`&&(A.value=n.math.add,A.show=`+`,r(a,1)):A.type!==5&&A.type!==7&&A.type!==1&&A.type!==3&&A.type!==13?T===`-`&&(p=s,h=u,r(a,2).push(2),i.push(_),i.push(y)):(i.push(S),r(a,2)),p=s,h=u):E===10?(p=s,h=u,r(a,2),i.push(S)):E===11?(p=s,h=u,i.push(S)):E===12?(p=s,h=u,r(a,6),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(6))):E===13&&(p=c,h=d,i.push(S)),r(a,-1),b=T}for(j=a.length;j--;)i.push(v);if(p[5]!==!0)throw new n.Exception(`complete the expression`);for(;m--;)i.push(v);return i.push(v),new n(i)},t.exports=n})),q4=o(((e,t)=>{var n=K4();n.prototype.toPostfix=function(){"use strict";for(var e=[],t,r,i,a,o,s=[{value:`(`,type:4,pre:0}],c=this.value,l=1;l<c.length;l++)if(c[l].type===1||c[l].type===3||c[l].type===13)c[l].type===1&&(c[l].value=Number(c[l].value)),e.push(c[l]);else if(c[l].type===4)s.push(c[l]);else if(c[l].type===5)for(;(r=s.pop()).type!==4;)e.push(r);else if(c[l].type===11){for(;(r=s.pop()).type!==4;)e.push(r);s.push(r)}else{t=c[l],a=t.pre,o=s[s.length-1],i=o.pre;var u=o.value==`Math.pow`&&t.value==`Math.pow`;if(a>i)s.push(t);else{for(;i>=a&&!u||u&&a<i;)r=s.pop(),o=s[s.length-1],e.push(r),i=o.pre,u=t.value==`Math.pow`&&o.value==`Math.pow`;s.push(t)}}return new n(e)},t.exports=n})),J4=o(((e,t)=>{var n=q4();n.prototype.postfixEval=function(e){"use strict";e||={},e.PI=Math.PI,e.E=Math.E;for(var t=[],r,i,a,o=this.value,s=e.n!==void 0,c=0;c<o.length;c++)if(o[c].type===1)t.push({value:o[c].value,type:1});else if(o[c].type===3)t.push({value:e[o[c].value],type:1});else if(o[c].type===0)t[t.length-1].type===void 0?t[t.length-1].value.push(o[c]):t[t.length-1].value=o[c].value(t[t.length-1].value);else if(o[c].type===7)t[t.length-1].type===void 0?t[t.length-1].value.push(o[c]):t[t.length-1].value=o[c].value(t[t.length-1].value);else if(o[c].type===8){for(var l=[],u=0;u<o[c].numberOfArguments;u++)l.push(t.pop().value);t.push({type:1,value:o[c].value.apply(o[c],l.reverse())})}else o[c].type===10?(r=t.pop(),i=t.pop(),i.type===void 0?(i.value=i.concat(r),i.value.push(o[c]),t.push(i)):r.type===void 0?(r.unshift(i),r.push(o[c]),t.push(r)):t.push({type:1,value:o[c].value(i.value,r.value)})):o[c].type===2||o[c].type===9?(r=t.pop(),i=t.pop(),i.type===void 0?(i=i.concat(r),i.push(o[c]),t.push(i)):r.type===void 0?(r.unshift(i),r.push(o[c]),t.push(r)):t.push({type:1,value:o[c].value(i.value,r.value)})):o[c].type===12?(r=t.pop(),r.type!==void 0&&(r=[r]),i=t.pop(),a=t.pop(),t.push({type:1,value:o[c].value(a.value,i.value,new n(r))})):o[c].type===13&&(s?t.push({value:e[o[c].value],type:3}):t.push([o[c]]));if(t.length>1)throw new n.Exception(`Uncaught Syntax error`);return t[0].value>0x38d7ea4c68000?`Infinity`:parseFloat(t[0].value.toFixed(15))},n.eval=function(e,t,n){return t===void 0?this.lex(e).toPostfix().postfixEval():n===void 0?t.length===void 0?this.lex(e).toPostfix().postfixEval(t):this.lex(e,t).toPostfix().postfixEval():this.lex(e,t).toPostfix().postfixEval(n)},t.exports=n})),Y4=o(((e,t)=>{var n=J4();n.prototype.formulaEval=function(){"use strict";for(var e,t,n,r=[],i=this.value,a=0;a<i.length;a++)i[a].type===1||i[a].type===3?r.push({value:i[a].type===3?i[a].show:i[a].value,type:1}):i[a].type===13?r.push({value:i[a].show,type:1}):i[a].type===0?r[r.length-1]={value:i[a].show+(i[a].show==`-`?``:`(`)+r[r.length-1].value+(i[a].show==`-`?``:`)`),type:0}:i[a].type===7?r[r.length-1]={value:(r[r.length-1].type==1?``:`(`)+r[r.length-1].value+(r[r.length-1].type==1?``:`)`)+i[a].show,type:7}:i[a].type===10?(e=r.pop(),t=r.pop(),i[a].show===`P`||i[a].show===`C`?r.push({value:`<sup>`+t.value+`</sup>`+i[a].show+`<sub>`+e.value+`</sub>`,type:10}):r.push({value:(t.type==1?``:`(`)+t.value+(t.type==1?``:`)`)+`<sup>`+e.value+`</sup>`,type:1})):i[a].type===2||i[a].type===9?(e=r.pop(),t=r.pop(),r.push({value:(t.type==1?``:`(`)+t.value+(t.type==1?``:`)`)+i[a].show+(e.type==1?``:`(`)+e.value+(e.type==1?``:`)`),type:i[a].type})):i[a].type===12&&(e=r.pop(),t=r.pop(),n=r.pop(),r.push({value:i[a].show+`(`+n.value+`,`+t.value+`,`+e.value+`)`,type:12}));return r[0].value},t.exports=n})),X4=o(((e,t)=>{var n=H4(),r=W4(),i=Y4(),a=100,o=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,s;t.exports=c;function c(e,t){s=0,t=10**(t===void 0?5:t),e=e.replace(/\n+/g,` `);function c(e,n,r){if(s++>a)throw s=0,Error(`Call stack overflow for `+r);if(e===``)throw Error(n+`(): '`+r+`' must contain a non-whitespace string`);e=u(e,r);var o=l(e);if(o.length>1||e.indexOf(`var(`)>-1)return n+`(`+e+`)`;var c=o[0]||``;c===`%`&&(e=e.replace(/\b[0-9\.]+%/g,function(e){return parseFloat(e.slice(0,-1))*.01}));var d=e.replace(new RegExp(c,`gi`),``),f;try{f=i.eval(d)}catch{return n+`(`+e+`)`}return c===`%`&&(f*=100),(n.length||c===`%`)&&(f=Math.round(f*t)/t),f+=c,f}function u(e,t){e=e.replace(/((?:\-[a-z]+\-)?calc)/g,``);for(var r=``,i=e,a;a=o.exec(i);){a[0].index>0&&(r+=i.substring(0,a[0].index));var s=n(`(`,`)`,i.substring([0].index));if(s.body===``)throw Error(`'`+e+`' must contain a non-whitespace string`);var l=c(s.body,``,t);r+=s.pre+l,i=s.post}return r+i}return r(e,/((?:\-[a-z]+\-)?calc)\(/,c)}function l(e){for(var t=[],n=[],r=/[\.0-9]([%a-z]+)/gi,i=r.exec(e);i;)!i||!i[1]||(n.indexOf(i[1].toLowerCase())===-1&&(t.push(i[1]),n.push(i[1].toLowerCase())),i=r.exec(e));return t}}));function Z4(e,t){let n=new Map;return function(){for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];let o=t(...i);if(n.has(o))return n.get(o);let s=e.apply(this,i);return n.set(o,s),s}}var Q4=`__react_svg_text_measurement_id`;function $4(e,t){if(typeof document>`u`)return null;try{let n=document.getElementById(Q4);if(!n){let e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);e.setAttribute(`aria-hidden`,`true`),e.style.width=`0`,e.style.height=`0`,e.style.position=`absolute`,e.style.top=`-100%`,e.style.left=`-100%`,n=document.createElementNS(`http://www.w3.org/2000/svg`,`text`),n.setAttribute(`id`,Q4),e.appendChild(n),document.body.appendChild(e)}return Object.assign(n.style,t),n.textContent=e,n.getComputedTextLength()}catch{return null}}var e3=Z4($4,(e,t)=>`${e}_${JSON.stringify(t)}`),t3=l(X4());function n3(e){return typeof e==`number`}function r3(e){return typeof e==`number`&&Number.isFinite(e)||typeof e==`string`}function i3(e){let{verticalAnchor:t=`end`,scaleToFit:n=!1,angle:r,width:i,lineHeight:a=`1em`,capHeight:o=`0.71em`,children:s,style:c,...l}=e,{x:u=0,y:d=0}=l,f=!r3(u)||!r3(d),{wordsWithWidth:p,spaceWidth:m}=(0,F.useMemo)(()=>({wordsWithWidth:(s==null?[]:s.toString().split(/(?:(?!\u00A0+)\s+)/)).map(e=>({word:e,wordWidth:e3(e,c)||0})),spaceWidth:e3(`\xA0`,c)||0}),[s,c]),h=(0,F.useMemo)(()=>f?[]:i||n?p.reduce((e,t)=>{let{word:r,wordWidth:a}=t,o=e[e.length-1];if(o&&(i==null||n||(o.width||0)+a+m<i))o.words.push(r),o.width=o.width||0,o.width+=a+m;else{let t={words:[r],width:a};e.push(t)}return e},[]):[{words:s==null?[]:s.toString().split(/(?:(?!\u00A0+)\s+)/)}],[f,i,n,s,p,m]);return{wordsByLines:h,startDy:(0,F.useMemo)(()=>f?``:t===`start`?(0,t3.default)(`calc(${o})`):t===`middle`?(0,t3.default)(`calc(${(h.length-1)/2} * -${a} + (${o} / 2))`):(0,t3.default)(`calc(${h.length-1} * -${a})`),[f,t,o,h.length,a]),transform:(0,F.useMemo)(()=>{let e=[];if(f)return``;if(n3(u)&&n3(d)&&n3(i)&&n&&h.length>0){let t=h[0].width||1,r=n===`shrink-only`?Math.min(i/t,1):i/t,a=r,o=u-r*u,s=d-a*d;e.push(`matrix(${r}, 0, 0, ${a}, ${o}, ${s})`)}return r&&e.push(`rotate(${r}, ${u}, ${d})`),e.length>0?e.join(` `):``},[f,u,d,i,n,h,r])}}var a3={overflow:`visible`};function o3(e){let{dx:t=0,dy:n=0,textAnchor:r=`start`,innerRef:i,innerTextRef:a,verticalAnchor:o,angle:s,lineHeight:c=`1em`,scaleToFit:l=!1,capHeight:u,width:d,...f}=e,{x:p=0,fontSize:m}=f,{wordsByLines:h,startDy:g,transform:_}=i3(e);return(0,I.jsx)(`svg`,{ref:i,x:t,y:n,fontSize:m,style:a3,children:h.length>0?(0,I.jsx)(`text`,{ref:a,transform:_,...f,textAnchor:r,children:h.map((e,t)=>(0,I.jsx)(`tspan`,{x:p,dy:t===0?g:c,children:e.words.join(` `)},t))}):null})}var s3={top:`top`,left:`left`,right:`right`,bottom:`bottom`};function c3(e){let{labelOffset:t,labelProps:n,orientation:r,range:i,tickLabelFontSize:a,tickLength:o}=e,s=r===s3.left||r===s3.top?-1:1,c,l,u;if(r===s3.top||r===s3.bottom){let e=r===s3.bottom&&typeof n.fontSize==`number`?n.fontSize:0;c=(Number(i[0])+Number(i[i.length-1]))/2,l=s*(o+t+a+e)}else c=s*((Number(i[0])+Number(i[i.length-1]))/2),l=-(o+t),u=`rotate(${s*90})`;return{x:c,y:l,transform:u}}function l3(e){let{hideTicks:t,horizontal:n,orientation:r,tickClassName:i,tickComponent:a,tickLabelProps:o,tickStroke:s=`#222`,tickTransform:c,ticks:l,strokeWidth:u,tickLineProps:d}=e;return l.map(e=>{let{value:l,index:f,from:p,to:m,formattedValue:h}=e,g=o[f]??{},_=Math.max(10,typeof g.fontSize==`number`&&g.fontSize||0),v=m.y+(n&&r!==s3.top?_:0);return(0,I.jsxs)(L4,{className:(0,I4.default)(`visx-axis-tick`,i),transform:c,children:[!t&&(0,I.jsx)(V4,{from:p,to:m,stroke:s,strokeWidth:u,strokeLinecap:`square`,...d}),a?a({...g,x:m.x,y:v,formattedValue:h}):(0,I.jsx)(o3,{x:m.x,y:v,...g,children:h})]},`visx-tick-${l}-${f}`)})}var u3={textAnchor:`middle`,fontFamily:`Arial`,fontSize:10,fill:`#222`};function d3(e){let{axisFromPoint:t,axisLineClassName:n,axisToPoint:r,hideAxisLine:i,hideTicks:a,horizontal:o,label:s=``,labelClassName:c,labelOffset:l=14,labelProps:u,orientation:d=s3.bottom,scale:f,stroke:p=`#222`,strokeDasharray:m,strokeWidth:h=1,tickClassName:g,tickComponent:_,tickLineProps:v,tickLabelProps:y,tickLength:b=8,tickStroke:x=`#222`,tickTransform:S,ticks:C,ticksComponent:w=l3}=e,T={...u3,...u},E={...u3,...typeof y==`object`?y:null},D=C.map(e=>{let{value:t,index:n}=e;return typeof y==`function`?y(t,n,C):E}),O=Math.max(10,...D.map(e=>typeof e.fontSize==`number`?e.fontSize:0));return(0,I.jsxs)(I.Fragment,{children:[w({hideTicks:a,horizontal:o,orientation:d,scale:f,tickClassName:g,tickComponent:_,tickLabelProps:D,tickStroke:x,tickTransform:S,ticks:C,strokeWidth:h,tickLineProps:v}),!i&&(0,I.jsx)(V4,{className:(0,I4.default)(`visx-axis-line`,n),from:t,to:r,stroke:p,strokeWidth:h,strokeDasharray:m}),s&&(0,I.jsx)(o3,{className:(0,I4.default)(`visx-axis-label`,c),...c3({labelOffset:l,labelProps:T,orientation:d,range:f.range(),tickLabelFontSize:O,tickLength:b}),...T,children:s})]})}function f3(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`center`,n=e;if(t!==`start`&&`bandwidth`in n){let e=n.bandwidth();return t===`center`&&(e/=2),n.round()&&(e=Math.round(e)),t=>{let r=n(t);return typeof r==`number`?r+e:r}}return e}function p3(e){let t=e;return`tickFormat`in t?t.tickFormat():B4}var m3=class{x=0;y=0;constructor(e){let{x:t=0,y:n=0}=e;this.x=t,this.y=n}value(){return{x:this.x,y:this.y}}toArray(){return[this.x,this.y]}};function h3(e,t){let{x:n,y:r}=e;return new m3(t?{x:n,y:r}:{x:r,y:n})}function g3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return typeof e==`number`?{start:e,end:e}:{start:0,end:0,...e}}function _3(e){let{children:t=d3,axisClassName:n,hideAxisLine:r=!1,hideTicks:i=!1,hideZero:a=!1,innerRef:o,left:s=0,numTicks:c=10,orientation:l=s3.bottom,rangePadding:u=0,scale:d,tickFormat:f,tickLength:p=8,tickValues:m,top:h=0,...g}=e,_=f??p3(d),v=l===s3.left,y=l===s3.top,b=y||l===s3.bottom,x=f3(d),S=v||y?-1:1,C=d.range(),w=g3(u),T=h3({x:Number(C[0])+.5-w.start,y:0},b),E=h3({x:Number(C[C.length-1])+.5+w.end,y:0},b),D=(m??z4(d,c)).filter(e=>!a||e!==0&&e!==`0`).map((e,t)=>({value:e,index:t})),O=D.map(e=>{let{value:t,index:n}=e,r=R4(x(t));return{value:t,index:n,from:h3({x:r,y:0},b),to:h3({x:r,y:p*S},b),formattedValue:_(t,n,D)}});return(0,I.jsx)(L4,{className:(0,I4.default)(`visx-axis`,n),innerRef:o,top:h,left:s,children:t({...g,axisFromPoint:T,axisToPoint:E,hideAxisLine:r,hideTicks:i,hideZero:a,horizontal:b,numTicks:c,orientation:l,rangePadding:u,scale:d,tickFormat:_,tickLength:p,tickPosition:x,tickSign:S,ticks:O})})}var v3=z(`path`)(({theme:e})=>({fill:`var(--arrow-color, ${e.palette.common.black})`})),y3=class extends F.Component{render(){let{x:e,y:t,className:n,scale:r}=this.props,i=this.props.direction||`left`,a=r.x(e),o=r.y(t),s=``,c=(e,t,n)=>`translate(${e}, ${t}) rotate(${n})`;return i===`left`&&(s=c(a-15,o,0)),i===`right`&&(s=c(a+15,o,180)),i===`up`&&(s=c(a,o-15,90)),i===`down`&&(s=c(a,o+15,270)),(0,I.jsx)(v3,{d:`m 0,0 8,-5 0,10 -8,-5`,transform:s,className:n})}};y3.propTypes={y:P.number,x:P.number,direction:P.oneOf([`left`,`right`,`up`,`down`]),className:P.string,scale:P$.isRequired},y3.defaultProps={y:0,x:0,direction:`left`};var b3=G$,x3=K$,S3=()=>0,C3=()=>0,w3=e=>{let t=[],n=0;for(;n>=e.min&&t.indexOf(n)<0;)t.push(n),n=Math.round((n-e.step)*1e4)/1e4;for(n=Math.round(e.step*1e4)/1e4;n<=e.max&&t.indexOf(n)<0;)t.push(n),n=Math.round((n+e.step)*1e4)/1e4;return t?t.filter(t=>t>=e.min&&t<=e.max):[]},T3=e=>e==null||ys(e)?1:e.split(` `).length,E3=e=>(e||``).replace(/<[^>]+>/g,``).split(` `).sort((e,t)=>t.length-e.length)[0].length,D3=e=>e?e*10:0,O3=e=>{let t=vs(e),n={left:t.x,top:t.y,bottom:t.y,right:t.x};return Es(e).reduce((e,t)=>(e.left=Math.min(e.left,t.x),e.top=Math.max(e.top,t.y),e.bottom=Math.min(e.bottom,t.y),e.right=Math.max(e.right,t.x),e),n)},k3=e=>{let t=ps(e);return t.sort((e,t)=>t.x-e.x),{a:t[0],b:t[1]}},A3=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),j3=e=>parseFloat(e.toFixed(4)),M3=(e,t)=>e&&t&&(j3(e.x)===j3(t.x)||j3(e.y)===j3(t.y)),N3=(e,t)=>e&&t&&xs({x:j3(e.x),y:j3(e.y)},{x:j3(t.x),y:j3(t.y)}),P3=(e,t)=>{let{min:n,max:r,step:i}=e;return t/((r-n)/i)},F3=e=>{let{domain:t,range:n,size:{width:r,height:i}}=e;return P3(t,r)<14||P3(n,i)<14},I3=e=>{let{domain:t,range:n,size:{width:r,height:i}}=e,a=P3(t,r),o=P3(n,i),s=t.step/(a/15),c=n.step/(o/15);return{domain:{min:t.min-s,max:t.max+s},range:{min:n.min-c,max:n.max+c}}},L3=e=>(e||[]).sort((e,t)=>e.x-t.x||e.y-t.y),R3=(e,t,n)=>(e.x-t.x)*(n.y-t.y)===(n.x-t.x)*(e.y-t.y),z3=(e,t)=>R3(e.from,t.from,t.to)&&R3(e.to,t.from,t.to),B3=(e,t,n)=>{let{type:r,building:i}=e;if(i)return!1;let a=(t||[]).filter(e=>e.type===r&&!e.building),o=a.findIndex(e=>xs(e,n));return o!==-1&&a.splice(o,1),!!a.find(t=>{if(r===`line`){let{from:n,to:i}=e;return N3(n,t.from)&&N3(i,t.to)||N3(n,t.to)&&N3(i,t.from)||r===`line`&&z3(t,e)}else if(r===`polygon`)return xs(L3(ps(e.points)),L3(ps(t.points)))})},V3=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(Object.keys(r).length!==Object.keys(i).length)return!1;for(let e in r)if(r[e]!==i[e])return!1}return!0};function H3(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function U3(e,t){return!e||H3(e)?e:H3(e.default)?e.default:t&&H3(e[t])?e[t]:t&&H3(e[t]?.default)?e[t].default:e}var W3=U3(Ah,`Readable`)||U3(q3.Readable,`Readable`),G3=og,K3=G3.default,q3=K3&&typeof K3==`object`?K3:G3,J3={includeArrows:P.object,graphProps:P.object},Y3={includeArrows:{left:!0,right:!0,up:!0,down:!0}},X3=z(`g`)(()=>({"& .visx-axis-line":{stroke:`#8a92c0`,strokeWidth:4},"& .visx-axis-tick":{fill:H.BLACK,"& > line":{stroke:`#8a92c0`}}})),Z3=z(`div`)(({theme:e,centered:t})=>({padding:0,margin:0,"* > *":{margin:0,padding:0},"& p":{margin:0},fontSize:e.typography.fontSize,...t&&{textAlign:`center`}})),Q3=z(y3)({fill:`#8a92c0`}),$3={fontFamily:`Roboto`,fontSize:`14px`,cursor:`inherit`},e6=(e,t,n,r,i,a)=>{let o=[];return e===t&&n-i<r&&r<n+i&&n-i<a&&a<n+i&&o.push(e),o},t6=e=>(e||[]).find(e=>e<0),n6=class extends F.Component{static propTypes={...J3,graphProps:I$.isRequired};static defaultProps=Y3;render(){let{includeArrows:e,graphProps:t,columnTicksValues:n,skipValues:r,distanceFromOriginToFirstNegativeY:i,dy:a}=this.props,{scale:o,domain:s,size:c,range:l}=t||{},u=e=>{let t=r&&r[0]===e?i+4:a;return{...$3,textAnchor:`middle`,y:t,dx:e===0?-10:0,dy:e===0?-7:0}},d=T3(s.axisLabel),f=D3(E3(s.axisLabel))+2;return(0,I.jsxs)(X3,{children:[(0,I.jsx)(_3,{scale:o.x,top:o.y(0),left:0,label:s.label,rangePadding:8,tickFormat:e=>e,tickLabelProps:u,tickValues:n,hideZero:!(s.labelStep||l.labelStep)&&s.min<=0}),e&&e.left&&(0,I.jsx)(Q3,{direction:`left`,x:s.min,y:0,scale:o}),e&&e.right&&(0,I.jsx)(Q3,{direction:`right`,x:s.max,y:0,scale:o}),s.axisLabel&&(0,I.jsx)(`foreignObject`,{x:c.width+17,y:o.y(0)-9,width:f,height:20*d,children:(0,I.jsx)(W3,{false:!0,children:(0,I.jsx)(Z3,{dangerouslySetInnerHTML:{__html:s.axisLabel}})})})]})}},r6=class extends F.Component{static propTypes={...J3,graphProps:I$.isRequired};static defaultProps=Y3;render(){let{includeArrows:e,graphProps:t,skipValues:n,rowTickValues:r}=this.props,{scale:i,range:a,size:o}=t||{},s=a.axisLabel?D3(a.axisLabel.length):0;return(0,I.jsxs)(X3,{children:[(0,I.jsx)(_3,{orientation:`left`,scale:i.y,top:0,height:o.height,left:i.x(0),label:a.label,labelProps:{"data-pie-readable":!1},rangePadding:8,tickLength:10,tickFormat:e=>n&&n.indexOf(e)>=0?``:e,tickLabelProps:e=>{let t=e.toLocaleString().replace(/[.-]/g,``).length||1;return{...$3,dy:4,dx:-10-t*9,"data-pie-readable":!1}},hideZero:!0,tickTextAnchor:`bottom`,tickValues:r}),e&&e.down&&(0,I.jsx)(Q3,{direction:`down`,x:0,y:a.min,scale:i}),e&&e.up&&(0,I.jsx)(Q3,{direction:`up`,x:0,y:a.max,scale:i}),a.axisLabel&&(0,I.jsx)(`foreignObject`,{x:i.x(0)-s/2,y:-33,width:s,height:`20`,children:(0,I.jsx)(W3,{false:!0,children:(0,I.jsx)(Z3,{centered:!0,dangerouslySetInnerHTML:{__html:a.axisLabel}})})})]})}},i6=class extends F.Component{static propTypes={...J3,graphProps:I$.isRequired};static defaultProps=Y3;xValues=()=>{let{graphProps:e}=this.props,{scale:t,domain:n}=e||{};if(!n||!t)return;let r=w3({...n,step:n.labelStep}),i=t6(r);return{columnTicksValues:r,firstNegativeX:i,distanceFromOriginToFirstNegativeX:Math.abs(t.y(0)-t.y(i))}};yValues=()=>{let{graphProps:e}=this.props,{scale:t,range:n}=e||{};if(!n||!t)return;let r=w3({...n,step:n.labelStep}),i=t6(r);return{rowTickValues:r,firstNegativeY:i,distanceFromOriginToFirstNegativeY:Math.abs(t.x(0)-t.x(i))}};render(){let{graphProps:e}=this.props,{domain:t,range:n}=e||{},{columnTicksValues:r,firstNegativeX:i,distanceFromOriginToFirstNegativeX:a}=this.xValues(),{rowTickValues:o,firstNegativeY:s,distanceFromOriginToFirstNegativeY:c}=this.yValues(),l=e6(i,s,a,c,6,25);return(0,I.jsxs)(X3,{children:[n.min<=0?(0,I.jsx)(n6,{...this.props,skipValues:l,columnTicksValues:r,distanceFromOriginToFirstNegativeY:c,dy:25}):null,t.min<=0?(0,I.jsx)(r6,{...this.props,skipValues:l,rowTickValues:o,distanceFromOriginToFirstNegativeX:a}):null]})}};function a6(e){return`bandwidth`in e?e.bandwidth():0}function o6(e){let{top:t=0,left:n=0,scale:r,width:i,stroke:a=`#eaf0f6`,strokeWidth:o=1,strokeDasharray:s,className:c,children:l,numTicks:u=10,lineStyle:d,offset:f,tickValues:p,...m}=e,h=p??z4(r,u),g=(f??0)+a6(r)/2,_=h.map((e,t)=>{let n=(R4(r(e))??0)+g;return{index:t,from:new m3({x:0,y:n}),to:new m3({x:i,y:n})}});return(0,I.jsx)(L4,{className:(0,I4.default)(`visx-rows`,c),top:t,left:n,children:l?l({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,I.jsx)(V4,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:d,...m},`row-line-${r}`)})})}function s6(e){let{top:t=0,left:n=0,scale:r,height:i,stroke:a=`#eaf0f6`,strokeWidth:o=1,strokeDasharray:s,className:c,numTicks:l=10,lineStyle:u,offset:d,tickValues:f,children:p,...m}=e,h=f??z4(r,l),g=(d??0)+a6(r)/2,_=h.map((e,t)=>{let n=(R4(r(e))??0)+g;return{index:t,from:new m3({x:n,y:0}),to:new m3({x:n,y:i})}});return(0,I.jsx)(L4,{className:(0,I4.default)(`visx-columns`,c),top:t,left:n,children:p?p({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,I.jsx)(V4,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:u,...m},`column-line-${r}`)})})}function c6(e){let{top:t,left:n,xScale:r,yScale:i,width:a,height:o,className:s,stroke:c,strokeWidth:l,strokeDasharray:u,numTicksRows:d,numTicksColumns:f,rowLineStyle:p,columnLineStyle:m,xOffset:h,yOffset:g,rowTickValues:_,columnTickValues:v,...y}=e;return(0,I.jsxs)(L4,{className:(0,I4.default)(`visx-grid`,s),top:t,left:n,children:[(0,I.jsx)(o6,{className:s,scale:i,width:a,stroke:c,strokeWidth:l,strokeDasharray:u,numTicks:d,lineStyle:p,offset:g,tickValues:_,...y}),(0,I.jsx)(s6,{className:s,scale:r,height:o,stroke:c,strokeWidth:l,strokeDasharray:u,numTicks:f,lineStyle:m,offset:h,tickValues:v,...y})]})}var l6=class extends F.Component{static propTypes={disabled:P.bool,disabledAdditionalGrid:P.bool,graphProps:I$.isRequired};getAdditionalGridProps=(e,t)=>{let{graphProps:{scale:n,size:{width:r,height:i},domain:a,range:o}}=this.props,s=w3({...o,step:o.labelStep}).filter(t=>e.includes(t)),c=w3({...a,step:a.labelStep}).filter(e=>t.includes(e)),l=s.length&&Math.min(...s).toString().replace(/[.-]/g,``).length||1,u=s.length&&Math.max(...s).toString().replace(/[.-]/g,``).length||1,d=Math.max(l,u)*9+22,f=n.x(0),p=n.y(0),m=`${f-d} ${d} ${r}`,h=`${p} 28 ${i}`,g=a.labelStep>0&&o.labelStep>0&&s&&c&&s.length>1&&c.length>1&&(s.length!==e.length||c.length!==t.length),_=c.filter(e=>e>=0||f-n.x(e)>d);return{rowTickLabelValues:s.filter(e=>e>=0||n.y(e)-p>28),columnTickLabelValues:_,rowStrokeDasharray:m,columnStrokeDasharray:h,displayAdditionalGrid:g}};render(){let{graphProps:e}=this.props,{scale:t,size:{height:n,width:r},domain:i,range:a}=e,o=w3(a),s=w3(i),{rowTickLabelValues:c,columnTickLabelValues:l,rowStrokeDasharray:u,columnStrokeDasharray:d,displayAdditionalGrid:f}=this.getAdditionalGridProps(o,s),p=i.labelStep*2===i.step||a.labelStep*2===a.step?`#9FA8DA`:`#7985CB`;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(c6,{innerRef:e=>this.grid=e,xScale:t.x,yScale:t.y,width:r,height:n,stroke:`#D3D3D3`,rowTickValues:o,columnTickValues:s}),f&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(o6,{scale:t.y,width:r,tickValues:c,stroke:p,strokeDasharray:u}),(0,I.jsx)(s6,{scale:t.x,height:n,tickValues:l,stroke:p,strokeDasharray:d})]})]})}};function u6(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function d6(e,t){return!e||u6(e)?e:u6(e.default)?e.default:t&&u6(e[t])?e[t]:t&&u6(e[t]?.default)?e[t].default:e}var f6=d6(Ah,`Readable`)||d6(h6.Readable,`Readable`),p6=og,m6=p6.default,h6=m6&&typeof m6==`object`?m6:p6,g6={left:-90,top:0,bottom:0,right:90},_6=(e,t,n)=>{let r=(e,t,n)=>`translate(${e}, ${t}), rotate(${n})`;if(e===`left`)return r(-20,n/2,g6[e]);if(e===`right`)return r(t+30,n/2,g6[e]);if(e===`top`)return r(t/2,-20,g6[e]);if(e===`bottom`)return r(t/2,n+30,g6[e])},v6=(e,t)=>{switch(e){case`left`:case`top`:return-t;case`right`:return-t-10;default:return-t+10}},y6=`Label`,b6={label:`${y6}-label`,axisLabel:`${y6}-axisLabel`,disabledAxisLabel:`${y6}-disabledAxisLabel`,bottomLabel:`${y6}-bottomLabel`},x6=z(`div`)(({theme:e})=>({[`& .${b6.label}`]:{fill:H.SECONDARY},[`& .${b6.axisLabel}`]:{fontSize:e.typography.fontSize-2,textAlign:`center`,padding:`0 4px`},[`& .${b6.disabledAxisLabel}`]:{pointerEvents:`none`},[`& .${b6.bottomLabel}`]:{marginTop:`44px`}})),S6=class extends F.Component{static propTypes={text:P.string,side:P.string,disabledLabel:P.bool,placeholder:P.string,graphProps:I$.isRequired,onChange:P.func,mathMlOptions:P.object};static defaultProps={onChange:()=>{}};render(){let{disabledLabel:e,placeholder:t,text:n,side:r,graphProps:i,onChange:a,mathMlOptions:o={}}=this.props,{size:s,domain:c,range:l}=i,u=(s.height||500)+(l.padding||0)*2,d=(s.width||500)+(c.padding||0)*2,f=_6(r,d,u),p=r===`left`||r===`right`?u:d,m=v6(r,36),h=r===`bottom`?58:54,g=[`bold`,`italic`,`underline`,`strikethrough`,`math`];return(0,I.jsx)(x6,{children:(0,I.jsx)(`foreignObject`,{x:-(p/2),y:m,width:p,height:h,transform:f,textAnchor:`middle`,children:(0,I.jsx)(f6,{children:(0,I.jsx)(D$,{className:L({[b6.bottomLabel]:r===`bottom`,[b6.disabledAxisLabel]:e},b6.axisLabel),markup:n||``,onChange:a,placeholder:!e&&t,toolbarOpts:{position:r===`bottom`?`top`:`bottom`,noPadding:!0,noBorder:!0},activePlugins:g,mathMlOptions:o})})})})}},C6={left:P.string,top:P.string,bottom:P.string,right:P.string};(class extends F.Component{static propTypes={disabledLabels:P.bool,placeholders:P.object,value:P.shape(C6),graphProps:P.object,onChange:P.func,mathMlOptions:P.object};onChangeLabel=(e,t)=>{let{value:n,onChange:r}=this.props;r({...n,[t]:e})};render(){let{disabledLabels:e,placeholders:t={},value:n={},graphProps:r,mathMlOptions:i={}}=this.props;return(0,I.jsx)(I.Fragment,{children:[`left`,`top`,`bottom`,`right`].map(a=>(0,I.jsx)(S6,{side:a,text:n[a],disabledLabel:e,placeholder:t[a],graphProps:r,onChange:e=>this.onChangeLabel(e,a),mathMlOptions:i},a))})}});var w6=class extends F.Component{static propTypes={width:P.number.isRequired,height:P.number.isRequired,onClick:P.func.isRequired,graphProps:I$.isRequired};static defaultProps={};componentDidMount(){let e=Dl(this.rect);e.on(`click`,t=>this.onRectClick(e,t))}shouldComponentUpdate(e){return!J$(this.props.graphProps,e.graphProps)||this.props.width!==e.width||this.props.height!==e.height}getRectPadding=()=>{let{graphProps:e}=this.props;return F3(e)?6:10};onRectClick=(e,t)=>{let{onClick:n,graphProps:r}=this.props,{scale:i}=r,a=this.getRectPadding(),o=kl(t,e.node()),s=i.x.invert(o[0]-a),c=i.y.invert(o[1]-a),l=w3(r.range),u=w3(r.domain),d=(e,t)=>e.length&&e.reduce((e,n)=>Math.abs(n-t)<=Math.abs(e-t)?n:e),f={};u.indexOf(s)>=0&&l.indexOf(c)>=0?(f.x=s,f.y=c):(f.x=d(u,s),f.y=d(l,c)),n(f)};render(){let{width:e,height:t}=this.props,n=this.getRectPadding();return(0,I.jsx)(`rect`,{ref:e=>this.rect=e,transform:`translate(-${n}, -${n})`,fill:`red`,fillOpacity:`0.0`,width:e+n*2,height:t+n*2})}},T6=Bp(`pie-lib:graphing-solution-set:graph`),E6={axesSettings:P.shape(J3),backgroundMarks:P.array,className:P.string,collapsibleToolbar:P.bool,collapsibleToolbarTitle:P.string,disabledLabels:P.bool,disabledTitle:P.bool,domain:k$,labels:P.shape(C6),labelModeEnabled:P.bool,coordinatesOnHover:P.bool,marks:P.array,onChangeLabels:P.func,onChangeMarks:P.func,onChangeTitle:P.func,range:k$,size:P.shape({width:P.number.isRequired,height:P.number.isRequired}),showLabels:P.bool,showPixelGuides:P.bool,showTitle:P.bool,title:P.string,tools:P.array},D6=e=>({x:-23,y:-23,width:e.width+46,height:e.height+46}),O6=({marks:e,currentTool:t})=>{let n=e.filter(e=>e.building)[0],r=ps(e);if(n&&t&&n.type!==t.type){let e=r.findIndex(e=>xs(e,n));e>=0&&r.splice(e,1)}return r},k6=class extends F.Component{constructor(e){super(e),this.maskUid=this.generateMaskId()}static propTypes={...E6,currentTool:P.object};static defaultProps={onChangeMarks:()=>{},disabledLabels:!1,disabledTitle:!1};state={};generateMaskId(){return`graph-`+(Math.random()*1e4).toFixed()}componentDidMount=()=>this.setState({labelNode:this.labelNode});changeMark=(e,t)=>{let{onChangeMarks:n,marks:r,gssLineData:i}=this.props;if(i?.selectedTool===`solutionSet`)return;let a=ps(r),o=a.findIndex(t=>xs(t,e));o>=0&&!B3(t,r,e)&&(a.splice(o,1,t),n(a))};completeMark=e=>{let{currentTool:t,marks:n}=this.props,r=n.filter(e=>e.building)[0];if(!r||!t)return;let i=t.complete(r,e);this.updateMarks(r,i)};updateMarks=(e,t,n=!1)=>{let{onChangeMarks:r,marks:i}=this.props,a=ps(i);if(!t||!t.building&&B3(t,i))return;let o=a.findIndex(t=>xs(t,e));o>=0?(a.splice(o,1,t),r(a)):n&&r([...a,t])};getComponent=e=>{if(!e)return null;let t=(this.props.tools||[]).find(t=>t.type===e.type);return t&&t.Component||null};onBgClick=e=>{let{x:t,y:n}=e||{},{labelModeEnabled:r,currentTool:i,marks:a,gssLineData:o,onSolutionSetSelected:s}=this.props;if(o){if(o.selectedTool===`solutionSet`){s(e);return}if(o.numberOfLines===1&&o.selectedTool===`lineA`&&a.length===1&&!a[0].building||o.numberOfLines===2&&o.selectedTool===`lineA`&&a.length===2||o.numberOfLines===2&&o.selectedTool===`lineA`&&a.length===1&&!a[0].building||o.numberOfLines===2&&o.selectedTool===`lineB`&&a.length===2&&!a[1].building)return}if(r||!i||[null,void 0].includes(t)||[null,void 0].includes(n))return;T6(`[onBgClick] x,y: `,t,n);let c=a.filter(e=>e.building)[0],l;l=c&&i&&c.type===i.type?i.addPoint({x:t,y:n},{...c}):i.addPoint({x:t,y:n},void 0),this.updateMarks(c,l,!0)};render(){let{axesSettings:e,currentTool:t,coordinatesOnHover:n,size:r,disabledLabels:i,disabledTitle:a,domain:o,backgroundMarks:s,range:c,title:l,labels:u,labelModeEnabled:d,labelsPlaceholders:f,showLabels:p,showPixelGuides:m,showTitle:h,titlePlaceholder:g,onChangeLabels:_,onChangeTitle:v,mathMlOptions:y={},gssLineData:b,disabled:x}=this.props,{marks:S}=this.props,C=F4(o,c,r,()=>this.rootNode),w=D6(r),T={graphProps:C,labelModeEnabled:d,gssLineData:b};S=O6({marks:S||[],currentTool:t});let E=S.filter(e=>e.type===`polygon`);b&&b.selectedTool===`solutionSet`&&b.sections.forEach(e=>{if(E.length===0||!V3(e,E[0].points)){let t={type:`polygon`,building:!1,closed:!0,points:e,isSolution:!1};x||S.push(t)}});let D=[];return D.push(...S.filter(e=>e.type===`polygon`)),D.push(...S.filter(e=>e.type===`line`)),(0,I.jsx)(E1,{rootRef:e=>this.rootNode=e,disabledTitle:a,disabledLabels:i,labels:u,labelsPlaceholders:f||{},showPixelGuides:m,showLabels:p,showTitle:h,title:l,titlePlaceholder:g,onChangeTitle:v,onChangeLabels:_,mathMlOptions:y,...T,children:(0,I.jsxs)(`g`,{transform:o&&o.padding&&o.range?`translate(${o.padding}, ${c.padding})`:void 0,children:[(0,I.jsx)(l6,{...T}),(0,I.jsx)(i6,{...e,...T}),(0,I.jsx)(w6,{...r,onClick:this.onBgClick,...T}),(0,I.jsxs)(`mask`,{id:`${this.maskUid}`,children:[(0,I.jsx)(`rect`,{...w,fill:`white`}),` `]}),(0,I.jsxs)(`g`,{id:`marks`,mask:`url('#${this.maskUid}')`,children:[(s||[]).map((e,t)=>{let n=this.getComponent(e),r=e.type;return(0,I.jsx)(n,{mark:{...e,disabled:!0,isBackground:!0},labelNode:this.state.labelNode,onClick:this.onBgClick,...T},`${r}-${t}-bg`)}),D.map((e,r)=>{let i=this.getComponent(e),a=e.type;return(0,I.jsx)(i,{mark:e,coordinatesOnHover:n,onChange:this.changeMark,onComplete:this.completeMark,onClick:this.onBgClick,onDragStart:this.startDrag,onDragStop:this.stopDrag,labelNode:this.state.labelNode,isToolActive:t&&a===t.type,...T},`${a}-${r}`)}),(0,I.jsx)(`foreignObject`,{ref:e=>this.labelNode=e,x:`0`,y:`0`,...r,style:{pointerEvents:`none`,fontSize:`14px`}})]})]})})}},A6=o((e=>{var t=d();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));o(((e,t)=>{t.exports=A6()}))();var j6=Symbol.for(`react.element`),M6=Symbol.for(`react.portal`),N6=Symbol.for(`react.fragment`),P6=Symbol.for(`react.strict_mode`),F6=Symbol.for(`react.profiler`),I6=Symbol.for(`react.consumer`),L6=Symbol.for(`react.context`),R6=Symbol.for(`react.forward_ref`),z6=Symbol.for(`react.suspense`),B6=Symbol.for(`react.suspense_list`),V6=Symbol.for(`react.memo`),H6=Symbol.for(`react.lazy`),U6=R6,W6=V6;function G6(e){if(typeof e==`object`&&e){let{$$typeof:t}=e;switch(t){case j6:switch(e=e.type,e){case N6:case F6:case P6:case z6:case B6:return e;default:switch(e&&=e.$$typeof,e){case L6:case R6:case H6:case V6:return e;case I6:return e;default:return t}}case M6:return t}}}function K6(e){return G6(e)===V6}function q6(e,t,n,r,{areStatesEqual:i,areOwnPropsEqual:a,areStatePropsEqual:o}){let s=!1,c,l,u,d,f;function p(i,a){return c=i,l=a,u=e(c,l),d=t(r,l),f=n(u,d,l),s=!0,f}function m(){return u=e(c,l),t.dependsOnOwnProps&&(d=t(r,l)),f=n(u,d,l),f}function h(){return e.dependsOnOwnProps&&(u=e(c,l)),t.dependsOnOwnProps&&(d=t(r,l)),f=n(u,d,l),f}function g(){let t=e(c,l),r=!o(t,u);return u=t,r&&(f=n(u,d,l)),f}function _(e,t){let n=!a(t,l),r=!i(e,c,t,l);return c=e,l=t,n&&r?m():n?h():r?g():f}return function(e,t){return s?_(e,t):p(e,t)}}function J6(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...i}){return q6(t(e,i),n(e,i),r(e,i),e,i)}function Y6(e,t){let n={};for(let r in e){let i=e[r];typeof i==`function`&&(n[r]=(...e)=>t(i(...e)))}return n}function X6(e){return function(t){let n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function Z6(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Q6(e,t){return function(t,{displayName:n}){let r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e,void 0)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=Z6(e);let i=r(t,n);return typeof i==`function`&&(r.mapToProps=i,r.dependsOnOwnProps=Z6(i),i=r(t,n)),i},r}}function $6(e,t){return(n,r)=>{throw Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function e8(e){return e&&typeof e==`object`?X6(t=>Y6(e,t)):e?typeof e==`function`?Q6(e,`mapDispatchToProps`):$6(e,`mapDispatchToProps`):X6(e=>({dispatch:e}))}function t8(e){return e?typeof e==`function`?Q6(e,`mapStateToProps`):$6(e,`mapStateToProps`):X6(()=>({}))}function n8(e,t,n){return{...n,...e,...t}}function r8(e){return function(t,{displayName:n,areMergedPropsEqual:r}){let i=!1,a;return function(t,n,o){let s=e(t,n,o);return i?r(s,a)||(a=s):(i=!0,a=s),a}}}function i8(e){return e?typeof e==`function`?r8(e):$6(e,`mergeProps`):()=>n8}function a8(e){e()}function o8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){a8(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var s8={notify(){},get:()=>[]};function c8(e,t){let n,r=s8,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=o8())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=s8)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var l8=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,u8=typeof navigator<`u`&&navigator.product===`ReactNative`,d8=l8||u8?F.useLayoutEffect:F.useEffect;function f8(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function p8(e,t){if(f8(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!f8(e[n[r]],t[n[r]]))return!1;return!0}var m8={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},h8={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},g8={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_8={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},v8={[U6]:g8,[W6]:_8};function y8(e){return K6(e)?_8:v8[e.$$typeof]||m8}var b8=Object.defineProperty,x8=Object.getOwnPropertyNames,S8=Object.getOwnPropertySymbols,C8=Object.getOwnPropertyDescriptor,w8=Object.getPrototypeOf,T8=Object.prototype;function E8(e,t){if(typeof t!=`string`){if(T8){let n=w8(t);n&&n!==T8&&E8(e,n)}let n=x8(t);S8&&(n=n.concat(S8(t)));let r=y8(e),i=y8(t);for(let a=0;a<n.length;++a){let o=n[a];if(!h8[o]&&!(i&&i[o])&&!(r&&r[o])){let n=C8(t,o);try{b8(e,o,n)}catch{}}}}return e}var D8=Symbol.for(`react-redux-context`),O8=typeof globalThis<`u`?globalThis:{};function k8(){if(!F.createContext)return{};let e=O8[D8]??=new Map,t=e.get(F.createContext);return t||(t=F.createContext(null),e.set(F.createContext,t)),t}var A8=k8(),j8=[null,null];function M8(e,t,n){d8(()=>e(...t),n)}function N8(e,t,n,r,i,a){e.current=r,n.current=!1,i.current&&(i.current=null,a())}function P8(e,t,n,r,i,a,o,s,c,l,u){if(!e)return()=>{};let d=!1,f=null,p=()=>{if(d||!s.current)return;let e=t.getState(),n,p;try{n=r(e,i.current)}catch(e){p=e,f=e}p||(f=null),n===a.current?o.current||l():(a.current=n,c.current=n,o.current=!0,u())};return n.onStateChange=p,n.trySubscribe(),p(),()=>{if(d=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}function F8(e,t){return e===t}function I8(e,t,n,{pure:r,areStatesEqual:i=F8,areOwnPropsEqual:a=p8,areStatePropsEqual:o=p8,areMergedPropsEqual:s=p8,forwardRef:c=!1,context:l=A8}={}){let u=l,d=t8(e),f=e8(t),p=i8(n),m=!!e;return e=>{let t=e.displayName||e.name||`Component`,n=`Connect(${t})`,r={shouldHandleStateChanges:m,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:d,initMapDispatchToProps:f,initMergeProps:p,areStatesEqual:i,areStatePropsEqual:o,areOwnPropsEqual:a,areMergedPropsEqual:s};function l(t){let[n,i,a]=F.useMemo(()=>{let{reactReduxForwardedRef:e,...n}=t;return[t.context,e,n]},[t]),o=F.useMemo(()=>{let e=u;return n?.Consumer,e},[n,u]),s=F.useContext(o),c=!!t.store&&!!t.store.getState&&!!t.store.dispatch,l=!!s&&!!s.store,d=c?t.store:s.store,f=l?s.getServerState:d.getState,p=F.useMemo(()=>J6(d.dispatch,r),[d]),[h,g]=F.useMemo(()=>{if(!m)return j8;let e=c8(d,c?void 0:s.subscription);return[e,e.notifyNestedSubs.bind(e)]},[d,c,s]),_=F.useMemo(()=>c?s:{...s,subscription:h},[c,s,h]),v=F.useRef(void 0),y=F.useRef(a),b=F.useRef(void 0),x=F.useRef(!1),S=F.useRef(!1),C=F.useRef(void 0);d8(()=>(S.current=!0,()=>{S.current=!1}),[]);let w=F.useMemo(()=>()=>b.current&&a===y.current?b.current:p(d.getState(),a),[d,a]),T=F.useMemo(()=>e=>h?P8(m,d,h,p,y,v,x,S,b,g,e):()=>{},[h]);M8(N8,[y,v,x,a,b,g]);let E;try{E=F.useSyncExternalStore(T,w,f?()=>p(f(),a):w)}catch(e){throw C.current&&(e.message+=`
|
|
359
|
+
`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&n0(e.body,`react-draggable-transparent-selection`)}function e0(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{t0(e)}):t0(e)}function t0(e){if(e)try{e.body&&r0(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function n0(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function r0(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function i0(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:d0(r);let i=f0(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+A1(s.paddingLeft)+A1(o.marginLeft),top:-i.offsetTop+A1(s.paddingTop)+A1(o.marginTop),right:G1(a)-U1(i)-i.offsetLeft+A1(s.paddingRight)-A1(o.marginRight),bottom:W1(a)-H1(i)-i.offsetTop+A1(s.paddingBottom)-A1(o.marginBottom)}}return k1(r.right)&&(t=Math.min(t,r.right)),k1(r.bottom)&&(n=Math.min(n,r.bottom)),k1(r.left)&&(t=Math.max(t,r.left)),k1(r.top)&&(n=Math.max(n,r.top)),[t,n]}function a0(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function o0(e){return e.props.axis===`both`||e.props.axis===`x`}function s0(e){return e.props.axis===`both`||e.props.axis===`y`}function c0(e,t,n){let r=typeof t==`number`?X1(e,t):null;if(typeof t==`number`&&!r)return null;let i=f0(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return K1(r||e,a,n.props.scale)}function l0(e,t,n){let r=!k1(e.lastX),i=f0(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function u0(e,t){let 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}}function d0(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function f0(e){let t=e.findDOMNode();if(!t)throw Error(`<DraggableCore>: Unmounted during event!`);return t}var p0=typeof process<`u`&&process.env.DRAGGABLE_DEBUG?console.log.bind(console):function(){},m0={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},h0=m0.mouse,g0=class extends F.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(`<DraggableCore> not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!z1(e.target,this.props.handle,t)||this.props.cancel&&z1(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=Z1(e);this.touchIdentifier=r;let i=c0(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=l0(this,a,o);p0(`DraggableCore: handleDragStart: %j`,s),p0(`calling`,this.props.onStart),!(this.props.onStart(e,s)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&$1(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,B1(n,h0.move,this.handleDrag),B1(n,h0.stop,this.handleDragStop))},this.handleDrag=e=>{let t=c0(e,this.touchIdentifier,this);if(t==null)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]=a0(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=l0(this,n,r);if(p0(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=c0(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=a0(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=l0(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&e0(a.ownerDocument),p0(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(p0(`DraggableCore: Removing handlers`),V1(a.ownerDocument,h0.move,this.handleDrag),V1(a.ownerDocument,h0.stop,this.handleDragStop))},this.onMouseDown=e=>(h0=m0.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(h0=m0.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(h0=m0.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(h0=m0.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&B1(e,m0.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;V1(t,m0.mouse.move,this.handleDrag),V1(t,m0.touch.move,this.handleDrag),V1(t,m0.mouse.stop,this.handleDragStop),V1(t,m0.touch.stop,this.handleDragStop),V1(e,m0.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&e0(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Au.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(p0(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return F.cloneElement(F.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};g0.displayName=`DraggableCore`,g0.propTypes={allowAnyClick:P.bool,allowMobileScroll:P.bool,children:P.node.isRequired,disabled:P.bool,enableUserSelectHack:P.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:P.arrayOf(P.number),handle:P.string,cancel:P.string,nodeRef:P.object,nonce:P.string,onStart:P.func,onDrag:P.func,onStop:P.func,onMouseDown:P.func,scale:P.number,className:j1,style:j1,transform:j1},g0.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var _0=class extends F.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(p0(`Draggable: onDragStart: %j`,t),this.props.onStart(e,u0(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;p0(`Draggable: onDrag: %j`,t);let n=u0(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=i0(this,r.x,r.y);r.x=i,r.y=a,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(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,u0(this,t))===!1)return!1;p0(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{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.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(p0(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Au.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,p=!s||this.state.dragging,m=s||r,h={x:o0(this)&&p?this.state.x:m.x,y:s0(this)&&p?this.state.y:m.y};this.state.isElementSVG?f=J1(h,c):d=q1(h,c);let g=F.Children.only(n),_=L(g.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return F.createElement(g0,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},F.cloneElement(g,{className:_,style:{...g.props.style,...d},transform:f}))}};_0.displayName=`Draggable`,_0.propTypes={...g0.propTypes,axis:P.oneOf([`both`,`x`,`y`,`none`]),bounds:P.oneOfType([P.shape({left:P.number,right:P.number,top:P.number,bottom:P.number}),P.string,P.oneOf([!1])]),defaultClassName:P.string,defaultClassNameDragging:P.string,defaultClassNameDragged:P.string,defaultPosition:P.shape({x:P.number,y:P.number}),positionOffset:P.shape({x:P.oneOfType([P.number,P.string]),y:P.oneOfType([P.number,P.string])}),position:P.shape({x:P.number,y:P.number}),className:j1,style:j1,transform:j1},_0.defaultProps={...g0.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var v0=Bp(`pie-lib:plot:grid-draggable`),y0=(e,t,n)=>r=>{let i=r+e(0);return t(n+e.invert(i)).toFixed(4)*1e3/1e3},b0=e=>t=>((0,B$.default)(!!e&&Ss(e.fromDelta)&&Ss(e.bounds)&&Ss(e.anchorPoint),`You must supply an object with: { anchorPoint: Function, fromDelta: Function, bounds: Function }`),class extends F.Component{static propTypes={disabled:P.bool,onDragStart:P.func,onDrag:P.func,onDragStop:P.func,onClick:P.func,onMove:P.func,graphProps:I$.isRequired};constructor(e){super(e),this.state={startX:null,startY:null}}grid=()=>{let{graphProps:e}=this.props,{scale:t,domain:n,range:r}=e;return{x:t.x(n.step)-t.x(0),y:t.y(r.step)-t.y(0)}};onStart=e=>{let{onDragStart:t}=this.props;document.activeElement&&document.activeElement.blur(),this._didDrag=!1,this.setState({startX:e.clientX,startY:e.clientY});let n=e.target,r=e=>{n.removeEventListener(`click`,r,!0),this._didDrag&&(e.stopPropagation(),e.preventDefault())};n.addEventListener(`click`,r,!0),t&&t()};position=()=>{let{x:t,y:n}=e.anchorPoint(this.props),{graphProps:r}=this.props,{scale:i,snap:a}=r;return{anchorPoint:{x:t,y:n},x:y0(i.x,a.x,t),y:y0(i.y,a.y,n)}};tiny=(e,t)=>{let n=e.toUpperCase(),r=Math.abs(t[`client${n}`]-this.state[`start${n}`]),i=r<Math.abs(this.grid()[e])/10;return v0(`[tiny] key: `,e,`delta: `,r,`out: `,i),i};getScaledBounds=()=>{let t=e.bounds(this.props,this.props.graphProps);v0(`bounds: `,t);let n=this.grid(),r={left:t.left*n.x,right:t.right*n.x,top:t.top*n.y,bottom:t.bottom*n.y},i=Math.abs(n.y);return r={...r,top:Math.min(0,r.top)-i,bottom:Math.abs(r.bottom)+i},v0(`[getScaledBounds]: `,r),r};getClientPoint=(e,t)=>{if(!e||!t)return null;let n=e.ownerSVGElement||e;if(n&&n.createSVGPoint){let r=n.createSVGPoint();if(t.touches&&t.touches.length>0){let e=t.touches[0];r.x=e.clientX,r.y=e.clientY}else r.x=t.clientX,r.y=t.clientY;return e.getScreenCTM?(r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]):null}let r=e.getBoundingClientRect();return r?[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]:null};skipDragOutsideOfBounds=(e,t,n)=>{let r=n.getRootNode(),i=this.getClientPoint(r,t);if(i===null)return!0;let[a,o]=i,{scale:s,domain:c,range:l}=n,u=s.x.invert(a),d=s.y.invert(o),f=e.deltaX>0&&u<c.min||e.deltaX<0&&u>c.max,p=e.deltaY>0&&d>l.max||e.deltaY<0&&d<l.min;return f||p};onDrag=(e,t)=>{let{onDrag:n,graphProps:r,disabled:i}=this.props;if((Math.abs(t.deltaX)>1||Math.abs(t.deltaY)>1)&&(this._didDrag=!0),!n||i)return;let a=this.getScaledBounds();if(t.deltaX<0&&t.deltaX<a.left||t.deltaX>0&&t.deltaX>a.right||t.deltaY<0&&t.deltaY<a.top||t.deltaY>0&&t.deltaY>a.bottom||this.skipDragOutsideOfBounds(t,e,r))return;let o=this.applyDelta({x:t.deltaX,y:t.deltaY});(o!==void 0||o!==null)&&n(o)};getDelta=e=>{let t=this.position(),n={x:t.x(e.x),y:t.y(e.y)};return q$(t.anchorPoint,n)};applyDelta=t=>{let n=this.getDelta(t);return v0(`[applyDelta] delta:`,n),e.fromDelta(this.props,n)};onStop=(e,t)=>{v0(`[onStop] dd:`,t);let{onDragStop:n,onClick:r,disabled:i}=this.props;if(n&&!i&&n(),v0(`[onStop] lastX/Y: `,t.lastX,t.lastY),!this._didDrag){if(!i&&typeof e?.stopPropagation==`function`&&e.stopPropagation(),r){v0(`call onClick`),this.setState({startX:null,startY:null});let{graphProps:t}=this.props,{scale:n,snap:i}=t;try{let[t,a]=kl(e,e.target),o=n.x.invert(t),s=n.y.invert(a);o=i.x(o),s=i.y(s),r({x:o,y:s})}catch{r({})}}this.setState({startX:null,startY:null});return}this.setState({startX:null,startY:null})};render(){let{disabled:n,onClick:r,...i}=this.props,a=this.grid(),o=e=>(e.nativeEvent||e).preventDefault(),s=this.state?!!this.state.startX:!1;return(0,I.jsx)(g0,{onMouseDown:o,onStart:this.onStart,onDrag:this.onDrag,onStop:this.onStop,axis:e.axis||`both`,grid:[a.x,a.y],children:(0,I.jsx)(t,{...i,disabled:n,isDragging:s,onClick:s?void 0:r})})}}),x0=Bp(`pie-lib:plot:trig`),S0=e=>180/Math.PI*e,C0=e=>Math.PI/180*e,w0=(e,t)=>{let n=t.y-e.y,r=t.x-e.x;x0(e,t,`vd: `,n,`hd: `,r);let i=Math.atan2(n,r);return i<0?i+Math.PI*2:i},T0=Math.PI/2;Math.PI+T0;var E0=(e,t)=>Math.abs(e/Math.sin(t)),D0=(e,t)=>(n,r)=>[A0(V$(n.x<r.x?e.max:e.min,n.y<r.y?t.max:t.min),n,r),A0(V$(r.x<n.x?e.max:e.min,r.y<n.y?t.max:t.min),r,n)],O0=(e,t)=>(x0(`[getOpposingSide] hyp: `,e,`angle:`,t),Math.abs(e*Math.sin(t))),k0=(e,t)=>{if(Number.isFinite(e)&&Number.isFinite(t))return e===0&&t>0?`y`:t===0&&e>0||e<t?`x`:`y`;if(isNaN(e)&&!isNaN(t))return`y`;if(!isNaN(e)&&isNaN(t))return`x`;if(e===1/0)return`y`;if(t===1/0)return`x`;console.warn(`hypotenuse - which is shorter? x:`,e,`y:`,t)},A0=(e,t,n)=>{let r=x0.enabled?x0.bind(x0,`diffEdge: [${t.x},${t.y} -> ${n.x},${n.y}]`):()=>{},i=w0(t,n);r(`x angle`,S0(i));let a=Math.abs(i-C0(90));r(`y angle`,S0(a));let o=Math.abs(t.x-e.x),s=E0(o,a),c=Math.abs(t.y-e.y),l=E0(c,i);r(`x: side`,o,`h:`,s),r(`y: side`,c,`h:`,l);let u=k0(s,l);if(u!==`x`&&u!==`y`)throw Error(`Cant decide which hypotenuse to use`);let d=u===`x`?new z$(o,O0(s,i)):new z$(O0(l,a),c);r(`point:`,d);let f=new z$(n.x<t.x?-1:1,n.y<t.y?-1:1);r(`multiplier:`,f);let p=d.multByPoint(f);r(`out:`,p);let m=p.add(new z$(t.x,t.y));return r(`normalized:`,m),m};function j0(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function M0(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function N0(e){let t,n,r;e.length===2?(t=e===j0||e===M0?e:P0,n=e,r=e):(t=j0,n=(t,n)=>j0(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function P0(){return 0}function F0(e){return e===null?NaN:+e}var I0=N0(j0),L0=I0.right;I0.left,N0(F0).center;var R0=Math.sqrt(50),z0=Math.sqrt(10),B0=Math.sqrt(2);function V0(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=R0?10:a>=z0?5:a>=B0?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?V0(e,t,n*2):[s,c,l]}function H0(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?V0(t,e,n):V0(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function U0(e,t,n){return t=+t,e=+e,n=+n,V0(e,t,n)[2]}function W0(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?U0(t,e,n):U0(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function G0(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function K0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function q0(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function J0(){}var Y0=.7,X0=1/Y0,Z0=`\\s*([+-]?\\d+)\\s*`,Q0=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,$0=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,e2=/^#([0-9a-f]{3,8})$/,t2=RegExp(`^rgb\\(${Z0},${Z0},${Z0}\\)$`),n2=RegExp(`^rgb\\(${$0},${$0},${$0}\\)$`),r2=RegExp(`^rgba\\(${Z0},${Z0},${Z0},${Q0}\\)$`),i2=RegExp(`^rgba\\(${$0},${$0},${$0},${Q0}\\)$`),a2=RegExp(`^hsl\\(${Q0},${$0},${$0}\\)$`),o2=RegExp(`^hsla\\(${Q0},${$0},${$0},${Q0}\\)$`),s2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};K0(J0,f2,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:c2,formatHex:c2,formatHex8:l2,formatHsl:u2,formatRgb:d2,toString:d2});function c2(){return this.rgb().formatHex()}function l2(){return this.rgb().formatHex8()}function u2(){return T2(this).formatHsl()}function d2(){return this.rgb().formatRgb()}function f2(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=e2.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?p2(t):n===3?new _2(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?m2(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?m2(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=t2.exec(e))?new _2(t[1],t[2],t[3],1):(t=n2.exec(e))?new _2(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=r2.exec(e))?m2(t[1],t[2],t[3],t[4]):(t=i2.exec(e))?m2(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=a2.exec(e))?w2(t[1],t[2]/100,t[3]/100,1):(t=o2.exec(e))?w2(t[1],t[2]/100,t[3]/100,t[4]):s2.hasOwnProperty(e)?p2(s2[e]):e===`transparent`?new _2(NaN,NaN,NaN,0):null}function p2(e){return new _2(e>>16&255,e>>8&255,e&255,1)}function m2(e,t,n,r){return r<=0&&(e=t=n=NaN),new _2(e,t,n,r)}function h2(e){return e instanceof J0||(e=f2(e)),e?(e=e.rgb(),new _2(e.r,e.g,e.b,e.opacity)):new _2}function g2(e,t,n,r){return arguments.length===1?h2(e):new _2(e,t,n,r??1)}function _2(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}K0(_2,g2,q0(J0,{brighter(e){return e=e==null?X0:X0**+e,new _2(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Y0:Y0**+e,new _2(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _2(S2(this.r),S2(this.g),S2(this.b),x2(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:v2,formatHex:v2,formatHex8:y2,formatRgb:b2,toString:b2}));function v2(){return`#${C2(this.r)}${C2(this.g)}${C2(this.b)}`}function y2(){return`#${C2(this.r)}${C2(this.g)}${C2(this.b)}${C2((isNaN(this.opacity)?1:this.opacity)*255)}`}function b2(){let e=x2(this.opacity);return`${e===1?`rgb(`:`rgba(`}${S2(this.r)}, ${S2(this.g)}, ${S2(this.b)}${e===1?`)`:`, ${e})`}`}function x2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function S2(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function C2(e){return e=S2(e),(e<16?`0`:``)+e.toString(16)}function w2(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new D2(e,t,n,r)}function T2(e){if(e instanceof D2)return new D2(e.h,e.s,e.l,e.opacity);if(e instanceof J0||(e=f2(e)),!e)return new D2;if(e instanceof D2)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new D2(o,s,c,e.opacity)}function E2(e,t,n,r){return arguments.length===1?T2(e):new D2(e,t,n,r??1)}function D2(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}K0(D2,E2,q0(J0,{brighter(e){return e=e==null?X0:X0**+e,new D2(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Y0:Y0**+e,new D2(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new _2(A2(e>=240?e-240:e+120,i,r),A2(e,i,r),A2(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new D2(O2(this.h),k2(this.s),k2(this.l),x2(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=x2(this.opacity);return`${e===1?`hsl(`:`hsla(`}${O2(this.h)}, ${k2(this.s)*100}%, ${k2(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function O2(e){return e=(e||0)%360,e<0?e+360:e}function k2(e){return Math.max(0,Math.min(1,e||0))}function A2(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var j2=e=>()=>e;function M2(e,t){return function(n){return e+n*t}}function N2(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function P2(e){return(e=+e)==1?F2:function(t,n){return n-t?N2(t,n,e):j2(isNaN(t)?n:t)}}function F2(e,t){var n=t-e;return n?M2(e,n):j2(isNaN(e)?t:e)}var I2=(function e(t){var n=P2(t);function r(e,t){var r=n((e=g2(e)).r,(t=g2(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=F2(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function L2(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function R2(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function z2(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=J2(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function B2(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function V2(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function H2(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=J2(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var U2=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,W2=new RegExp(U2.source,`g`);function G2(e){return function(){return e}}function K2(e){return function(t){return e(t)+``}}function q2(e,t){var n=U2.lastIndex=W2.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=U2.exec(e))&&(i=W2.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:V2(r,i)})),n=W2.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?K2(c[0].x):G2(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function J2(e,t){var n=typeof t,r;return t==null||n===`boolean`?j2(t):(n===`number`?V2:n===`string`?(r=f2(t))?(t=r,I2):q2:t instanceof f2?I2:t instanceof Date?B2:R2(t)?L2:Array.isArray(t)?z2:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?H2:V2)(e,t)}function Y2(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function X2(e){return function(){return e}}function Z2(e){return+e}var Q2=[0,1];function $2(e){return e}function e4(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:X2(isNaN(t)?NaN:.5)}function t4(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function n4(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=e4(i,r),a=n(o,a)):(r=e4(r,i),a=n(a,o)),function(e){return a(r(e))}}function r4(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=e4(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=L0(e,t,1,r)-1;return a[n](i[n](t))}}function i4(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function a4(){var e=Q2,t=Q2,n=J2,r,i,a,o=$2,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==$2&&(o=t4(e[0],e[n-1])),s=n>2?r4:n4,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),V2))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,Z2),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=Y2,u()},d.clamp=function(e){return arguments.length?(o=e?!0:$2,u()):o!==$2},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function o4(){return a4()($2,$2)}function s4(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function c4(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function l4(e){return e=c4(Math.abs(e)),e?e[1]:NaN}function u4(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function d4(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var f4=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function p4(e){if(!(t=f4.exec(e)))throw Error(`invalid format: `+e);var t;return new m4({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}p4.prototype=m4.prototype;function m4(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}m4.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function h4(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var g4;function _4(e,t){var n=c4(e,t);if(!n)return g4=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(g4=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+c4(e,Math.max(0,t+a-1))[0]}function v4(e,t){var n=c4(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var y4={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:s4,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>v4(e*100,t),r:v4,s:_4,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function b4(e){return e}var x4=Array.prototype.map,S4=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function C4(e){var t=e.grouping===void 0||e.thousands===void 0?b4:u4(x4.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?b4:d4(x4.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=p4(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):y4[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=y4[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=h4(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&g4!==void 0?S4[8+g4/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(l4(t)/3)))*3,r=10**-n,i=l((e=p4(e),e.type=`f`,e),{suffix:S4[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var w4,T4,E4;D4({thousands:`,`,grouping:[3],currency:[`$`,``]});function D4(e){return w4=C4(e),T4=w4.format,E4=w4.formatPrefix,w4}function O4(e){return Math.max(0,-l4(Math.abs(e)))}function k4(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(l4(t)/3)))*3-l4(Math.abs(e)))}function A4(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,l4(t)-l4(e))+1}function j4(e,t,n,r){var i=W0(e,t,n),a;switch(r=p4(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=k4(i,o))&&(r.precision=a),E4(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=A4(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=O4(i))&&(r.precision=a-(r.type===`%`)*2);break}return T4(r)}function M4(e){var t=e.domain;return e.ticks=function(e){var n=t();return H0(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return j4(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=U0(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function N4(){var e=o4();return e.copy=function(){return i4(e,N4())},G0.apply(e,arguments),M4(e)}var P4=({min:e,max:t,step:n})=>({step:n,min:parseInt(e/n)*n,max:parseInt(t/n)*n}),F4=(e,t,n,r)=>{(0,B$.default)(e.min<e.max,`domain: min must be less than max`),(0,B$.default)(t.min<t.max,`range: min must be less than max`);let i=P4(e),a=P4(t);return{scale:{x:N4().domain([e.min,e.max]).range([0,n.width]),y:N4().domain([t.max,t.min]).range([0,n.height])},snap:{x:U$.bind(null,i.min,i.max,i.step),y:U$.bind(null,a.min,a.max,a.step)},domain:e,range:t,size:n,getRootNode:r}},I4=l(o(((e,t)=>{(function(){"use strict";var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}))());function L4(e){let{top:t=0,left:n=0,transform:r,className:i,children:a,innerRef:o,...s}=e;return(0,I.jsx)(`g`,{ref:o,className:(0,I4.default)(`visx-group`,i),transform:r||`translate(${n}, ${t})`,...s,children:a})}function R4(e){if((typeof e==`function`||typeof e==`object`&&e)&&`valueOf`in e){let t=e.valueOf();if(typeof t==`number`)return t}return e}function z4(e,t){let n=e;return`ticks`in n?n.ticks(t):n.domain().filter((e,n,r)=>t==null||r.length<=t||n%Math.round((r.length-1)/t)===0)}function B4(e){return e?.toString()}function V4(e){let{from:t={x:0,y:0},to:n={x:1,y:1},fill:r=`transparent`,className:i,innerRef:a,...o}=e,s=t.x===n.x||t.y===n.y;return(0,I.jsx)(`line`,{ref:a,className:(0,I4.default)(`visx-line`,i),x1:t.x,y1:t.y,x2:n.x,y2:n.y,fill:r,shapeRendering:s?`crispEdges`:`auto`,...o})}var H4=o(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}})),U4=o(((e,t)=>{t.exports=n;function n(e,t,n){e instanceof RegExp&&(e=r(e,n)),t instanceof RegExp&&(t=r(t,n));var a=i(e,t,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+e.length,a[1]),post:n.slice(a[1]+t.length)}}function r(e,t){var n=t.match(e);return n?n[0]:null}n.range=i;function i(e,t,n){var r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;)u==c?(r.push(u),c=n.indexOf(e,u+1)):r.length==1?s=[r.pop(),l]:(i=r.pop(),i<a&&(a=i,o=l),l=n.indexOf(t,u+1)),u=c<l&&c>=0?c:l;r.length&&(s=[a,o])}return s}})),W4=o(((e,t)=>{var n=U4();t.exports=r;function r(e,t,n){var r=e;return i(e,t).reduce(function(e,i){return e.replace(i.functionIdentifier+`(`+i.matches.body+`)`,a(i.matches.body,i.functionIdentifier,n,r,t))},e)}function i(e,t){var r=[],i=typeof t==`string`?RegExp(`\\b(`+t+`)\\(`):t;do{var a=i.exec(e);if(!a)return r;if(a[1]===void 0)throw Error(`Missing the first couple of parenthesis to get the function identifier in `+t);var o=a[1],s=a.index,c=n(`(`,`)`,e.substring(s));if(!c||c.start!==a[0].length-1)throw SyntaxError(o+`(): missing closing ')' in the value '`+e+`'`);r.push({matches:c,functionIdentifier:o}),e=c.post}while(i.test(e));return r}function a(e,t,n,i,a){return n(r(e,a,n),t,i)}})),G4=o(((e,t)=>{var n=function(e){this.value=e};n.math={isDegree:!0,acos:function(e){return n.math.isDegree?180/Math.PI*Math.acos(e):Math.acos(e)},add:function(e,t){return e+t},asin:function(e){return n.math.isDegree?180/Math.PI*Math.asin(e):Math.asin(e)},atan:function(e){return n.math.isDegree?180/Math.PI*Math.atan(e):Math.atan(e)},acosh:function(e){return Math.log(e+Math.sqrt(e*e-1))},asinh:function(e){return Math.log(e+Math.sqrt(e*e+1))},atanh:function(e){return Math.log((1+e)/(1-e))},C:function(e,t){var r=1,i=e-t,a=t;a<i&&(a=i,i=t);for(var o=a+1;o<=e;o++)r*=o;return r/n.math.fact(i)},changeSign:function(e){return-e},cos:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.cos(e)},cosh:function(e){return(Math.E**+e+Math.E**(-1*e))/2},div:function(e,t){return e/t},fact:function(e){if(e%1!=0)return`NaN`;for(var t=1,n=2;n<=e;n++)t*=n;return t},inverse:function(e){return 1/e},log:function(e){return Math.log(e)/Math.log(10)},mod:function(e,t){return e%t},mul:function(e,t){return e*t},P:function(e,t){for(var n=1,r=Math.floor(e)-Math.floor(t)+1;r<=Math.floor(e);r++)n*=r;return n},Pi:function(e,t,n){for(var r=1,i=e;i<=t;i++)r*=Number(n.postfixEval({n:i}));return r},pow10x:function(e){for(var t=1;e--;)t*=10;return t},sigma:function(e,t,n){for(var r=0,i=e;i<=t;i++)r+=Number(n.postfixEval({n:i}));return r},sin:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.sin(e)},sinh:function(e){return(Math.E**+e-Math.E**(-1*e))/2},sub:function(e,t){return e-t},tan:function(e){return n.math.isDegree&&(e=n.math.toRadian(e)),Math.tan(e)},tanh:function(e){return n.sinha(e)/n.cosha(e)},toRadian:function(e){return e*Math.PI/180},and:function(e,t){return e&t}},n.Exception=function(e){this.message=e},t.exports=n})),K4=o(((e,t)=>{var n=G4();function r(e,t){for(var n=0;n<e.length;n++)e[n]+=t;return e}for(var i=[{token:`sin`,show:`sin`,type:0,value:n.math.sin},{token:`cos`,show:`cos`,type:0,value:n.math.cos},{token:`tan`,show:`tan`,type:0,value:n.math.tan},{token:`pi`,show:`π`,type:3,value:`PI`},{token:`(`,show:`(`,type:4,value:`(`},{token:`)`,show:`)`,type:5,value:`)`},{token:`P`,show:`P`,type:10,value:n.math.P},{token:`C`,show:`C`,type:10,value:n.math.C},{token:` `,show:` `,type:14,value:` `.anchor},{token:`asin`,show:`asin`,type:0,value:n.math.asin},{token:`acos`,show:`acos`,type:0,value:n.math.acos},{token:`atan`,show:`atan`,type:0,value:n.math.atan},{token:`7`,show:`7`,type:1,value:`7`},{token:`8`,show:`8`,type:1,value:`8`},{token:`9`,show:`9`,type:1,value:`9`},{token:`int`,show:`Int`,type:0,value:Math.floor},{token:`cosh`,show:`cosh`,type:0,value:n.math.cosh},{token:`acosh`,show:`acosh`,type:0,value:n.math.acosh},{token:`ln`,show:` ln`,type:0,value:Math.log},{token:`^`,show:`^`,type:10,value:Math.pow},{token:`root`,show:`root`,type:0,value:Math.sqrt},{token:`4`,show:`4`,type:1,value:`4`},{token:`5`,show:`5`,type:1,value:`5`},{token:`6`,show:`6`,type:1,value:`6`},{token:`/`,show:`÷`,type:2,value:n.math.div},{token:`!`,show:`!`,type:7,value:n.math.fact},{token:`tanh`,show:`tanh`,type:0,value:n.math.tanh},{token:`atanh`,show:`atanh`,type:0,value:n.math.atanh},{token:`Mod`,show:` Mod `,type:2,value:n.math.mod},{token:`1`,show:`1`,type:1,value:`1`},{token:`2`,show:`2`,type:1,value:`2`},{token:`3`,show:`3`,type:1,value:`3`},{token:`*`,show:`×`,type:2,value:n.math.mul},{token:`sinh`,show:`sinh`,type:0,value:n.math.sinh},{token:`asinh`,show:`asinh`,type:0,value:n.math.asinh},{token:`e`,show:`e`,type:3,value:`E`},{token:`log`,show:` log`,type:0,value:n.math.log},{token:`0`,show:`0`,type:1,value:`0`},{token:`.`,show:`.`,type:6,value:`.`},{token:`+`,show:`+`,type:9,value:n.math.add},{token:`-`,show:`-`,type:9,value:n.math.sub},{token:`,`,show:`,`,type:11,value:`,`},{token:`Sigma`,show:`Σ`,type:12,value:n.math.sigma},{token:`n`,show:`n`,type:13,value:`n`},{token:`Pi`,show:`Π`,type:12,value:n.math.Pi},{token:`pow`,show:`pow`,type:8,value:Math.pow,numberOfArguments:2},{token:`&`,show:`&`,type:9,value:n.math.and}],a={0:11,1:0,2:3,3:0,4:0,5:0,6:0,7:11,8:11,9:1,10:10,11:0,12:11,13:0,14:-1,15:11},o=0;o<i.length;o++)i[o].precedence=a[i[o].type];var s={0:!0,1:!0,3:!0,4:!0,6:!0,8:!0,9:!0,12:!0,13:!0,14:!0,15:!0},c={0:!0,1:!0,2:!0,3:!0,4:!0,5:!0,6:!0,7:!0,8:!0,9:!0,10:!0,11:!0,12:!0,13:!0,15:!0},l={0:!0,3:!0,4:!0,8:!0,12:!0,13:!0,15:!0},u={},d={0:!0,1:!0,3:!0,4:!0,6:!0,8:!0,12:!0,13:!0,15:!0},f={1:!0},p=[[],`123789456+-*/()^!PCe0.,n &`.split(``),[`pi`,`ln`,`Pi`],[`sin`,`cos`,`tan`,`Del`,`int`,`Mod`,`log`,`pow`],[`asin`,`acos`,`atan`,`cosh`,`root`,`tanh`,`sinh`],[`acosh`,`atanh`,`asinh`,`Sigma`]];function m(e,t,n,r){for(var i=0;i<r;i++)if(e[n+i]!==t[i])return!1;return!0}n.tokenTypes={FUNCTION_WITH_ONE_ARG:0,NUMBER:1,BINARY_OPERATOR_HIGH_PRECENDENCE:2,CONSTANT:3,OPENING_PARENTHESIS:4,CLOSING_PARENTHESIS:5,DECIMAL:6,POSTFIX_FUNCTION_WITH_ONE_ARG:7,FUNCTION_WITH_N_ARGS:8,BINARY_OPERATOR_LOW_PRECENDENCE:9,BINARY_OPERATOR_PERMUTATION:10,COMMA:11,EVALUATED_FUNCTION:12,EVALUATED_FUNCTION_PARAMETER:13,SPACE:14},n.addToken=function(e){for(var t=0;t<e.length;t++){var r=e[t].token.length,o=-1;e[t].type===n.tokenTypes.FUNCTION_WITH_N_ARGS&&e[t].numberOfArguments===void 0&&(e[t].numberOfArguments=2),p[r]=p[r]||[];for(var s=0;s<p[r].length;s++)if(e[t].token===p[r][s]){o=h(p[r][s],i);break}o===-1?(i.push(e[t]),e[t].precedence=a[e[t].type],p.length<=e[t].token.length&&(p[e[t].token.length]=[]),p[e[t].token.length].push(e[t].token)):(i[o]=e[t],e[t].precedence=a[e[t].type])}};function h(e,t){for(var n=0;n<t.length;n++)if(t[n].token===e)return n;return-1}function g(e){for(var t=[],r=e.length,a,o,s,c=0;c<r;c++)if(!(c<r-1&&e[c]===` `&&e[c+1]===` `)){for(a=``,o=e.length-c>p.length-2?p.length-1:e.length-c;o>0;o--)if(p[o]!==void 0)for(s=0;s<p[o].length;s++)m(e,p[o][s],c,o)&&(a=p[o][s],s=p[o].length,o=0);if(c+=a.length-1,a===``)throw new n.Exception(`Can't understand after `+e.slice(c));t.push(i[h(a,i)])}return t}var _={value:n.math.changeSign,type:0,pre:21,show:`-`},v={value:`)`,show:`)`,type:5,pre:0},y={value:`(`,type:4,pre:0,show:`(`};n.lex=function(e,t){"use strict";var i=[y],a=[],o=e,p=s,m=0,h=u,b=``,x;t!==void 0&&n.addToken(t);var S={},C=g(o);for(x=0;x<C.length;x++){var w=C[x];if(w.type===14){if(x>0&&x<C.length-1&&C[x+1].type===1&&(C[x-1].type===1||C[x-1].type===6))throw new n.Exception(`Unexpected Space`);continue}var T=w.token,E=w.type,D=w.value,O=w.precedence,k=w.show,A=i[i.length-1],j;for(j=a.length;j--&&a[j]===0;)if([0,2,3,4,5,9,11,12,13].indexOf(E)!==-1){if(p[E]!==!0)throw new n.Exception(T+` is not allowed after `+b);i.push(v),p=c,h=d,a.pop()}if(p[E]!==!0)throw new n.Exception(T+` is not allowed after `+b);if(h[E]===!0&&(E=2,D=n.math.mul,k=`×`,O=3,--x),S={value:D,type:E,pre:O,show:k,numberOfArguments:w.numberOfArguments},E===0)p=s,h=u,r(a,2),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(2));else if(E===1)A.type===1?(A.value+=D,r(a,1)):i.push(S),p=c,h=l;else if(E===2)p=s,h=u,r(a,2),i.push(S);else if(E===3)i.push(S),p=c,h=d;else if(E===4)r(a,1),m++,p=s,h=u,i.push(S);else if(E===5){if(!m)throw new n.Exception(`Closing parenthesis are more than opening one, wait What!!!`);m--,p=c,h=d,i.push(S),r(a,1)}else if(E===6){if(A.hasDec)throw new n.Exception(`Two decimals are not allowed in one number`);A.type!==1&&(A={value:0,type:1,pre:0},i.push(A)),p=f,r(a,1),h=u,A.value+=D,A.hasDec=!0}else E===7&&(p=c,h=d,r(a,1),i.push(S));E===8?(p=s,h=u,r(a,w.numberOfArguments+2),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(w.numberOfArguments+2))):E===9?(A.type===9?A.value===n.math.add?(A.value=D,A.show=k,r(a,1)):A.value===n.math.sub&&k===`-`&&(A.value=n.math.add,A.show=`+`,r(a,1)):A.type!==5&&A.type!==7&&A.type!==1&&A.type!==3&&A.type!==13?T===`-`&&(p=s,h=u,r(a,2).push(2),i.push(_),i.push(y)):(i.push(S),r(a,2)),p=s,h=u):E===10?(p=s,h=u,r(a,2),i.push(S)):E===11?(p=s,h=u,i.push(S)):E===12?(p=s,h=u,r(a,6),i.push(S),C[x+1].type!==4&&(i.push(y),a.push(6))):E===13&&(p=c,h=d,i.push(S)),r(a,-1),b=T}for(j=a.length;j--;)i.push(v);if(p[5]!==!0)throw new n.Exception(`complete the expression`);for(;m--;)i.push(v);return i.push(v),new n(i)},t.exports=n})),q4=o(((e,t)=>{var n=K4();n.prototype.toPostfix=function(){"use strict";for(var e=[],t,r,i,a,o,s=[{value:`(`,type:4,pre:0}],c=this.value,l=1;l<c.length;l++)if(c[l].type===1||c[l].type===3||c[l].type===13)c[l].type===1&&(c[l].value=Number(c[l].value)),e.push(c[l]);else if(c[l].type===4)s.push(c[l]);else if(c[l].type===5)for(;(r=s.pop()).type!==4;)e.push(r);else if(c[l].type===11){for(;(r=s.pop()).type!==4;)e.push(r);s.push(r)}else{t=c[l],a=t.pre,o=s[s.length-1],i=o.pre;var u=o.value==`Math.pow`&&t.value==`Math.pow`;if(a>i)s.push(t);else{for(;i>=a&&!u||u&&a<i;)r=s.pop(),o=s[s.length-1],e.push(r),i=o.pre,u=t.value==`Math.pow`&&o.value==`Math.pow`;s.push(t)}}return new n(e)},t.exports=n})),J4=o(((e,t)=>{var n=q4();n.prototype.postfixEval=function(e){"use strict";e||={},e.PI=Math.PI,e.E=Math.E;for(var t=[],r,i,a,o=this.value,s=e.n!==void 0,c=0;c<o.length;c++)if(o[c].type===1)t.push({value:o[c].value,type:1});else if(o[c].type===3)t.push({value:e[o[c].value],type:1});else if(o[c].type===0)t[t.length-1].type===void 0?t[t.length-1].value.push(o[c]):t[t.length-1].value=o[c].value(t[t.length-1].value);else if(o[c].type===7)t[t.length-1].type===void 0?t[t.length-1].value.push(o[c]):t[t.length-1].value=o[c].value(t[t.length-1].value);else if(o[c].type===8){for(var l=[],u=0;u<o[c].numberOfArguments;u++)l.push(t.pop().value);t.push({type:1,value:o[c].value.apply(o[c],l.reverse())})}else o[c].type===10?(r=t.pop(),i=t.pop(),i.type===void 0?(i.value=i.concat(r),i.value.push(o[c]),t.push(i)):r.type===void 0?(r.unshift(i),r.push(o[c]),t.push(r)):t.push({type:1,value:o[c].value(i.value,r.value)})):o[c].type===2||o[c].type===9?(r=t.pop(),i=t.pop(),i.type===void 0?(i=i.concat(r),i.push(o[c]),t.push(i)):r.type===void 0?(r.unshift(i),r.push(o[c]),t.push(r)):t.push({type:1,value:o[c].value(i.value,r.value)})):o[c].type===12?(r=t.pop(),r.type!==void 0&&(r=[r]),i=t.pop(),a=t.pop(),t.push({type:1,value:o[c].value(a.value,i.value,new n(r))})):o[c].type===13&&(s?t.push({value:e[o[c].value],type:3}):t.push([o[c]]));if(t.length>1)throw new n.Exception(`Uncaught Syntax error`);return t[0].value>0x38d7ea4c68000?`Infinity`:parseFloat(t[0].value.toFixed(15))},n.eval=function(e,t,n){return t===void 0?this.lex(e).toPostfix().postfixEval():n===void 0?t.length===void 0?this.lex(e).toPostfix().postfixEval(t):this.lex(e,t).toPostfix().postfixEval():this.lex(e,t).toPostfix().postfixEval(n)},t.exports=n})),Y4=o(((e,t)=>{var n=J4();n.prototype.formulaEval=function(){"use strict";for(var e,t,n,r=[],i=this.value,a=0;a<i.length;a++)i[a].type===1||i[a].type===3?r.push({value:i[a].type===3?i[a].show:i[a].value,type:1}):i[a].type===13?r.push({value:i[a].show,type:1}):i[a].type===0?r[r.length-1]={value:i[a].show+(i[a].show==`-`?``:`(`)+r[r.length-1].value+(i[a].show==`-`?``:`)`),type:0}:i[a].type===7?r[r.length-1]={value:(r[r.length-1].type==1?``:`(`)+r[r.length-1].value+(r[r.length-1].type==1?``:`)`)+i[a].show,type:7}:i[a].type===10?(e=r.pop(),t=r.pop(),i[a].show===`P`||i[a].show===`C`?r.push({value:`<sup>`+t.value+`</sup>`+i[a].show+`<sub>`+e.value+`</sub>`,type:10}):r.push({value:(t.type==1?``:`(`)+t.value+(t.type==1?``:`)`)+`<sup>`+e.value+`</sup>`,type:1})):i[a].type===2||i[a].type===9?(e=r.pop(),t=r.pop(),r.push({value:(t.type==1?``:`(`)+t.value+(t.type==1?``:`)`)+i[a].show+(e.type==1?``:`(`)+e.value+(e.type==1?``:`)`),type:i[a].type})):i[a].type===12&&(e=r.pop(),t=r.pop(),n=r.pop(),r.push({value:i[a].show+`(`+n.value+`,`+t.value+`,`+e.value+`)`,type:12}));return r[0].value},t.exports=n})),X4=o(((e,t)=>{var n=H4(),r=W4(),i=Y4(),a=100,o=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g,s;t.exports=c;function c(e,t){s=0,t=10**(t===void 0?5:t),e=e.replace(/\n+/g,` `);function c(e,n,r){if(s++>a)throw s=0,Error(`Call stack overflow for `+r);if(e===``)throw Error(n+`(): '`+r+`' must contain a non-whitespace string`);e=u(e,r);var o=l(e);if(o.length>1||e.indexOf(`var(`)>-1)return n+`(`+e+`)`;var c=o[0]||``;c===`%`&&(e=e.replace(/\b[0-9\.]+%/g,function(e){return parseFloat(e.slice(0,-1))*.01}));var d=e.replace(new RegExp(c,`gi`),``),f;try{f=i.eval(d)}catch{return n+`(`+e+`)`}return c===`%`&&(f*=100),(n.length||c===`%`)&&(f=Math.round(f*t)/t),f+=c,f}function u(e,t){e=e.replace(/((?:\-[a-z]+\-)?calc)/g,``);for(var r=``,i=e,a;a=o.exec(i);){a[0].index>0&&(r+=i.substring(0,a[0].index));var s=n(`(`,`)`,i.substring([0].index));if(s.body===``)throw Error(`'`+e+`' must contain a non-whitespace string`);var l=c(s.body,``,t);r+=s.pre+l,i=s.post}return r+i}return r(e,/((?:\-[a-z]+\-)?calc)\(/,c)}function l(e){for(var t=[],n=[],r=/[\.0-9]([%a-z]+)/gi,i=r.exec(e);i;)!i||!i[1]||(n.indexOf(i[1].toLowerCase())===-1&&(t.push(i[1]),n.push(i[1].toLowerCase())),i=r.exec(e));return t}}));function Z4(e,t){let n=new Map;return function(){for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];let o=t(...i);if(n.has(o))return n.get(o);let s=e.apply(this,i);return n.set(o,s),s}}var Q4=`__react_svg_text_measurement_id`;function $4(e,t){if(typeof document>`u`)return null;try{let n=document.getElementById(Q4);if(!n){let e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);e.setAttribute(`aria-hidden`,`true`),e.style.width=`0`,e.style.height=`0`,e.style.position=`absolute`,e.style.top=`-100%`,e.style.left=`-100%`,n=document.createElementNS(`http://www.w3.org/2000/svg`,`text`),n.setAttribute(`id`,Q4),e.appendChild(n),document.body.appendChild(e)}return Object.assign(n.style,t),n.textContent=e,n.getComputedTextLength()}catch{return null}}var e3=Z4($4,(e,t)=>`${e}_${JSON.stringify(t)}`),t3=l(X4());function n3(e){return typeof e==`number`}function r3(e){return typeof e==`number`&&Number.isFinite(e)||typeof e==`string`}function i3(e){let{verticalAnchor:t=`end`,scaleToFit:n=!1,angle:r,width:i,lineHeight:a=`1em`,capHeight:o=`0.71em`,children:s,style:c,...l}=e,{x:u=0,y:d=0}=l,f=!r3(u)||!r3(d),{wordsWithWidth:p,spaceWidth:m}=(0,F.useMemo)(()=>({wordsWithWidth:(s==null?[]:s.toString().split(/(?:(?!\u00A0+)\s+)/)).map(e=>({word:e,wordWidth:e3(e,c)||0})),spaceWidth:e3(`\xA0`,c)||0}),[s,c]),h=(0,F.useMemo)(()=>f?[]:i||n?p.reduce((e,t)=>{let{word:r,wordWidth:a}=t,o=e[e.length-1];if(o&&(i==null||n||(o.width||0)+a+m<i))o.words.push(r),o.width=o.width||0,o.width+=a+m;else{let t={words:[r],width:a};e.push(t)}return e},[]):[{words:s==null?[]:s.toString().split(/(?:(?!\u00A0+)\s+)/)}],[f,i,n,s,p,m]);return{wordsByLines:h,startDy:(0,F.useMemo)(()=>f?``:t===`start`?(0,t3.default)(`calc(${o})`):t===`middle`?(0,t3.default)(`calc(${(h.length-1)/2} * -${a} + (${o} / 2))`):(0,t3.default)(`calc(${h.length-1} * -${a})`),[f,t,o,h.length,a]),transform:(0,F.useMemo)(()=>{let e=[];if(f)return``;if(n3(u)&&n3(d)&&n3(i)&&n&&h.length>0){let t=h[0].width||1,r=n===`shrink-only`?Math.min(i/t,1):i/t,a=r,o=u-r*u,s=d-a*d;e.push(`matrix(${r}, 0, 0, ${a}, ${o}, ${s})`)}return r&&e.push(`rotate(${r}, ${u}, ${d})`),e.length>0?e.join(` `):``},[f,u,d,i,n,h,r])}}var a3={overflow:`visible`};function o3(e){let{dx:t=0,dy:n=0,textAnchor:r=`start`,innerRef:i,innerTextRef:a,verticalAnchor:o,angle:s,lineHeight:c=`1em`,scaleToFit:l=!1,capHeight:u,width:d,...f}=e,{x:p=0,fontSize:m}=f,{wordsByLines:h,startDy:g,transform:_}=i3(e);return(0,I.jsx)(`svg`,{ref:i,x:t,y:n,fontSize:m,style:a3,children:h.length>0?(0,I.jsx)(`text`,{ref:a,transform:_,...f,textAnchor:r,children:h.map((e,t)=>(0,I.jsx)(`tspan`,{x:p,dy:t===0?g:c,children:e.words.join(` `)},t))}):null})}var s3={top:`top`,left:`left`,right:`right`,bottom:`bottom`};function c3(e){let{labelOffset:t,labelProps:n,orientation:r,range:i,tickLabelFontSize:a,tickLength:o}=e,s=r===s3.left||r===s3.top?-1:1,c,l,u;if(r===s3.top||r===s3.bottom){let e=r===s3.bottom&&typeof n.fontSize==`number`?n.fontSize:0;c=(Number(i[0])+Number(i[i.length-1]))/2,l=s*(o+t+a+e)}else c=s*((Number(i[0])+Number(i[i.length-1]))/2),l=-(o+t),u=`rotate(${s*90})`;return{x:c,y:l,transform:u}}function l3(e){let{hideTicks:t,horizontal:n,orientation:r,tickClassName:i,tickComponent:a,tickLabelProps:o,tickStroke:s=`#222`,tickTransform:c,ticks:l,strokeWidth:u,tickLineProps:d}=e;return l.map(e=>{let{value:l,index:f,from:p,to:m,formattedValue:h}=e,g=o[f]??{},_=Math.max(10,typeof g.fontSize==`number`&&g.fontSize||0),v=m.y+(n&&r!==s3.top?_:0);return(0,I.jsxs)(L4,{className:(0,I4.default)(`visx-axis-tick`,i),transform:c,children:[!t&&(0,I.jsx)(V4,{from:p,to:m,stroke:s,strokeWidth:u,strokeLinecap:`square`,...d}),a?a({...g,x:m.x,y:v,formattedValue:h}):(0,I.jsx)(o3,{x:m.x,y:v,...g,children:h})]},`visx-tick-${l}-${f}`)})}var u3={textAnchor:`middle`,fontFamily:`Arial`,fontSize:10,fill:`#222`};function d3(e){let{axisFromPoint:t,axisLineClassName:n,axisToPoint:r,hideAxisLine:i,hideTicks:a,horizontal:o,label:s=``,labelClassName:c,labelOffset:l=14,labelProps:u,orientation:d=s3.bottom,scale:f,stroke:p=`#222`,strokeDasharray:m,strokeWidth:h=1,tickClassName:g,tickComponent:_,tickLineProps:v,tickLabelProps:y,tickLength:b=8,tickStroke:x=`#222`,tickTransform:S,ticks:C,ticksComponent:w=l3}=e,T={...u3,...u},E={...u3,...typeof y==`object`?y:null},D=C.map(e=>{let{value:t,index:n}=e;return typeof y==`function`?y(t,n,C):E}),O=Math.max(10,...D.map(e=>typeof e.fontSize==`number`?e.fontSize:0));return(0,I.jsxs)(I.Fragment,{children:[w({hideTicks:a,horizontal:o,orientation:d,scale:f,tickClassName:g,tickComponent:_,tickLabelProps:D,tickStroke:x,tickTransform:S,ticks:C,strokeWidth:h,tickLineProps:v}),!i&&(0,I.jsx)(V4,{className:(0,I4.default)(`visx-axis-line`,n),from:t,to:r,stroke:p,strokeWidth:h,strokeDasharray:m}),s&&(0,I.jsx)(o3,{className:(0,I4.default)(`visx-axis-label`,c),...c3({labelOffset:l,labelProps:T,orientation:d,range:f.range(),tickLabelFontSize:O,tickLength:b}),...T,children:s})]})}function f3(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`center`,n=e;if(t!==`start`&&`bandwidth`in n){let e=n.bandwidth();return t===`center`&&(e/=2),n.round()&&(e=Math.round(e)),t=>{let r=n(t);return typeof r==`number`?r+e:r}}return e}function p3(e){let t=e;return`tickFormat`in t?t.tickFormat():B4}var m3=class{x=0;y=0;constructor(e){let{x:t=0,y:n=0}=e;this.x=t,this.y=n}value(){return{x:this.x,y:this.y}}toArray(){return[this.x,this.y]}};function h3(e,t){let{x:n,y:r}=e;return new m3(t?{x:n,y:r}:{x:r,y:n})}function g3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return typeof e==`number`?{start:e,end:e}:{start:0,end:0,...e}}function _3(e){let{children:t=d3,axisClassName:n,hideAxisLine:r=!1,hideTicks:i=!1,hideZero:a=!1,innerRef:o,left:s=0,numTicks:c=10,orientation:l=s3.bottom,rangePadding:u=0,scale:d,tickFormat:f,tickLength:p=8,tickValues:m,top:h=0,...g}=e,_=f??p3(d),v=l===s3.left,y=l===s3.top,b=y||l===s3.bottom,x=f3(d),S=v||y?-1:1,C=d.range(),w=g3(u),T=h3({x:Number(C[0])+.5-w.start,y:0},b),E=h3({x:Number(C[C.length-1])+.5+w.end,y:0},b),D=(m??z4(d,c)).filter(e=>!a||e!==0&&e!==`0`).map((e,t)=>({value:e,index:t})),O=D.map(e=>{let{value:t,index:n}=e,r=R4(x(t));return{value:t,index:n,from:h3({x:r,y:0},b),to:h3({x:r,y:p*S},b),formattedValue:_(t,n,D)}});return(0,I.jsx)(L4,{className:(0,I4.default)(`visx-axis`,n),innerRef:o,top:h,left:s,children:t({...g,axisFromPoint:T,axisToPoint:E,hideAxisLine:r,hideTicks:i,hideZero:a,horizontal:b,numTicks:c,orientation:l,rangePadding:u,scale:d,tickFormat:_,tickLength:p,tickPosition:x,tickSign:S,ticks:O})})}var v3=z(`path`)(({theme:e})=>({fill:`var(--arrow-color, ${e.palette.common.black})`})),y3=class extends F.Component{render(){let{x:e,y:t,className:n,scale:r}=this.props,i=this.props.direction||`left`,a=r.x(e),o=r.y(t),s=``,c=(e,t,n)=>`translate(${e}, ${t}) rotate(${n})`;return i===`left`&&(s=c(a-15,o,0)),i===`right`&&(s=c(a+15,o,180)),i===`up`&&(s=c(a,o-15,90)),i===`down`&&(s=c(a,o+15,270)),(0,I.jsx)(v3,{d:`m 0,0 8,-5 0,10 -8,-5`,transform:s,className:n})}};y3.propTypes={y:P.number,x:P.number,direction:P.oneOf([`left`,`right`,`up`,`down`]),className:P.string,scale:P$.isRequired},y3.defaultProps={y:0,x:0,direction:`left`};var b3=G$,x3=K$,S3=()=>0,C3=()=>0,w3=e=>{let t=[],n=0;for(;n>=e.min&&t.indexOf(n)<0;)t.push(n),n=Math.round((n-e.step)*1e4)/1e4;for(n=Math.round(e.step*1e4)/1e4;n<=e.max&&t.indexOf(n)<0;)t.push(n),n=Math.round((n+e.step)*1e4)/1e4;return t?t.filter(t=>t>=e.min&&t<=e.max):[]},T3=e=>e==null||ys(e)?1:e.split(` `).length,E3=e=>(e||``).replace(/<[^>]+>/g,``).split(` `).sort((e,t)=>t.length-e.length)[0].length,D3=e=>e?e*10:0,O3=e=>{let t=vs(e),n={left:t.x,top:t.y,bottom:t.y,right:t.x};return Es(e).reduce((e,t)=>(e.left=Math.min(e.left,t.x),e.top=Math.max(e.top,t.y),e.bottom=Math.min(e.bottom,t.y),e.right=Math.max(e.right,t.x),e),n)},k3=e=>{let t=ps(e);return t.sort((e,t)=>t.x-e.x),{a:t[0],b:t[1]}},A3=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2}),j3=e=>parseFloat(e.toFixed(4)),M3=(e,t)=>e&&t&&(j3(e.x)===j3(t.x)||j3(e.y)===j3(t.y)),N3=(e,t)=>e&&t&&xs({x:j3(e.x),y:j3(e.y)},{x:j3(t.x),y:j3(t.y)}),P3=(e,t)=>{let{min:n,max:r,step:i}=e;return t/((r-n)/i)},F3=e=>{let{domain:t,range:n,size:{width:r,height:i}}=e;return P3(t,r)<14||P3(n,i)<14},I3=e=>{let{domain:t,range:n,size:{width:r,height:i}}=e,a=P3(t,r),o=P3(n,i),s=t.step/(a/15),c=n.step/(o/15);return{domain:{min:t.min-s,max:t.max+s},range:{min:n.min-c,max:n.max+c}}},L3=e=>(e||[]).sort((e,t)=>e.x-t.x||e.y-t.y),R3=(e,t,n)=>(e.x-t.x)*(n.y-t.y)===(n.x-t.x)*(e.y-t.y),z3=(e,t)=>R3(e.from,t.from,t.to)&&R3(e.to,t.from,t.to),B3=(e,t,n)=>{let{type:r,building:i}=e;if(i)return!1;let a=(t||[]).filter(e=>e.type===r&&!e.building),o=a.findIndex(e=>xs(e,n));return o!==-1&&a.splice(o,1),!!a.find(t=>{if(r===`line`){let{from:n,to:i}=e;return N3(n,t.from)&&N3(i,t.to)||N3(n,t.to)&&N3(i,t.from)||r===`line`&&z3(t,e)}else if(r===`polygon`)return xs(L3(ps(e.points)),L3(ps(t.points)))})},V3=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(Object.keys(r).length!==Object.keys(i).length)return!1;for(let e in r)if(r[e]!==i[e])return!1}return!0};function H3(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function U3(e,t){return!e||H3(e)?e:H3(e.default)?e.default:t&&H3(e[t])?e[t]:t&&H3(e[t]?.default)?e[t].default:e}var W3=U3(Ah,`Readable`)||U3(q3.Readable,`Readable`),G3=og,K3=G3.default,q3=K3&&typeof K3==`object`?K3:G3,J3={includeArrows:P.object,graphProps:P.object},Y3={includeArrows:{left:!0,right:!0,up:!0,down:!0}},X3=z(`g`)(()=>({"& .visx-axis-line":{stroke:`#8a92c0`,strokeWidth:4},"& .visx-axis-tick":{fill:H.BLACK,"& > line":{stroke:`#8a92c0`}}})),Z3=z(`div`)(({theme:e,centered:t})=>({padding:0,margin:0,"* > *":{margin:0,padding:0},"& p":{margin:0},fontSize:e.typography.fontSize,...t&&{textAlign:`center`}})),Q3=z(y3)({fill:`#8a92c0`}),$3={fontFamily:`Roboto`,fontSize:`14px`,cursor:`inherit`},e6=(e,t,n,r,i,a)=>{let o=[];return e===t&&n-i<r&&r<n+i&&n-i<a&&a<n+i&&o.push(e),o},t6=e=>(e||[]).find(e=>e<0),n6=class extends F.Component{static propTypes={...J3,graphProps:I$.isRequired};static defaultProps=Y3;render(){let{includeArrows:e,graphProps:t,columnTicksValues:n,skipValues:r,distanceFromOriginToFirstNegativeY:i,dy:a}=this.props,{scale:o,domain:s,size:c,range:l}=t||{},u=e=>{let t=r&&r[0]===e?i+4:a;return{...$3,textAnchor:`middle`,y:t,dx:e===0?-10:0,dy:e===0?-7:0}},d=T3(s.axisLabel),f=D3(E3(s.axisLabel))+2;return(0,I.jsxs)(X3,{children:[(0,I.jsx)(_3,{scale:o.x,top:o.y(0),left:0,label:s.label,rangePadding:8,tickFormat:e=>e,tickLabelProps:u,tickValues:n,hideZero:!(s.labelStep||l.labelStep)&&s.min<=0}),e&&e.left&&(0,I.jsx)(Q3,{direction:`left`,x:s.min,y:0,scale:o}),e&&e.right&&(0,I.jsx)(Q3,{direction:`right`,x:s.max,y:0,scale:o}),s.axisLabel&&(0,I.jsx)(`foreignObject`,{x:c.width+17,y:o.y(0)-9,width:f,height:20*d,children:(0,I.jsx)(W3,{false:!0,children:(0,I.jsx)(Z3,{dangerouslySetInnerHTML:{__html:s.axisLabel}})})})]})}},r6=class extends F.Component{static propTypes={...J3,graphProps:I$.isRequired};static defaultProps=Y3;render(){let{includeArrows:e,graphProps:t,skipValues:n,rowTickValues:r}=this.props,{scale:i,range:a,size:o}=t||{},s=a.axisLabel?D3(a.axisLabel.length):0;return(0,I.jsxs)(X3,{children:[(0,I.jsx)(_3,{orientation:`left`,scale:i.y,top:0,height:o.height,left:i.x(0),label:a.label,labelProps:{"data-pie-readable":!1},rangePadding:8,tickLength:10,tickFormat:e=>n&&n.indexOf(e)>=0?``:e,tickLabelProps:e=>{let t=e.toLocaleString().replace(/[.-]/g,``).length||1;return{...$3,dy:4,dx:-10-t*9,"data-pie-readable":!1}},hideZero:!0,tickTextAnchor:`bottom`,tickValues:r}),e&&e.down&&(0,I.jsx)(Q3,{direction:`down`,x:0,y:a.min,scale:i}),e&&e.up&&(0,I.jsx)(Q3,{direction:`up`,x:0,y:a.max,scale:i}),a.axisLabel&&(0,I.jsx)(`foreignObject`,{x:i.x(0)-s/2,y:-33,width:s,height:`20`,children:(0,I.jsx)(W3,{false:!0,children:(0,I.jsx)(Z3,{centered:!0,dangerouslySetInnerHTML:{__html:a.axisLabel}})})})]})}},i6=class extends F.Component{static propTypes={...J3,graphProps:I$.isRequired};static defaultProps=Y3;xValues=()=>{let{graphProps:e}=this.props,{scale:t,domain:n}=e||{};if(!n||!t)return;let r=w3({...n,step:n.labelStep}),i=t6(r);return{columnTicksValues:r,firstNegativeX:i,distanceFromOriginToFirstNegativeX:Math.abs(t.y(0)-t.y(i))}};yValues=()=>{let{graphProps:e}=this.props,{scale:t,range:n}=e||{};if(!n||!t)return;let r=w3({...n,step:n.labelStep}),i=t6(r);return{rowTickValues:r,firstNegativeY:i,distanceFromOriginToFirstNegativeY:Math.abs(t.x(0)-t.x(i))}};render(){let{graphProps:e}=this.props,{domain:t,range:n}=e||{},{columnTicksValues:r,firstNegativeX:i,distanceFromOriginToFirstNegativeX:a}=this.xValues(),{rowTickValues:o,firstNegativeY:s,distanceFromOriginToFirstNegativeY:c}=this.yValues(),l=e6(i,s,a,c,6,25);return(0,I.jsxs)(X3,{children:[n.min<=0?(0,I.jsx)(n6,{...this.props,skipValues:l,columnTicksValues:r,distanceFromOriginToFirstNegativeY:c,dy:25}):null,t.min<=0?(0,I.jsx)(r6,{...this.props,skipValues:l,rowTickValues:o,distanceFromOriginToFirstNegativeX:a}):null]})}};function a6(e){return`bandwidth`in e?e.bandwidth():0}function o6(e){let{top:t=0,left:n=0,scale:r,width:i,stroke:a=`#eaf0f6`,strokeWidth:o=1,strokeDasharray:s,className:c,children:l,numTicks:u=10,lineStyle:d,offset:f,tickValues:p,...m}=e,h=p??z4(r,u),g=(f??0)+a6(r)/2,_=h.map((e,t)=>{let n=(R4(r(e))??0)+g;return{index:t,from:new m3({x:0,y:n}),to:new m3({x:i,y:n})}});return(0,I.jsx)(L4,{className:(0,I4.default)(`visx-rows`,c),top:t,left:n,children:l?l({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,I.jsx)(V4,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:d,...m},`row-line-${r}`)})})}function s6(e){let{top:t=0,left:n=0,scale:r,height:i,stroke:a=`#eaf0f6`,strokeWidth:o=1,strokeDasharray:s,className:c,numTicks:l=10,lineStyle:u,offset:d,tickValues:f,children:p,...m}=e,h=f??z4(r,l),g=(d??0)+a6(r)/2,_=h.map((e,t)=>{let n=(R4(r(e))??0)+g;return{index:t,from:new m3({x:n,y:0}),to:new m3({x:n,y:i})}});return(0,I.jsx)(L4,{className:(0,I4.default)(`visx-columns`,c),top:t,left:n,children:p?p({lines:_}):_.map(e=>{let{from:t,to:n,index:r}=e;return(0,I.jsx)(V4,{from:t,to:n,stroke:a,strokeWidth:o,strokeDasharray:s,style:u,...m},`column-line-${r}`)})})}function c6(e){let{top:t,left:n,xScale:r,yScale:i,width:a,height:o,className:s,stroke:c,strokeWidth:l,strokeDasharray:u,numTicksRows:d,numTicksColumns:f,rowLineStyle:p,columnLineStyle:m,xOffset:h,yOffset:g,rowTickValues:_,columnTickValues:v,...y}=e;return(0,I.jsxs)(L4,{className:(0,I4.default)(`visx-grid`,s),top:t,left:n,children:[(0,I.jsx)(o6,{className:s,scale:i,width:a,stroke:c,strokeWidth:l,strokeDasharray:u,numTicks:d,lineStyle:p,offset:g,tickValues:_,...y}),(0,I.jsx)(s6,{className:s,scale:r,height:o,stroke:c,strokeWidth:l,strokeDasharray:u,numTicks:f,lineStyle:m,offset:h,tickValues:v,...y})]})}var l6=class extends F.Component{static propTypes={disabled:P.bool,disabledAdditionalGrid:P.bool,graphProps:I$.isRequired};getAdditionalGridProps=(e,t)=>{let{graphProps:{scale:n,size:{width:r,height:i},domain:a,range:o}}=this.props,s=w3({...o,step:o.labelStep}).filter(t=>e.includes(t)),c=w3({...a,step:a.labelStep}).filter(e=>t.includes(e)),l=s.length&&Math.min(...s).toString().replace(/[.-]/g,``).length||1,u=s.length&&Math.max(...s).toString().replace(/[.-]/g,``).length||1,d=Math.max(l,u)*9+22,f=n.x(0),p=n.y(0),m=`${f-d} ${d} ${r}`,h=`${p} 28 ${i}`,g=a.labelStep>0&&o.labelStep>0&&s&&c&&s.length>1&&c.length>1&&(s.length!==e.length||c.length!==t.length),_=c.filter(e=>e>=0||f-n.x(e)>d);return{rowTickLabelValues:s.filter(e=>e>=0||n.y(e)-p>28),columnTickLabelValues:_,rowStrokeDasharray:m,columnStrokeDasharray:h,displayAdditionalGrid:g}};render(){let{graphProps:e}=this.props,{scale:t,size:{height:n,width:r},domain:i,range:a}=e,o=w3(a),s=w3(i),{rowTickLabelValues:c,columnTickLabelValues:l,rowStrokeDasharray:u,columnStrokeDasharray:d,displayAdditionalGrid:f}=this.getAdditionalGridProps(o,s),p=i.labelStep*2===i.step||a.labelStep*2===a.step?`#9FA8DA`:`#7985CB`;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(c6,{innerRef:e=>this.grid=e,xScale:t.x,yScale:t.y,width:r,height:n,stroke:`#D3D3D3`,rowTickValues:o,columnTickValues:s}),f&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(o6,{scale:t.y,width:r,tickValues:c,stroke:p,strokeDasharray:u}),(0,I.jsx)(s6,{scale:t.x,height:n,tickValues:l,stroke:p,strokeDasharray:d})]})]})}};function u6(e){return typeof e==`function`||typeof e==`object`&&!!e&&typeof e.$$typeof==`symbol`}function d6(e,t){return!e||u6(e)?e:u6(e.default)?e.default:t&&u6(e[t])?e[t]:t&&u6(e[t]?.default)?e[t].default:e}var f6=d6(Ah,`Readable`)||d6(h6.Readable,`Readable`),p6=og,m6=p6.default,h6=m6&&typeof m6==`object`?m6:p6,g6={left:-90,top:0,bottom:0,right:90},_6=(e,t,n)=>{let r=(e,t,n)=>`translate(${e}, ${t}), rotate(${n})`;if(e===`left`)return r(-20,n/2,g6[e]);if(e===`right`)return r(t+30,n/2,g6[e]);if(e===`top`)return r(t/2,-20,g6[e]);if(e===`bottom`)return r(t/2,n+30,g6[e])},v6=(e,t)=>{switch(e){case`left`:case`top`:return-t;case`right`:return-t-10;default:return-t+10}},y6=`Label`,b6={label:`${y6}-label`,axisLabel:`${y6}-axisLabel`,disabledAxisLabel:`${y6}-disabledAxisLabel`,bottomLabel:`${y6}-bottomLabel`},x6=z(`div`)(({theme:e})=>({[`& .${b6.label}`]:{fill:H.SECONDARY},[`& .${b6.axisLabel}`]:{fontSize:e.typography.fontSize-2,textAlign:`center`,padding:`0 4px`},[`& .${b6.disabledAxisLabel}`]:{pointerEvents:`none`},[`& .${b6.bottomLabel}`]:{marginTop:`44px`}})),S6=class extends F.Component{static propTypes={text:P.string,side:P.string,disabledLabel:P.bool,placeholder:P.string,graphProps:I$.isRequired,onChange:P.func,mathMlOptions:P.object};static defaultProps={onChange:()=>{}};render(){let{disabledLabel:e,placeholder:t,text:n,side:r,graphProps:i,onChange:a,mathMlOptions:o={}}=this.props,{size:s,domain:c,range:l}=i,u=(s.height||500)+(l.padding||0)*2,d=(s.width||500)+(c.padding||0)*2,f=_6(r,d,u),p=r===`left`||r===`right`?u:d,m=v6(r,36),h=r===`bottom`?58:54,g=[`bold`,`italic`,`underline`,`strikethrough`,`math`];return(0,I.jsx)(x6,{children:(0,I.jsx)(`foreignObject`,{x:-(p/2),y:m,width:p,height:h,transform:f,textAnchor:`middle`,children:(0,I.jsx)(f6,{children:(0,I.jsx)(D$,{className:L({[b6.bottomLabel]:r===`bottom`,[b6.disabledAxisLabel]:e},b6.axisLabel),markup:n||``,onChange:a,placeholder:!e&&t,toolbarOpts:{position:r===`bottom`?`top`:`bottom`,noPadding:!0,noBorder:!0},activePlugins:g,mathMlOptions:o})})})})}},C6={left:P.string,top:P.string,bottom:P.string,right:P.string};(class extends F.Component{static propTypes={disabledLabels:P.bool,placeholders:P.object,value:P.shape(C6),graphProps:P.object,onChange:P.func,mathMlOptions:P.object};onChangeLabel=(e,t)=>{let{value:n,onChange:r}=this.props;r({...n,[t]:e})};render(){let{disabledLabels:e,placeholders:t={},value:n={},graphProps:r,mathMlOptions:i={}}=this.props;return(0,I.jsx)(I.Fragment,{children:[`left`,`top`,`bottom`,`right`].map(a=>(0,I.jsx)(S6,{side:a,text:n[a],disabledLabel:e,placeholder:t[a],graphProps:r,onChange:e=>this.onChangeLabel(e,a),mathMlOptions:i},a))})}});var w6=class extends F.Component{static propTypes={width:P.number.isRequired,height:P.number.isRequired,onClick:P.func.isRequired,graphProps:I$.isRequired};static defaultProps={};componentDidMount(){let e=Dl(this.rect);e.on(`click`,t=>this.onRectClick(e,t))}shouldComponentUpdate(e){return!J$(this.props.graphProps,e.graphProps)||this.props.width!==e.width||this.props.height!==e.height}getRectPadding=()=>{let{graphProps:e}=this.props;return F3(e)?6:10};onRectClick=(e,t)=>{let{onClick:n,graphProps:r}=this.props,{scale:i}=r,a=this.getRectPadding(),o=kl(t,e.node()),s=i.x.invert(o[0]-a),c=i.y.invert(o[1]-a),l=w3(r.range),u=w3(r.domain),d=(e,t)=>e.length&&e.reduce((e,n)=>Math.abs(n-t)<=Math.abs(e-t)?n:e),f={};u.indexOf(s)>=0&&l.indexOf(c)>=0?(f.x=s,f.y=c):(f.x=d(u,s),f.y=d(l,c)),n(f)};render(){let{width:e,height:t}=this.props,n=this.getRectPadding();return(0,I.jsx)(`rect`,{ref:e=>this.rect=e,transform:`translate(-${n}, -${n})`,fill:`red`,fillOpacity:`0.0`,width:e+n*2,height:t+n*2})}},T6=Bp(`pie-lib:graphing-solution-set:graph`),E6={axesSettings:P.shape(J3),backgroundMarks:P.array,className:P.string,collapsibleToolbar:P.bool,collapsibleToolbarTitle:P.string,disabledLabels:P.bool,disabledTitle:P.bool,domain:k$,labels:P.shape(C6),labelModeEnabled:P.bool,coordinatesOnHover:P.bool,marks:P.array,onChangeLabels:P.func,onChangeMarks:P.func,onChangeTitle:P.func,range:k$,size:P.shape({width:P.number.isRequired,height:P.number.isRequired}),showLabels:P.bool,showPixelGuides:P.bool,showTitle:P.bool,title:P.string,tools:P.array},D6=e=>({x:-23,y:-23,width:e.width+46,height:e.height+46}),O6=({marks:e,currentTool:t})=>{let n=e.filter(e=>e.building)[0],r=ps(e);if(n&&t&&n.type!==t.type){let e=r.findIndex(e=>xs(e,n));e>=0&&r.splice(e,1)}return r},k6=class extends F.Component{constructor(e){super(e),this.maskUid=this.generateMaskId()}static propTypes={...E6,currentTool:P.object};static defaultProps={onChangeMarks:()=>{},disabledLabels:!1,disabledTitle:!1};state={};generateMaskId(){return`graph-`+(Math.random()*1e4).toFixed()}componentDidMount=()=>this.setState({labelNode:this.labelNode});changeMark=(e,t)=>{let{onChangeMarks:n,marks:r,gssLineData:i}=this.props;if(i?.selectedTool===`solutionSet`)return;let a=ps(r),o=a.findIndex(t=>xs(t,e));o>=0&&!B3(t,r,e)&&(a.splice(o,1,t),n(a))};completeMark=e=>{let{currentTool:t,marks:n}=this.props,r=n.filter(e=>e.building)[0];if(!r||!t)return;let i=t.complete(r,e);this.updateMarks(r,i)};updateMarks=(e,t,n=!1)=>{let{onChangeMarks:r,marks:i}=this.props,a=ps(i);if(!t||!t.building&&B3(t,i))return;let o=a.findIndex(t=>xs(t,e));o>=0?(a.splice(o,1,t),r(a)):n&&r([...a,t])};getComponent=e=>{if(!e)return null;let t=(this.props.tools||[]).find(t=>t.type===e.type);return t&&t.Component||null};onBgClick=e=>{let{x:t,y:n}=e||{},{labelModeEnabled:r,currentTool:i,marks:a,gssLineData:o,onSolutionSetSelected:s}=this.props;if(o){if(o.selectedTool===`solutionSet`){s(e);return}if(o.numberOfLines===1&&o.selectedTool===`lineA`&&a.length===1&&!a[0].building||o.numberOfLines===2&&o.selectedTool===`lineA`&&a.length===2||o.numberOfLines===2&&o.selectedTool===`lineA`&&a.length===1&&!a[0].building||o.numberOfLines===2&&o.selectedTool===`lineB`&&a.length===2&&!a[1].building)return}if(r||!i||[null,void 0].includes(t)||[null,void 0].includes(n))return;T6(`[onBgClick] x,y: `,t,n);let c=a.filter(e=>e.building)[0],l;l=c&&i&&c.type===i.type?i.addPoint({x:t,y:n},{...c}):i.addPoint({x:t,y:n},void 0),this.updateMarks(c,l,!0)};render(){let{axesSettings:e,currentTool:t,coordinatesOnHover:n,size:r,disabledLabels:i,disabledTitle:a,domain:o,backgroundMarks:s,range:c,title:l,labels:u,labelModeEnabled:d,labelsPlaceholders:f,showLabels:p,showPixelGuides:m,showTitle:h,titlePlaceholder:g,onChangeLabels:_,onChangeTitle:v,mathMlOptions:y={},gssLineData:b,disabled:x}=this.props,{marks:S}=this.props,C=F4(o,c,r,()=>this.rootNode),w=D6(r),T={graphProps:C,labelModeEnabled:d,gssLineData:b};S=O6({marks:S||[],currentTool:t});let E=S.filter(e=>e.type===`polygon`);b&&b.selectedTool===`solutionSet`&&b.sections.forEach(e=>{if(E.length===0||!V3(e,E[0].points)){let t={type:`polygon`,building:!1,closed:!0,points:e,isSolution:!1};x||S.push(t)}});let D=[];return D.push(...S.filter(e=>e.type===`polygon`)),D.push(...S.filter(e=>e.type===`line`)),(0,I.jsx)(E1,{rootRef:e=>this.rootNode=e,disabledTitle:a,disabledLabels:i,labels:u,labelsPlaceholders:f||{},showPixelGuides:m,showLabels:p,showTitle:h,title:l,titlePlaceholder:g,onChangeTitle:v,onChangeLabels:_,mathMlOptions:y,...T,children:(0,I.jsxs)(`g`,{transform:o&&o.padding&&o.range?`translate(${o.padding}, ${c.padding})`:void 0,children:[(0,I.jsx)(l6,{...T}),(0,I.jsx)(i6,{...e,...T}),(0,I.jsx)(w6,{...r,onClick:this.onBgClick,...T}),(0,I.jsxs)(`mask`,{id:`${this.maskUid}`,children:[(0,I.jsx)(`rect`,{...w,fill:`white`}),` `]}),(0,I.jsxs)(`g`,{id:`marks`,mask:`url('#${this.maskUid}')`,children:[(s||[]).map((e,t)=>{let n=this.getComponent(e),r=e.type;return(0,I.jsx)(n,{mark:{...e,disabled:!0,isBackground:!0},labelNode:this.state.labelNode,onClick:this.onBgClick,...T},`${r}-${t}-bg`)}),D.map((e,r)=>{let i=this.getComponent(e),a=e.type;return(0,I.jsx)(i,{mark:e,coordinatesOnHover:n,onChange:this.changeMark,onComplete:this.completeMark,onClick:this.onBgClick,onDragStart:this.startDrag,onDragStop:this.stopDrag,labelNode:this.state.labelNode,isToolActive:t&&a===t.type,...T},`${a}-${r}`)}),(0,I.jsx)(`foreignObject`,{ref:e=>this.labelNode=e,x:`0`,y:`0`,...r,style:{pointerEvents:`none`,fontSize:`14px`}})]})]})})}},A6=o((e=>{var t=d();t.useSyncExternalStore,t.useRef,t.useEffect,t.useMemo,t.useDebugValue}));o(((e,t)=>{t.exports=A6()}))();var j6=Symbol.for(`react.element`),M6=Symbol.for(`react.portal`),N6=Symbol.for(`react.fragment`),P6=Symbol.for(`react.strict_mode`),F6=Symbol.for(`react.profiler`),I6=Symbol.for(`react.consumer`),L6=Symbol.for(`react.context`),R6=Symbol.for(`react.forward_ref`),z6=Symbol.for(`react.suspense`),B6=Symbol.for(`react.suspense_list`),V6=Symbol.for(`react.memo`),H6=Symbol.for(`react.lazy`),U6=R6,W6=V6;function G6(e){if(typeof e==`object`&&e){let{$$typeof:t}=e;switch(t){case j6:switch(e=e.type,e){case N6:case F6:case P6:case z6:case B6:return e;default:switch(e&&=e.$$typeof,e){case L6:case R6:case H6:case V6:return e;case I6:return e;default:return t}}case M6:return t}}}function K6(e){return G6(e)===V6}function q6(e,t,n,r,{areStatesEqual:i,areOwnPropsEqual:a,areStatePropsEqual:o}){let s=!1,c,l,u,d,f;function p(i,a){return c=i,l=a,u=e(c,l),d=t(r,l),f=n(u,d,l),s=!0,f}function m(){return u=e(c,l),t.dependsOnOwnProps&&(d=t(r,l)),f=n(u,d,l),f}function h(){return e.dependsOnOwnProps&&(u=e(c,l)),t.dependsOnOwnProps&&(d=t(r,l)),f=n(u,d,l),f}function g(){let t=e(c,l),r=!o(t,u);return u=t,r&&(f=n(u,d,l)),f}function _(e,t){let n=!a(t,l),r=!i(e,c,t,l);return c=e,l=t,n&&r?m():n?h():r?g():f}return function(e,t){return s?_(e,t):p(e,t)}}function J6(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...i}){return q6(t(e,i),n(e,i),r(e,i),e,i)}function Y6(e,t){let n={};for(let r in e){let i=e[r];typeof i==`function`&&(n[r]=(...e)=>t(i(...e)))}return n}function X6(e){return function(t){let n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function Z6(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Q6(e,t){return function(t,{displayName:n}){let r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e,void 0)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=Z6(e);let i=r(t,n);return typeof i==`function`&&(r.mapToProps=i,r.dependsOnOwnProps=Z6(i),i=r(t,n)),i},r}}function $6(e,t){return(n,r)=>{throw Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function e8(e){return e&&typeof e==`object`?X6(t=>Y6(e,t)):e?typeof e==`function`?Q6(e,`mapDispatchToProps`):$6(e,`mapDispatchToProps`):X6(e=>({dispatch:e}))}function t8(e){return e?typeof e==`function`?Q6(e,`mapStateToProps`):$6(e,`mapStateToProps`):X6(()=>({}))}function n8(e,t,n){return{...n,...e,...t}}function r8(e){return function(t,{displayName:n,areMergedPropsEqual:r}){let i=!1,a;return function(t,n,o){let s=e(t,n,o);return i?r(s,a)||(a=s):(i=!0,a=s),a}}}function i8(e){return e?typeof e==`function`?r8(e):$6(e,`mergeProps`):()=>n8}function a8(e){e()}function o8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){a8(()=>{let t=e;for(;t;)t.callback(),t=t.next})},get(){let t=[],n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0,i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var s8={notify(){},get:()=>[]};function c8(e,t){let n,r=s8,i=0,a=!1;function o(e){u();let t=r.subscribe(e),n=!1;return()=>{n||(n=!0,t(),d())}}function s(){r.notify()}function c(){m.onStateChange&&m.onStateChange()}function l(){return a}function u(){i++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=o8())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=s8)}function f(){a||(a=!0,u())}function p(){a&&(a=!1,d())}let m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:l,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>r};return m}var l8=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,u8=typeof navigator<`u`&&navigator.product===`ReactNative`,d8=l8||u8?F.useLayoutEffect:F.useEffect;function f8(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function p8(e,t){if(f8(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!f8(e[n[r]],t[n[r]]))return!1;return!0}var m8={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},h8={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},g8={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_8={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},v8={[U6]:g8,[W6]:_8};function y8(e){return K6(e)?_8:v8[e.$$typeof]||m8}var b8=Object.defineProperty,x8=Object.getOwnPropertyNames,S8=Object.getOwnPropertySymbols,C8=Object.getOwnPropertyDescriptor,w8=Object.getPrototypeOf,T8=Object.prototype;function E8(e,t){if(typeof t!=`string`){if(T8){let n=w8(t);n&&n!==T8&&E8(e,n)}let n=x8(t);S8&&(n=n.concat(S8(t)));let r=y8(e),i=y8(t);for(let a=0;a<n.length;++a){let o=n[a];if(!h8[o]&&!(i&&i[o])&&!(r&&r[o])){let n=C8(t,o);try{b8(e,o,n)}catch{}}}}return e}var D8=Symbol.for(`react-redux-context`),O8=typeof globalThis<`u`?globalThis:{};function k8(){if(!F.createContext)return{};let e=O8[D8]??=new Map,t=e.get(F.createContext);return t||(t=F.createContext(null),e.set(F.createContext,t)),t}var A8=k8(),j8=[null,null];function M8(e,t,n){d8(()=>e(...t),n)}function N8(e,t,n,r,i,a){e.current=r,n.current=!1,i.current&&(i.current=null,a())}function P8(e,t,n,r,i,a,o,s,c,l,u){if(!e)return()=>{};let d=!1,f=null,p=()=>{if(d||!s.current)return;let e=t.getState(),n,p;try{n=r(e,i.current)}catch(e){p=e,f=e}p||(f=null),n===a.current?o.current||l():(a.current=n,c.current=n,o.current=!0,u())};return n.onStateChange=p,n.trySubscribe(),p(),()=>{if(d=!0,n.tryUnsubscribe(),n.onStateChange=null,f)throw f}}function F8(e,t){return e===t}function I8(e,t,n,{pure:r,areStatesEqual:i=F8,areOwnPropsEqual:a=p8,areStatePropsEqual:o=p8,areMergedPropsEqual:s=p8,forwardRef:c=!1,context:l=A8}={}){let u=l,d=t8(e),f=e8(t),p=i8(n),m=!!e;return e=>{let t=e.displayName||e.name||`Component`,n=`Connect(${t})`,r={shouldHandleStateChanges:m,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:d,initMapDispatchToProps:f,initMergeProps:p,areStatesEqual:i,areStatePropsEqual:o,areOwnPropsEqual:a,areMergedPropsEqual:s};function l(t){let[n,i,a]=F.useMemo(()=>{let{reactReduxForwardedRef:e,...n}=t;return[t.context,e,n]},[t]),o=F.useMemo(()=>{let e=u;return n?.Consumer,e},[n,u]),s=F.useContext(o),c=!!t.store&&!!t.store.getState&&!!t.store.dispatch,l=!!s&&!!s.store,d=c?t.store:s.store,f=l?s.getServerState:d.getState,p=F.useMemo(()=>J6(d.dispatch,r),[d]),[h,g]=F.useMemo(()=>{if(!m)return j8;let e=c8(d,c?void 0:s.subscription);return[e,e.notifyNestedSubs.bind(e)]},[d,c,s]),_=F.useMemo(()=>c?s:{...s,subscription:h},[c,s,h]),v=F.useRef(void 0),y=F.useRef(a),b=F.useRef(void 0),x=F.useRef(!1),S=F.useRef(!1),C=F.useRef(void 0);d8(()=>(S.current=!0,()=>{S.current=!1}),[]);let w=F.useMemo(()=>()=>b.current&&a===y.current?b.current:p(d.getState(),a),[d,a]),T=F.useMemo(()=>e=>h?P8(m,d,h,p,y,v,x,S,b,g,e):()=>{},[h]);M8(N8,[y,v,x,a,b,g]);let E;try{E=F.useSyncExternalStore(T,w,f?()=>p(f(),a):w)}catch(e){throw C.current&&(e.message+=`
|
|
360
360
|
The error may be correlated with this previous error:
|
|
361
361
|
${C.current.stack}
|
|
362
362
|
|